Dog-Cat Hybrid Images.
Hybrid Images is a technology that combines low-spatial frequencies of one picture with the high spatial frequencies of another picture. By using this method, an image with an interpretation changes with viewing distance is produced.
This project is about how to write an image filtering function and use it to create hybrid images. There are two parts are inlcuded.The first part is Image Filtering. we need to write a function to implement the basic function of built in function imfilter().The other part is to implement the function to generate the Hybrid Images, which is the sum of a low-pass filtered version of the one image and a high-pass filtered version of a second image.
%example code
for level=1:n
nimage=image(:,:,level)
newimage=padarray(nimage,[padrow,padcol],'symmetric');
[row,col]=size(newimage);
for i=padrow+1:row-padrow
for j=padcol+1:col-padcol
matrix=newimage(i-padrow:i+padrow,j-padcol:j+padcol) .* filter;
output(i-padrow,j-padcol,level)=sum(matrix(:));
end
end
end
filter test result |
![]() ![]() ![]() |
![]() ![]() ![]() ![]() |
Hybrid Images |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
The project works well, no bugs were found so far.If trying more value for fliter, the result may be more accurate