Discrete Cosine Transformation Source Code
Objective:
To gain and generate the coding for Image Steganography by using Discrete Cosine Transformation method
Content/Result:
For Discrete Cosine Transformation, I used the DCT formula built-in in the MATLAB. The steps that I've done are:
- read the cover image
- broke the cover image into 8×8 block of pixels (segmentisation)
- applied the DCT function for each block of cover image
- read the hidden image
- applied the DCT function for f hidden image
- merge/hide the DCT cover image and the DCT hidden image
- applied inverse DCT function for the merged image of cover and hidden image
% RED
for i=1:100
for j=1:100
blockmatrix = CoverR( (i-1)*8+1:(i-1)*8+8, (j-1)*8+1:(j-1)*8+8 );
dctblockmatrix = dct(blockmatrix);
JEmbedR( (i-1)*8+1:(i-1)*8+8, (j-1)*8+1:(j-1)*8+8 ) = dctblockmatrix;
JEmbedR( (i-1)*8+8:(i-1)*8+8, (j-1)*8+8:(j-1)*8+8 ) = JHiddenR(i, j);
end
end
for i=1:100
for j=1:100
blockmatrix = JEmbedR( (i-1)*8+1:(i-1)*8+8, (j-1)*8+1:(j-1)*8+8 );
invdctblockmatrix = idct(blockmatrix);
uncoverR( (i-1)*8+1:(i-1)*8+8, (j-1)*8+1:(j-1)*8+8 ) = invdctblockmatrix;
end
end
Conclusion:
No comments:
Post a Comment