cv2.barcode

None

Attributes

Classes

class cv2.barcode.BarcodeDetector
__init__(self)
Parameters:

self

Return type:

None

__init__(self, prototxt_path: str, model_path: str)
Parameters:
  • self

  • prototxt_path (str) –

  • model_path (str) –

Return type:

None

decodeWithType(img, points) retval, decoded_info, decoded_type

Decodes barcode in image once it’s found by the detect() method. * * @param img grayscale or color (BGR) image containing bar code. * @param points vector of rotated rectangle vertices found by detect() method (or some other algorithm). * For N detected barcodes, the dimensions of this array should be [N][4]. * Order of four points in vector is bottomLeft, topLeft, topRight, bottomRight. * @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded. * @param decoded_type vector strings, specifies the type of these barcodes * @return true if at least one valid barcode have been found

Parameters:
  • self

  • img (cv2.typing.MatLike) –

  • points (cv2.typing.MatLike) –

Return type:

tuple[bool, _typing.Sequence[str], _typing.Sequence[str]]

decodeWithType(img, points) retval, decoded_info, decoded_type

Decodes barcode in image once it’s found by the detect() method. * * @param img grayscale or color (BGR) image containing bar code. * @param points vector of rotated rectangle vertices found by detect() method (or some other algorithm). * For N detected barcodes, the dimensions of this array should be [N][4]. * Order of four points in vector is bottomLeft, topLeft, topRight, bottomRight. * @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded. * @param decoded_type vector strings, specifies the type of these barcodes * @return true if at least one valid barcode have been found

Parameters:
Return type:

tuple[bool, _typing.Sequence[str], _typing.Sequence[str]]

detectAndDecodeWithType(img[, points]) retval, decoded_info, decoded_type, points

Both detects and decodes barcode

 * @param img grayscale or color (BGR) image containing barcode.
 * @param decoded_info UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.
 * @param decoded_type vector of strings, specifies the type of these barcodes
 * @param points optional output vector of vertices of the found  barcode rectangle. Will be empty if not found.
 * @return true if at least one valid barcode have been found
Parameters:
  • self

  • img (cv2.typing.MatLike) –

  • points (cv2.typing.MatLike | None) –

Return type:

tuple[bool, _typing.Sequence[str], _typing.Sequence[str], cv2.typing.MatLike]

detectAndDecodeWithType(img[, points]) retval, decoded_info, decoded_type, points

Both detects and decodes barcode

 * @param img grayscale or color (BGR) image containing barcode.
 * @param decoded_info UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.
 * @param decoded_type vector of strings, specifies the type of these barcodes
 * @param points optional output vector of vertices of the found  barcode rectangle. Will be empty if not found.
 * @return true if at least one valid barcode have been found
Parameters:
Return type:

tuple[bool, _typing.Sequence[str], _typing.Sequence[str], cv2.UMat]

Functions