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 次查看(过去 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
0 个评论
回答(2 个)
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 个评论
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
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
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!