ReadSingleDataCode


Reads a single data code (1D or 2D) in the input image.

Applications:The main tool for reading both linear and matrix codes (Data Matrix, QR Code), including DPM.

Syntax

C++
C#
Python
 
def ReadSingleDataCode(
	state: ReadDataCodes_State,
	inImage: Image,
	inDpmParams: DpmParams,
	/,
	*,
	inRoi: Rectangle2D | None = None,
	inRoiAlignment: CoordinateSystem2D | None = None,
	inMatrixSymbologies: MatrixSymbologies | None = None,
	inLinearSymbologies: LinearSymbologies | None = None,
	inDetectorParams: DataCodeDetectorParams = DataCodeDetectorParams(Polarity.Any, 10, DatacodeDetectionMethod.FinderEdges, DatacodePyramidStrategy.Precise, DatacodeDecodeStrategy.Precise, DatacodeFinderTradeoff.Balanced, True, DatacodePerspectiveLevel.Low, DatacodeDistortionLevel.Low, True, 30.0, None, False),
	inMatrixCodeParams: MatrixCodeParams = MatrixCodeParams(8, 72, 8, 72, 3.5, 24.0, True, True, False, True, 4.0),
	inLinearCodeParams: LinearCodeParams = LinearCodeParams(0.9, 6.0, 4, None, True, True, None, False, 0.25),
	inComputeScores: bool = False,
	outAlignedRoi: Rectangle2D | None = None
)
-> (
	outDataCode: DataCode | None,
	outCandidates: list[Path],
	outNoReads: list[DataCode]
)

Parameters

Name Type Default Description
Input will be modified ioState ReadDataCodes_State
Input value inImage Image Input image
Input value inRoi Rectangle2D | None None Region of interest
Input value inRoiAlignment CoordinateSystem2D | None None Coordinate system for the region of interest
Input value inMatrixSymbologies MatrixSymbologies | None None Specifies which matrix symbologies the filter should try to read
Input value inLinearSymbologies LinearSymbologies | None None Specifies which linear symbologies the filter should try to read
Input value inDetectorParams DataCodeDetectorParams DataCodeDetectorParams(Polarity.Any, 10, DatacodeDetectionMethod.FinderEdges, DatacodePyramidStrategy.Precise, DatacodeDecodeStrategy.Precise, DatacodeFinderTradeoff.Balanced, True, DatacodePerspectiveLevel.Low, DatacodeDistortionLevel.Low, True, 30.0, None, False) Parameters of the code detection algorithm, common for linear and matrix codes
Input value inMatrixCodeParams MatrixCodeParams MatrixCodeParams(8, 72, 8, 72, 3.5, 24.0, True, True, False, True, 4.0) Parameters specific to matrix (2D) codes
Input value inDpmParams DpmParams Parameters specific to direct part marking codes
Input value inLinearCodeParams LinearCodeParams LinearCodeParams(0.9, 6.0, 4, None, True, True, None, False, 0.25) Parameters specific to linear (1D) codes
Input value inComputeScores bool False Enables computing of confidence scores (slower)
Output value outDataCode DataCode | None A code that has been correctly detected and decoded
Output value outCandidates list[Path] Diagnostic information about detection results
Output value outAlignedRoi Rectangle2D | None None Input ROI after transformation (in the image coordinates)
Output value outNoReads list[DataCode] List of codes that have been detected but not decoded