| MIL 10 User Guide
| Customize Help

Color separation



See also
Availability
Not available in MIL-Lite

Available in MIL

You can use McolProject() with M_COLOR_SEPARATION to remove a color from an image. Eliminating a color can be useful since it allows you to isolate colors which should be considered part of the background. To perform color separation, you must identify the background, selected, and rejected colors; these are referred to as the separation colors.

By properly specifying the colors, the projection operation is able to identify the unwanted color information (the stamp), and create a new version of the image that only contains the wanted color information (the background and the signature). The following two-dimensional graphs illustrate the color distribution of the signature/stamp image, and how that distribution is modified to remove the stamp and keep the signature.

Various conditions, such as different cameras and illuminants, can cause color from identical images to appear dissimilar. If this occurs, you can call McolTransform() to perform a relative color calibration before separating colors. Relative color calibration ensures all colors are consistent according to a specified reference color. For more information, see the Relative color calibration section earlier in this chapter.

Separation operation

The color separation operation can return either an image with the color separation result, or the transformation matrix with which to perform the color separation. This depends on whether you store the result in an image buffer or a MIL array buffer. If you retrieve the matrix, you can then use it with MimConvert() to separate the colors. When doing this, make sure that the color distribution of all the images to convert is similar, otherwise unpredictable results can occur.

You can pass the separation colors to McolProject() as either three explicit color values, or as colors taken from the source image. To specify explicit color values, you must use a 3x3 MIL array buffer. To specify colors from the source image, you must use a data identification image that identifies the corresponding source image pixels to use as the background (M_BACKGROUND_LABEL), selected (M_SELECTED_LABEL), and rejected (M_REJECTED_LABEL) colors.

MIL ignores pixels in the source image that you do not identify as background, selected, or rejected. You must identify at least one pixel for each. If you identify multiple pixels as background, selected, or rejected, MIL averages the colors of those pixels. If the data identification image is smaller than the source image, MIL ignores the outlying source image pixels.