Extracting the RGB color model based on the image of the binarized

  In reality we are dealing with is often an RGB color image. Its main objective to propose by HSI conversion, color and other technology components.

 

Gradation of the RGB components:

  RGB can be divided into R, G, B three-component. When R = G = B is the gray scale image, in order to facilitate many cases, direct use of a component to be gray-scale, as shown below:

    The red portion of the figure above the R component is more pronounced than the other two whitish; G in the same manner grass lighter component, B component lighter sky. The other parts of the road is almost the same gray-black. In practice, we can

  Demand selectively choose components.

 

RGB grayscale difference components:

  Sometimes our request is to extract a color from an image area, then the easiest way is to use RGB color.

  E.g. extraction bouquet red petals, the RG difference component can be employed (the target is red, G is the interference component), or, extracting green seedlings on the soil surface, GRB difference component (G 2 parts may be employed, the soil may

  Presence of R, B components interference), below shows the results of extraction:

  

  If you encounter a more complex case, the difference according to a suitable target color component and the interference color design.

  

 

Grayscale HSI components:

    H, S, I denote the hue, saturation, lightness. Refers to the hue of said regular color (red, white, black, etc.), it represents the degree of saturation of bright colors, the greater the value the more vivid, bright color lightness is

  degree. These three properties may be represented by two vertebral bodies, wherein the lightness is a vertical central axis, in the vertical direction, different brightness; each a cross section corresponding to the brightness, represented in polar coordinates H, S, H is an angle, S modulo long.

  HSI model as shown:

  

 

  We can RGB to HSI, there are many relevant formulas, different characteristics, here's one:

    rgb_min = min (r, g, b)

    rgb_max=max(r,g,b)

    I=rgb_max

    S=(rgb_max-rgb_min)/rgb_max

    if r==rgb_max

      H=abs(g-b)/(rgb_max-rgb_min)/3

    if g==rgb_max

      H=1/3+abs(r-b)/(rgb_max-rgb_min)/3

    if  b==rgb_max

 

      H=2/3+abs(r-g)/(rgb_max-rgb_min)/3

 

  H thus calculated to range [0,1), S in the range [0,1), I range [0,255]. Grayscale HSI components as follows:

  

  Usually luma component and effect similar gradation (grayscale may be possible based on lightness), sometimes using the saturation of the image and tone gradation number lot would facilitate extraction, is below saturation value based on the extracted two

  (Generally, if the RGB components to be used based on the color of the extracted color is better, after all, to get a more accurate if the saturation information, the above formula will be more complex than use):

  

  Since saturation of the background is low, and saturation of the target, and a target composed of a plurality of colors, so that if the direct based on the gradation of brightness of the whole bouquet possible to extract, extracted by the saturation effect is great.

  Further, HSI may be used in combination, characterized in that the more obvious, for example, may eliminate the hue and saturation of the red-eye phenomenon, here we are not particularly explored algorithms based HSI!

 

 

 

   

  

Guess you like

Origin www.cnblogs.com/kensporger/p/11618520.html