I want to make a DCT steganography on the quantized DCT coefficients... should I do the embedding block by block?? and can I use the blockproc function in Matlab for embedding ?

2 views (last 30 days)
DCT steganography embedding function using Matlab

Accepted Answer

Walter Roberson
Walter Roberson on 1 Oct 2016
Any block that you are not going to embed data in, you might as well not bother to put through the DCT process.
DCT, like FFT, is not specific to any one block size. However, DCT for information hiding is often used together with JPEG images. JPEG uses DCT on 8 x 8 blocks internally, so if you do DCT on 8 x 8 blocks yourself and hide data in them, then you know that the data hiding would survive the JPEG DCT process, whereas if you used a different block size than JPEG was using, if you were to then compress the image using JPEG, the hidden data might get lost.
  5 Comments
Walter Roberson
Walter Roberson on 1 Oct 2016
Edited: Walter Roberson on 1 Oct 2016
After using blockproc on YourImage to create dct_coefficients,
num_blocks = floor( size(YourImage)/8 );
tot_blocks = min( prod(num_blocks), number_of_bits_to_embed);
for blockidx = 1 : tot_blocks
[rblock_idx, cblock_idx] = ind2sub(num_blocks, blockidx);
first_dct_coeff_of_block = dct_coefficiants((cblock_idx-1)*8+1, (rblock_idx-1)*8+1);
%now modify the coefficient and store it back in the same place
...
end
Note: the range of values that can be in first_dct_coeff_of_block is +/- 255*8*8 which is +/- 16320 . The values are floating point numbers, not integers.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!