%improve underwater image

tic;

nImages=5;

filepath = ('C:\Users\Kamran\Documents\MATLAB\images\');

for k=1:nImages

I= imread([filepath, 'frame-' ,num2str(k), '.jpg']);

I1=im2double(I);

figure(),imshow(I1)

end

% imshow(Il), title('original');

RGB=I1;

cform2lab=makecform('srgb2lab');

LAB= applycform(RGB, cform2lab);

%image onvert in to L*A*B color space

L=LAB(:,:,1);

LAB(:,:,1)=adapthisteq(L,'cliplimit', 0.02, 'Distribution', 'rayleigh');

cform2srgb=makecform('lab2srgb');

% convert back to RGB

A=applycform(LAB, cform2srgb);

t=toc,

%imwrite(A,strcat('a','.jpg'))

figure(), imshow(A)

%subplot(2,2,1), imshow(RGB), title('BEFOR CLAHE');

%subplot(2,2,2), imshow(A), title('AFETR CLAHE');

Similar questions and discussions