A sample hybrid image using my_imfilter implementation.
There are two main goals of this project:
The implementaion of imfilter is quite straightforward. The API accepts two parameters:image and filter. The function does its work in following steps:
Within the above steps, the most important one is to do the convolution for each pixels in the image. The code goes like this:
%Code doing convolution.
for l = 1 : size(image, 3)
%do convolution on padded channel
for i = startRow : endRow
for j = startCol : endCol
convolution = 0.0;
for r = 1 : filterHeight
for c = 1 : filterWidth
convolution = convolution + ...
filter(r,c) * paddedImage(i - halfFilterHeight + r - 1,...
j - halfFilterWidth + c - 1, l);
end
end
%set the convolution result to that pixel
output(i - startRow + 1, j - startCol + 1, l) = convolution;
end
end
end
With the help of imfilter(), making an hybrid image from two input images if rather straightforward. The steps are:
The following table of images is the results of implemented imfilter(). For each row, they are original image, average blurred image, Gaussion blurred image, Sobel image, Laplacian image and High pass filtered image.
![]() ![]() ![]() ![]() ![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() |
Using the given datasets, I was able to test the hybrid image genreation algorithm on them. The following part are the some hybrid images I got, and I also listed the cutoff fequency which has the best effect.
![]() ![]() ![]() |
![]() ![]() ![]() |
![]() ![]() ![]() |
![]() ![]() ![]() |
![]() ![]() ![]() |