Error in Image Embedding....
古いコメントを表示
Hello i am trying to run following code...
i=imread('lena.tif');
s=double(i);
j=imread('watermark.bmp');
w=double(j);
[m,n]=size(s);
[g,h]=size(w);
x=dec2bin(s,8); % decimal to binary transformation
y=double(x);
y=y-48;
plane=cell(1,8);
for r=1:8
plane{r}=y(:,r);
end
for r=1:8
planes{r}=reshape(plane{r},m,n);
end
but i am getting error as follows: ??? Operands to the and && operators must be convertible to logical scalar values.
Error in ==> dec2bin at 31 if any(d < 0) any(~isfinite(d))
Error in ==> Un2 at 13 x=dec2bin(s,8); % decimal to binary transformation
my image size is 512*512 ans watermark size is 64*64.. any one would like to suggest me how can i debug it...thnax and regards....
3 件のコメント
David Young
2011 年 3 月 6 日
Please could you edit your question and use the code formatting button so that the code is readable. (Alternatively, indent each line of code by two spaces.)
Also, it would be useful to know whether my previous answers (on log-polar transforms) had helped you - you haven't accepted them (or any other answers) but you haven't said that they didn't help either. It takes time to give an answer, so it's good to acknowledge good ones - it just takes one click.
amitesh kumar
2011 年 3 月 6 日
David Young
2011 年 3 月 6 日
Thanks!
David
採用された回答
その他の回答 (2 件)
amitesh kumar
2011 年 3 月 6 日
1 件のコメント
Walter Roberson
2011 年 3 月 6 日
Using w(m,n) = 0 could result in "Attempt to grow array along ambiguous dimension" if w (your watermark image) was 3 dimensional, such as would be the case if it is an RGB image. You need to test for that case and figure out what you want to do if it happens.
amitesh kumar
2011 年 3 月 7 日
2 件のコメント
Walter Roberson
2011 年 3 月 7 日
I'll need to see the full corrected code, not just the additional steps.
amitesh kumar
2011 年 3 月 7 日
カテゴリ
ヘルプ センター および File Exchange で Watermarking についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!