Filter löschen
Filter löschen

Determine the number of bits used for every pixel intensity

3 Ansichten (letzte 30 Tage)
Hi,
I would like to determine the number of bits used for every pixel intensity. Is this possible?
I am aware that imhist() shows the distribution of pixel intensity values, but is it possible to see how many bits are allocated for each pixel intensity?
Thank you.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 28 Aug. 2019
Bearbeitet: Walter Roberson am 28 Aug. 2019
For int8 and uint8 the number of bits per pixel is 8 times the number of color planes.
For int16 and uint16 it is 16 times the number of color planes.
For int32 and uint32 it is 32 times the number of color planes.
For int64 and uint64 it is 64 times the number of color planes.
For single() it is 32 times the number of color planes.
For double() it is 64 times the number of color planes.
These values do not change depending on the intensity of the pixel, only depending on the class() of the datatype.
There are cases in which you can compress into a smaller number of bits (or sometimes a larger number of bits!), but the number of bits required depends upon which compression scheme you are using. (Your question hints that you might be thinking about Huffman encoding.)

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by