imaqLearnColorPattern

NI Vision for LabWindows/CVI Function

imaqLearnColorPattern

Usage

int imaqLearnColorPattern(Image* image, const LearnColorPatternOptions* options);

Purpose

Prepares an image for use as a color template for imaqMatchColorPattern(). If you change the color template image after calling this function, you must call the function again to learn the modified image.

Image Types Supported

IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL

Parameters

Name

Type

Description

image Image* The image about which the function learns pattern matching information. The function appends the pattern matching information to the image.
options const LearnColorPatternOptions* Describes the information the algorithm learns about the color pattern.

Return Value

Type

Description

int On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError().

Parameter Discussion

options—Set options to NULL to use the default options, as follows:

learnMode IMAQ_LEARN_SHIFT_INFORMATION
featureMode IMAQ_COLOR_AND_SHAPE_FEATURES
threshold 80
ignoreMode IMAQ_IGNORE_NONE
colorsToIgnore NULL (Use all colors)
numColorsToIgnore 0