ExtractSingleColorPlane Method

NI Vision for Visual Basic

ExtractSingleColorPlane Method

Syntax

CWIMAQVision.ExtractSingleColorPlane SourceImage, DestImage, ColorPlane

Return Type

Long

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

Purpose

Extracts a single plane from a color image. The plane that you extract is independent from the type of the image. For example, you can extract the hue plane from an RGB32 image or the green plane from an HSL32 image.

Remarks

The source image must be RGB32, HSL32, or RGBU64 and the destination image must be U8 for RGB32 and HSL32 and I16 for RGBU64. Only the red, green, or blue plane can be extracted from RGBU64 images.

Parameters

SourceImage As CWIMAQImage

The color image from which the function extracts the color plane.

DestImage As CWIMAQImage

The resulting image containing the extracted plane.

ColorPlane As CWIMAQColorPlanes

The color plane to extract from the image.

Example

'To run this example, the image in Viewer1 must be RGB32 or HSL32 and the image in Viewer2
'must be U8.
Private Sub Run_Click()
    'Extract the luminance plane from the color image in Viewer1
    CWIMAQVision1.ExtractSingleColorPlane CWIMAQViewer1.Image, CWIMAQViewer2.Image, _
                                          cwimaqLuminancePlane
End Sub

See Also

ExtractColorPlanes

ReplaceColorPlanes