필터 지우기
필터 지우기

will someone find an error regard this code? because my watermaked modifed/inserted only left side of host image..

조회 수: 1 (최근 30일)
clc;
clear all;
hi=imread('Lena.tif');
[m,n]=size(hi);
area=m*n*8;
hi=dec2bin(hi); hi;
wi=imread('cameraman (2).tif');
b=imresize(wi,1/4);
imwrite(b,'wm.tif');
wi=imread('wm.tif');
[x,y]=size(wi);
wm=dec2bin(wi);
wlength=x*y*8;
i=1; j=1; k=1;
cnt=0;
while i<area
cnt=cnt+1;
if cnt>wlength;
break;
end
hi(i,8)=wm(j,k);
k=k+1;
if k>8
k=1;
j=j+1;
end
i=i+1;
end
h1=bin2dec(hi);
[u,v]=size(h1);
h1=reshape(h1,m,n);
h1=uint8(h1);
wmm(1:m,1:n)=h1(1:m,1:n);
imshow(wmm);
imwrite(wmm,'w_image.tif');
imshow(wmm);
  댓글 수: 7
SHALU SINGH
SHALU SINGH 2014년 9월 18일
편집: SHALU SINGH 2014년 9월 18일
there is an errors like, "Unsupported image datatype 'struct'." "error in imwrite validateSizes", "Unsupported image datatype 'struct'." i did't understand whats the problem here..
Guillaume
Guillaume 2014년 9월 18일
Sorry I made a typo the third line should have read:
cameraman = uint8(repmat((0:255)', 1, 256));
I've edited the comment to correct the error.

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by