LSB substitution by verifying pixel values odd or even

1 次查看(过去 30 天)
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);

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Agriculture 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by