How to get back to the nearest equal original image from the exposure image.?

1 view (last 30 days)
I am working to normalize images from over and under exposure.
I=imread('cameraman.tif');
imshow(I);
[r,c]=size(I);
avg=sum(sum(I))/(r*c);
Imask=-avg;
U=I+Imask;
I1mask=avg;
O=I+I1mask;
imwrite(O,"over.png");
imwrite(U,"under.png");
From this Over and Under exposure images, i wanted to get back to the nearest original image without taking original image into reference.
I tried these steps,
grayImage=imread('over.png');
I=imread('cameraman.tif');
normalizedImage = uint8(255*mat2gray(grayImage));
figure
imshow(I);
figure
imshow(grayImage);
figure
imshow(normalizedImage);
But still I need a better image. Is that possible? Can you help me.

Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!