简体   繁体   中英

What is good image processing algorithm for comparing differences in video frames?

I am looking for a good (simple, relatively fast) algorithm for comparing video frames and calculating the difference between the frames. I imagine a function like this:

//Same Scene
diff = ImageDiff(FrameInScene1, nextFrameInScene1); //diff is low
//Scene Boundary
diff = ImageDiff(FrameInScene2, nextFrameInScene3); //diff is high

Where diff is a numeric value of the similarity/difference between the frames. For example, two adjacent frames in the same scene would have low values, but a scene change would have very high values.

Note: I am not looking for a scene detection algorithm (some are timecode based), but this would be a good example of the problem.

A library with C# code would be ideal

Consecutive frames ? Mean Squared Error, Mean Absolute Error, PSNR.

Given so little information about your problem it doesn't make sense to suggest anything more.

I am not sure of C#! Have you used openCV? I wrote the code in C and I had used the BHATTACHARYA algorithm for comparing. You can use OpenCV from c# also look at : http://www.emgu.com/wiki/index.php/Main_Page .

All you would be doing is:

  1. Grab the two frames.
  2. Get the histograms of these in two separate pointer.
  3. Pass these two pointers and use a normalization factor and compare the histograms.

I hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM