You are here: Start » AVL.NET » AVL.ReadSingleQRCode(AvlNet.Image, AvlNet.Rectangle2D?, AvlNet.CoordinateSystem2D?, float?, float?, int?, float?, float?, AvlNet.QRCode, AvlNet.Rectangle2D)

AVL.ReadSingleQRCode(AvlNet.Image, AvlNet.Rectangle2D?, AvlNet.CoordinateSystem2D?, float?, float?, int?, float?, float?, AvlNet.QRCode, AvlNet.Rectangle2D)

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

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void ReadSingleQRCode(
	AvlNet.Image inImage,
	AvlNet.Rectangle2D? inRoi,
	AvlNet.CoordinateSystem2D? inRoiAlignment,
	float? inUnitSize,
	float? inContrast,
	int? inPatternQuality,
	float? inCodeDirection,
	float? inMinLineMagnitude,
	out AvlNet.QRCode outQRCode,
	out AvlNet.Rectangle2D outAlignedRoi
)

Parameters

inImage
Type: AvlNet.Image
Input image
inRoi
Type: System.Nullable<AvlNet.Rectangle2D>
Range of pixels to be processed, or null.
inRoiAlignment
Type: System.Nullable<AvlNet.CoordinateSystem2D>
Adjusts the region of interest to the position of the inspected object, or null.
inUnitSize
Type: System.Nullable<System.Single>
Estimated size of a code unit in pixels, or null.
inContrast
Type: System.Nullable<System.Single>
Difference between brightest and darkest pixel within the code, or null.
inPatternQuality
Type: System.Nullable<System.Int32>
Quality of the code from 1 (extremely deformed) to 3 (perfect), or null.
inCodeDirection
Type: System.Nullable<System.Single>
Direction of one of the axes of the code, or null.
inMinLineMagnitude
Type: System.Nullable<System.Single>
Strength of an edge within the code; default depends on parameters, or null.
outQRCode
Type: AvlNet.QRCode
outAlignedRoi
Type: AvlNet.Rectangle2D

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).

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.

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