Sunday, March 20, 2011

Frame Differencing using OpenCV in C++

Frame differencing is a simple concept. Its basically a difference of two images. The regions on the image that differ are marked in the Final image.

Btw, My other programs in OpenCV will be posted here

We perform absolute difference between 2 images (usually by 255 for a white pixel or a 0 for a black pixel).

Its all basically how you define your frame differencing to be (you can customize it to suit your own requirement).

This concept is called Frame Differencing or rather Static Frame Differencing. This is very useful is detection motion from a static point of view(a stationary camera taking a video). However this not useful when the camera is in motion or when its moved. Such situations (where camera motion is to be considered) require different strategies.

The program is explained as follows:

In more cleaner C++ API:


More C like API:






OUTPUT:


No comments:

Post a Comment