Image to binary conversion

3 次查看(过去 30 天)
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.

采纳的回答

Chandra Kurniawan
Chandra Kurniawan 2012-3-11
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 个评论
Nandhini Rajkumar
Nandhini Rajkumar 2012-3-11
Thank you so much. it worked.
maryam zaman
maryam zaman 2013-4-27
How we can convert each pixel value of image in binary?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by