Difference between binary and grayscale images?

32 Ansichten (letzte 30 Tage)
Prabha K
Prabha K am 12 Dez. 2022
Bearbeitet: DGM am 13 Dez. 2022
What is the difference between binary and greyscale images?

Antworten (1)

DGM
DGM am 12 Dez. 2022
Bearbeitet: DGM am 12 Dez. 2022
Interpretations may vary, but I think a common general description would be. This is just my interpretation.
A grayscale image is a single-channel image possibly (but not necessarily) containing many intermediate intensities between (and potentially including) black and white. These images may also be simply referred to as "monochrome", "single-channel" or "intensity" images. Many of the documentation files denote single-channel images with the variable name I for "intensity".
Caveats: It's easy to find examples where "grayscale" or "monochrome" are used in reference to multichannel (RGB) images which simply have no zero color content. Context is important. I prefer the descriptors "single-channel" or 'I" instead of "grayscale" because of this.
A binary image is an image which has been reduced so that there are only two possible pixel values. These images are what the documentation typically represents with the variable name BW for "black and white".
While it might be common for a binary image to be represented as a logical array of 0 and 1, it is likely for a binary image to be of numeric class (e.g. a uint8 image containing only 0 and 255). So all logical-class images are binary, but not all binary images are logical-class.
Caveats: While a binary image may be numeric, it might not be correctly handled by some tools unless it is properly converted to a logical class or unless it can be blindly cast as logical without changing the object content. Generally, this would mean that a numeric-class representation of a binary image should have a "black" value of zero, regardless of the white value being used.
There is also nothing about the term "binary image" which implies that the image is only single-channel, though it may be common for some of MATLAB's tools (e.g. imshow()) to only handle logical images if they are single-channel.
See also:
  2 Kommentare
Image Analyst
Image Analyst am 12 Dez. 2022
In my experience it's far more common for a binary image to be logical than uint8, since they're usually gotten from some kind of thresholding operation.
DGM
DGM am 13 Dez. 2022
Bearbeitet: DGM am 13 Dez. 2022
In documentation and discussions, I think that's definitely the prevailing theme. For good reason too.
That said, it's fairly common to see binarized masks transported in uint8-format files and represented in uint8-scale in other applications. I prefer to consider "binary" or "binarized" as the more generalized term.
All this language gets awful muddy at times. I'm sure a number of people asking about "binary" images (e.g. in steganography threads) are talking about handling numeric image data bitwise. Even the common use of "I" or "intensity" runs into ambiguity if you consider HSI exists and is occasionally requested (for some reason). ... but wait. Are they asking about HSI color model, or are they asking about hyperspectral imaging?? :D

Melden Sie sich an, um zu kommentieren.

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