Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Q.

Sharpen the Blurred image of the north pole


of the moon (Fig0338(a)(blurry_moon)) using
Laplacian masks
clc;
close all;
clear all;
I = im2double(imread('Fig0338(a)(blurry_moon).tif'));
mask1 = [0 1 0;1 -4 1;0 1 0];
mask2 = [1 1 1;1 -8 1;1 1 1];
resp = imfilter(I, mask1, 'conv');
minR = min(resp(:));
maxR = max(resp(:));
resp = (resp - minR) / (maxR - minR);
sharpened = I + resp;
minA = min(sharpened(:));
maxA = max(sharpened(:));
sharpened = (sharpened - minA) / (maxA - minA);
sharpened = imadjust(sharpened, [60/255 200/255], [0 1]);
figure;
subplot(2,2,1);imshow(I); title('Original image');
subplot(2,2,2);imshow(resp); title('Laplacian filtered image');
subplot(2,2,3);imshow(sharpened); title('Sharpened image');

1
Published with MATLAB® R2014a

You might also like