Opencv | Color Space

Today, we are talking about color space in Opencv. In general, there are so many different colors in the world combining everything that we have seen.But specifically, it seems that only several basic colors become “color space”, which is root of every single color.
The use of color image processing is motivated by two factors:
1.Color is a powerful descriptor that often simplifies object identification and extraction from a scene.
2.Humans can discern thousands of color shapes and intensities, compared to about only two dozens of grayscales.
Color image processing is divided into two major areas
Full-color image processing
Pseudo-color image processing
Some of the gray-scale methods are directly applicable to color images. Others require reformulation to be consistent with the properties of the color spaces.

The light uses additive color system with three primary colors, Red, Green, Blue, will be added together to reproduce other colors.
Pigments uses a subtractive color system that absorbs a primary color and reflect or transmits the other two. The primary colors of pigments are Magenta, Cyan, and Yellow.
在这里插入图片描述
The purpose of a color model (or color space or color system) is to facilitate the specification of colors in some standard way.
A color model is a specification of a coordinate system where each color is represented by a single point.
RGB (red, green blue)
CMY or CMYK (cyan, magenta, yellow, black)
HSI (hue, saturation, intensity)

RGB: Additive Color System

Additive color involves the use of colored lights. It starts with darkness and mixes red, green and blue light together to produce other colors.
Combining one of these additive primary colors with another produces the subtractive primary colors, i.e., Yellow, Cyan, and Magenta.
Combining all three primary colors produces white.

CIE: CMY Model

Cyan (blue-green), Magenta (blue-red), and Yellow (red-green) are primary colors of pigments.
Most devices that deposit colored pigment on paper, such as color printer and copiers, require CMY data. Usually, we add black (K) to get CMYK color model.
RGB and CMY color models are ideally suited for hardware implementations, but
They are not well suited for describing colors for human interpretation.
They cannot capture human intuitions about the topology of colors.

When humans view a color object, we describe it by its hue (H), saturation (S), and intensity (I) as follows.
Hue: the color attribute that describes a pure color (the property of a color that varies in passing from red, yellow, green, cyan, blue, magenta, red).
Saturation: the measure of the degree to which a pure color is diluted by white light (purity of color).
Intensity (brightness): the property that varies in pass from black to white.

HSI Color Model

在这里插入图片描述
If we divide them into three different levels, including H,S,I, what will happen?
在这里插入图片描述
Given an image in RGB color format, the HSI color coordinates can be obtained as follows (not perfect):
在这里插入图片描述
In conclusion, it’s not so hard for us to exchange RGB, HSI or CMY in different spaces. As we can see, the array is not so complex. But for a picture, it’s also important to choose color space properly, which will have a good job for your following process, such as color segment and Contrast Stretching.

That’s all, thank you for reading.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值