View Source Evision.XImgProc.ContourFitting (Evision v0.2.9)

Summary

Types

t()

Type that represents an XImgProc.ContourFitting struct.

Functions

Clears the algorithm state

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

Fit two closed curves using fourier descriptors. More details in @cite PersoonFu1977 and @cite BergerRaghunathan1998

Fit two closed curves using fourier descriptors. More details in @cite PersoonFu1977 and @cite BergerRaghunathan1998

Reads algorithm parameters from a file storage

set number of Fourier descriptors used in estimateTransformation

set number of Fourier descriptors when estimateTransformation used vector<Point>

Stores algorithm parameters in a file storage

Types

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

Type that represents an XImgProc.ContourFitting struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

@spec clear(Keyword.t()) :: any() | {:error, String.t()}
@spec clear(t()) :: t() | {:error, String.t()}

Clears the algorithm state

Positional Arguments
  • self: Evision.XImgProc.ContourFitting.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.XImgProc.ContourFitting.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, src, dst)

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

Fit two closed curves using fourier descriptors. More details in @cite PersoonFu1977 and @cite BergerRaghunathan1998

Positional Arguments
  • self: Evision.XImgProc.ContourFitting.t()

  • src: Evision.Mat.

    Contour defining first shape.

  • dst: Evision.Mat.

    Contour defining second shape (Target).

Keyword Arguments
  • fdContour: bool.

    false then src and dst are contours and true src and dst are fourier descriptors.

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

    : \f$ \alpha \f$=alphaPhiST(0,0), \f$ \phi \f$=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation center

  • dist: double.

    distance between src and dst after matching.

Python prototype (for reference only):

estimateTransformation(src, dst[, alphaPhiST[, fdContour]]) -> alphaPhiST, dist
Link to this function

estimateTransformation(self, src, dst, opts)

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

Fit two closed curves using fourier descriptors. More details in @cite PersoonFu1977 and @cite BergerRaghunathan1998

Positional Arguments
  • self: Evision.XImgProc.ContourFitting.t()

  • src: Evision.Mat.

    Contour defining first shape.

  • dst: Evision.Mat.

    Contour defining second shape (Target).

Keyword Arguments
  • fdContour: bool.

    false then src and dst are contours and true src and dst are fourier descriptors.

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

    : \f$ \alpha \f$=alphaPhiST(0,0), \f$ \phi \f$=alphaPhiST(0,1) (in radian), s=alphaPhiST(0,2), Tx=alphaPhiST(0,3), Ty=alphaPhiST(0,4) rotation center

  • dist: double.

    distance between src and dst after matching.

Python prototype (for reference only):

estimateTransformation(src, dst[, alphaPhiST[, fdContour]]) -> alphaPhiST, dist
@spec getCtrSize(Keyword.t()) :: any() | {:error, String.t()}
@spec getCtrSize(t()) :: integer() | {:error, String.t()}

getCtrSize

Positional Arguments
  • self: Evision.XImgProc.ContourFitting.t()
Return
  • retval: integer()

@returns number of fourier descriptors

Python prototype (for reference only):

getCtrSize() -> retval
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.XImgProc.ContourFitting.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 getFDSize(Keyword.t()) :: any() | {:error, String.t()}
@spec getFDSize(t()) :: integer() | {:error, String.t()}

getFDSize

Positional Arguments
  • self: Evision.XImgProc.ContourFitting.t()
Return
  • retval: integer()

@returns number of fourier descriptors used for optimal curve matching

Python prototype (for reference only):

getFDSize() -> 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.XImgProc.ContourFitting.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 setCtrSize(Keyword.t()) :: any() | {:error, String.t()}
@spec setCtrSize(t(), integer()) :: t() | {:error, String.t()}

set number of Fourier descriptors used in estimateTransformation

Positional Arguments
  • self: Evision.XImgProc.ContourFitting.t()

  • n: integer().

    number of Fourier descriptors equal to number of contour points after resampling.

Python prototype (for reference only):

setCtrSize(n) -> None
@spec setFDSize(Keyword.t()) :: any() | {:error, String.t()}
@spec setFDSize(t(), integer()) :: t() | {:error, String.t()}

set number of Fourier descriptors when estimateTransformation used vector<Point>

Positional Arguments
  • self: Evision.XImgProc.ContourFitting.t()

  • n: integer().

    number of fourier descriptors used for optimal curve matching.

Python prototype (for reference only):

setFDSize(n) -> None
@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