Azzera filtri
Azzera filtri

LSB substitution by verifying pixel values odd or even

1 visualizzazione (ultimi 30 giorni)
for embedding a message b, keep the pixel value odd for bit 0 and even for bit 1. i have developed code in this manner. But output values are not getting as expected. Somebody plz help to figure out the mistake.
c=round(rand(2,12));
m=1:2;n=1:12;
a(m,n)=c(m,n);
disp(a);
b=dec2bin(128);
l=length(b);
for k=1:l
if b(k)==1
if mod(c(1,k),2)==1
c(1,k)=c(1,k);
else
c(1,k)=c(1,k)+1;
if mod(c(1,k),2)==0
c(1,k)=c(1,k);
else
c(1,k)=c(1,k)+1;
end
end
end
end
disp(c);

Risposte (0)

Categorie

Scopri di più su Agriculture in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by