Title:
Masking and Filtering Source Code
Objective:
To gain and generate the coding for Image Steganography by using Masking and Filtering method
Content/Result:
For masking and filtering, I changed the luminance of the cover image by inserting the hidden image in it. The steps that I've done are:
- read the cover and hidden image
- cover the cover image into binary matrix
- hide the hidden image into the matrix of cover matrix
- update the binary matrix of the cover image
- convert back the update binary matrix of cover + hidden into numerical
- extract the hidden image
- update the binary matrix of the cover image
Some of the coding examples is as below:
function [I_image_rev] = mf_image(coverimg, hiddenimg)
%% read the cover and hidden images
I_image = coverimg;
I_hidden = hiddenimg;
[m,n,o]=size(I_image);
[m1,n1] = size(I_hidden);
%% cover the cover image into binary matrix
for i=1:m,
for j=1:n,
for k=1:o,
I_image_bin{i,j,k} = {dec2bin(I_image(i,j,k),8)};
end
end
end
%% hide the hidden image into the matrix of cover matrix
for i=1:m1,
for j=1:n1,
I_image_hidden{i,j} = {dec2bin(I_hidden(i,j),8)};
binaryof_I_image_hidden = cell2mat(I_image_hidden{i,j});
binaryof_I_image_bin_1st_R = cell2mat(I_image_bin{(i-1)*3+1,j,1});
binaryof_I_image_bin_1st_G = cell2mat(I_image_bin{(i-1)*3+1,j,2});
binaryof_I_image_bin_1st_B = cell2mat(I_image_bin{(i-1)*3+1,j,3});
binaryof_I_image_bin_2nd_R = cell2mat(I_image_bin{(i-1)*3+2,j,1});
binaryof_I_image_bin_2nd_G = cell2mat(I_image_bin{(i-1)*3+2,j,2});
binaryof_I_image_bin_2nd_B = cell2mat(I_image_bin{(i-1)*3+2,j,3});
binaryof_I_image_bin_3rd_R = cell2mat(I_image_bin{(i-1)*3+3,j,1});
binaryof_I_image_bin_3rd_G = cell2mat(I_image_bin{(i-1)*3+3,j,2});
binaryof_I_image_bin_3rd_B = cell2mat(I_image_bin{(i-1)*3+3,j,3});
Conclusion:
I hide the secret image by changing the luminance of the cover image. The differences between those two image is cannot slightly detected by human visual system.