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

Link to this section Summary

Types

t()

Type that represents an XImgProc.SuperpixelLSC struct.

Functions

Clears the algorithm state

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

Enforce label connectivity.

Enforce label connectivity.

getDefaultName

Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.

Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.

Returns the segmentation labeling of the image.

Returns the segmentation labeling of the image.

Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelLSC object.

Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelLSC object.

Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelLSC object.

Reads algorithm parameters from a file storage

Stores algorithm parameters in a file storage

Link to this section Types

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

Type that represents an XImgProc.SuperpixelLSC 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.SuperpixelLSC.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.SuperpixelLSC.t()
Return
  • retval: bool

Python prototype (for reference only):

empty() -> retval
Link to this function

enforceLabelConnectivity(self)

View Source
@spec enforceLabelConnectivity(t()) :: t() | {:error, String.t()}

Enforce label connectivity.

Positional Arguments
  • self: Evision.XImgProc.SuperpixelLSC.t()
Keyword Arguments
  • min_element_size: int.

    The minimum element size in percents that should be absorbed into a bigger superpixel. Given resulted average superpixel size valid value should be in 0-100 range, 25 means that less then a quarter sized superpixel should be absorbed, this is default.

The function merge component that is too small, assigning the previously found adjacent label to this component. Calling this function may change the final number of superpixels.

Python prototype (for reference only):

enforceLabelConnectivity([, min_element_size]) -> None
Link to this function

enforceLabelConnectivity(self, opts)

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

Enforce label connectivity.

Positional Arguments
  • self: Evision.XImgProc.SuperpixelLSC.t()
Keyword Arguments
  • min_element_size: int.

    The minimum element size in percents that should be absorbed into a bigger superpixel. Given resulted average superpixel size valid value should be in 0-100 range, 25 means that less then a quarter sized superpixel should be absorbed, this is default.

The function merge component that is too small, assigning the previously found adjacent label to this component. Calling this function may change the final number of superpixels.

Python prototype (for reference only):

enforceLabelConnectivity([, min_element_size]) -> None
@spec getDefaultName(t()) :: binary() | {:error, String.t()}

getDefaultName

Positional Arguments
  • self: Evision.XImgProc.SuperpixelLSC.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
Link to this function

getLabelContourMask(self)

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

Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.

Positional Arguments
  • self: Evision.XImgProc.SuperpixelLSC.t()
Keyword Arguments
  • thick_line: bool.

    If false, the border is only one pixel wide, otherwise all pixels at the border are masked.

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

    Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise.

The function return the boundaries of the superpixel segmentation.

Python prototype (for reference only):

getLabelContourMask([, image[, thick_line]]) -> image
Link to this function

getLabelContourMask(self, opts)

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

Returns the mask of the superpixel segmentation stored in SuperpixelLSC object.

Positional Arguments
  • self: Evision.XImgProc.SuperpixelLSC.t()
Keyword Arguments
  • thick_line: bool.

    If false, the border is only one pixel wide, otherwise all pixels at the border are masked.

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

    Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise.

The function return the boundaries of the superpixel segmentation.

Python prototype (for reference only):

getLabelContourMask([, image[, thick_line]]) -> image
@spec getLabels(t()) :: Evision.Mat.t() | {:error, String.t()}

Returns the segmentation labeling of the image.

Positional Arguments
  • self: Evision.XImgProc.SuperpixelLSC.t()
Return
  • labels_out: Evision.Mat.t().

    Return: A CV_32SC1 integer array containing the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].

Each label represents a superpixel, and each pixel is assigned to one superpixel label.

The function returns an image with the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].

Python prototype (for reference only):

getLabels([, labels_out]) -> labels_out
@spec getLabels(t(), [{atom(), term()}, ...] | nil) ::
  Evision.Mat.t() | {:error, String.t()}

Returns the segmentation labeling of the image.

Positional Arguments
  • self: Evision.XImgProc.SuperpixelLSC.t()
Return
  • labels_out: Evision.Mat.t().

    Return: A CV_32SC1 integer array containing the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].

Each label represents a superpixel, and each pixel is assigned to one superpixel label.

The function returns an image with the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].

Python prototype (for reference only):

getLabels([, labels_out]) -> labels_out
Link to this function

getNumberOfSuperpixels(self)

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

Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelLSC object.

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

Python prototype (for reference only):

getNumberOfSuperpixels() -> retval
@spec iterate(t()) :: t() | {:error, String.t()}

Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelLSC object.

Positional Arguments
  • self: Evision.XImgProc.SuperpixelLSC.t()
Keyword Arguments
  • num_iterations: int.

    Number of iterations. Higher number improves the result.

This function can be called again without the need of initializing the algorithm with createSuperpixelLSC(). This save the computational cost of allocating memory for all the structures of the algorithm.

The function computes the superpixels segmentation of an image with the parameters initialized with the function createSuperpixelLSC(). The algorithms starts from a grid of superpixels and then refines the boundaries by proposing updates of edges boundaries.

Python prototype (for reference only):

iterate([, num_iterations]) -> None
@spec iterate(t(), [{atom(), term()}, ...] | nil) :: t() | {:error, String.t()}

Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelLSC object.

Positional Arguments
  • self: Evision.XImgProc.SuperpixelLSC.t()
Keyword Arguments
  • num_iterations: int.

    Number of iterations. Higher number improves the result.

This function can be called again without the need of initializing the algorithm with createSuperpixelLSC(). This save the computational cost of allocating memory for all the structures of the algorithm.

The function computes the superpixels segmentation of an image with the parameters initialized with the function createSuperpixelLSC(). The algorithms starts from a grid of superpixels and then refines the boundaries by proposing updates of edges boundaries.

Python prototype (for reference only):

iterate([, num_iterations]) -> None
@spec read(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}

Reads algorithm parameters from a file storage

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

Stores algorithm parameters in a file storage

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

Has overloading in C++

Python prototype (for reference only):

write(fs, name) -> None