|
I wonder if anyone can help.
I am trying to embed a watermark within a JPEG image at pseudo-random
locations within the DCT transform (based on 'randintrlv', using the seed as a
key). However, I need to make sure I don't embed the watermark over the DC
coefficients (element 1,1 in each 8x8 block).
Does anyone know how I can sift out the DC values from the DCT matrix so
that I can then randomize the locations of the remaining coefficients without
writing over the DC values? Obviously though, I will need to put the
coefficients back in the correct positions and reinsert the DC values before
saving the watermarked image.
The image I am using is 512x512 grayscale.
This is my current method of sifting out the DC values:
mask = logical(ones(8,8)); % 8x8 is the block size for DCT
mask(1) = 0
mask =
0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
repmask = repmat(mask(512,512)); % repmask is now size of image and
zeros highlight DC coefficients that need to be avoided.
Thanks in advance for any help!
|