View Source Evision.ShapeTransformer (Evision v0.1.28)

Link to this section 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.

getDefaultName

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

Link to this section Types

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

Type that represents an ShapeTransformer struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

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.t().

    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.t().

    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(t()) :: t() | {:error, String.t()}

Clears the algorithm state

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

Python prototype (for reference only):

clear() -> None
@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(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.t().

    Contour defining first shape.

  • targetShape: Evision.Mat.t().

    Contour defining second shape (Target).

  • matches: [Evision.DMatch].

    Standard vector of Matches between points.

Python prototype (for reference only):

estimateTransformation(transformingShape, targetShape, matches) -> None
@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(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}

Reads algorithm parameters from a file storage

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

Python prototype (for reference only):

read(fn_) -> None
@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
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.t().

    Input image.

Keyword Arguments
  • flags: int.

    Image interpolation method.

  • borderMode: int.

    border style.

  • borderValue: 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(), [{atom(), 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.t().

    Input image.

Keyword Arguments
  • flags: int.

    Image interpolation method.

  • borderMode: int.

    border style.

  • borderValue: Scalar.

    border value.

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

    Output image.

Python prototype (for reference only):

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

Stores algorithm parameters in a file storage

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

Python prototype (for reference only):

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

write

Positional Arguments
  • self: Evision.ShapeTransformer.t()
  • fs: Evision.FileStorage.t()
  • name: String

Has overloading in C++

Python prototype (for reference only):

write(fs, name) -> None