imaqReadDataMatrixBarcode2

NI Vision for LabWindows/CVI Function

imaqReadDataMatrixBarcode2

Usage

DataMatrixReport* imaqReadDataMatrixBarcode2(Image* image, const ROI* roi, DataMatrixGradingMode prepareForGrading, const DataMatrixDescriptionOptions* descriptionOptions, const DataMatrixSizeOptions* sizeOptions, const DataMatrixSearchOptions* searchOptions);

Purpose

Locates and then reads the value encoded in a Data Matrix barcode. You can compare the decoded data to a reference string or check whether the data contains a specific pattern. Many of the options provided by this function allow for automatic detection of properties of the Data Matrix barcode or what methods the function should use to locate and decode the barcode. Specifying specific properties and methods for these options will greatly increase the performance of the function.

Image Types Supported

IMAQ_IMAGE_U8

Parameters

Name

Type

Description

image Image* The image containing the Data Matrix barcode to read.
roi const ROI* A region of interest specifying the location of the barcode in the image. The first contour of roi must be a rectangle, rotated rectangle, or closed contour. If skipLocation of the searchOptions parameter is set to TRUE, a closed contour has an additional constraint of being four-sided. Set this parameter to NULL to use the entire image.
prepareForGrading DataMatrixGradingMode Specifies if the function should make calculations needed to prepare to grade the Data Matrix barcode.
descriptionOptions const DataMatrixDescriptionOptions* Describes the Data Matrix barcode the function should look for.
sizeOptions const DataMatrixSizeOptions* Describes sizing information for the Data Matrix barcode the function should look for.
searchOptions const DataMatrixSearchOptions* Describes the methods and limitations the function should use when searching for the Data Matrix barcode.

Return Value

Type

Description

DataMatrixReport* On success, this function returns a structure containing information about the Data Matrix barcode. 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().

Parameter Discussion

descriptionOptions—Set the descriptionOptions parameter to NULL to use the default options, as follows:

aspectRatio 0.0
rows 0
columns 0
rectangle FALSE
ecc IMAQ_AUTO_DETECT_ECC
polarity IMAQ_AUTO_DETECT_POLARITY
cellFillPercentage IMAQ_AUTO_DETECT_CELL_FILL_PERCENTAGE
minBorderIntegrity 80.0
mirrorMode IMAQ_AUTO_DETECT_MIRROR

sizeOptions—Set the sizeOptions parameter to NULL to use the default options, as follows:

minSize 0
maxSize 0
quietZoneWidth 10

searchOptions—Set the searchOptions parameter to NULL to use the default options, as follows:

rotationMode IMAQ_UNLIMITED_ROTATION
skipLocation FALSE
edgeThreshold 30
demodulationMode IMAQ_AUTO_DETECT_DEMODULATION_MODE
cellSampleSize IMAQ_AUTO_DETECT_CELL_SAMPLE_SIZE
cellFilterMode IMAQ_AUTO_DETECT_CELL_FILTER_MODE
skewDegreesAllowed 5
maxIterations 500
initialSearchVectorWidth 5