基于DCT域的图像信息隐藏技术~
本人做毕业设计,题目是基于DCT域的图像信息隐藏技术,程序虽然写出来了,但是结果却不对,希望大家能帮我看看.我的掩护对象是LENA图片,嵌入对象是HILL图片.嵌入程序如下:
function inputimage=dct(coverimage,embedimage)
alph=0.015;
dctfun=@dct2;
coverimage1=coverimage(:,:,1);
coverimage2=coverimage(:,:,2);
coverimage3=coverimage(:,:,3);
coverimage1Dct=blkproc(coverimage1,,dctfun);
coverimage2Dct=blkproc(coverimage2,,dctfun);
coverimage3Dct=blkproc(coverimage3,,dctfun);
embedimage1=embedimage(:,:,1);
embedimage2=embedimage(:,:,2);
embedimage3=embedimage(:,:,3);
=size(coverimage1Dct);
=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
idctfun=@idct2;
inputimage11=blkproc(inputimage1,,idctfun);
inputimage12=blkproc(inputimage2,,idctfun);
inputimage13=blkproc(inputimage3,,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;
dctfun=@dct2;
coverimage1=coverimage(:,:,1);
coverimage2=coverimage(:,:,2);
coverimage3=coverimage(:,:,3);
coverimage1Dct=blkproc(coverimage1,,dctfun);
coverimage2Dct=blkproc(coverimage2,,dctfun);
coverimage3Dct=blkproc(coverimage3,,dctfun);
inputimage1=inputimage(:,:,1);
inputimage2=inputimage(:,:,2);
inputimage3=inputimage(:,:,3);
=size(coverimage1Dct);
=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
idctfun=@idct2;
outputimage11=blkproc(outputimage1,,idctfun);
outputimage12=blkproc(outputimage2,,idctfun);
outputimage13=blkproc(outputimage3,,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 编辑 ]
页:
[1]