だからここに私がやろうとしていたことがあります。私はmatlabが初めてです。使ってまだ 1 日ほどしか経っていません。LSB アルゴリズムを使用して、イメージ内にステートメントまたは文字列のグループを埋め込みます。文字列はファイルから読み取られます。今のところ、ファイル操作は使用していません。1 つの文字を使用してこれを試していますが、何が問題なのかわかりません。アルゴは単純に見えますが、私の出力、つまりカバー ピクセルとステグ ピクセルの両方が同じ値を示しています。:(
cover=imread('D:\l.jpg');
steg=cover;
l=1;
LSB=0;
height = size (cover, 1);
width = size (cover, 2);
message = 'J' ;
mdec = uint8(message);
mbin = dec2bin(mdec, 8);
mbins= mbin(:);
len=length(mbins);
for i = 1:height
for j = 1:width
if(l<=len)
LSB = mod(cover(i,j), 2);
if(mbins(l)==LSB)
steg(i,j) = cover(i,j);
else if (mbins(l)~=LSB && LSB==1 && mbins(l)==0)
steg(i,j) = cover(i,j)-1;
else if (mbins(l)~=LSB && LSB==0 && mbins(l)==1)
steg(i,j) = cover(i,j)+1;
end
end
end
l=l+1;
end
end
end
imwrite(steg,'D:\hidden.jpg');
%imshow(steg)
cover(1, 1:8)
steg(1, 1:8)