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.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › strange refresh... using v3ga/BlobDetection
Page Index Toggle Pages: 1
strange refresh... using v3ga/BlobDetection (Read 600 times)
strange refresh... using v3ga/BlobDetection
Feb 13th, 2006, 5:12am
 
Hi,

I don't know if the suject for this thread is correct...will see.

I'm using v3ga's BlobDetection Lib, and it's working great.

But I have a problem with the "refresh".
See the screen capture here: http://www.smallfly.com/v3ga_BlobDetection/

If the blob (in this case my hand) is not touching any of the letf, top, or rigth borders of the applet everything is fine. As soon as the blob touches one of those borders I get what you can see in the second screen capture.

As the edges of the blob are correct (green dot lines), I assume it has some thing to do with my code for the triangles. The following method:

void displayWire(Blob b)
{
 // m_blob = b;
 strokeWeight(1);
 stroke(255,0,0);
 BlobTriangle bTri;
 EdgeVertex tA,tB,tC;
 float xA,yA;
 float xB,yB;
 float xC,yC;

 for (int t=0;t<b.getTriangleNb();t++)
 {
   bTri = b.getTriangle(t);
   tA = b.getTriangleVertexA(bTri);
   tB = b.getTriangleVertexB(bTri);
   tC = b.getTriangleVertexC(bTri);

   xA = tA.x*width;
   yA = tA.y*height;  // centered
   xB = tB.x*width;
   yB = tB.y*height;
   xC = tC.x*width;
   yC = tC.y*height;

   beginShape();
   vertex(xA, yA);
   vertex(xB, yB);
   vertex(xB, yB);
   vertex(xC, yC);
   vertex(xC, yC);
   vertex(xA, yA);
   endShape();

 }
}


I run this sketch using OPENGL.

Any help is welcome.

Thanks
Re: strange refresh... using v3ga/BlobDetection
Reply #1 - Feb 16th, 2006, 5:00pm
 
got some information by v3ga.

"Everything is fine in your code.
5 blobs have been detected ,the algorithm works by walking along the edges, and when it reaches the borders of the screen it stops. The trick is to add a border line (black or white depending on your discrimination) around the image sent to detection so that all the opened blobs (touching the edge of the screen) would be automatically closed ! In your cas, only one big blob would be then found."

Hope this helps other people.

Thanks.
Page Index Toggle Pages: 1