hi i have some questions about image 's levels i should insert a watermark in 0 ,3 and 7 level of an image and calculate robustness against jpg, Gaussian noise attack but i do not know how to access these levels? is bitset function suitable for this? thanks

 Accepted Answer

Image Analyst
Image Analyst on 30 Oct 2014

0 votes

See attached demo where you can specify what bitplane to insert the hidden/watermark image.

12 Comments

nadia
nadia on 30 Oct 2014
thanks Image Analyst but i have some question about this code: 1- what means this line bitToSet = str2double(cell2mat(inputdlg(prompt, dialogTitle, numberOfLines, defaultResponse))); 2- the prompt is used for bitplane for example if i want to hide the image in lsb i should enter 1 in the box or for level 3 i should enter 3 in the message box?
nadia's follow up question moved here:
Thanks Image Analyst but I have some questions about this code:
1- What does this line mean:
bitToSet = str2double(cell2mat(inputdlg(prompt, dialogTitle, numberOfLines, defaultResponse)));
2- The prompt is used for bitplane. For example if I want to hide the image in lsb 1, should the user enter 1 in the box, or for level 3, the user should enter 3 in the message box?
1. I probably should have split it into 2 or 3 lines. Basically it gets a number as a double, because inputdlg returns a string. We want 3, not '3'.
2. Yes.
nadia
nadia on 30 Oct 2014
thanks a lot for your answers if i want to check fidelity and robustness of my watermarking how can i use PSNR in matlab?
It's a built in function in the Image Processing Toolbox. Just look it up in the help:
peaksnr = psnr(A,ref) calculates the peak signal-to-noise ratio for the image A, with the image ref as the reference. A and ref must be of the same size and class.
If you don't have that toolbox, I have a manual method, attached.
nadia
nadia on 31 Oct 2014
thank you very much
hi i have an other question if i want to have jpeg attack on this watermark how can i do it? for example if wm was watermarked image i can do it with this code:
imwrite(wm,'wmjpg.jpg','jpeg','Quality',10)
if i want to calculate the correlation between watermark image and watermark image after attack how can i do it?
I guess you'd write it out very compressed, like you did. Then use imread() to read it back in. Then try to recover the watermark using your custom algorithm. Then have some kind of figure of merit as to how much you extracted resembles your original, expected, uncorrupted watermark. PSNR just compares images, which is not really what you're interested in, though it's a measure of how different the image is from your starting image to begin with. You should make up an ROC curve to determine how successful your algorithm is at finding the watermark.
i have an other problem i produce a watermark image with rand function and round it now my watermark image is an zero-one image i should insert this watermark in lena image after i add Gaussian noise to final image and recover watermark from noisy watermark image it produce an error
Error using bitget
Inputs must be non-negative integers.
my noisy watermark image has values between 0-1 and every where its value is 1 it produce this error how can i solve this problem
It's not much of a watermark if it was created with the rand() function. Watermarks have structure as far as I know, and to determine if your image was "stolen" you have to retrieve the watermark and determine if the structure is still there. There may be some fancier ones that watermark with other things than images. I saw one that used the Fibonacci series that was very robust to cropping, noise, etc.
Anyway, you need to multiply your image by 255 and then cast to uint8
grayImage = uint8(255 * normalizedImage);
nadia
nadia on 31 Oct 2014
if i want to insert watermark in DCT of image how can i do it?
I don't know. I'd have to research it because it's not my field. But I'll let you do that since it's your problem. Good luck.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!