pub trait ScanSegmentTrait: AlgorithmTrait + ScanSegmentTraitConst {
// Required method
fn as_raw_mut_ScanSegment(&mut self) -> *mut c_void;
// Provided methods
fn get_number_of_superpixels(&mut self) -> Result<i32> { ... }
fn iterate(&mut self, img: &impl ToInputArray) -> Result<()> { ... }
fn get_labels(&mut self, labels_out: &mut impl ToOutputArray) -> Result<()> { ... }
fn get_label_contour_mask(
&mut self,
image: &mut impl ToOutputArray,
thick_line: bool,
) -> Result<()> { ... }
fn get_label_contour_mask_def(
&mut self,
image: &mut impl ToOutputArray,
) -> Result<()> { ... }
}
Expand description
Mutable methods for crate::ximgproc::ScanSegment
Required Methods§
fn as_raw_mut_ScanSegment(&mut self) -> *mut c_void
Provided Methods§
Sourcefn get_number_of_superpixels(&mut self) -> Result<i32>
fn get_number_of_superpixels(&mut self) -> Result<i32>
Returns the actual superpixel segmentation from the last image processed using iterate.
Returns zero if no image has been processed.
Sourcefn iterate(&mut self, img: &impl ToInputArray) -> Result<()>
fn iterate(&mut self, img: &impl ToInputArray) -> Result<()>
Calculates the superpixel segmentation on a given image with the initialized parameters in the ScanSegment object.
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.
§Parameters
- img: 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.
Sourcefn get_labels(&mut self, labels_out: &mut impl ToOutputArray) -> Result<()>
fn get_labels(&mut 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_32UC1 integer array containing the labels of the superpixel segmentation. The labels are in the range [0, getNumberOfSuperpixels()].
Sourcefn get_label_contour_mask(
&mut self,
image: &mut impl ToOutputArray,
thick_line: bool,
) -> Result<()>
fn get_label_contour_mask( &mut self, image: &mut impl ToOutputArray, thick_line: bool, ) -> Result<()>
Returns the mask of the superpixel segmentation stored in the ScanSegment object.
The function return the boundaries of the superpixel segmentation.
§Parameters
- image: Return: CV_8UC1 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.
§C++ default parameters
- thick_line: false
Sourcefn get_label_contour_mask_def(
&mut self,
image: &mut impl ToOutputArray,
) -> Result<()>
fn get_label_contour_mask_def( &mut self, image: &mut impl ToOutputArray, ) -> Result<()>
Returns the mask of the superpixel segmentation stored in the ScanSegment object.
The function return the boundaries of the superpixel segmentation.
§Parameters
- image: Return: CV_8UC1 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.
§Note
This alternative version of ScanSegmentTrait::get_label_contour_mask function uses the following default values for its arguments:
- thick_line: false
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.