how to convert a grayscale image to binary sequence
Mostrar comentarios más antiguos
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 comentarios
Khulood Malek
el 10 de Jun. de 2020
Image of cemeraman how to obtain the binary image from the original images and plot it
Image Analyst
el 10 de Jun. de 2020
Khulood, if you'll search my Answer below you'll see a variable called binaryImage and how I get it via thresholding.
Respuesta aceptada
Más respuestas (2)
Lokesh Ravindranathan
el 17 de Jul. de 2013
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 comentario
Image Analyst
el 17 de Jul. de 2013
You don't need to call permute() and reshape() - simply do I(:). But I don't think that's what he wants.
Ali nafaa
el 29 de Nov. de 2022
0 votos
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 comentarios
Image Analyst
el 29 de Nov. de 2022
But this does not show how to "embed this sequence into another image" (in other words steganography).
Ali nafaa
el 29 de Nov. de 2022
create a new Image Array with the same number of rows and columns as original image array, containing all elements as zero.
Image Analyst
el 29 de Nov. de 2022
Yes, that's what your call to zeros() does. But where does the data hiding (embedding) come about in your code?
Categorías
Más información sobre Watermarking en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!