i have this code to embed. How can i extract the secret message from the stego JPEG? also there is bright in the image when i apply the dct2 does anyone know how to solve it. here is my embedding process code :

3 vues (au cours des 30 derniers jours)
clear; clc;
a= imread ('lena.jpg'); I1=rgb2gray(a);
f = double(I1);
f= f-128; [mf, nf]= size(f); mb=mf/8; nb=nf/8;
% the input image
Ff = blkproc(f, [8 8],'dct2');
% customized Q table quanttable=1*[16 11 10 16 24 40 51 61; 12 12 14 19 26 58 60 55; 14 13 16 24 40 57 69 56; 14 17 22 29 51 87 80 62; 18 22 37 56 68 109 103 77; 24 35 55 64 81 104 113 92; 49 64 78 87 103 121 120 101; 72 92 95 98 112 100 103 99];
Fq= round (blkproc(Ff,[8 8], @(x)x./quanttable));
imwrite(Fq, 'Compressed.jpg'); RFf= round(blkproc (Ff,[8 8], @(x)x./quanttable)); invdct= @idct2; x= blkproc(RFf,[8 8],invdct);
Imwrite(x, 'cover.jpg');
Cover=imread('cover.jpg');
b=input('your words ? ');
c=double(b);
d=dec2bin(c);
[q w]=size(d);
siz=q*w;
%% first pixel
for i=1:siz, x=dec2bin(Cover(i)); x(8)=d(i); y=bin2dec(x); Cover(i)=y; end
Cover(256,256)=q;
%%
for i=1:siz, X=dec2bin(Cover(i)); D(i)=X(8); end
data=char(bin2dec(reshape(D,q,w))); data=data';
msgbox(data);
imwrite(Cover,'stego.jpg') Stegoimage=imread ('stego.jpg');
%%
subplot(211);imshow(Cover); subplot(212);imshow(Stegoimage);

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by