Monday, January 16, 2017

9:29 AM

Abre To Corazon...
Nice to see you Automator, now i would like to explain you about how to make color tracking program in C ++ using OpenCV. And if you need how to tracking using python you can check in here. But before i will explain it more you must to know first about what is HSV?

Another way to characterize a color is in terms of the HSV model.
  1. The hue (H) of a color refers to which pure color it resembles. All tints, tones and shades of red have the same hue. Hues are described by a number that specifies the position of the corresponding pure color on the color wheel, as a fraction between 0 and 1. Value 0 refers to red; 1/6 is yellow; 1/3 is green; and so forth around the color wheel.
  2. The saturation (S) of a color describes how white the color is. A pure red is fully saturated, with a saturation of 1; tints of red have saturations less than 1; and white has a saturation of 0.
  3. The value (V) of a color, also called its lightness, describes how dark the color is. A value of 0 is black, with increasing lightness moving away from black.
This diagram, called the single-hexcone model of color space, can help you visualize the meaning of the H, S, and V parameters figure 2.

Figure 2. Hexagonal pyramid HSV

Many reasons why HSV usually is used for segmentation object compare with RGB, I will try to explain more:

The simple answer is that unlike RGB, HSV separates luma, or the image intensity, from chroma or the color information. This is very useful in many applications. For example, if you want to do histogram equalization of a color image, you probably want to do that only on the intensity component, and leave the color components alone. Otherwise you will get very strange colors.

In computer vision you often want to separate color components from intensity for various reasons, such as robustness to lighting changes, or removing shadows.

Note, however, that HSV is one of many color spaces that separate color from intensity (See YCbCr, Lab, etc.). HSV is often used simply because the code for converting between RGB and HSV is widely available and can also be easily implemented. For example, the Image Processing Toolbox for MATLAB includes functions rgb2hsv and hsv2rgb.

*my program running in Visual Studio 2012 and using OpenCV version 2.4.13 if you didn't have software Visual studio you can download in here 

For my full source code you can download in link below

2 komentar: