I've transformed an image from RGB to cieLAB and then extracted a channel. How can I automatically adjust the tonal range of the a channel like in Adobe Photoshop?
A = imread('image.jpg');
CT = makecform('srgb2lab');
lab = applycform(A,CT);
a = lab(:,:,2);
%????? --> how to automatically adjust the tonal range of a channel?
Auto Level Adjustment in Photoshop: