Color Theory in Computer Vision
Last Updated on January 6, 2023 by Editorial Team
Author(s): Akula Hemanth Kumar
Computer Vision
Making computer vision easy with Monk, a low code Deep Learning tool, and a unified wrapper for ComputerΒ Vision.
Color Vision
History of ColorΒ theory:
Color model from the book βTheory of Colorsβ by Johann Wolfgang.
RYB colors
Proof as to why RYB was Considered to be primaryΒ colors
Trichromatic Theory
- Also known as Young-Helmholtz theory.
Three types of cone photoreceptors
- Short-preferring(Blue)
- Middle-preferring(Green)
- Long-preferring(Red)
RGB SpaceΒ Spanning
Opponent colorΒ theory
- There are colors not directly perceivable in normal lighting conditions.
- The trichromatic theory fails to incorporate theseΒ colors.
- The opponent-process works through excitatory and inhibitory responses, with the two components of each mechanism opposing eachΒ other.
Gray Scale
- Monochromatic SingleΒ Channel
- Pixel values from 0(Black) to 255(White)
- Grayscale images contain only shades ofΒ gray.
Use cases
- Less data complexity and storage requirements
- Many applications work well with gray scales. Complex channels are not required.
- Improved computation speeds.
RGB
- The additive color space is based on the RGB colorΒ model.
- Three Channels Red, Green, andΒ Blue.
- Used in many image processing and computer vision applications.
Accessing channels of RGB image usingΒ OpenCV
Additive and Subtractive ColorΒ Theory
Convert RGB to CMYK usingΒ PIL
CIE -LAB
L -Lightness ( Intensity)
a -Green toΒ Magenta
b -Blue toΒ Yellow
Convert RGB to LAB usingΒ SkImage
CIE-YCrCb
Y-LuminanceΒ , Cr -Red, CbΒ -Blue
- Resemblance with YUVΒ mode
Convert RGB to YCrCb usingΒ SkImage
CIE-XYZ
Convert RGB to XYZ usingΒ SkImage
HSV
Convert RGB to HSV usingΒ Skimage
Other ColorΒ Spaces
- Haematoxylin-Eosin-DAB(HED)
- CIE-LCH colorΒ space
- YUV colorΒ space
- YIQ colorΒ space
- Stain colorΒ space
- HSL colorΒ space
You can find the complete jupyter notebookΒ here.
If you have any questions, you can reach Abhishek. Feel free to reach out toΒ him.
I am extremely passionate about computer vision and deep learning. I am an open-source contributor to Monk Libraries.
You can also see my other writingsΒ at:
Color Theory in Computer Vision was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.
Published via Towards AI