grade_datacode2d — SYMBOL print_quality op

• 데이터 종류: image2d → table

• 호출: import fullseye as fs; fs.ledger.grade_datacode2d(image, symbology='auto', *, aperture_x=0.8, expected_text=None)(구현을 직접 호출하려면 import symgrade; symgrade.grade_datacode2d(image, symbology='auto', *, aperture_x=0.8, expected_text=None), 원장에서 가져오려면 opssymbol.get("grade_datacode2d"))

• GPU: 없음(CPU 참조 구현만)

사용법

영상 속 2-D 심볼(QR / Data Matrix)의 인쇄 품질 등급을 반환한다(table).

> 아래 상세 설명은 원문입니다 —— 요약과 제목은 번역되어 있습니다.

Grade a QR Code or Data Matrix in a reflectance image. The symbol is read (qrsym.qr_read / dmsym.dm_read), the image is filtered with a circular measuring aperture of aperture_x · X (default 0.8 X) and sampled at every module centre through the reader's homography, plus a one-module ring of quiet zone.

• symbol_contrast SC = Rmax − Rmin over those samples; GT = Rmin + SC / 2.

• module modulation 2·|R − GT| / SC; a module on the wrong side of GT (compared with the *ideal* module rebuilt from the decoded data) is graded 0. A codeword's grade is its worst module; the modulation grade is the highest level L such that the codewords graded below L, counted as errors, still leave unused error correction of grade ≥ L in every block (the error-correction rule of the 2-D method, as publicly described).

• fixed_pattern_damage: the worst module grade over the fixed patterns (QR: finders, separators, timing, alignment; Data Matrix: the L finder, the clock track and alignment patterns) and the quiet-zone ring. ★Simplified: one dull module of a finder limits it (the published method grades finder segments separately).

• the grid: the reader's homography is re-fitted (normalised DLT, twice) to every module edge measured along all rows and columns (sub-sample GT crossings within 0.45 module of an ideal dark/light boundary), so that the reader's own fit error is not graded as print non-uniformity (grid_refined).

• axial_nonuniformity = |X̄ − Ȳ| / ((X̄ + Ȳ)/2) of the mean module pitch along the two grid axes in pixels (the fitted grid: a tilt about one axis shows up here).

• grid_nonuniformity = the largest distance (modules) between a timing-pattern module centre located from its own edges and the fitted projective grid.

• unused_error_correction = min over blocks of 1 − 2·e / (n_ec − p) with the decoder's corrected-codeword count e and the misdecode-protection codewords p (QR 1-L/M/Q, 2-L, 3-L; 0 for Data Matrix).

• decode: 4 if read (and equal to expected_text when given), else 0.

overall_grade = the minimum parameter grade (0..4), letter, limiting. ideal_source says how the ideal modules were obtained ("reencode": the decoded text re-encoded with the same version / level / mask / mode reproduced the read; "codewords" (Data Matrix): rebuilt from the corrected codewords; "sampled": neither was possible, the thresholded samples stand in and wrong-side modules cannot be seen — modulation is then optimistic, flagged).

限界 / limits: 反射率は画像の値のまま、開口は円。Data Matrix 144x144 の不揃いなブロックのブロック割り当ては近似。鏡像の QR は読み取り器の格子(転置)で採点する。

空の入力は ValueError。拒否(ValueError): 2-D でない、非有限、未知の symbology、aperture_x が [0, 2] の外。読めないシンボルは例外にせず overall_grade = 0、decode = False (検証器が F を付けるのと同じ。読めない理由は error)。

자세한 사용 가이드

• symbol_reading 패밀리 가이드

참고(샘플 데이터·문헌)

• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.

• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.

• 알고리즘의 정전(저자·연도)과 용도는 위의 패밀리 사용 가이드에 적혀 있습니다.

실행 가능한 예제(이 연산자를 실제로 호출하는 검증된 샘플)

• poc_symbol_part_dpm — py -3.11 examples/poc_symbol_part_dpm.py

타입이 이어지는 다음 연산자(table 를 입력으로 받는 것)

render_symbol · symbol_read_trials · symbol_read_pod · ocr_classify · ocr_read_line · ocr_read_trials

같은 카테고리(print_quality)

grade_barcode_profile · grade_barcode1d


*Provenance: symgrade.py — SYMBOL 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.