Trait opencv::prelude::SuperpixelSLICTraitConst
source · pub trait SuperpixelSLICTraitConst: AlgorithmTraitConst {
// Required method
fn as_raw_SuperpixelSLIC(&self) -> *const c_void;
// Provided methods
fn get_number_of_superpixels(&self) -> Result<i32> { ... }
fn get_labels(&self, labels_out: &mut impl ToOutputArray) -> Result<()> { ... }
fn get_label_contour_mask(
&self,
image: &mut impl ToOutputArray,
thick_line: bool
) -> Result<()> { ... }
fn get_label_contour_mask_def(
&self,
image: &mut impl ToOutputArray
) -> Result<()> { ... }
}
Expand description
Constant methods for crate::ximgproc::SuperpixelSLIC
Required Methods§
fn as_raw_SuperpixelSLIC(&self) -> *const c_void
Provided Methods§
sourcefn get_number_of_superpixels(&self) -> Result<i32>
fn get_number_of_superpixels(&self) -> Result<i32>
Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelSLIC object.
sourcefn get_labels(&self, labels_out: &mut impl ToOutputArray) -> Result<()>
fn get_labels(&self, labels_out: &mut impl ToOutputArray) -> Result<()>
Returns the segmentation labeling of the image.
Each label represents a superpixel, and each pixel is assigned to one superpixel label.
Parameters
- labels_out: Return: A CV_32SC1 integer array containing the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].
The function returns an image with the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].
sourcefn get_label_contour_mask(
&self,
image: &mut impl ToOutputArray,
thick_line: bool
) -> Result<()>
fn get_label_contour_mask( &self, image: &mut impl ToOutputArray, thick_line: bool ) -> Result<()>
Returns the mask of the superpixel segmentation stored in SuperpixelSLIC object.
Parameters
-
image: Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise.
-
thick_line: If false, the border is only one pixel wide, otherwise all pixels at the border are masked.
The function return the boundaries of the superpixel segmentation.
C++ default parameters
- thick_line: true
sourcefn get_label_contour_mask_def(
&self,
image: &mut impl ToOutputArray
) -> Result<()>
fn get_label_contour_mask_def( &self, image: &mut impl ToOutputArray ) -> Result<()>
Returns the mask of the superpixel segmentation stored in SuperpixelSLIC object.
Parameters
-
image: Return: CV_8U1 image mask where -1 indicates that the pixel is a superpixel border, and 0 otherwise.
-
thick_line: If false, the border is only one pixel wide, otherwise all pixels at the border are masked.
The function return the boundaries of the superpixel segmentation.
Note
This alternative version of [get_label_contour_mask] function uses the following default values for its arguments:
- thick_line: true