Skip to main content

BoolVisionOps

Trait BoolVisionOps 

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

Vision ops on bool tensors

Provided Methods§

Source

fn connected_components( img: BoolTensor<Self>, connectivity: Connectivity, ) -> IntTensor<Self>

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( img: BoolTensor<Self>, connectivity: Connectivity, opts: ConnectedStatsOptions, ) -> (IntTensor<Self>, 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]

Source

fn bool_erode( input: BoolTensor<Self>, kernel: BoolTensor<Self>, opts: MorphOptions<Self, Bool>, ) -> BoolTensor<Self>

Erodes an input tensor with the specified kernel.

Source

fn bool_dilate( input: BoolTensor<Self>, kernel: BoolTensor<Self>, opts: MorphOptions<Self, Bool>, ) -> BoolTensor<Self>

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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<B: FusionBackend + BoolVisionOps> BoolVisionOps for Fusion<B>

Source§

impl<E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement> BoolVisionOps for NdArray<E, I, Q>

Source§

impl<R, F, I, BT> BoolVisionOps for CubeBackend<R, F, I, BT>

Implementors§