www.gusucode.com > images 案例代码 matlab源码程序 > images/FindLimitsToStretchContrastInGrayscaleImageExample.m

    %% Find Limits to Stretch Contrast in Grayscale Image
% 
%%
% Read grayscale image into the workspace and display it. 

% Copyright 2015 The MathWorks, Inc.

I = imread('pout.tif');
figure
imshow(I)
%%
% Adjust the contrast in the image using |stretchlim| to set the limits,
% and display the result. The example uses the default limits |[0.01 0.99]|,
% saturating the upper 1% and the lower 1%.
J = imadjust(I,stretchlim(I),[]);
figure
imshow(J)