mask_mn = (mask_sum)/9; img_H = (mask(ij)-mask_mn)*img(ij)+(mask(i-1j-1)-mask_mn)*img(i-1j-1)+(mask(i-1j)-mask_mn)*img(i-1j)+... (mask(i-1j+1)-mask_mn)*img(i-1j+1)+(mask(ij-1)-mask_mn)*img(ij-1)+(mask(ij+1)-mask_mn)*img(ij+1)+... (mask(i+1j-1)-mask_mn)*img(i+1j-1)+(mask(i+1j)-mask_mn)*img(i+1j)+(mask(i+1j+1)-mask_mn)*img(i+1j+1); k=0.5;