How to plot histogram of difference of two images using MATLAB

2 ビュー (過去 30 日間)
Mustafa Uysal
Mustafa Uysal 2019 年 12 月 16 日
編集済み: Ridwan Alam 2019 年 12 月 17 日
i would like to calculate difference of two images. Then, histogram of difference of two images. So, when i plot histogram i want to see negative values. But i can't see negative values. So, i think my code is not true. How can i calculate histogram of difference of two images.
My two images are original_result and output_image. And difference of two image is image_of_dif. my result.
Adsız.png

採用された回答

Ridwan Alam
Ridwan Alam 2019 年 12 月 17 日
編集済み: Ridwan Alam 2019 年 12 月 17 日
histogram(image_of_dif)
will plot the histogram showing the distribution of values (both positive and negative differences).
  2 件のコメント
Mustafa Uysal
Mustafa Uysal 2019 年 12 月 17 日
編集済み: Mustafa Uysal 2019 年 12 月 17 日
thanks for reply. i tried this.
image_of_dif = (image_of_dif);
h=histogram(image_of_dif);
figure;
plot(h); %plot histogram
and i see that error
Error using plot
Not enough input arguments.
also i see this result. i don't know whether it is true or notAdsız.png
Ridwan Alam
Ridwan Alam 2019 年 12 月 17 日
編集済み: Ridwan Alam 2019 年 12 月 17 日
histogram() by default plots the histogram, which is what your pic represents. And it shows the negative values as you expected, right?
The h is a histogram object, not an array to plot directly. For more details: https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.histogram.html
Please accept the answer if it works for you. Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by