|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
本人做毕业设计,题目是基于DCT域的图像信息隐藏技术,程序虽然写出来了,但是结果却不对,希望大家能帮我看看.
我的掩护对象是LENA图片,嵌入对象是HILL图片.嵌入程序如下:
function inputimage=dct(coverimage,embedimage)
alph=0.015;
[email=dctfun=@dct2]dctfun=@dct2[/email];
coverimage1=coverimage(:,:,1);
coverimage2=coverimage(:,:,2);
coverimage3=coverimage(:,:,3);
coverimage1Dct=blkproc(coverimage1,[8,8],dctfun);
coverimage2Dct=blkproc(coverimage2,[8,8],dctfun);
coverimage3Dct=blkproc(coverimage3,[8,8],dctfun);
embedimage1=embedimage(:,:,1);
embedimage2=embedimage(:,:,2);
embedimage3=embedimage(:,:,3);
[m,n]=size(coverimage1Dct);
[m1,n1]=size(embedimage1);
for i=1:m
for j=1:n
inputimage1(i,j)=coverimage1Dct(i,j)+double(embedimage1(i,j))*alph;
inputimage2(i,j)=coverimage2Dct(i,j)+double(embedimage2(i,j))*alph;
inputimage3(i,j)=coverimage3Dct(i,j)+double(embedimage3(i,j))*alph;
end
end
[email=idctfun=@idct2]idctfun=@idct2[/email];
inputimage11=blkproc(inputimage1,[8,8],idctfun);
inputimage12=blkproc(inputimage2,[8,8],idctfun);
inputimage13=blkproc(inputimage3,[8,8],idctfun);
inputimage11=uint8(inputimage11);
inputimage12=uint8(inputimage12);
inputimage13=uint8(inputimage13);
inputimage(:,:,1)=inputimage11;
inputimage(:,:,2)=inputimage12;
inputimage(:,:,3)=inputimage13;
imwrite(inputimage,'inputimage.bmp');
figure(1)
imshow(inputimage)
figure(2)
imshow(coverimage)
提取过程如下:
function outputimage=indct(coverimage,inputimage)
alph=0.015;
[email=dctfun=@dct2]dctfun=@dct2[/email];
coverimage1=coverimage(:,:,1);
coverimage2=coverimage(:,:,2);
coverimage3=coverimage(:,:,3);
coverimage1Dct=blkproc(coverimage1,[8,8],dctfun);
coverimage2Dct=blkproc(coverimage2,[8,8],dctfun);
coverimage3Dct=blkproc(coverimage3,[8,8],dctfun);
inputimage1=inputimage(:,:,1);
inputimage2=inputimage(:,:,2);
inputimage3=inputimage(:,:,3);
[m,n]=size(coverimage1Dct);
[m1,n1]=size(inputimage1);
for i=1:m
for j=1:n
outputimage1(i,j)=(double(inputimage1(i,j))-coverimage1Dct(i,j))/alph;
outputimage2(i,j)=(double(inputimage2(i,j))-coverimage2Dct(i,j))/alph;
outputimage3(i,j)=(double(inputimage3(i,j))-coverimage3Dct(i,j))/alph;
end
end
[email=idctfun=@idct2]idctfun=@idct2[/email];
outputimage11=blkproc(outputimage1,[8,8],idctfun);
outputimage12=blkproc(outputimage2,[8,8],idctfun);
outputimage13=blkproc(outputimage3,[8,8],idctfun);
outputimage11=uint8(outputimage11);
outputimage12=uint8(outputimage12);
outputimage13=uint8(outputimage13);
outputimage(:,:,1)=outputimage11;
outputimage(:,:,2)=outputimage12;
outputimage(:,:,3)=outputimage13;
figure(1)
imshow(outputimage)
有知道的帮我下哈~~~~~~~~~~~~
[ 本帖最后由 eight 于 2007-4-21 11:08 编辑 ] |
|