How to plot histogram of difference of two images using MATLAB
조회 수: 1 (최근 30일)
이전 댓글 표시
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/254715/Ads%C4%B1z.png)
댓글 수: 0
채택된 답변
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
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 Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!