imaqReadQRCode
Usage
QRCodeReport* imaqReadQRCode(Image* image, const ROI* roi, QRGradingMode reserved, const QRCodeDescriptionOptions* descriptionOptions, const QRCodeSizeOptions* sizeOptions, const QRCodeSearchOptions* searchOptions);
Purpose
Locates and reads the value encoded in a QR code. 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 QR code or what methods the function should use to locate and decode the code. Selecting 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 QR code to be detected. |
roi | const ROI* | A region of interest specifying the location of the code 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. |
reserved | QRGradingMode | This is reserved for future use. Set this parameter to IMAQ_QR_NO_GRADING. |
descriptionOptions | const QRCodeDescriptionOptions* | Describes the QR code the function should look for. |
sizeOptions | const QRCodeSizeOptions* | Describes sizing information for the QR code the function should look for. |
searchOptions | const QRCodeSearchOptions* | Describes the methods and limitations the function should use when searching for the QR code. |
Return Value
Type |
Description |
---|---|
QRCodeReport* | On success, this function returns a structure containing information about the QR code. 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 descriptionOptions to NULL to use the following default values:
dimensions | IMAQ_QR__DIMENSIONS_AUTO_DETECT |
polarity | IMAQ_QR_POLARITY_AUTO_DETECT |
mirror | IMAQ_QR_MIRROR_MODE_AUTO_DETECT |
modelType | IMAQ_QR_MODELTYPE_AUTO_DETECT |
sizeOptions—Set sizeOptions to NULL to use the following default values:
minSize | 0 |
maxSize | 0 |
searchOptions—Set searchOptions to NULL to use the following default values:
rotationMode | IMAQ_QR_ROTATION_MODE_UNLIMITED |
skipLocation | FALSE |
edgeThreshold | 30 |
demodulationMode | IMAQ_QR_DEMODULATION_MODE_AUTO_DETECT |
cellSampleSize | IMAQ_QR_CELL_SAMPLE_SIZE_AUTO_DETECT |
cellFilterMode | IMAQ_QR_CELL_FILTER_MODE_AUTO_DETECT |
skewDegreesAllowed | 5 |