difference of image histograms
古いコメントを表示
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
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 件のコメント
KALYAN ACHARJYA
2020 年 5 月 30 日
ok thanks. The code works although it doesn't plot a histogram but a line without bar. is it right? a question: is the result obtained with this code the same if I had: im3=imsubtract(im1,im2); histogram(im3) or imhist(im3)? What is the difference between imhist() and histogram()? another question: in a histogram is it possibile to exclude a value of bin like, for example, the value 0 because its column is higher than the others? sorry for the numerous questions. Thank you so much for the support.
KALYAN ACHARJYA
2020 年 5 月 30 日
im1=rgb2gray(imread('image1_name'));
im2=rgb2gray(imread('image2_name'));
diff_hist=imhist(im1)-imhist(im2);
bar(diff_hist)
KALYAN ACHARJYA
2020 年 5 月 30 日
Ok, thank you. Is there any function to find histogram's peaks? After that, how to set thresholds to classify the different ranges of values in the histogram? Thanks a lot for the support.
KALYAN ACHARJYA
2020 年 5 月 30 日
編集済み: KALYAN ACHARJYA
2020 年 5 月 30 日
hostgram_peak=max(diff_hist)
Ses the lobes in the histogram, are there any distinct difference to classify different objects.

KALYAN ACHARJYA
2020 年 5 月 30 日
Please write your comment, in the comment section (Just below), not in answer section.
giuseppe catarinella
2020 年 5 月 30 日
Image Analyst
2020 年 5 月 30 日
Try findpeaks() in the Signal Processing Toolbox. Or fit to multiple Gaussians. See attached demos.
giuseppe catarinella
2020 年 5 月 30 日
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
2020 年 5 月 31 日
カテゴリ
ヘルプ センター および File Exchange で Image Category Classification についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!