Why is imhist() not clipping data?
古いコメントを表示
I can't seem to find out why that imhist plots aren't clipping the data. Or why the color bar is inside of the plot.
figure, sgtitle(strcat('Number of intensity levels = ',string(n_lvls)))
subplot(2,2,1), imshow(og_img), axis image, title('Original small matrix')
subplot(2,2,2), imhist(og_img), ylim([0 1000]), title('Original Image Histogram')
subplot(2,2,3), imshow(histeq(og_img)), axis image, title('Histogram equalized')
subplot(2,2,4), imhist(histeq(og_img)), title('Histogram equalized image histogram')

1 件のコメント
Could you provide the necessary data so we can attempt to reproduce this?
Also, whenever you report a problem like this, always include the software version number. (see ver).
You may also want to review, https://www.mathworks.com/help/matlab/creating_plots/resolving-low-level-graphics-issues.html
回答 (1 件)
Image Analyst
2020 年 10 月 4 日
This works fine for me
og_img = imread('cameraman.tif');
n_lvls = 100;
figure, sgtitle(strcat('Number of intensity levels = ',string(n_lvls)))
subplot(2,2,1), imshow(og_img), axis image, title('Original small matrix')
subplot(2,2,2), imhist(og_img)
% ylim([0 1000])
title('Original Image Histogram')
subplot(2,2,3), imshow(histeq(og_img)), axis image, title('Histogram equalized')
subplot(2,2,4), imhist(histeq(og_img)), title('Histogram equalized image histogram')
Why are you calling ylim?

3 件のコメント
Zackary Coburn
2020 年 10 月 4 日
Image Analyst
2020 年 10 月 5 日
It appears sgtitle() is causing the gray scale wedge to appear in the wrong place. I'll contact the Image Processing team developers about it. If you take out sgtitle() it seems to work fine.
Zackary Coburn
2020 年 10 月 5 日
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
