how to convert a grayscale image to binary sequence
이전 댓글 표시
I'm research on watermarking. I want to convert a grayscale image MxN pixel (a pixel value 0~255)in to a binary sequence and permute it to embed this sequence into another image. after i can extract this sequence and restore to original grayscale image. What should i do. Please help me.
댓글 수: 2
Khulood Malek
2020년 6월 10일
Image of cemeraman how to obtain the binary image from the original images and plot it
Image Analyst
2020년 6월 10일
Khulood, if you'll search my Answer below you'll see a variable called binaryImage and how I get it via thresholding.
채택된 답변
추가 답변 (2개)
Lokesh Ravindranathan
2013년 7월 17일
For converting image into binary sequence,
For permutation use the following code
permute(reshape(I, numel(I), 1))
Use the permuted image for embedding.
댓글 수: 1
Image Analyst
2013년 7월 17일
You don't need to call permute() and reshape() - simply do I(:). But I don't think that's what he wants.
Ali nafaa
2022년 11월 29일
0 개 추천
x = imread('cameraman.tif');
figure,imshow(x);
[r,c] = size (x);
output=zeros(r,c);
for i = 1 : r
for j = 1 : c
if x(i,j) > 128
output(i,j)=1;
else
output(i,j)=0;
end
end
end
figure,imshow(output);
댓글 수: 3
Image Analyst
2022년 11월 29일
But this does not show how to "embed this sequence into another image" (in other words steganography).
Ali nafaa
2022년 11월 29일
create a new Image Array with the same number of rows and columns as original image array, containing all elements as zero.
Image Analyst
2022년 11월 29일
Yes, that's what your call to zeros() does. But where does the data hiding (embedding) come about in your code?
카테고리
도움말 센터 및 File Exchange에서 Watermarking에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!