image watermarking using dwt
1 回表示 (過去 30 日間)
古いコメントを表示
I am using the following code to embed an image as a watermark in HL component of the host image "after performing dwt on host image" and I get this error message
""Array dimensions must match for binary array op"" could you help me to fix this problem please?
B = 'Host.png';
rgbhostImage = imread(B);
[f7,f8]= wfilters('haar','d');
[A,V,H,D]= dwt2(rgbhostImage,'haar','d');
[A2,V2,H2,D2]= dwt2(A,'haar','d');
w= imread('watermarkimage.png');
water= imresize(w, [512, 365]);
imwrite(water,'watermarkimage2.png');
watermark= imread('watermarkimage2.png');
%watermarking
wtrmrk= double(watermark);
Q= double(H2);
wtrmrkedimage= Q+0.001*wtrmrk;
0 件のコメント
採用された回答
KALYAN ACHARJYA
2019 年 5 月 25 日
編集済み: KALYAN ACHARJYA
2019 年 5 月 25 日
As you didnot provided the sufficient data, but I have figure out, in which line the error occured
I have test the code with different images, the error is same
wtrmrkedimage= Q+0.001*wtrmrk;
% Plese ensure that Q and wtrmrk must have same size
How can you add the two different dimension matrices, debug the code in such that Q and wtrmrk must have same dimention (also type), checked the following way.
>> whos Q
Name Size Bytes Class Attributes
Q 128x128 131072 double
>> whos wtrmrk
Name Size Bytes Class Attributes
wtrmrk 512x365 1495040 double
>>
Check the all variable, so that dimention must agree.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!