LSB code
古いコメントを表示
I want hide a text in image using LSB algorithm
for example:
X = image;
S = secret message;
I write:
X2(:)=bitset(X(:),1,S(:));
but when run i have an error
"??? Error using ==> bitset
Inputs must be non-negative integers."
after convert to binary i have another error
??? Undefined function or method 'bitset' for input arguments of type 'char'.
please help me.
1 件のコメント
Michael Chan
2012 年 4 月 21 日
Similar methods are used in Matlab in the following example for static images:
http://www.mathworks.com/matlabcentral/fileexchange/36288-embedding-hiding-image-within-image-with-n-bit-lsb-steganography
http://www.mathworks.com/matlabcentral/fileexchange/36275-image-description-notes-with-n-bit-lsb-steganography
採用された回答
その他の回答 (5 件)
Walter Roberson
2011 年 11 月 26 日
0 投票
What data types are X and S? That is, what does class() report for each of them?
Your S must be a vector of values, each 0 or 1. It cannot be '0' or '1', and it cannot be (e.g) 72 (which corresponds to the coding for 'H')
pratiksha patil
2012 年 3 月 4 日
0 投票
But how can I again extract the original message file???????
4 件のコメント
Aseel H
2012 年 3 月 7 日
編集済み: Walter Roberson
2020 年 5 月 3 日
Michael Chan
2012 年 4 月 21 日
Similar methods are used in Matlab in the following example for static images:
http://www.mathworks.com/matlabcentral/fileexchange/36288-embedding-hiding-image-within-image-with-n-bit-lsb-steganography
http://www.mathworks.com/matlabcentral/fileexchange/36275-image-description-notes-with-n-bit-lsb-steganography
Sanjeeb Behera
2016 年 9 月 10 日
When I run this code it gives an error in below line bin_vector(idk) = bitget(cover(row,col), 7);
Error - The variable bin_vector appears to change size on every loop iteration (within script). Consider perallocating for speed
Walter Roberson
2016 年 9 月 10 日
That would not be an error, it would be a warning given by the editor. It is a matter of efficiency, not a matter of being incorrect MATLAB. If you want to avoid the warning you can use
bin = zeros(cl, 8);
before the "for x = 1 : cl" loop.
sha
2012 年 3 月 21 日
This is my example of extraction..
hopefully you can try..
%determined the size of watermarked image
mw=size(image1,1); %heigth of the watermarked image
nw=size(image1,2); %width of the watermarked image
for ii = 1: mw
for jj = 1 : nw
watermark (ii,jj) = bitget(image1(ii,jj),1);
end
end
figure(2)
imshow(watermark);
title('extracted image'); % watermark image for watermarking
1 件のコメント
ghassan78
2014 年 1 月 27 日
ok my bro , but i think this code don't work with color watermark ... just with gray
Swati Nagpal
2018 年 7 月 21 日
0 投票
I m working on lsb to hide text behind an image I have done the encryption part but I m having problem in decryption of lsb. So j request you to help me in that or pls share code for retrieval of hidden message from the image.
1 件のコメント
Image Analyst
2018 年 7 月 21 日
I believe my answer did that, didn't it? If not, tell me what about it didn't work, and attach your cover image and secret image so that the problem can be demonstrated.
Ariba Tariq
2018 年 7 月 31 日
0 投票
I am working on LSB to hide parts of one secret image into multiple cover images and then trying to recover secret from all the cover images. It would help me a lot if anybody can guide me through this or share a code of similar concept.
1 件のコメント
Image Analyst
2018 年 7 月 31 日
To process a sequence of files with my code, make my code a function, then put it inside a for loop that you get from the FAQ: https://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
カテゴリ
ヘルプ センター および File Exchange で Watermarking についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!