0

I want to calculate a histogram for the color image and computed histograms for each color channel. R=48*256;G=48*256;B=48*256; (48 superpixels, each one has 256 range)

  1. How to calculate the (R, G, B) histogram distance for specific superpixel to another superpixel in color image? For example,pdist(SP1,SP2,'emd');

  2. How to calculate the Histogram distance with multiple images?

Any help is greatly appreciated. Thank you

Azaad
  • 23
  • 6
  • This is too broad of a question. You can certainly just convert to grayscale and that's enough, but if you want to find the colour distance there are many ways to do it. You can start with the three duplicate links provided above. You can also try this Cross Validated post: https://stats.stackexchange.com/questions/7400/how-to-assess-the-similarity-of-two-histograms – rayryeng Jun 06 '17 at 14:09
  • Thank you @rayryeng, All these posts are dealing with entire image and I am not computing a histogram for the whole image. I am taking superpixels into account and calculate histogram distances among them.For example, how can I pass color histograms to (sqrt(H1).*sqrt(H2))? – Azaad Jun 06 '17 at 15:06
  • Use any of the methods and use it on histograms of the super pixels instead of the entire image. – rayryeng Jun 06 '17 at 15:10
  • How to concatenate the three channels histogram into one histogram? for example, R=48*256,G=48*256,B=48*256. I have tried this hist= histogram([rcounts(:),gcounts(:),bcounts(:)],0:255); – Azaad Jun 12 '17 at 16:32

0 Answers0