Struct opencv::ximgproc::ScanSegment
source · pub struct ScanSegment { /* private fields */ }
Expand description
Class implementing the F-DBSCAN (Accelerated superpixel image segmentation with a parallelized DBSCAN algorithm) superpixels algorithm by Loke SC, et al. loke2021accelerated for original paper.
The algorithm uses a parallelised DBSCAN cluster search that is resistant to noise, competitive in segmentation quality, and faster than existing superpixel segmentation methods. When tested on the Berkeley Segmentation Dataset, the average processing speed is 175 frames/s with a Boundary Recall of 0.797 and an Achievable Segmentation Accuracy of 0.944. The computational complexity is quadratic O(n2) and more suited to smaller images, but can still process a 2MP colour image faster than the SEEDS algorithm in OpenCV. The output is deterministic when the number of processing threads is fixed, and requires the source image to be in Lab colour format.
Trait Implementations§
source§impl AlgorithmTrait for ScanSegment
impl AlgorithmTrait for ScanSegment
source§impl AlgorithmTraitConst for ScanSegment
impl AlgorithmTraitConst for ScanSegment
fn as_raw_Algorithm(&self) -> *const c_void
source§fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
source§fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
source§fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
source§fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
§Note
source§fn empty(&self) -> Result<bool>
fn empty(&self) -> Result<bool>
source§fn save(&self, filename: &str) -> Result<()>
fn save(&self, filename: &str) -> Result<()>
source§fn get_default_name(&self) -> Result<String>
fn get_default_name(&self) -> Result<String>
source§impl Boxed for ScanSegment
impl Boxed for ScanSegment
source§unsafe fn from_raw(
ptr: <ScanSegment as OpenCVFromExtern>::ExternReceive
) -> Self
unsafe fn from_raw( ptr: <ScanSegment as OpenCVFromExtern>::ExternReceive ) -> Self
source§fn into_raw(self) -> <ScanSegment as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <ScanSegment as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <ScanSegment as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <ScanSegment as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(
&mut self
) -> <ScanSegment as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self ) -> <ScanSegment as OpenCVTypeExternContainer>::ExternSendMut
source§impl Debug for ScanSegment
impl Debug for ScanSegment
source§impl Drop for ScanSegment
impl Drop for ScanSegment
source§impl From<ScanSegment> for Algorithm
impl From<ScanSegment> for Algorithm
source§fn from(s: ScanSegment) -> Self
fn from(s: ScanSegment) -> Self
source§impl ScanSegmentTrait for ScanSegment
impl ScanSegmentTrait for ScanSegment
fn as_raw_mut_ScanSegment(&mut self) -> *mut c_void
source§fn get_number_of_superpixels(&mut self) -> Result<i32>
fn get_number_of_superpixels(&mut self) -> Result<i32>
source§fn iterate(&mut self, img: &impl ToInputArray) -> Result<()>
fn iterate(&mut self, img: &impl ToInputArray) -> Result<()>
source§fn get_labels(&mut self, labels_out: &mut impl ToOutputArray) -> Result<()>
fn get_labels(&mut self, labels_out: &mut impl ToOutputArray) -> Result<()>
source§fn 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<()>
source§fn 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<()>
source§impl ScanSegmentTraitConst for ScanSegment
impl ScanSegmentTraitConst for ScanSegment
fn as_raw_ScanSegment(&self) -> *const c_void
impl Send for ScanSegment
Auto Trait Implementations§
impl Freeze for ScanSegment
impl RefUnwindSafe for ScanSegment
impl !Sync for ScanSegment
impl Unpin for ScanSegment
impl UnwindSafe for ScanSegment
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold
. Read more