imaqAbsoluteDifference

NI Vision for LabWindows/CVI Function

imaqAbsoluteDifference

Usage

int imaqAbsoluteDifference(Image* dest, const Image* sourceA, const Image* sourceB);

Purpose

Subtracts one image from another and returns the absolute value of the difference.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_RGB

Parameters

Name

Type

Description

dest Image* The destination image.
sourceA const Image* The first image to subtract.
sourceB const Image* The second image to subtract.

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

The type of the sourceB image depends on the type of the sourceA, as follows:

  • If sourceA is IMAQ_IMAGE_U8, sourceB must be IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, or IMAQ_IMAGE_RGB.
  • If sourceA is IMAQ_IMAGE_I16 or IMAQ_IMAGE_SGL, sourceB must be IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, or IMAQ_IMAGE_SGL.
  • If sourceA is IMAQ_IMAGE_RGB, sourceB must be IMAQ_IMAGE_RGB or IMAQ_IMAGE_U8.