image watermarking using dwt
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
jojototo
il 25 Mag 2019
Commentato: jojototo
il 31 Mag 2019
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 Commenti
Risposta accettata
KALYAN ACHARJYA
il 25 Mag 2019
Modificato: KALYAN ACHARJYA
il 25 Mag 2019
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.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!