How to extract pixel values in 8-bit binary format from an image?

回答 (2 件)

Image Analyst
Image Analyst 2013 年 3 月 27 日

1 投票

If you want 8 bit, just cast it to 8 bit:
image8bit = uint8(originalImage);
If you want a string of binary digits, use dec2bin()
binaryString = dec2bin(170)
Result:
binaryString =
10101010
Harshit
Harshit 2013 年 3 月 27 日

0 投票

Once you extract the pixel from image quantize it to (0,256) fixed point representation. Let the pixel be p(i,j) the output should be [p(i,j)/max_image{p(i,j)*256].

3 件のコメント

Bala
Bala 2013 年 3 月 27 日
Thank u so much 4 ur reply,but im nt getting ur answer.Can u pls explain.I want in 8bit representation.
Divya Khanna
Divya Khanna 2020 年 4 月 4 日
Why do we divide it in the end?
Image Analyst
Image Analyst 2020 年 4 月 4 日
Just ignore this answer. It's not correct.

サインインしてコメントする。

カテゴリ

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

質問済み:

2013 年 3 月 27 日

コメント済み:

2020 年 4 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by