Thread Subject: Sifting out DC values

Subject: Sifting out DC values

From: Jack Branning

Date: 31 May, 2008 11:18:01

Message: 1 of 1

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!

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com