|
|
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [WM]: a question about cox's algorithm
Hello, You are commiting two mistakes. 1. First you are trying to
execute Cox's algorithm using binary watermarks which will simply embed either a 0 or 1 in the pixel coefficients. This is flawed.
You have to generate random numbers. Distribute them either by normal distribution with mean 0 and variance 1 or by uniform
distribution. As I mentioned in my first reply, sort 63 coefficients barring (0,0) coeffient from each block,
select a few highest (say first 20-25 of them ) as these are the low frequency coefficients which contribute to the image
content the most. This is must. Then embedd these statistically distributed random numbers (watermarks) in the selected low
frequency coefficients of the image by taking alpha=0.1 for embedding. Since the random numbers are real values, embedding will
result in making the pixel coefficients (integers) into real. This will be rounded off to make
an integer again. You are selecting the right bottom coefficient which is supposed to belong to high freq area of image whose
contribution to image content is zero. That is why you are unable to visualize the effect of watermark embedding.
2. If you select a binary image as a watermark, first read its pixel coefficients, then distribute
these coefficients using normal distribution with mean 0 and variance 1. This means you have added Gaussian noise to the watermark.
Then embed this mark in the image coefficients in spatial domain and not in frequency domain-so do not take DCT of image in this
case. Simply block code your image equal to the size of binary watermark. In other words, if binary watermark is 32x32,
then block code your bitmap image in size 32x32 and not 8x8 as it is required only for DCT. Put the binary watermark into each block
of the original image. In this case, since you have not taken DCT, you are
working in spatial domain. Lastly without DCT, there is no need of Inverse DCT also. 3. I do not
know whether you are programming in C/C++ or MatLab. Any how, you will get accurate results only when you subtract 128 from actual
pixel intensity value. For ex., if pixel value is 190, further processing should be done on 190-128=62 only. After embedding 62 may
be changed to 64. Then before reconstructing your image for finally writing in the file add 128 again to make it 64+128=192. So
ultimately, your pixel is modified from 190 to 192. This 192 is to be saved in the file. You are crossing 255 value because, you are
not subracting 128. Good Luck Anurag Mishra
yanmiaobest
<yanmiaobest@163.com> wrote: hi, my watermark image is a binary
image, if I want to hide 0, substract a small value from the original one, and if I want to hide 1, add a small
value to the original one. So 'a' is -1 when signature value is 0, and 1 when signature is 1.
I followed your advice, but it did't work either. I wonder if somthing wrong with my process. Here is my process:
1. divide the original image into 8*8 blocks 2. perform dct on each block 3. inject watermark into
each block to a fixed position. In my example, I inject just one bit per block into the right buttom coeffienct. 4.
inverse dct and write them to file extraction: 1. divide original image and watermarked image into 8*8
block 2. perform dct on each block. 3. compare the injected position and extract watermark. Here is
a block of the original image: 19 11 9 15 18 15 13 16 17 10 8 14 17
15 14 17 13 8 7 11 14 14 15 17 10 6 7 7 11 12 16 17 8 6 8 4 8 10 16 16 9 10 9 5 4 10 16 17 9 12 11 4 2 8 14 15 11
15 13 4 2 9 15 15 after dct transform, it becomes: 91.00 -14.40 16.21 1.24 0.50 1.28 0.59 1.85 13.20 -0.98 -10.15
10.14 14.12 -0.41 0.08 -0.54 6.75 8.94 0.18 -0.24 0.14 -0.90 -0.07 -2.34 -0.85 0.18 0.32 -0.34 0.31 0.31 0.14 0.11 -0.50
-0.01 -0.14 0.47 -0.50 -0.06 0.33 1.84 -1.15 0.19 -0.06 -0.44 0.11 0.09 0.07 -0.32 1.26 -0.12 0.43 0.13 -0.33 0.15 -0.18
-0.87 -1.47 0.21 -0.65 -0.09 -0.16 -0.16 0.11
0.73 &nbs
p; ------ inject into
here after injection, 0.73 becomes 0.80 and after inverse dct, the values are: 19 11 9 15 18 15 13 16 17 10 8 14 17 15
14 17 13 8 7 11 14 14
15 17 10 6 7 7 11 12 16 17 8 6 8 4 8 10 16 16 9 10 9 5 4 10 16 17 9 12 11 4 2 8 14 15 11 15 13 4 2 9 15 15 here
is the problem: nothing changes! So I can't extact watermark. I tried many positions to inject, but the
problem remains, and many times, the inverse dct value is out range, which means the value > 255.
|