how to do binary conversion of an image?

1 visualización (últimos 30 días)
sana saleeme
sana saleeme el 7 de En. de 2016
Comentada: Walter Roberson el 8 de En. de 2016
how to do binary conversion of an image?
  4 comentarios
hemalatha
hemalatha el 8 de En. de 2016
Editada: hemalatha el 8 de En. de 2016
read the image into an array,that array consists of pixels a=imread("give your imagepath"); now convert the array of pixels into binary by using the inbuilt function dec2bin, binaryvalues=dec2bin(a); now you get the binary values in single column
Walter Roberson
Walter Roberson el 8 de En. de 2016
hemalatha, that is not quite correct. You need
binaryvalues = reshape( (dec2bin(a, 8)-'0').', [], 1);
to get the binary values in a single column (presuming that the image was uint8 data type.)

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by