I want to compute the output image by first dividing the image into 8*8 blocks and applying laplace filter separately and combine them but I am not getting the correct output Here is the code:
I=imread('moon.tif');
figure;
imshow(I);
title('Original Image');
g=[0 1 0;1 -4 1;0 1 0];
[N, M] = size(I);
output = zeros(N,M);
for i=1:8:N
for j=1:8:M
a = min(i+7,N);
b = min(j+7,M);
img = I(i:a,j:b);
r = imfilter(im2double(img),g);
output(i:a,j:b) = im2double(img)-r;
end
end
figure;
imshow(output);
Here is the output I am getting blocks by blocks discontinuous But when I run this code
I=imread('moon.tif');
figure;
imshow(I);
title('Original Image');
g=[0 1 0;1 -4 1;0 1 0];
resp=imfilter(I,g);
output = I-resp;
figure;
imshow(output);
title('Sharpened image');
I am getting the correct output. How to get this by dividing the image into 8x8 blocks and combining them
8 x 8
is for working in a tiling method? If not, what you're asking doesn't make sense. $\endgroup$ – Royi Feb 26 at 9:09