Image to binary conversion

조회 수: 9 (최근 30일)
Nandhini Rajkumar
Nandhini Rajkumar 2012년 3월 11일
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