I'm trying to decimate given picture
- Vertically.
- Horizontally.
- Horizontally + Vertically.
I know that I should use low-pass filter* and then downsample** it not to see any aliasing in image. To this my code is below:
Horizontally filter:
filter_hor = [0.25,0.5,0.25];
filtered_hor = imfilter(big_shirt,filter_hor);%% big_shirt is shirt image given above
decimated_hor = filtered_hor(1:2:end,:);%%decimated_hor = downsample(filtered_hor,2);
imshow(decimated_hor)
title('Horizontally filtered')
axis on
Vertically filter:
filter_ver = [0.25;0.5;0.25];
filtered_ver = imfilter(big_shirt,filter_ver);
decimated_ver = filtered_ver(:,1:2:end);
imshow(decimated_ver)
title('Vertically filtered')
axis on
Horizontally + Vertically filter:
filtered_2D = imfilter(decimated_hor,filter_ver);
decimated_2D = filtered_2D(:,1:2:end);
imshow(decimated_2D)
title('2D filtered')
What I get is :
*My low pass filter is: [0.25,0.5,0.25]
**By a factor of 2
My expectation is:
When I use horizontal filter, I just get rid of aliasing on lines of shirt collar.
When I use vertical filter, I just get rid of aliasing in vertically lines.
Vertical+horizontal will be nice picture like what I get.
However in first two cases are not satisfied. What can be the problem. My resolution on computer is 1366X768 and image size is 800X600. When I use imshow, I get:
Warning: Image is too big to fit on screen; displaying at 67%
Can be problem related to this or am I doing something wrong?