View Source Evision.WeChatQRCode.WeChatQRCode (Evision v0.1.37)

Summary

Types

t()

Type that represents an WeChatQRCode.WeChatQRCode struct.

Functions

Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode

Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode

getScaleFactor

set scale factor QR code detector use neural network to detect QR. Before running the neural network, the input image is pre-processed by scaling. By default, the input image is scaled to an image with an area of 160000 pixels. The scale factor allows to use custom scale the input image: width = scaleFactorwidth height = scaleFactorwidth

Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).

Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).

Types

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

Type that represents an WeChatQRCode.WeChatQRCode struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

Link to this function

detectAndDecode(self, img)

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

Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode

Positional Arguments
  • self: Evision.WeChatQRCode.WeChatQRCode.t()

  • img: Evision.Mat.t().

    supports grayscale or color (BGR) image.

Return
  • retval: [string]

  • points: [Evision.Mat].

    optional output array of vertices of the found QR code quadrangle. Will be empty if not found.

@return list of decoded string.

Python prototype (for reference only):

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

detectAndDecode(self, img, opts)

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

Both detects and decodes QR code. To simplify the usage, there is a only API: detectAndDecode

Positional Arguments
  • self: Evision.WeChatQRCode.WeChatQRCode.t()

  • img: Evision.Mat.t().

    supports grayscale or color (BGR) image.

Return
  • retval: [string]

  • points: [Evision.Mat].

    optional output array of vertices of the found QR code quadrangle. Will be empty if not found.

@return list of decoded string.

Python prototype (for reference only):

detectAndDecode(img[, points]) -> retval, points
@spec getScaleFactor(t()) :: number() | {:error, String.t()}

getScaleFactor

Positional Arguments
  • self: Evision.WeChatQRCode.WeChatQRCode.t()
Return
  • retval: float

Python prototype (for reference only):

getScaleFactor() -> retval
Link to this function

setScaleFactor(self, scalingFactor)

View Source
@spec setScaleFactor(t(), number()) :: t() | {:error, String.t()}

set scale factor QR code detector use neural network to detect QR. Before running the neural network, the input image is pre-processed by scaling. By default, the input image is scaled to an image with an area of 160000 pixels. The scale factor allows to use custom scale the input image: width = scaleFactorwidth height = scaleFactorwidth

Positional Arguments
  • self: Evision.WeChatQRCode.WeChatQRCode.t()
  • scalingFactor: float

scaleFactor valuse must be > 0 and <= 1, otherwise the scaleFactor value is set to -1 and use default scaled to an image with an area of 160000 pixels.

Python prototype (for reference only):

setScaleFactor(_scalingFactor) -> None
@spec weChatQRCode() :: t() | {:error, String.t()}

Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).

Keyword Arguments
  • detector_prototxt_path: string.

    prototxt file path for the detector

  • detector_caffe_model_path: string.

    caffe model file path for the detector

  • super_resolution_prototxt_path: string.

    prototxt file path for the super resolution model

  • super_resolution_caffe_model_path: string.

    caffe file path for the super resolution model

Return
  • self: Evision.WeChatQRCode.WeChatQRCode.t()

Python prototype (for reference only):

WeChatQRCode([, detector_prototxt_path[, detector_caffe_model_path[, super_resolution_prototxt_path[, super_resolution_caffe_model_path]]]]) -> <wechat_qrcode_WeChatQRCode object>
@spec weChatQRCode([{atom(), term()}, ...] | nil) :: t() | {:error, String.t()}

Initialize the WeChatQRCode. It includes two models, which are packaged with caffe format. Therefore, there are prototxt and caffe models (In total, four paramenters).

Keyword Arguments
  • detector_prototxt_path: string.

    prototxt file path for the detector

  • detector_caffe_model_path: string.

    caffe model file path for the detector

  • super_resolution_prototxt_path: string.

    prototxt file path for the super resolution model

  • super_resolution_caffe_model_path: string.

    caffe file path for the super resolution model

Return
  • self: Evision.WeChatQRCode.WeChatQRCode.t()

Python prototype (for reference only):

WeChatQRCode([, detector_prototxt_path[, detector_caffe_model_path[, super_resolution_prototxt_path[, super_resolution_caffe_model_path]]]]) -> <wechat_qrcode_WeChatQRCode object>