We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Jmyron image problem (Read 635 times)
Jmyron image problem
Dec 22nd, 2007, 1:32am
 
Hi everyone, i have some problem about images while using JMyron. when I run the application the image is always appearing left corner. i dont know why it is there.. plz help Sad

code is here....
//-------------------------------------
import JMyron.*;
JMyron m;

int MAX = 50;
int[] xpos = new int[MAX];
int[] ypos = new int[MAX];
PImage kelebek;

void setup() {
 size(320,240);
 m = new JMyron();
 m.start(width,height);
 m.findGlobs(1);
 m.adaptivity(120.0);
 m.minDensity(100);
 m.maxDensity(10000);
 noFill();
 frameRate(30);
 smooth();
}

void draw() {
 loadPixels();
 background(100);
 m.update();
 m.imageCopy(pixels);
 updatePixels();
 display(m.globCenters());
}

void display(int [][] lst) {

 for (int j=0;j<lst.length;j++) {
   int x = lst[j][0];
   int y = lst[j][1];
   
   for (int i = 0; i < xpos.length-1; i++) {
     xpos[i] = xpos[i+1];
     ypos[i] = ypos[i+1];
   }

 
   xpos[xpos.length-1] = x;
   ypos[ypos.length-1] = y;
   kelebek = loadImage("heart.png");

   for (int i = 0; i < xpos.length; i++) {
     image(kelebek,xpos[i],ypos[i],i,i);
   }
 }
}


Re: Jmyron image problem
Reply #1 - Dec 22nd, 2007, 6:01pm
 
any idea?
Re: Jmyron image problem
Reply #2 - Jan 17th, 2008, 9:29pm
 
i have noticed the same problem and i think we are not the only ones.. i am not sure if its a bug in jmyron or not..

but here's how you could remove it..

check for any glob that is at position (0,0) or near that pixel.. if it is true, dont display it

enjoy
Page Index Toggle Pages: 1