Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Datacodes » ReadSingleQRCode


Module: Datacodes

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

Name Type Range Description
inImage Image Input image
inRoi Rectangle2D* Range of pixels to be processed
inRoiAlignment CoordinateSystem2D* Adjusts the region of interest to the position of the inspected object
inMinModuleSize Real 1.5 - 100.0 Lower estimated size of a code unit in pixels
inMaxModuleSize Real 1.5 - 100.0 Upper estimated size of a code unit in pixels
inContrastThreshold Real* 1.0 - 255.0 Guaranteed gray level difference between dark and bright modules
inPatternQuality Integer* 1 - 3 Quality of the code from 1 (extremely deformed) to 3 (perfect)
inAllowRotation Bool Allows codes rotated in relation to the axes of the input image
inPolarity Polarity Specifies whether code is darker or brighter than the background
inMinLineMagnitude Real* 1.0 - 255.0 Strength of an edge within the code; default depends on parameters
outQRCode QRCode?
outAlignedRoi Rectangle2D Input ROI after transformation (in the image coordinates)


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

inMinModuleSize is the expected lower bound of one module (smallest unit of the code).

inMinModuleSize is the expected upper bound of one module (smallest unit of the code).

Parameter inContrastThreshold 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.

inAllowRotation Allows codes rotated in relation to the axes of the input image.

inPolarity Setup polarity of QR code can improve performance of ReadingQRCodes

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.


Description of usage of this filter can be found in examples and tutorial: Read the QR Code.

Simple case.

Dark and lower quality code.

Code viewed from an angle.


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.

Complexity Level

This filter is available on Basic Complexity Level.

Filter Group

This filter is member of ReadQRCodes filter group.

See Also