Trait ConnectedComponents
pub trait ConnectedComponents {
// Required methods
fn connected_components(self, connectivity: Connectivity) -> Tensor<2, Int>;
fn connected_components_with_stats(
self,
connectivity: Connectivity,
options: ConnectedStatsOptions,
) -> (Tensor<2, Int>, ConnectedStats);
}Expand description
Connected components tensor extensions
Required Methods§
fn connected_components(self, connectivity: Connectivity) -> Tensor<2, Int>
fn connected_components(self, connectivity: Connectivity) -> Tensor<2, Int>
Computes the connected components labeled image of boolean image with 4 or 8 way connectivity - returns a tensor of the component label of each pixel.
img- The boolean image tensor in the format [batches, height, width]
fn connected_components_with_stats(
self,
connectivity: Connectivity,
options: ConnectedStatsOptions,
) -> (Tensor<2, Int>, ConnectedStats)
fn connected_components_with_stats( self, connectivity: Connectivity, options: ConnectedStatsOptions, ) -> (Tensor<2, Int>, ConnectedStats)
Computes the connected components labeled image of boolean image with 4 or 8 way connectivity and collects statistics on each component - returns a tensor of the component label of each pixel, along with stats collected for each component.
img- The boolean image tensor in the format [batches, height, width]
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".