How to do multiple detect using CamShift in OpenCv?

asked 2013-10-24 11:43:01 -0500

Michael Vance gravatar image

updated 2013-10-24 11:58:06 -0500

berak gravatar image

I am working on a project it is actually originated from the camshift demo and i really wanted to track in a multiple manner. It is done by color matching. I also modified the demo, i added sounding an alarm and a allowable motion for the tracked object. here is the a part of the code that i added to the demo:


Rect brect= trackBox.boundingRect();

            if(brect.height<20&&brect.width<20||(brect.x + brect.width)>pt1.x||(brect.height+brect.y)>pt1.y||brect.x<pt2.x||brect.y<pt2.y)

            printf("A L E R T !\n");
            paused = !paused;
            PlaySound(TEXT("ALARM.wav"), NULL, SND_FILENAME|SND_LOOP);

What i wanted to happen is to trigger the alarm when another object that is of the same color is present, but i dont know how. Can anyone help how to do multi detect?

edit retag flag offensive close merge delete