Please, I would really appreciated it If someone could give me some advice. I am not asking for written code,just want advice on how to go about retrieving the hidden message
embedding data in DWT subband using LSB Steganography?
3 views (last 30 days)
Show older comments
Hi, I am attempting to do the above. code I have to so far. I need help to extract the hidden message from
stego image.please can someone help me?
%Cover Image
origIm = imread('lena.bmp');
% Discrete Wavelet Transform
[LL LH HL HH]=dwt2(origIm,'haar');
dec=[...
LL,LH
HL,HH
...
];
%figure;imshow(dec,[]);title ('DWT');
%[visibleRows visibleColumns] = size(origIm);
A = importdata('minutiaTest.txt');
binaryString = transpose(dec2bin(A,8));
binaryString = binaryString(:);
N = length(binaryString);
b = zeros(N,1); %b is a vector of bits
for k = 1:N
if(binaryString(k) == '1')
b(k) = 1;
else
b(k) = 0;
end
end
%c=HH;
s = HH;
%figure (1);imshow(s);
height = size(HH,1);
width = size(HH,2);
k = 1; Array=[];l=1;my=1;
for i = 1 : height
for j = 1 : width
LSB = mod(double(HH(i,j)), 2);
if (k>N || LSB == b(k))
s(i,j) = HH(i,j);
l=k+1;
else
if(LSB == 1)
s(i,j) = HH(i,j) - 1;
else
s(i,j) = HH(i,j) + 1;
Array(my)=l;
l=l+1;
my= my + 1;
end
k = k + 1;
end
end
end
%%%%%
%figure (2); imshow(s);
stego=idwt2(LL,LH,HL,HH,'haar');
imwrite(uint8(stego), 'hiddenmsgimage.bmp');
%imshow(stego);
Stego = imread('hiddenmsgimage.bmp');
%imshow(Stego);
[LL LH HL HH]=dwt2(Stego,'haar');
dec=[...
LL,LH
HL,HH
...
];
%imshow(HH);
%figure;imshow(dec,[]);title ('DWT');
k = 1;my=1;ur=1;
for i = 1 : height
for j = 1 : width
if( k<=N )
if (my<numel(Array) && Array(my)==ur)
b(k)=~(mod(double(s(i,j)),2));
else
b(k) = mod(double(s(i,j)),2);
end
k = k + 1;
my= my + 1;
end
ur=ur+1;
end
end
%%%%
disp(b);
Answers (0)
See Also
Categories
Find more on Wavelet Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!