Skip to main content

ConnectedComponents

Trait ConnectedComponents 

Source
pub trait ConnectedComponents<B: Backend> {
    // Required methods
    fn connected_components(
        self,
        connectivity: Connectivity,
    ) -> Tensor<B, 2, Int>;
    fn connected_components_with_stats(
        self,
        connectivity: Connectivity,
        options: ConnectedStatsOptions,
    ) -> (Tensor<B, 2, Int>, ConnectedStats<B>);
}
Expand description

Connected components tensor extensions

Required Methods§

Source

fn connected_components(self, connectivity: Connectivity) -> Tensor<B, 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]

Source

fn connected_components_with_stats( self, connectivity: Connectivity, options: ConnectedStatsOptions, ) -> (Tensor<B, 2, Int>, ConnectedStats<B>)

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]

Implementations on Foreign Types§

Source§

impl<B: BoolVisionOps> ConnectedComponents<B> for Tensor<B, 2, Bool>

Implementors§