View Source Evision.ArUco.Dictionary (Evision v0.1.38)

Summary

Types

t()

Type that represents an ArUco.Dictionary struct.

Functions

Dictionary

Basic ArUco dictionary constructor

Basic ArUco dictionary constructor

Generate a canonical marker image

Generate a canonical marker image

Transform list of bytes to matrix of bits

Transform matrix of bits to list of bytes with 4 marker rotations

Returns Hamming distance of the input bits to the specific id.

Returns Hamming distance of the input bits to the specific id.

Given a matrix of bits. Returns whether if marker is identified or not.

Read a new dictionary from FileNode.

Write a dictionary to FileStorage, format is the same as in readDictionary().

Write a dictionary to FileStorage, format is the same as in readDictionary().

Types

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

Type that represents an ArUco.Dictionary struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

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

Dictionary

Return
  • self: Dictionary

Python prototype (for reference only):

Dictionary() -> <aruco_Dictionary object>
Link to this function

dictionary(bytesList, markerSize)

View Source
@spec dictionary(Evision.Mat.maybe_mat_in(), integer()) :: t() | {:error, String.t()}

Basic ArUco dictionary constructor

Positional Arguments
  • bytesList: Evision.Mat.t().

    bits for all ArUco markers in dictionary see memory layout in the class description

  • markerSize: int.

    ArUco marker size in units

Keyword Arguments
  • maxcorr: int.

    maximum number of bits that can be corrected

Return
  • self: Dictionary

Python prototype (for reference only):

Dictionary(bytesList, _markerSize[, maxcorr]) -> <aruco_Dictionary object>
Link to this function

dictionary(bytesList, markerSize, opts)

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

Basic ArUco dictionary constructor

Positional Arguments
  • bytesList: Evision.Mat.t().

    bits for all ArUco markers in dictionary see memory layout in the class description

  • markerSize: int.

    ArUco marker size in units

Keyword Arguments
  • maxcorr: int.

    maximum number of bits that can be corrected

Return
  • self: Dictionary

Python prototype (for reference only):

Dictionary(bytesList, _markerSize[, maxcorr]) -> <aruco_Dictionary object>
Link to this function

generateImageMarker(self, id, sidePixels)

View Source
@spec generateImageMarker(t(), integer(), integer()) ::
  Evision.Mat.t() | {:error, String.t()}

Generate a canonical marker image

Positional Arguments
  • self: Evision.ArUco.Dictionary.t()
  • id: int
  • sidePixels: int
Keyword Arguments
  • borderBits: int.
Return
  • img: Evision.Mat.t().

Python prototype (for reference only):

generateImageMarker(id, sidePixels[, _img[, borderBits]]) -> _img
Link to this function

generateImageMarker(self, id, sidePixels, opts)

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

Generate a canonical marker image

Positional Arguments
  • self: Evision.ArUco.Dictionary.t()
  • id: int
  • sidePixels: int
Keyword Arguments
  • borderBits: int.
Return
  • img: Evision.Mat.t().

Python prototype (for reference only):

generateImageMarker(id, sidePixels[, _img[, borderBits]]) -> _img
@spec get_bytesList(t()) :: Evision.Mat.t()
@spec get_markerSize(t()) :: integer()
Link to this function

get_maxCorrectionBits(self)

View Source
@spec get_maxCorrectionBits(t()) :: integer()
Link to this function

getBitsFromByteList(byteList, markerSize)

View Source
@spec getBitsFromByteList(Evision.Mat.maybe_mat_in(), integer()) ::
  Evision.Mat.t() | {:error, String.t()}

Transform list of bytes to matrix of bits

Positional Arguments
  • byteList: Evision.Mat.t()
  • markerSize: int
Return
  • retval: Evision.Mat.t()

Python prototype (for reference only):

getBitsFromByteList(byteList, markerSize) -> retval
Link to this function

getByteListFromBits(bits)

View Source
@spec getByteListFromBits(Evision.Mat.maybe_mat_in()) ::
  Evision.Mat.t() | {:error, String.t()}

Transform matrix of bits to list of bytes with 4 marker rotations

Positional Arguments
  • bits: Evision.Mat.t()
Return
  • retval: Evision.Mat.t()

Python prototype (for reference only):

getByteListFromBits(bits) -> retval
Link to this function

getDistanceToId(self, bits, id)

View Source
@spec getDistanceToId(t(), Evision.Mat.maybe_mat_in(), integer()) ::
  integer() | {:error, String.t()}

Returns Hamming distance of the input bits to the specific id.

Positional Arguments
  • self: Evision.ArUco.Dictionary.t()
  • bits: Evision.Mat.t()
  • id: int
Keyword Arguments
  • allRotations: bool.
Return
  • retval: int

If allRotations flag is set, the four posible marker rotations are considered

Python prototype (for reference only):

getDistanceToId(bits, id[, allRotations]) -> retval
Link to this function

getDistanceToId(self, bits, id, opts)

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

Returns Hamming distance of the input bits to the specific id.

Positional Arguments
  • self: Evision.ArUco.Dictionary.t()
  • bits: Evision.Mat.t()
  • id: int
Keyword Arguments
  • allRotations: bool.
Return
  • retval: int

If allRotations flag is set, the four posible marker rotations are considered

Python prototype (for reference only):

getDistanceToId(bits, id[, allRotations]) -> retval
Link to this function

identify(self, onlyBits, maxCorrectionRate)

View Source
@spec identify(t(), Evision.Mat.maybe_mat_in(), number()) ::
  {integer(), integer()} | false | {:error, String.t()}

Given a matrix of bits. Returns whether if marker is identified or not.

Positional Arguments
  • self: Evision.ArUco.Dictionary.t()
  • onlyBits: Evision.Mat.t()
  • maxCorrectionRate: double
Return
  • retval: bool
  • idx: int
  • rotation: int

Returns reference to the marker id in the dictionary (if any) and its rotation.

Python prototype (for reference only):

identify(onlyBits, maxCorrectionRate) -> retval, idx, rotation
Link to this function

readDictionary(self, fn_)

View Source
@spec readDictionary(t(), Evision.FileNode.t()) :: boolean() | {:error, String.t()}

Read a new dictionary from FileNode.

Positional Arguments
  • self: Evision.ArUco.Dictionary.t()
  • fn_: Evision.FileNode.t()
Return
  • retval: bool

Dictionary example in YAML format:\n nmarkers: 35\n markersize: 6\n maxCorrectionBits: 5\n marker_0: "101011111011111001001001101100000000"\n ...\n marker_34: "011111010000111011111110110101100101"

Python prototype (for reference only):

readDictionary(fn_) -> retval
Link to this function

set_bytesList(self, prop)

View Source
@spec set_bytesList(t(), Evision.Mat.maybe_mat_in()) :: t()
Link to this function

set_markerSize(self, prop)

View Source
@spec set_markerSize(t(), integer()) :: t()
Link to this function

set_maxCorrectionBits(self, prop)

View Source
@spec set_maxCorrectionBits(t(), integer()) :: t()
Link to this function

writeDictionary(self, fs)

View Source
@spec writeDictionary(t(), Evision.FileStorage.t()) :: t() | {:error, String.t()}

Write a dictionary to FileStorage, format is the same as in readDictionary().

Positional Arguments
  • self: Evision.ArUco.Dictionary.t()
  • fs: Evision.FileStorage.t()
Keyword Arguments

Python prototype (for reference only):

writeDictionary(fs[, name]) -> None
Link to this function

writeDictionary(self, fs, opts)

View Source
@spec writeDictionary(t(), Evision.FileStorage.t(), [{atom(), term()}, ...] | nil) ::
  t() | {:error, String.t()}

Write a dictionary to FileStorage, format is the same as in readDictionary().

Positional Arguments
  • self: Evision.ArUco.Dictionary.t()
  • fs: Evision.FileStorage.t()
Keyword Arguments

Python prototype (for reference only):

writeDictionary(fs[, name]) -> None