### 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.

- Current Color Library: This displays a list of the libraries that are currently present on the PC. Color libraries are saved to one of the following locations based on the installed path:
  C:\Microscan\Vscape\Jobs\Colors
  or
  C:\Omron\Vscape\Jobs\Colors
  Color libraries are always stored with the extension .color.xml. In the example above, the library ColorCard2 would be saved to a file named ColorCard2.color.xml.

- New Color Lib…: Click this button to create a new color library. You will be allowed to enter a name for the library. Then a file will be created with a single color, and the Color Library Editor will be opened to allow you to edit it.

- Color Lib Editor…: Clicking this button will open up the Color Library Editor. This allows you to add or delete colors from the library, train those colors, and/or manually adjust the parameters of each color.

##### Color Selection

- Match to Color: Select the color you want to match against. You can select from colors registered in the color library.

- Fill Tolerance %: This value specifies the minimum percentage of the region of interest that must be filled with a given color in order for it to be considered a match. The color in the library with the highest fill percentage, which is also higher than this value, will be the color that is identified.

- Color Precision: This controls how many pixels you will touch within the region of interest. You can increase speed by doing a coarser search of the region of interest.
  [Analyze Every Pixel]: Analyze the color of all pixels.
  [Every Other Pixel]: Analyze the color every 2 pixels.
  [Every 3rd Pixel]: Analyze the color every 3 pixels.
  [Every 4 Pixel]: Analyze the color every 4 pixels.

#### 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: