Question

I've tryout some tutorial of converting Grayscale image to Histogram and thus perform comparision between the histogram. So, I've obtained the value returned from compare function in double datatype. Like this.

My problem here now is, how can I visualize the "non-match/ error" detected between images? Can I like obtained back the coordinates of those non-match pixels and draw a rectangle or circle at that particular coordinate?

Or any suggestion on algorithm I can take?

Was it helpful?

Solution

You can't do that from histogram comparison directly. As stated in the documentation,

Use the function compareHist to get a numerical parameter that express how well two histograms match with each other.

This measure is just a distance value which tells you how similar are the two histograms (or how similar are the two images in terms of color distribution).

However, you can use histogram backprojection to visualize how well each pixel in image A fits the color distribution (histogram) of an image B. Take a look to that OpenCV example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top