我正在隱藏文本到圖像..但我無法得到確切的文本消息回..可以有人plz幫助我在整理的問題和錯誤我的代碼.. K I正在使用的值是2。這裏的代碼如下:錯誤恢復文本隱藏到圖像
clc;
close all; clear all;
clf;
cov_img=imread('pears.png');
cov_img1 =rgb2gray(cov_img);
cov_img1=imresize(cov_img1,[256 256]);
imshow(cov_img1);
k=input('enter no of bits ');
a='In this context, cryptography, steganography and water marking schemes play a vital role in establishing secret communication through encryption, hiding and embedding secret information in digital medium respectively. ';
b=dec2bin(double(a),8);
c=b(:);
d=reshape(c,[],k);
e=bin2dec(d);
[m n]=size(e);
for i=1:256;
for j=1:256;
S(i,j)=cov_img1(i,j)-mod(cov_img1(i,j),2^k)+e(i,:);
j=j+1;
end
i=i+1;
end
figure, imshow(S,[]);
%%Extraction
for i=1:256;
for j=1:256;
E(i,j)=mod(double(S(i,j)),2^k);
j=j+1;
end
i=i+1;
end
e1=dec2bin(E,2);
e2=e1';
e3=reshape(e1,[],8);
e4=bin2dec(e3);
e5=char(e4);
disp(e5)
[mse psnr]=msepsnr(cov_img1,S);
disp('PSNR value is : ');
disp(psnr);
disp(' db');
disp('MSE value is');
disp(mse);
%%%%%%%
看看你的for循環並測試增量方法嗎? – Austin 2014-09-05 19:54:03
你應該解釋你的代碼。你不能粘貼整個代碼並要求人們進行調試。 – 2014-09-05 20:21:36
@ ParagS.Chandakkar我想使用LSB技術將圖像隱藏到圖像中..我部分能夠從圖像中恢復隱藏的文本,但它不是我嵌入的正確文本:( 可能我是在提取過程中做錯了什麼:( – user3801619 2014-09-05 20:38:25