Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compare two still images using emgu cv in c#

Have searched on Stackoverflow.com and google. But didn't found any proper method to do so apart from the link shown below.

compare two images and extract the difference using emgu cv library

Please suggest or give helpful feedback so that i can start up with the application.

like image 540
Prakash Vishwakarma Avatar asked Oct 02 '22 03:10

Prakash Vishwakarma


1 Answers

Please have a look at the Emgu CV API documentation for the methods of the Image class.

It contains the method AbsDiff to compute the absolute differences between two images. It also provides Cmp to get a comparison mask for the differences between two images.

To get a single value describing the difference you could use the number of non-zero pixels per channel provided by the Image.CountNonzero method. Then find the channel with the maximum number of changed (non-zero) pixels. To get a relative value (percentage) just divide that by width * height (total number of pixels in the image).

like image 80
andyp Avatar answered Oct 03 '22 18:10

andyp