Back to Adaptive Vision Library website

You are here: Start » Function Reference » Datacodes » ReadMultipleQRCodes

ReadMultipleQRCodes


Detects and recognizes all QR codes on the input image.

Header:AVL.h

Syntax

C++
C#
 
void avl::ReadMultipleQRCodes
(
	const avl::Image& inImage,
	atl::Optional<const avl::Rectangle2D&> inRoi,
	atl::Optional<const avl::CoordinateSystem2D&> inRoiAlignment,
	int inResultsExpected,
	atl::Optional<float> inUnitSize,
	atl::Optional<float> inContrast,
	atl::Optional<int> inPatternQuality,
	atl::Optional<float> inCodeDirection,
	atl::Optional<float> inMinLineMagnitude,
	atl::Array<avl::QRCode>& outQRCodes,
	atl::Optional<avl::Rectangle2D&> outAlignedRoi = atl::NIL
)

Parameters

Name Type Range Default Description
inImage const Image& Input image
inRoi Optional<const Rectangle2D&> NIL Range of pixels to be processed
inRoiAlignment Optional<const CoordinateSystem2D&> NIL Adjusts the region of interest to the position of the inspected object
inResultsExpected int 0 - 255 1 How many results we expect, 0 if as many as possible
inUnitSize Optional<float> 1.5 - 100.0 NIL Estimated size of a code unit in pixels
inContrast Optional<float> 1.0 - 255.0 NIL Difference between brightest and darkest pixel within the code
inPatternQuality Optional<int> 1 - 3 NIL Quality of the code from 1 (extremely deformed) to 3 (perfect)
inCodeDirection Optional<float> 0.0 - 89.9 NIL Direction of one of the axes of the code
inMinLineMagnitude Optional<float> 1.0 - 255.0 NIL Strength of an edge within the code; default depends on parameters
outQRCodes Array<QRCode>&
outAlignedRoi Optional<Rectangle2D&> NIL Input ROI after transformation (in the image coordinates)

Description

The filter locates and decodes QR code on the image (inImage) within given region (inRoi). The encoded text length must be greater than 2.

inUnitSize is the expected size of one module (smallest unit of the code). If there are multiple codes, size of the smallest one should be provided.

Parameter inResultsExpected determines how many codes are to be found within the image. Thus the algorithm continues searching until it reaches the desired number of codes or has nowhere to search.

Parameter inContrast describes contrast of the code - namely, it denotes the brightness difference between light and dark modules of the code. If not given, the algorithm uses normalization of the image to enhance the code and computes this value automatically.

inPatternQuality is an integer from the range <1,3> describing how much the code is blurred or the positional patterns are deformed. For instance, value 3 corresponds to a perfect quality code, while value 1 to an extremely blurred one. For standard cases it is recommended to use quality of 2 or to leave it default.

inCodeDirection determines the direction of one axis of the code. To make it less ambiguous, its value should be between 0 and 90 (exclusive).

inMinLineMagnitude describes strength of an edge within the code. This value determined automatically is usually correct, so this parameter can be viewed as a hint for the algorithm in nonstandard, tough cases.

Examples

Simple case.

Dark and lower quality code.

Multiple codes within one image.

Code viewed from an angle.

Remarks

To be correctly detected, the code should have safety area around it (of same brightness as the code background color) at least as wide as its unit. Moreover, unit size should be at least 2 pixels.

See Also

  • ReadSingleQRCode – Detects and recognizes a single QR code on the input image.