difference of image histograms

22 次查看(过去 30 天)
hello, in Matlab is equal to do the histogram of difference of two grayscale images and the difference of the two histograms of the images? How to perform the difference of two histograms and plot the negative values of this difference?
thank you for the help,
Giuseppe

回答(1 个)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020-5-29
编辑:KALYAN ACHARJYA 2020-5-29
im1=rgb2gray(imread('image1_name'));
im2=rgb2gray(imread('image2_name'));
diff_hist=imhist(im1)-imhist(im2);
plot(diff_hist)
Ensure that both have same data type images to get the same range of bins
  10 个评论
Image Analyst
Image Analyst 2020-5-30
Yes, if you want. It can be tricky to get findpeaks() to get just the peaks you want and not all of the peaks you don't want, but you can play around with the tons of input parameteters until it gets just the ones you want.
giuseppe catarinella
Ok, thank you so much. This advise was very useful. I'd like to ask other questions about this argument. First, using the function findpeaks(), how can I show also the x coordinates of the peaks. I remind you that I have a histogram of an image and I would to show the bin values of the peaks in addition to the values of counts that the function already returnss. Second, is it possible to use findpeaks() function for a vector of objects of type histogram and consequently use histogram() function for a vector of images? If yes, how can I do this? Thank you very much for the support.

请先登录,再进行评论。

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by