In this example we captured a series of JPEG images from a camera aimed at a traffic scene. Using the first
frame as the reference, we analyzed each image by comparing it to the reference and calculated the
correlation coefficient.
The individual frames and their coefficients are shown at left.

The Visual Basic sample application, Comparator, uses the Victor Library and the helper modules vicstats and vicfx
to load, compare, and analyze images. Download Comparator and its VB source code.

We can see that for the frames with no vehicles shown the correlations to the reference image are very high: .96 and .97. But
when a car begins to enter the scene, as in Test Frame4 the value dips to .94. Test Frame1 shows a dark vehicle
in the far lane and the value drops to .91. And in Frame8 the value dramatically declined to .78 when a car begins to enter the scene
in the near lane.

This can be an efficient method for automatically screening video frames for scene changes. The suspect frames can then
be analyzed visually or with image processing techniques. The applications can include
detecting motion with security cameras, finding a matching image, and quality control.

The procedure is:

determine the dimensions of the reference image and allocate a source image buffer

determine the dimensions of the test image and allocate an operator image buffer