Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Calculate hue distance from hue histogram?

I'm currently making an object model by using HSV color histogram. As visually similar colors may have very different hue values (eg. 1 degree and 359 degree are similar red hues), Hue Distance is suggested instead of the Hue Component.

My goal is to implement the distance function from the reading below but I have so many questions in my mind :(

image description

First, is H represent the hue value extracted from each hsv_image pixel or is it represent each bin in the original histogram where I extracted the Href ?

Second, if I use the function minVal, maxVal, minLoc, maxLoc = cv2.minmaxLoc(hue_histogram) to find the Href, is Href = maxVal or Href = maxLoc? If Href = maxLoc, will Href be a bin holding a range of hue value in the histogram? If so, how do I apply Href, which is a range of value, to this distance function?

Thank you so much!