when i apply crop attack on watermarked image it give me this error( Error in ==> extraction at 18 green = X(:,:,2);) while i embedd a watermark in blue channel how can i solve this problem? how can i apply crop attack?

조회 수: 1 (최근 30일)
when i apply crop attack on watermarked image it give me this error( Error in ==> extraction at 18 green = X(:,:,2);) while i embedd a watermark in blue channel how can i solve this problem? how can i apply crop attack

답변 (2개)

Walter Roberson
Walter Roberson 2015년 5월 28일
Your watermarkrgb.png was created with a single layer, not as RGB.
You should get into the habit of writing in code to check for valid input before attempting operations.
  댓글 수: 2
shameen khan
shameen khan 2015년 5월 28일
NO. after embedding a watermark in blue channel i used cat function for cancatenation of three layer then write image as watermarkrgb
Walter Roberson
Walter Roberson 2015년 5월 28일
How much does it cost you to put in a test to see whether the image you read in actually has 3 layers? Do they still charge 20 cents per punched card like they used to in my day?

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2015년 5월 28일
Your code has lots of stuff commented out. Like Walter said, your X is not 3D, full color RGB. Your code is essentially this:
X=imread('watermarkrgb.png');
green = X(:,:,2);
And it needs to be this:
originalImage = imread('watermarkrgb.png');
[rows, columns, numberOfColorChannels] = size(originalImage);
if numberOfColorChannels == 1
% It's monochrome, not full RGB
% Create the needed color channels.
red = originalImage;
green = originalImage;
blue= originalImage;
else
% It's full color. Just extract the color channels
% from the RGB image.
red = originalImage(:,:,1);
green = originalImage(:,:,2);
blue = originalImage(:,:,3);
end
  댓글 수: 3
Image Analyst
Image Analyst 2015년 5월 29일
SW1=SU1*sW11*SV1'; is not in my code. This looks like a totally new error that can be solved with this link. You need to check the dimensions of all 3 of those arrays.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by