Using Stretchlim and Imadjust (automatically and manually)
10 次查看(过去 30 天)
显示 更早的评论
How do I correct my code by
(1) first getting an output which uses stretchlim and imadjust to adjust the contrast of an image automatically
(2) manually adjusting the contrast level [low_in high_in] using the imadjust function.
img = imread('coins.png'); %to open the original image of the coins
imshow(img); %to show the original image of the coins
orig_imadjust = imadjust(img); %to automatically adjust the contrast of the coin image using imadjust
orig_stretchlim = stretchlim (img) %to automatically adjust the contrast of the coin image stretchlim
% ??? -- to manually adjust the contrast level using imadjust function [low_in high_in]
orig_imhista = imhist(orig_imadjust) %to get the histogram of orig_imadjust
orig_imhistb = imhist(orig_stretchlim) %to get the histogram of orig_stretchlim
montage({img,orig_imadjust,orig_stretchlim,orig_imhista,orig_imhistb},"Size",[2 3])
0 个评论
回答(2 个)
Image Analyst
2021-12-20
Look at the documentation for imadjust(). It allows you to specify the min and max output gray levels, and the gray level range of the input image what will get mapped into that min to max range.
Any gray levels in the input image below the min output level will be clipped to the min output gray level you specified.
Any gray levels in the input image above the max output level will be clipped to the max output gray level you specified.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!