View Source Evision.WeChatQRCode.WeChatQRCode (Evision v1.0.0-rc.0)

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

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 CNN-based models in ONNX format: a detector model and a super resolution model.

Initialize the WeChatQRCode. It includes two CNN-based models in ONNX format: a detector model and a super resolution model.

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(named_args)

View Source
@spec detectAndDecode(Keyword.t()) :: any() | {:error, String.t()}
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.

    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.

    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

getScaleFactor(named_args)

View Source
@spec getScaleFactor(Keyword.t()) :: any() | {:error, String.t()}
@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(named_args)

View Source
@spec setScaleFactor(Keyword.t()) :: any() | {:error, String.t()}
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 CNN-based models in ONNX format: a detector model and a super resolution model.

Keyword Arguments
  • detector_model_path: string.

    onnx model file path for the detector

  • super_resolution_model_path: string.

    onnx model file path for the super resolution model

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

Python prototype (for reference only):

WeChatQRCode([, detector_model_path[, super_resolution_model_path]]) -> <wechat_qrcode_WeChatQRCode object>
Link to this function

weChatQRCode(named_args)

View Source
@spec weChatQRCode(Keyword.t()) :: any() | {:error, String.t()}
@spec weChatQRCode(
  [detector_model_path: term(), super_resolution_model_path: term()]
  | nil
) ::
  t() | {:error, String.t()}

Initialize the WeChatQRCode. It includes two CNN-based models in ONNX format: a detector model and a super resolution model.

Keyword Arguments
  • detector_model_path: string.

    onnx model file path for the detector

  • super_resolution_model_path: string.

    onnx model file path for the super resolution model

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

Python prototype (for reference only):

WeChatQRCode([, detector_model_path[, super_resolution_model_path]]) -> <wechat_qrcode_WeChatQRCode object>