필터 지우기
필터 지우기

sir i have a code which i want to use in image steganography but whenever i am trying to take that code and use in my gui its showing me error

조회 수: 1 (최근 30일)
i want to use this code in my gui but i want to retrieve the image from the previous button and whenever im using the previous button its showing me error
the code which i want to use
c = imread('images.jpg');
message = 'hellokarthick'
message = strtrim(message);
m = length(message) * 8;
AsciiCode = uint8(message);
binaryString = transpose(dec2bin(AsciiCode,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
s = c;
height = size(c,1);
width = size(c,2);
k = 1;
for i = 1 : height
for j = 1 : width
LSB = mod(double(c(i,j)), 2);
if (k>m || LSB == b(k))
s(i,j) = c(i,j);
else
if(LSB == 1)
s(i,j) = c(i,j) - 1;
else
s(i,j) = c(i,j) + 1;
end
k = k + 1;
end
end
end
imwrite(s, 'hiddenmsgimage.bmp');
the code which i am using
c = imread('get(handles.filename, 'String');');
message = 'handles.edit2, 'String''
message = strtrim(message);
m = length(message) * 8;
AsciiCode = uint8(message);
binaryString = transpose(dec2bin(AsciiCode,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
s = c;
height = size(c,1);
width = size(c,2);
k = 1;
for i = 1 : height
for j = 1 : width
LSB = mod(double(c(i,j)), 2);
if (k>m || LSB == b(k))
s(i,j) = c(i,j);
else
if(LSB == 1)
s(i,j) = c(i,j) - 1;
else
s(i,j) = c(i,j) + 1;
end
k = k + 1;
end
end
end
imwrite(s, 'hiddenmsgimage.bmp');

답변 (2개)

Walter Roberson
Walter Roberson 2015년 6월 22일
Replace
c = imread('get(handles.filename, 'String');');
with
filename = get(handles.filename, 'String');
c = imread(filename);
  댓글 수: 1
Image Analyst
Image Analyst 2015년 6월 22일
Better yet, just use dir() to load the image names into a listbox so the user can easily click on a name to select it. Why force your user to have to know the filename and type it in? Don't be cruel to your users.

댓글을 달려면 로그인하십시오.


eng
eng 2015년 7월 3일
plz, where is the decoding part ? can you continue it plz to be more useful for us :)

Community Treasure Hunt

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

Start Hunting!

Translated by