필터 지우기
필터 지우기

image watermarking using dwt

조회 수: 1 (최근 30일)
jojototo
jojototo 2019년 5월 25일
댓글: jojototo 2019년 5월 31일
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;

채택된 답변

KALYAN ACHARJYA
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.
  댓글 수: 1
jojototo
jojototo 2019년 5월 31일
Thank you so much

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by