The project is related to
hybrid image
-
zero padding (I use mirror padding method)
- Example(I only domenstrate lefttop and left side):
%lefttop for i=indexbase_c:-1:1 for j=indexbase_r:-1:1 img_pad(j,i)=img_g(indexbase_r-j+1,indexbase_c-i+1); end end %left for i=indexbase_c:-1:1 for j=indexbase_r:rows img_pad(j,i)=img_g(j-indexbase_r+1,indexbase_c-i+1); end end
result :
- Example(I only domenstrate lefttop and left side):
-
convolution
tmp_val=filter.*img_pad(start_r-floor(indexbase_r/2):start_r+floor(indexbase_r/2),start_c-floor(indexbase_c/):start_c+floor(indexbase_c/2));%multiply selected area on the image and the filter value=sum(sum(tmp_val)); output_tmp(j,i)=value;
explanation: I used matrix multiplication to multiply selected window of the original picture and the filter. Then I used sum() funciton to add the value up. At last, assign the value to a new matrix.
-
Repeat mirror padding and convolution for three dimentions
- Matlab https://ca.nctu.edu.tw/news-list/software-release/208-matlab-r2014b-release
- execute the proj1.m file in the code directory.