convert Malab to vb2010 help me
Show older comments
function LSB_embed(image_name,stego_name,tile)
%image_name=input('Ten anh:','s');
I=imread(image_name);
[m,n]=size(I);
dodai=floor(tile*m*n/100)
%dodai=input('Do dai thong diep:');
%tile=input('Cho ti le nhung:');
%l_dodai=dodai;
%L_B=zeros(1,24);
%i=24;
%while l_dodai>0
% L_B(i)=mod(l_dodai,2);
% l_dodai=floor(l_dodai/2);
% i=i-1;
%end
%chuyen do dai sang nhi phan
bin_message=mod(floor(rand(1,dodai)*10),2);
L_message=length(bin_message)
L_B=zeros(1,24);
i=24;
while L_message>0
L_B(i)=mod(L_message,2);
L_message=floor(L_message/2);
i=i-1;
end
w = [L_B bin_message];
l_w=length(w);
S=I;
d=1;
xl=waitbar(0,'Dang giau tin...');
for i=1:m
waitbar(i/m);
for j=1:n
if d<=l_w
S(i,j)=floor(I(i,j)/2)*2+w(d);
d=d+1;
else
break;
end
end
end
close(xl);
%stego_name=input('cho biet ten anh moi:','s');
imwrite(S,stego_name);
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB 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!