Question

I am using the CAMshift algorithm for my final year project but am stuck on a point. I am not able to terminate the algorithm automatically. Even after I remove the object from in front of the camera, the algorithm keeps tracking. I have heard about the termination criteria but don't know whether it is applicable here or not. Any help is appreciated. Thanks in advance.

Here's my code on github: code

Thanks

Was it helpful?

Solution

Ok I figured it out myself. The ROI in the actual image can be cropped so as to get a new image. Comparing the actual object size and the ROI size, if the ratio is beyond a specific value, we can determine that the object is lost.

In my case, the ratio is taken as 0.3

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top