O'Reilly logo

Learn OpenCV 4 by Building Projects - Second Edition by Prateek Joshi, Vinicius G. Mendonca, David Millan Escriva

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How well does it work?

As we can see, frame differencing addresses a couple of important problems we faced earlier. It can quickly adapt to lighting changes or camera movement. If an object comes in to the frame and stays there, it will not be detected in future frames. One of the main concerns of this approach is about detecting uniformly colored objects. It can only detect the edges of a uniformly colored object. The reason is that a large portion of this object will result in very low pixel differences:

Let's say this object moved slightly. If we compare this with the previous frame, it will look like this:

Hence, we have very few pixels ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required