Image to binary conversion

3 visualizaciones (últimos 30 días)
Nandhini Rajkumar
Nandhini Rajkumar el 11 de Mzo. de 2012
Hi,I would like to convert each pixel value of an image to one byte. how do i do it. I tried
for i=1:a
for j=1:b
k(i,j)=dec2bin(image(i,j));
end;
end;
where a and b are size of the image. But there comes size mismatch error. Please help me to correct it.

Respuesta aceptada

Chandra Kurniawan
Chandra Kurniawan el 11 de Mzo. de 2012
for i = 1 : a
for j = 1 : b
k{i,j} = dec2bin(image(i,j));
end
end
please use cell-array to store strings, not array.
  2 comentarios
Nandhini Rajkumar
Nandhini Rajkumar el 11 de Mzo. de 2012
Thank you so much. it worked.
maryam zaman
maryam zaman el 27 de Abr. de 2013
How we can convert each pixel value of image in binary?

Iniciar sesión para comentar.

Más 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