Skip to main content

ImageOpsPort

Trait ImageOpsPort 

Source
pub trait ImageOpsPort: Send + Sync {
    // Required methods
    fn cvt_color(
        &self,
        src: &dyn MatView,
        conv: ColorConversion,
    ) -> Result<OwnedMatView, ImageOpsError>;
    fn gaussian_blur(
        &self,
        src: &dyn MatView,
        ksize: (u32, u32),
        sigma_x: f64,
        sigma_y: f64,
    ) -> Result<OwnedMatView, ImageOpsError>;
    fn threshold(
        &self,
        src: &dyn MatView,
        thresh: f64,
        max_val: f64,
        kind: ThresholdKind,
    ) -> Result<OwnedMatView, ImageOpsError>;
    fn absdiff(
        &self,
        lhs: &dyn MatView,
        rhs: &dyn MatView,
    ) -> Result<OwnedMatView, ImageOpsError>;
    fn convert_scale_abs(
        &self,
        src: &dyn MatView,
        scale: f64,
        offset: f64,
    ) -> Result<OwnedMatView, ImageOpsError>;
    fn min_max_loc(
        &self,
        src: &dyn MatView,
    ) -> Result<MinMaxResult, ImageOpsError>;
    fn count_non_zero(&self, src: &dyn MatView) -> Result<u64, ImageOpsError>;
    fn resize(
        &self,
        src: &dyn MatView,
        new_width: u32,
        new_height: u32,
    ) -> Result<OwnedMatView, ImageOpsError>;
}
Expand description

Port exposing element-wise and reduction image operations.

Required Methods§

Source

fn cvt_color( &self, src: &dyn MatView, conv: ColorConversion, ) -> Result<OwnedMatView, ImageOpsError>

Convert src between color spaces per ColorConversion.

Source

fn gaussian_blur( &self, src: &dyn MatView, ksize: (u32, u32), sigma_x: f64, sigma_y: f64, ) -> Result<OwnedMatView, ImageOpsError>

Apply a Gaussian blur with the given kernel size and sigmas.

Source

fn threshold( &self, src: &dyn MatView, thresh: f64, max_val: f64, kind: ThresholdKind, ) -> Result<OwnedMatView, ImageOpsError>

Threshold a grayscale image.

Source

fn absdiff( &self, lhs: &dyn MatView, rhs: &dyn MatView, ) -> Result<OwnedMatView, ImageOpsError>

Element-wise absolute difference of two identically shaped images.

Source

fn convert_scale_abs( &self, src: &dyn MatView, scale: f64, offset: f64, ) -> Result<OwnedMatView, ImageOpsError>

Element-wise saturate_u8(|src * scale + offset|).

Source

fn min_max_loc(&self, src: &dyn MatView) -> Result<MinMaxResult, ImageOpsError>

Locate the minimum and maximum pixel values and their first positions.

Source

fn count_non_zero(&self, src: &dyn MatView) -> Result<u64, ImageOpsError>

Count non-zero pixels in a grayscale image.

Source

fn resize( &self, src: &dyn MatView, new_width: u32, new_height: u32, ) -> Result<OwnedMatView, ImageOpsError>

Resize src to the given dimensions.

Implementors§