Our terms of service are changing. Learn more.

Publication

Computer Vision

Color Theory in Computer Vision

Last Updated on November 16, 2020 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.

Photo by Paweł Czerwiński on Unsplash

Color Vision

Source

History of Color theory:

Color model from the book “Theory of Colors” by Johann Wolfgang.

Source

RYB colors

Proof as to why RYB was Considered to be primary colors

Source

Trichromatic Theory

  • Also known as Young-Helmholtz theory.

Three types of cone photoreceptors

  • Short-preferring(Blue)
  • Middle-preferring(Green)
  • Long-preferring(Red)
Source

RGB Space Spanning

Source

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.
Source

Accessing channels of RGB image using OpenCV

https://medium.com/media/0061b5c87860b47bbb1a2d49744f3bf6/href

Additive and Subtractive Color Theory

Convert RGB to CMYK using PIL

https://medium.com/media/19a118f7bb2dd5ec46aa72b59b4923be/href

CIE -LAB

L -Lightness ( Intensity)

a -Green to Magenta

b -Blue to Yellow

Convert RGB to LAB using SkImage

https://medium.com/media/cb962f15bd846c47a5d5211a7c567a25/href

CIE-YCrCb

Y-Luminance , Cr -Red, Cb -Blue

  • Resemblance with YUV mode

Convert RGB to YCrCb using SkImage

https://medium.com/media/1008698882bacb1dbfd91d56e48ce8c3/href

CIE-XYZ

Source

Convert RGB to XYZ using SkImage

https://medium.com/media/4ebe5b8a492f56698c70b029d41ac86f/href

HSV

Source

Convert RGB to HSV using Skimage

https://medium.com/media/82c297911f34df38e4f5732f606ce522/href

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:

Akula Hemanth Kumar – Medium


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

Feedback ↓