Skip to main content

BoolVisionOps

Trait BoolVisionOps 

pub trait BoolVisionOps: Backend {
    // Provided methods
    fn connected_components(
        img: Self::BoolTensorPrimitive,
        connectivity: Connectivity,
        out_dtype: IntDType,
    ) -> Self::IntTensorPrimitive { ... }
    fn connected_components_with_stats(
        img: Self::BoolTensorPrimitive,
        connectivity: Connectivity,
        opts: ConnectedStatsOptions,
        out_dtype: IntDType,
    ) -> (Self::IntTensorPrimitive, ConnectedStatsPrimitive<Self>) { ... }
    fn bool_erode(
        input: Self::BoolTensorPrimitive,
        kernel: Self::BoolTensorPrimitive,
        opts: MorphOptions,
    ) -> Self::BoolTensorPrimitive { ... }
    fn bool_dilate(
        input: Self::BoolTensorPrimitive,
        kernel: Self::BoolTensorPrimitive,
        opts: MorphOptions,
    ) -> Self::BoolTensorPrimitive { ... }
}
Expand description

Vision ops on bool tensors

Provided Methods§

fn connected_components( img: Self::BoolTensorPrimitive, connectivity: Connectivity, out_dtype: IntDType, ) -> Self::IntTensorPrimitive

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( img: Self::BoolTensorPrimitive, connectivity: Connectivity, opts: ConnectedStatsOptions, out_dtype: IntDType, ) -> (Self::IntTensorPrimitive, ConnectedStatsPrimitive<Self>)

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]

fn bool_erode( input: Self::BoolTensorPrimitive, kernel: Self::BoolTensorPrimitive, opts: MorphOptions, ) -> Self::BoolTensorPrimitive

Erodes an input tensor with the specified kernel.

fn bool_dilate( input: Self::BoolTensorPrimitive, kernel: Self::BoolTensorPrimitive, opts: MorphOptions, ) -> Self::BoolTensorPrimitive

Dilates an input tensor with the specified kernel.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl BoolVisionOps for Dispatch

§

impl BoolVisionOps for Flex

§

impl<B> BoolVisionOps for Fusion<B>

Available on crate feature fusion only.