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?
3 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
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
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?
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
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.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!