limits = stretchlim(I)
limits = stretchlim(I, tol)
| Parameter | Description |
|---|---|
| I | Input grayscale or RGB image. |
| tol | Scalar tolerance or two-element tolerance vector in the range [0, 1]. |
| Parameter | Description |
|---|---|
| limits | 2-by-N matrix of lower and upper contrast limits, with one column per channel. |
Find contrast stretching limits.
I=0.2+0.6*repmat(linspace(0,1,96),64,1);
limits=stretchlim(I);
J=imadjust(I,limits,[0;1]);
figure; subplot(1,2,1); imagesc(I); g=linspace(0,1,64)'; colormap([g g g]); title('Input');
subplot(1,2,2); imagesc(J); g=linspace(0,1,64)'; colormap([g g g]); title('Adjusted');
| Version | Description |
|---|---|
| 2.0.0 | initial version |