Friday 12 October 2012

WEEK 10 FYP 2


Title:
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:
  1. read the cover image
  2. broke the cover image into 8×8 block of pixels (segmentisation)
  3. applied the DCT function for each block of cover image
  4. read the hidden image
  5. applied the DCT function for f hidden image
  6. merge/hide the DCT cover image and the DCT hidden image
  7. applied inverse DCT function for the merged image of cover and hidden image

Some of the coding examples is as below:

% 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:
The DCT method can separate the image into low, medium and high frequencies. Most of the data are stored in low frequencies. So the hidden image will be store in low frequencies.








No comments:

Post a Comment