Nodes/comfyui_cv/CV QR Decode At Points
ComfyUI Node

CV QR Decode At Points

Decodes the QR code(s) inside quads that were located by ANY other means - a contour quadrilateral, a homography, hand-annotated points, a DNN detector - using cv2's decodeMulti/decodeCurved. This keeps detection and decoding composable: when OpenCV's own detector misses a code but you can outline it (e.g. 'CV Find Quadrilateral' on a thresholded region, or 'CV Annotate Points'), the payload is still readable. Points are consumed 4 at a time in corner order (any winding); trailing points that do not complete a quad are ignored. Give it the corners of the SYMBOL, not of the white quiet zone around it - cv2 rectifies exactly the quad it is handed, so a quad that includes the margin decodes to nothing. Undecodable quads come out as empty strings, never an error.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV QR Decode At Points
  • image
  • points
  • found
  • decoded_count
  • text
  • texts
  • straight_codes
detector
mode
Categoryimage/CV/codes

Inputs (4)

NameTypeDefaultDescription
imageNPARRAY,IMAGEImage containing the code(s). An IMAGE batch uses its first frame. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.
pointsNPARRAYCorner points, (N*4, 2) or (N, 4, 2), in per-code corner order - e.g. the 'corners' output of 'OpenCV QR Detect' / 'CV Find Quadrilateral', or annotated points. cv2 expects the corners of the SYMBOL ITSELF (the outer finder-pattern corners), not of the white quiet zone around it - a quad that includes the margin decodes to an empty string.
detectorCOMBOWhich cv2 decoder implementation reads the rectified patch. Both accept externally supplied corners; the ArUco-based one can be more tolerant of small/warped symbols.
modeCOMBOstraight: decodeMulti - perspective-rectify the quad and read it. curved: decodeCurved per quad, for codes wrapped around a curved surface (classic detector only).

Outputs (5)

NameTypeDescription
foundBOOLEANTrue when at least one quad decoded to a non-empty string.
decoded_countINTHow many of the supplied quads decoded.
textSTRINGDecoded strings, one per line - wire into 'Preview as Text'.
textsNPARRAY(N,) string array aligned with the supplied quads; an empty entry marks a quad that did not decode.
straight_codesIMAGEIMAGE batch of the rectified binarized symbols, one per decoded quad (white-padded to a common size).