log-scaled histogram intersection
3 views (last 30 days)
Show older comments
Hello, I am trying to compute the similarity between two images A and B. A contains an object and B contains the same object and other different objects. I use histogram intersection, but due to the fact that my images give long-tailed distributions, I log scale my histograms first. The problem is that I don't know how to compute the intersection between this two log-scaled histograms. I did this :
if true
[ca,ba] = imhist(A) ; set(gca, 'YScale', 'log');
[cb,bb] = imhist(B) ; set(gca, 'YScale', 'log');
end
to logscale my image then to compute the intersection, I refer to this function but the problem here is the input of this function should be ca and cb after being log-scaled, thing I don't know how to return it. I am a quiet beginner with that, so I am asking you for help.
0 Comments
Answers (1)
Image Analyst
on 19 Oct 2017
That code will only tell you if the histograms are similar, not if the images are similar. You could take your image and rearrange the pixels into either a ramp, or totally scrambled to look almost like white noise, and the histogram would be exactly the same, because the same pixels are there, just in different locations. So, is histogram comparison going to be good in your case? Or would you be better off with things like image subtraction, immse(), or psnr(), or ssim()?
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!