imaqROIToMask
Usage
int imaqROIToMask(Image* mask, const ROI* roi, int fillValue, const Image* imageModel, int* inSpace);
Purpose
Transforms a region of interest (ROI) into a mask image.
Image Types Supported
IMAQ_IMAGE_U8
Parameters
Name
|
Type
|
Description
|
---|---|---|
mask | Image* | The resulting mask image. |
roi | const ROI* | The descriptor defining the ROI. |
fillValue | int | The pixel value of the mask. All pixels inside the ROI receive this value. |
imageModel | const Image* | An optional template for the destination mask image. This parameter can be any image type that NI Vision supports. If you supply an imageModel, the mask image is the size of the model. If you set imageModel to NULL, the size of mask is equal to the size of the bounding rectangle of the ROI, which reduces the amount of memory used. The function sets the offset of the mask image to reflect the real position of the ROI. |
inSpace | int* | If you used imageModel, this parameter indicates on return whether the mask is a true representation of the ROI. If TRUE, the ROI data is completely within imageModel. If FALSE, some of the ROI data fell outside the space associated with imageModel. Set this parameter to NULL if you do not need this information, or if you did not use imageModel. |
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(). |