imaqLearnColor

NI Vision for LabWindows/CVI Function

imaqLearnColor

Usage

ColorInformation* imaqLearnColor(const Image* image, const ROI* roi, ColorSensitivity sensitivity, int saturation);

Purpose

Extracts the color features of an image. Use these features for color matching with imaqMatchColor().

Image Types Supported

IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL

Parameters

Name

Type

Description

image const Image* The image containing the color information to learn.
roi const ROI* The region about which the function learns the color information. Set this parameter to NULL to learn color information about the whole image.
sensitivity ColorSensitivity Specifies the sensitivity of the color information in the image.
saturation int Sets a threshold value which the function uses to separate colors with similar hues. The function classifies colors below the given saturation value separately from colors above the given saturation value.

Return Value

Type

Description

ColorInformation* On success, this function returns a color information structure which you can pass into imaqMatchColor(). On failure, this function returns NULL. To get extended error information, call imaqGetLastError(). When you are finished with this structure, dispose of it by calling imaqDispose().