matlab水印程序,谁可以帮我改一下

[复制链接]
查看11 | 回复1 | 2011-5-20 10:54:09 | 显示全部楼层 |阅读模式
clear;
load mis
I=X;
type='db1';
[CA1,CH1,CV1,CD1]=DWT2(I,type);
C1=[CH1 CV1 CD1];
[length1,width1]=size(CA1);
[M1,N1]=size(C1);
T1=50;
alpha=0.2;
for counter2 =1:1:N1

for counter1=1:1:M1

if (C1(counter1,counter2)>T1)

marked(counter1,counter2)=randn(1,1);

NEWC1(counter1,counter2)=double(C1(counter1,counter2))+...
alpha*abs(double(C1(counter1,counter2)))*marked1(counter1,counter2);

else

marked(counter1,counter2)=0;

NEWC1(counter1,counter2)=double(C1(counter1,counter2));

end;

end;
end;
NEWCH1=NEWC1(1:lenght1,1:width1);
NEWCV1=NEWC1(1:lenght1,width1+1:2*width1);
NEWCD1=NEWC1(1:lenght1,2*width1+1:3*width1);
R1=double(idwt2(CA1,NEWCH1,NEWCV1,NEWCD1,type));
watermark1=double(R1)-double(I);
figure(1);
subplot(1,2,1);
image(I);
axis('square');
title('yuanshituxiang');
subplot(1,2,2);
imshow(R1/250);
axis('square');
title('xiaobobianhuanghoudetuxiang');
figure(2);
imshow(watermark1*10^16);
axis('square');
title('shuiyintuxiang');
newmarked1=reshape(marked1,M1*N1,1);
T2=60;
for counter2=1:1:N1

for counter1=1:1:M1

if(NEWC1(counter1,counter2)>T2)

NEWC1X(counter1,counter2)=NEWC1(counter1,counter2);

else

NEWC1X(counter1,counter2)=0;

end;

end;
end;
NEWC1X=reshape(NEWC1X,M1*N1,1);
correlation1=zeros(1000,1);
for corrcounter=1:1:1000

if (corrcounter==500)

correlation1(corrcounter,1)=NEWC1X'*newmarked1/(M1*N1);

else

rnmark=randn(M1*N1,1);

correlation1(corrcounter,1)=NEWC1X'*rnmark/(M1*N1);

end;
end;

originalthreshold=0;

for counter2=1:1:N1

for counter1=1:1:M1

if(NEWC1(counter1,counter2)>T2)

originalthreshold=originalthreshold+abs(NEWC1(counter1,counter2));

end;

end;

end;


originalthreshold=originalthreshold*alpha/(2*M1*N1);
corrcounter=1000;
originalthresholdvector=ones(corrcounter,1)*originalthreshold;
figure(3);
plot(correlation1,'-');
hold on;
plot(originalthresholdvector,'-');
title('yuanshidejiashuiyindetuxiang');
xlabel('shuiyin');
ylabel('jiancexiangying');
运行出来说第二句有问题,应该怎么改,还有图像应该放在那里?mis是一幅图

回复

使用道具 举报

千问 | 2011-5-20 10:54:09 | 显示全部楼层
不好意思,太难了,不会
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行