i am not getting why secret message(x) is changing when apply dwt on image.
1 view (last 30 days)
Show older comments
neha gautam
on 17 Feb 2016
Commented: neha gautam
on 19 Feb 2016
x=-4.335145935643288e-04;
img = imread('frame286.png');
img1=rgb2gray(img);
img2=im2double(img1);
liftscheme = liftwave('haar','int2int');
[cA cH cV cD]=lwt2(img2,'liftscheme');
cD(180,1)=x;
X = idwt2(cA,cH,cV,cD,'liftscheme');
imwrite(X,'gg23.png');
x2= imread('gg23.png');
img5=im2double(x2);
[cA1 cH1 cV1 cD1]=lwt2(x2,'liftscheme');
rr3=cD1(180,1);
now value is changed ie (rr3!=x)
but when i does not create image then it gives same values
x=-4.335145935643288e-04;
img = imread('frame286.png');
img1=rgb2gray(img);
img2=im2double(img1);
liftscheme = liftwave('haar','int2int');
[cA cH cV cD]=lwt2(img2,'liftscheme');
cD(180,1)=x;
X = idwt2(cA,cH,cV,cD,'liftscheme');
[cA1 cH1 cV1 cD1]=lwt2(X,'liftscheme');
rr3=cD1(180,1);
plz someone explain why this is happening because of imwrite?
0 Comments
Accepted Answer
Walter Roberson
on 17 Feb 2016
Round off error. See this bit of documentation in imwrite():
"If A is a grayscale or RGB color image of data type double or single, then imwrite assumes that the dynamic range is [0,1] and automatically scales the data by 255 before writing it to the file as 8-bit values. If the data in A is single, convert A to double before writing to a GIF or TIFF file."
Therefore when you are writing to the .png file, your floating point values are being quantized. That is not happening when you do not write to file.
3 Comments
Walter Roberson
on 18 Feb 2016
With the quantization to 8 bit values, you effectively cannot hide more than 8 bits worth of information in one coefficient. Your input value of -4.335145935643288e-04 is specified to an accuracy of 53 bits (the next closest representable number would display as ending with 9 instead of 8). You are therefore going to have to break up the information to be hidden into a minimum of 7 bytes (more likely 8 bytes), and hide the bytes in different places and upon extraction re-assemble the bytes into the desired hidden number.
In practice, it is uncommon to hide more than 3 bits per coefficient, as doing so changes the image too much visually, and the goal of steganography is to hide changes, not make them obvious.
More Answers (0)
See Also
Categories
Find more on Discrete Multiresolution Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!