View Source Evision.Barcode.BarcodeDetector (Evision v0.1.28)

Link to this section Summary

Types

t()

Type that represents an Barcode.BarcodeDetector struct.

Functions

Initialize the BarcodeDetector.

Initialize the BarcodeDetector.

Decodes barcode in image once it's found by the detect() method.

Detects Barcode in image and returns the rectangle(s) containing the code.

Detects Barcode in image and returns the rectangle(s) containing the code.

Both detects and decodes barcode

Both detects and decodes barcode

Link to this section Types

@type t() :: %Evision.Barcode.BarcodeDetector{ref: reference()}

Type that represents an Barcode.BarcodeDetector struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

@spec barcodeDetector() :: t() | {:error, String.t()}

Initialize the BarcodeDetector.

Keyword Arguments
  • prototxt_path: string.

    prototxt file path for the super resolution model

  • model_path: string.

    model file path for the super resolution model

Return
  • self: BarcodeDetector

Python prototype (for reference only):

BarcodeDetector([, prototxt_path[, model_path]]) -> <barcode_BarcodeDetector object>
@spec barcodeDetector([{atom(), term()}, ...] | nil) :: t() | {:error, String.t()}

Initialize the BarcodeDetector.

Keyword Arguments
  • prototxt_path: string.

    prototxt file path for the super resolution model

  • model_path: string.

    model file path for the super resolution model

Return
  • self: BarcodeDetector

Python prototype (for reference only):

BarcodeDetector([, prototxt_path[, model_path]]) -> <barcode_BarcodeDetector object>
Link to this function

decode(self, img, points)

View Source
@spec decode(t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in()) ::
  {[binary()], [Evision.Barcode.BarcodeType.t()]} | false | {:error, String.t()}

Decodes barcode in image once it's found by the detect() method.

Positional Arguments
  • self: Evision.Barcode.BarcodeDetector.t()

  • img: Evision.Mat.t().

    grayscale or color (BGR) image containing bar code.

  • points: Evision.Mat.t().

    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<Point2f> is bottomLeft, topLeft, topRight, bottomRight.

Return
  • retval: bool

  • decoded_info: [string].

    UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.

  • decoded_type: [BarcodeType].

    vector of BarcodeType, specifies the type of these barcodes

Python prototype (for reference only):

decode(img, points) -> retval, decoded_info, decoded_type
@spec detect(t(), Evision.Mat.maybe_mat_in()) ::
  Evision.Mat.t() | false | {:error, String.t()}

Detects Barcode in image and returns the rectangle(s) containing the code.

Positional Arguments
  • self: Evision.Barcode.BarcodeDetector.t()

  • img: Evision.Mat.t().

    grayscale or color (BGR) image containing (or not) Barcode.

Return
  • retval: bool

  • points: Evision.Mat.t().

    Output vector of vector of vertices of the minimum-area rotated rectangle containing the codes. For N detected barcodes, the dimensions of this array should be [N][4]. Order of four points in vector< Point2f> is bottomLeft, topLeft, topRight, bottomRight.

Python prototype (for reference only):

detect(img[, points]) -> retval, points
@spec detect(t(), Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil) ::
  Evision.Mat.t() | false | {:error, String.t()}

Detects Barcode in image and returns the rectangle(s) containing the code.

Positional Arguments
  • self: Evision.Barcode.BarcodeDetector.t()

  • img: Evision.Mat.t().

    grayscale or color (BGR) image containing (or not) Barcode.

Return
  • retval: bool

  • points: Evision.Mat.t().

    Output vector of vector of vertices of the minimum-area rotated rectangle containing the codes. For N detected barcodes, the dimensions of this array should be [N][4]. Order of four points in vector< Point2f> is bottomLeft, topLeft, topRight, bottomRight.

Python prototype (for reference only):

detect(img[, points]) -> retval, points
Link to this function

detectAndDecode(self, img)

View Source
@spec detectAndDecode(t(), Evision.Mat.maybe_mat_in()) ::
  {[binary()], [Evision.Barcode.BarcodeType.t()], Evision.Mat.t()}
  | false
  | {:error, String.t()}

Both detects and decodes barcode

Positional Arguments
  • self: Evision.Barcode.BarcodeDetector.t()

  • img: Evision.Mat.t().

    grayscale or color (BGR) image containing barcode.

Return
  • retval: bool

  • decoded_info: [string].

    UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.

  • decoded_type: [BarcodeType].

    vector of BarcodeType, specifies the type of these barcodes

  • points: Evision.Mat.t().

    optional output vector of vertices of the found barcode rectangle. Will be empty if not found.

Python prototype (for reference only):

detectAndDecode(img[, points]) -> retval, decoded_info, decoded_type, points
Link to this function

detectAndDecode(self, img, opts)

View Source
@spec detectAndDecode(t(), Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil) ::
  {[binary()], [Evision.Barcode.BarcodeType.t()], Evision.Mat.t()}
  | false
  | {:error, String.t()}

Both detects and decodes barcode

Positional Arguments
  • self: Evision.Barcode.BarcodeDetector.t()

  • img: Evision.Mat.t().

    grayscale or color (BGR) image containing barcode.

Return
  • retval: bool

  • decoded_info: [string].

    UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.

  • decoded_type: [BarcodeType].

    vector of BarcodeType, specifies the type of these barcodes

  • points: Evision.Mat.t().

    optional output vector of vertices of the found barcode rectangle. Will be empty if not found.

Python prototype (for reference only):

detectAndDecode(img[, points]) -> retval, decoded_info, decoded_type, points