이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
code for different attacks on watermarking
조회 수: 7 (최근 30일)
이전 댓글 표시
please help for different types of attacks for watermarking
답변 (1개)
Image Analyst
2022년 4월 23일
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
Sunita Pradhan
2022년 4월 23일
i want the code for different geometric attacks on watermarking.please help me.am unable to change the code.please check the file and modify it for cropping and scaling attacks and for filtering attacks..please help me if possible.i need it badly
Image Analyst
2022년 4월 23일
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
2022년 4월 23일
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
2022년 4월 24일
i have that file but i cant run different attacks on it.please help me..i need it..badly..please
Sunita Pradhan
2022년 4월 24일
can you please check the file error...and help me to solve the issue.
clc
close all
%Original Image
host=imread('128.jpg');
subplot(1,3,1)
figure(1);
imshow(host);
title('Original color image');
[h_LL,h_LH,h_HL,h_HH]=dwt2(host,'haar');
img=h_LL;
%watermark Image
watermark=imread('32.jpg');
watermark=imresize(watermark,[m n])
subplot(1,3,2)
figure(2);
imshow(watermark);
title('Watermark image');
[w_LL,w_LH,w_HL,w_HH]=dwt2(watermark,'haar');
img_wat=w_LL;
% watermark embedding
wd_LL=h_LL+(0.03*w_LL);
%output
watermarked=idwt2(wd_LL,h_LH,h_HL,h_HH,'haar');
imwrite(uint8(watermarked),'Watermarked.jpg');
subplot(1,3,1)
imwrite(res,'DwtwatermarkedImage.jpg','jpg');
figure(3);
res=((uint8(watermarked)));
imshow(res);
title('Watermarked Image');
inputImage=res;
wm=imread(res);
[wm_LL,wm_LH,wm_HL,wm_HH]=dwt2(wm,'haar');
%watermark extraction
ewat=(wm_LL-h_LL)/0.03;
%output
watermarked=idwt2(ewat,w_LH,w_HL,w_HH,'haar');
figure(4);imshow(uint8(watermarked));
op=((uint8(watermarked)));
imwrite(uint8(watermarked),'EWatermark.jpg');title('Extracted Watermark');
mse_extraction=MSE(res,op)
psnr=PSNR(res,op)
Image Analyst
2022년 4월 24일
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
2022년 4월 24일
Image Analyst
2022년 4월 24일
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.
Image Analyst
2022년 4월 24일
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
2022년 4월 25일
Walter Roberson
2022년 4월 25일
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
2022년 4월 25일
Image Analyst
2022년 4월 25일
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
2022년 4월 25일
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
2022년 4월 26일
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
2022년 4월 26일
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
2022년 4월 26일
Image Analyst does not volunteer email support. He will not help you through email.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)