what is the meaning of the following code ?

3 ビュー (過去 30 日間)
Gayatri B
Gayatri B 2019 年 9 月 18 日
コメント済み: Gayatri B 2019 年 10 月 9 日
Following code is for retrieving image from stego image in image steganography. Can anyone please tell me meaning of it ?
function Retrive_Callback(hObject, eventdata, handles)
global l;
h=mod(l,2);
p=zeros(1000,1000);
for x=1:1000
for y=1:1000
if(h(x,y)==1)
p(x,y)=255;
end
end
end
s=im2bw(p);
axes(handles.axes4);
imshow(s);
grid on;

採用された回答

Sebastian Körner
Sebastian Körner 2019 年 9 月 18 日
the code semes to have some errors in it but i think the idea of your code is :
create a 1000x1000 matrix with zeros, replacing some zeros with 255 (all values in a line from top left corner to bottom right corner of the matrix)
format the matrix to a image and show the image
  1 件のコメント
Gayatri B
Gayatri B 2019 年 9 月 18 日
Ohk, I'll check for errors. Thank You !

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2019 年 10 月 2 日
p is just 255 * h. And s just thresholds p back to 0 or 1, which is just the original h. So all that code is unnecessary.
Replace with
function Retrive_Callback(hObject, eventdata, handles)
global l;
h=mod(l,2);
axes(handles.axes4);
imshow(h, []);
grid on;
By the way, you reversed x and y. Matrices are indexed (y, x) NOT (x,y) because the first index is the y, or row, value, not the column value.
  1 件のコメント
Gayatri B
Gayatri B 2019 年 10 月 9 日
Okay, Thank you !

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by