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

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

getCtrSize

getDefaultName

getFDSize

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

Link to this section Types

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

Type that represents an XImgProc.ContourFitting struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

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

    Contour defining first shape.

  • dst: Evision.Mat.t().

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

    Contour defining first shape.

  • dst: Evision.Mat.t().

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

getCtrSize

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

@returns number of fourier descriptors

Python prototype (for reference only):

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

getFDSize

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

@returns number of fourier descriptors used for optimal curve matching

Python prototype (for reference only):

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

Reads algorithm parameters from a file storage

Positional Arguments
  • self: Evision.XImgProc.ContourFitting.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.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(t(), integer()) :: t() | {:error, String.t()}

set number of Fourier descriptors used in estimateTransformation

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

  • n: int.

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

Python prototype (for reference only):

setCtrSize(n) -> None
@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: int.

    number of fourier descriptors used for optimal curve matching.

Python prototype (for reference only):

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

Stores algorithm parameters in a file storage

Positional Arguments
  • self: Evision.XImgProc.ContourFitting.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.XImgProc.ContourFitting.t()
  • fs: Evision.FileStorage.t()
  • name: String

Has overloading in C++

Python prototype (for reference only):

write(fs, name) -> None