Color Spectrum

http://www.normankoren.com/light_color.html   Digital Image Basics http://en.wikipedia.org/wiki/RAL_colour_standard

 

The color spectrum is a 1D representation of the 3D color information in an image. The spectrum represents all the color information associated with that image or a region of the image in the HSL space.

HSL Color Space

If the input image is in RGB format, the image is first converted to HSL format and the color spectrum is computed from the HSL space. Using HSL images directly—those acquired with an image acquisition device with an onboard RGB to HSL conversion for color matching—improves the operation speed.

Colors represented in the HSL model space are easy for humans to quantify. The luminance—or intensity—component in the HSL space is separated from the color information. This feature leads to a more robust color representation independent of light intensity variation. However, the chromaticity—or hue and saturationplane cannot be used to represent the black and white colors that often comprise the background colors in many machine vision applications. Refer to the color pattern matching section for more information about color spaces.

Each element in the color spectrum array corresponds to a bin of colors in the HSL space. The last two elements of the array represent black and white colors, respectively.

how the HSL color space is divided into bins

The hue space is divided into a number of equal sectors, and each sector is further divided into two parts: one part representing high saturation values and another part representing low saturation values. Each of these parts corresponds to a color bin—an element in the color spectrum array.

The following figure illustrates the correspondence between the color spectrum elements and the bins in the color space.

A color spectrum with a larger number of bins, or elements, represents the color information in an image with more detail, such as a higher color resolution, than a spectrum with fewer bins.

The value of each element in the color spectrum indicates the percentage of image pixels in each color bin. When the number of bins is set according to the color sensitivity parameter, the machine vision software scans the image, counts the number of pixels that fall into each bin, and stores the ratio of the count and total number of pixels in the image in the appropriate element within the color spectrum array.

The color spectrum contains useful information about the color distribution in the image. You can analyze the color spectrum to get information such as the most dominant color in the image, which is the element with the highest value in the color spectrum. You also can use the array of the color spectrum to directly analyze the color distribution and for color matching applications.

If you lighten or darken color images you need to understand how color is represented. Unfortunately there are several models for representing color. The first two should be familiar; the latter two may be new.

  • It is not practical to use RGB or CMY(K) to adjust brightness or color saturation because each of the three color channels would have to be changed, and changing them by the same amount to adjust brightness would usually shift the color (hue).
  • HSV and HSL are practical for editing because the software only needs to change V, L, or S.

Image editing software typically transforms RGB data into one of these representations, performs the adjustment, then transforms the data back to RGB. You need to know which color model is used because the effects on saturation are very different.

HSV – It is not practical to use RGB or CMY(K) to adjust brightness or color saturation because each of the three color channels would have to be changed, and changing them by the same amount to adjust brightness would usually shift the color (hue). HSV and HSL are practical for editing because the software only needs to change V, L, or S. Image editing software typically transforms RGB data into one of these representations, performs the adjustment, then transforms the data back to RGB. You need to know which color model is used because the effects on saturation are very different.

HSL color. Maximum color saturation takes place at L = 0.5 (50%). L = 0 is pure black and L = 1 (100%) is pure white, regardless of H or S. The HSL color model can be depicted as a double cone, widest at the middle (L = 0.5), coming to points at the top (L = 1; pure white) and bottom (L = 0; pure black).

HSV and HSL were developed to represent colors in systems with limited dynamic range (pixel levels 0-255 for 24-bit color). The limitation forces a compromise.

  • HSV represents saturation much better than brightness: V = 1 can be a pure primary color or pure white; hence “Value” is a poor representation of brightness.
  • HSL represents brightness much better than saturation: L = 1 is always pure white, but when L > 0.5, colors with S = 1 contain white, hence aren’t completely saturated.
  • In both models, hue H is unchanged when L, V, or S are adjusted.

 

Darkening in HSV reduces saturation. Darkening in HSL increases saturation when L > 0.5.
  Lightening in HSV increases saturation. Lightening in HSL reduces saturation when L > 0.5.

HSV
Best representation of saturation
 
HSL
Best representation of lightness
V, L, and H illustrated for S = 1 (maximum saturation)
V, L, and S illustrated for H = 0.333 (120º; Green)

HSV: Best representation of saturation

HSL: Best representation of lightness

e the eye can barely distinguish about 200 different gray levels

RGB is the primary color

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: