Color ID Tool Parameters

Color ID allows you to train a library of colors which is used during runtime to identify any colors present.

 

Color Library Selection

This editor is used to manipulate the color library that the tool will work with. It is very similar to the Font Editor in the OCR Tool.

 

 

Color Selection

 

 

 

 

Color Library Editor

The Color Library Editor dialog is launched by clicking on the Color Lib Editor... button in the parameter area of the Color Tool. The dialog will load the currently selected color library and will allow you to add/remove colors, manipulate the values of existing colors, and save the library when finished.

 

 

Colors Panel

The left panel of the dialog provides a scrolling list of the colors currently within the library. You can select any color in the list to retrain it or manually modify its settings. The Add... button at the bottom will allow you to add a new color.  The Remove… button will delete the currently selected color.

Selected Color Panel

The right panel will always show all the settings for the currently selected color. You can modify the name of the color using the text box at the top of the panel:

 

 

A color is specified as a range of either Hue, Saturation, and Intensity values, or as a range of Red, Green, and Blue values. This is known as the color space. HSI is the default color space. The dropdown menu can be used to switch to RGB if necessary.

 

 

HSI Color Space

With the HSI color space, Hue is represented as an angle from the origin of the color space, Saturation is the distance from the center, and Intensity is the location on the z-axis (the third dimension):

 

 

 

Note: Value = Intensity in this context.

 

Hue is represented by a color wheel, where red is at 0 degrees.

 

 

The wheel provides a user-adjustable window that can be dragged around the wheel, and re-sized (using the anchor points on either end) as a way to specify the upper and lower hue range for the current color. The text box on the left allows you to type the value for the lower range, and the text box on the right allows you to enter the value for the upper range. Note that the valid hue values are 0 to 255, and it is allowable to have a color whose hue range crosses 0, which is often necessary for red. Maroon is shown in this example:

 

 

Note that the lower range is 246 and the upper range is 9. This may seem counter-intuitive, but these are acceptable values, as this color will produce hue values that straddle 0, some pixels will have hues in the 246 to 255 range, and some will be in the 0 to 9 range.

 

 

The Saturation slider allows the setting of an upper and lower range for the saturation value of the current color. Note that the background of the slider reflects the hue that is selected in the hue wheel. If you adjust the hue with the hue wheel, the background of the saturation slider should update to show the effect on that hue as you adjust the saturation.

 

 

The Intensity slider allows you to adjust the upper and lower range of the intensity value for this color.

 

Note: When adjusting any of the HSI values, the effect of your adjustments is shown with a color gradient at the top of the panel that represents the range of your settings:

 

 

RGB Color Space

In the RGB color space, you can adjust the upper and lower ranges for the R,G and B values.

 

 

This is preferable when training on shades of gray that have no hue.

 

Training a Color Value

Although you can manually set the values for a given color, it is easier to train them. When you open the Color Library Editor, a separate Train Color region of interest will show up in the image next to the region of interest for your Color Tool:

 

 

You can drag and resize this region of interest to the color you want to train, and then click the train button. The dialog will be updated to reflect the color values seen in the image. When you click the train button, the system will calculate the hue, saturation, and intensity values that occur most frequently. These values then become the center of the range. The standard deviation of hue, saturation, and intensity (or RGB) are also calculated, and the range is then set to be the center value +/- 3 sigma.

Visual Feedback

When the Color Library Editor is open, the main region of interest of the tool will highlight any pixels that match the selected color. This allows you to adjust their settings, and to see how well those settings match the color.

 

A color that matches somewhat:

 

 

A color that matches almost exactly: