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 views (last 30 days)
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

Answers (2)

Walter Roberson
Walter Roberson on 28 May 2015
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 Comments
shameen khan
shameen khan on 28 May 2015
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 on 28 May 2015
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?

Sign in to comment.


Image Analyst
Image Analyst on 28 May 2015
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 Comments
Image Analyst
Image Analyst on 29 May 2015
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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!