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 日

0 投票

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 件)

カテゴリ

ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by