code for different attacks on watermarking
Show older comments
please help for different types of attacks for watermarking
Answers (1)
Image Analyst
on 23 Apr 2022
0 votes
See section 24.3 here:
You'll find lots of papers on it.
(Anticipating your next question.....)
Sorry, I don't have any of them coded up for you.
19 Comments
Sunita Pradhan
on 23 Apr 2022
Image Analyst
on 23 Apr 2022
Yep, I anticipated your next question perfectly.
Again, sorry I don't have any code to do that. I'd have to spend days developing it just like you will, or months like the people who wrote those papers did. If I had such code or could write it in 5 minutes or less, I'd give it to you. But I'm sure it's not trivial. That said, once you write your code if you have questions about an error message, we can answer that. But we can't write a whole turnkey application suite for you. We just don't have that much time to donate to you. I'm sure there are graduate students making image forensics their entire masters or Ph.D., so it's not trivial.
If you really need it done and can't do it yourself, the Mathworks would be delighted to write the code for you. Contact their consulting department here:
Of course they don't do it for free so you have to decide how much it's worth to you do get it done.
Walter Roberson
on 23 Apr 2022
The code you attached appears to be from https://github.com/ShurenQi/FGPCET . You would need the rest of that third-party code in order to run that file.
Sunita Pradhan
on 24 Apr 2022
Sunita Pradhan
on 24 Apr 2022
Image Analyst
on 24 Apr 2022
You forgot to attach the error. Please include ALL the red text. And we can't run your code anyway because you forgot to attach 128.jpg and 32.jpg.
Sunita Pradhan
on 24 Apr 2022
Image Analyst
on 24 Apr 2022
You need to assign m as the number of rows you want the resized image to be after resizing. Right now it's unknown/unassigned.
Sunita Pradhan
on 24 Apr 2022
Image Analyst
on 24 Apr 2022
Perhaps you mean
[hostRows, hostColumns, hostNumColorChannels] = size(host);
watermark=imresize(watermark, [hostRows, hostColumns]);
which will resize the watermark image to be the same size as the host image.
Sunita Pradhan
on 25 Apr 2022
Walter Roberson
on 25 Apr 2022
One of the arrays is based on the size of the original image. The other is based on the size of the 32 x 32 watermark. There is not going to be any way to add them together.
Sunita Pradhan
on 25 Apr 2022
Sunita Pradhan
on 25 Apr 2022
Image Analyst
on 25 Apr 2022
I computed that here:
[hostRows, hostColumns, hostNumColorChannels] = size(host);
Notice that I did not use cryptics one-letter variable names that make your code look like an undecyperable alphabet soup mess of a code. I used descriptive variable names where it's glaring obvious what the variables recomment - a practice I hope you'll follow. If you still don't know, then
m = hostRows
n = hostColumns
p = hostNumColorChannels
For your error, it's saying that the two matrices are different sizes so you can't add them together. Put these lines in your code before the error line:
[LLRows, LLColumns, LLNumColorChannels] = size(watermarked_LL)
[hostLLRows, hostLLColumns, hostLLNumColorChannels] = size(host_LL)
What does that report to the command window? Evidently something does not match up.
Walter Roberson
on 25 Apr 2022
read the documentation for dwt2 https://www.mathworks.com/help/wavelet/ref/dwt2.html#d123e27693 and see that the first output is half the size of the input. You resized your watermark to 32 by 32 so your first output from dwt2 of that would be about 16 x 16.
In order to be able to add that 16 x 16 array to the output of the dwt2 from the original image, that other dwt2 would also have to be 16 x 16. Which would require that the original image is 32 x 32. But that is clearly not the case.
You have a small number of options at this point:
1. You can resize the original image to 32 x 32 as well 2. You can resize the watermark to the same size as the image 3. you can give up on trying to add those matrices together 4. you can choose a subset of the larger dwt2 result to add the watermark to, leaving the rest unchanged.
SrinivasHarsha
on 26 Apr 2022
Hi Image Analyst,
we need a help from you
can you send a response to my mail if possible.
we will contact you reg: image processing help
my mail id: srinivas.nato@gmail.com
SrinivasHarsha
on 26 Apr 2022
Hi Image Analyst,
we need a help from you
can you send a response to my mail if possible.
we will contact you reg: image processing help
my mail id: srinivas.nato@gmail.com
Walter Roberson
on 26 Apr 2022
Image Analyst does not volunteer email support. He will not help you through email.
Categories
Find more on Watermarking in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!