Ask Your Question

Haar Cascade instability

asked 2016-07-15 09:37:03 -0500

marcosbontempo gravatar image

updated 2016-07-15 09:38:03 -0500


I trained my Cascade Classifier to identify an object. It works, but not in all frames.

Here is a frame missing one object:

image description

And here is other frame with all the objects:

image description

The images are almost the same. When I apply the cascade in a video, I can see the moments that the objects are not identified and it looks incomplete. Does anybody know how can I identify all the objects in all the frames, so the green rectangle will be permanent? Why it is happening, since the images are almost the same?

Any tip will be very helpful,


edit retag flag offensive close merge delete


Cascades are sensitive to light changes and thus summation of pixel changes. In a video in a supermarket, where lighting pulses at a certain frequency, this can influence the different frames, as well as the auto setting functions of the camera grabbing the frames. To avoid this, filtering in time is the only way to go, which can be done as suggested below by either a Kalman filter or by an Optical Flow filter!

StevenPuttemans gravatar imageStevenPuttemans ( 2016-08-03 04:38:24 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2016-08-02 10:58:31 -0500

shoemakerlevy9 gravatar image

One option for a video feed would be to add a Kalman filter. This can prevent brief periods where you stop detecting the object, and it works even if the object becomes occluded. A kalman filter will compare the previous state of an object to the newly provided state to determine if there is an object and where it is. In laymens terms it does something like this: well I've been seeing two objects for the past 10 seconds and now ones gone, whats the probability that one warped away (probably not so high). I will continue tracking it and predict where I think it is. --5 seconds pass-- Is the object still gone, yes, okay now I will stop tracking it.

edit flag offensive delete link more

Question Tools



Asked: 2016-07-15 09:37:03 -0500

Seen: 295 times

Last updated: Aug 02 '16