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
OpenCV Unique Face ID (Read 480 times)
OpenCV Unique Face ID
Apr 27th, 2010, 7:46am
 
Hey guyz;

Quick question: Is it possible to give each face recognized by OpenCV a unique ID?

Like most of the people, im trying to put speech balloons over people. But i want to make it in a discussion-like way.

For example i put a question phrase on visitor#1, when the second visitor enters the Tracking area, i put an answer phrase upon him.

The problem is that the rectangles (PNG images in my case) switch places between the two visitors all the time. So the guy who has a question becomes the one with the answer randomly (well maybe not random, i guess its due to flickering in tracking.)

My question is: how can i give unique tracking id's on visitors so the balloons stick to them and dont switch between visitors?

Heres a part of the code where i get the number of people and put a balloon accordingly.

Code:
for( int i=0; i<faces.length; i++ ) {

image(img[0], faces[0].x-150, faces[0].y-150);
if ( faces.length > 1 )
{
image(img[1], faces[1].x-150, faces[1].y-150);
}
if (faces.length > 2)
{
image(img[2], faces[2].x-150, faces[2].y-150);
}

}
println(faces.length);



Thx in advance.
Page Index Toggle Pages: 1