View Source Evision.XImgProc.ScanSegment (Evision v0.2.9)
Summary
Functions
Clears the algorithm state
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
getDefaultName
Returns the mask of the superpixel segmentation stored in the ScanSegment object.
Returns the mask of the superpixel segmentation stored in the ScanSegment object.
Returns the segmentation labeling of the image.
Returns the segmentation labeling of the image.
Returns the actual superpixel segmentation from the last image processed using iterate.
Calculates the superpixel segmentation on a given image with the initialized parameters in the ScanSegment object.
Reads algorithm parameters from a file storage
save
Stores algorithm parameters in a file storage
write
Types
@type t() :: %Evision.XImgProc.ScanSegment{ref: reference()}
Type that represents an XImgProc.ScanSegment
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.ScanSegment.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.ScanSegment.t()
Return
- retval:
bool
Python prototype (for reference only):
empty() -> retval
@spec getDefaultName(Keyword.t()) :: any() | {:error, String.t()}
@spec getDefaultName(t()) :: binary() | {:error, String.t()}
getDefaultName
Positional Arguments
- self:
Evision.XImgProc.ScanSegment.t()
Return
- retval:
String
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 getLabelContourMask(Keyword.t()) :: any() | {:error, String.t()}
@spec getLabelContourMask(t()) :: Evision.Mat.t() | {:error, String.t()}
Returns the mask of the superpixel segmentation stored in the ScanSegment object.
Positional Arguments
- self:
Evision.XImgProc.ScanSegment.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_8UC1 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 getLabelContourMask(t(), [{:thick_line, term()}] | nil) :: Evision.Mat.t() | {:error, String.t()}
Returns the mask of the superpixel segmentation stored in the ScanSegment object.
Positional Arguments
- self:
Evision.XImgProc.ScanSegment.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_8UC1 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(Keyword.t()) :: any() | {:error, String.t()}
@spec getLabels(t()) :: Evision.Mat.t() | {:error, String.t()}
Returns the segmentation labeling of the image.
Positional Arguments
- self:
Evision.XImgProc.ScanSegment.t()
Return
labels_out:
Evision.Mat.t()
.Return: A CV_32UC1 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.
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.ScanSegment.t()
Return
labels_out:
Evision.Mat.t()
.Return: A CV_32UC1 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.
Python prototype (for reference only):
getLabels([, labels_out]) -> labels_out
@spec getNumberOfSuperpixels(Keyword.t()) :: any() | {:error, String.t()}
@spec getNumberOfSuperpixels(t()) :: integer() | {:error, String.t()}
Returns the actual superpixel segmentation from the last image processed using iterate.
Positional Arguments
- self:
Evision.XImgProc.ScanSegment.t()
Return
- retval:
integer()
Returns zero if no image has been processed.
Python prototype (for reference only):
getNumberOfSuperpixels() -> retval
@spec iterate(t(), Evision.Mat.maybe_mat_in()) :: t() | {:error, String.t()}
Calculates the superpixel segmentation on a given image with the initialized parameters in the ScanSegment object.
Positional Arguments
self:
Evision.XImgProc.ScanSegment.t()
img:
Evision.Mat
.Input image. Supported format: CV_8UC3. Image size must match with the initialized image size with the function createScanSegment(). It MUST be in Lab color space.
This function can be called again for other images without the need of initializing the algorithm with createScanSegment(). This save the computational cost of allocating memory for all the structures of the algorithm.
Python prototype (for reference only):
iterate(img) -> None
@spec read(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}
Reads algorithm parameters from a file storage
Positional Arguments
- self:
Evision.XImgProc.ScanSegment.t()
- func:
Evision.FileNode
Python prototype (for reference only):
read(fn) -> None
save
Positional Arguments
- self:
Evision.XImgProc.ScanSegment.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.ScanSegment.t()
- fs:
Evision.FileStorage
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.ScanSegment.t()
- fs:
Evision.FileStorage
- name:
String
Has overloading in C++
Python prototype (for reference only):
write(fs, name) -> None