View Source Evision.ShapeTransformer (Evision v0.2.9)

Summary

Types

t()

Type that represents an ShapeTransformer struct.

Functions

Apply a transformation, given a pre-estimated transformation parameters.

Apply a transformation, given a pre-estimated transformation parameters.

Clears the algorithm state

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read

Estimate the transformation parameters of the current transformer algorithm, based on point matches.

Reads algorithm parameters from a file storage

Apply a transformation, given a pre-estimated transformation parameters, to an Image.

Apply a transformation, given a pre-estimated transformation parameters, to an Image.

Stores algorithm parameters in a file storage

Types

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

Type that represents an ShapeTransformer struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

Link to this function

applyTransformation(named_args)

View Source
@spec applyTransformation(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

applyTransformation(self, input)

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

Apply a transformation, given a pre-estimated transformation parameters.

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

  • input: Evision.Mat.

    Contour (set of points) to apply the transformation.

Return
  • retval: float

  • output: Evision.Mat.t().

    Output contour.

Python prototype (for reference only):

applyTransformation(input[, output]) -> retval, output
Link to this function

applyTransformation(self, input, opts)

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

Apply a transformation, given a pre-estimated transformation parameters.

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

  • input: Evision.Mat.

    Contour (set of points) to apply the transformation.

Return
  • retval: float

  • output: Evision.Mat.t().

    Output contour.

Python prototype (for reference only):

applyTransformation(input[, output]) -> retval, output
@spec clear(Keyword.t()) :: any() | {:error, String.t()}
@spec clear(t()) :: t() | {:error, String.t()}

Clears the algorithm state

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

Python prototype (for reference only):

clear() -> None
@spec empty(Keyword.t()) :: any() | {:error, String.t()}
@spec empty(t()) :: boolean() | {:error, String.t()}

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read

Positional Arguments
  • self: Evision.ShapeTransformer.t()
Return
  • retval: bool

Python prototype (for reference only):

empty() -> retval
Link to this function

estimateTransformation(named_args)

View Source
@spec estimateTransformation(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

estimateTransformation(self, transformingShape, targetShape, matches)

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

Estimate the transformation parameters of the current transformer algorithm, based on point matches.

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

  • transformingShape: Evision.Mat.

    Contour defining first shape.

  • targetShape: Evision.Mat.

    Contour defining second shape (Target).

  • matches: [Evision.DMatch].

    Standard vector of Matches between points.

Python prototype (for reference only):

estimateTransformation(transformingShape, targetShape, matches) -> None
Link to this function

getDefaultName(named_args)

View Source
@spec getDefaultName(Keyword.t()) :: any() | {:error, String.t()}
@spec getDefaultName(t()) :: binary() | {:error, String.t()}

getDefaultName

Positional Arguments
  • self: Evision.ShapeTransformer.t()
Return

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.

Python prototype (for reference only):

getDefaultName() -> retval
@spec read(Keyword.t()) :: any() | {:error, String.t()}
@spec read(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}

Reads algorithm parameters from a file storage

Positional Arguments

Python prototype (for reference only):

read(fn) -> None
@spec save(Keyword.t()) :: any() | {:error, String.t()}
@spec save(t(), binary()) :: t() | {:error, String.t()}

save

Positional Arguments
  • self: Evision.ShapeTransformer.t()
  • filename: String

Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).

Python prototype (for reference only):

save(filename) -> None
@spec warpImage(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

warpImage(self, transformingImage)

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

Apply a transformation, given a pre-estimated transformation parameters, to an Image.

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

  • transformingImage: Evision.Mat.

    Input image.

Keyword Arguments
  • flags: integer().

    Image interpolation method.

  • borderMode: integer().

    border style.

  • borderValue: Evision.scalar().

    border value.

Return
  • output: Evision.Mat.t().

    Output image.

Python prototype (for reference only):

warpImage(transformingImage[, output[, flags[, borderMode[, borderValue]]]]) -> output
Link to this function

warpImage(self, transformingImage, opts)

View Source
@spec warpImage(
  t(),
  Evision.Mat.maybe_mat_in(),
  [borderMode: term(), borderValue: term(), flags: term()] | nil
) :: Evision.Mat.t() | {:error, String.t()}

Apply a transformation, given a pre-estimated transformation parameters, to an Image.

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

  • transformingImage: Evision.Mat.

    Input image.

Keyword Arguments
  • flags: integer().

    Image interpolation method.

  • borderMode: integer().

    border style.

  • borderValue: Evision.scalar().

    border value.

Return
  • output: Evision.Mat.t().

    Output image.

Python prototype (for reference only):

warpImage(transformingImage[, output[, flags[, borderMode[, borderValue]]]]) -> output
@spec write(Keyword.t()) :: any() | {:error, String.t()}
@spec write(t(), Evision.FileStorage.t()) :: t() | {:error, String.t()}

Stores algorithm parameters in a file storage

Positional Arguments

Python prototype (for reference only):

write(fs) -> None
@spec write(t(), Evision.FileStorage.t(), binary()) :: t() | {:error, String.t()}

write

Positional Arguments

Has overloading in C++

Python prototype (for reference only):

write(fs, name) -> None