MatchColor Method

NI Vision for Visual Basic

MatchColor Method

Syntax

CWIMAQVision.MatchColor SourceImage, ColorInformation, Scores [, Regions]

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Finds the match between the color content of multiple regions in an image and those defined by the input ColorInformation.

Remarks

Use this method with RGB32 and HSL32 images.

Parameters

SourceImage As CWIMAQImage

The color image from which you want to extract the color feature to compare with the color defined by ColorInformation.

ColorInformation As CWIMAQColorInformation

The color information. Use LearnColor to get the color information.

Scores As Variant

On return, an array containing the match scores for each region in the image. The match scores are represented on a scale of 0 to 1000 where 0 indicates no match and 1000 indicates a perfect match.

Regions As Variant

[Optional] A CWIMAQRegions object the contains information about the regions in the image whose color information has to be compared with the input color information. All region contours are considered to be external. If the collections contains multiple region objects, the color information in each region is compared with the input color information individually and the match results are reported for each region. If this parameter is not supplied, the entire image is considered as a single region.

Example

Color Matching Example

See Also

LearnColor

CWIMAQRegions