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§
Sourcefn cvt_color(
&self,
src: &dyn MatView,
conv: ColorConversion,
) -> Result<OwnedMatView, ImageOpsError>
fn cvt_color( &self, src: &dyn MatView, conv: ColorConversion, ) -> Result<OwnedMatView, ImageOpsError>
Convert src between color spaces per ColorConversion.
Sourcefn gaussian_blur(
&self,
src: &dyn MatView,
ksize: (u32, u32),
sigma_x: f64,
sigma_y: f64,
) -> Result<OwnedMatView, ImageOpsError>
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.
Sourcefn threshold(
&self,
src: &dyn MatView,
thresh: f64,
max_val: f64,
kind: ThresholdKind,
) -> Result<OwnedMatView, ImageOpsError>
fn threshold( &self, src: &dyn MatView, thresh: f64, max_val: f64, kind: ThresholdKind, ) -> Result<OwnedMatView, ImageOpsError>
Threshold a grayscale image.
Sourcefn absdiff(
&self,
lhs: &dyn MatView,
rhs: &dyn MatView,
) -> Result<OwnedMatView, ImageOpsError>
fn absdiff( &self, lhs: &dyn MatView, rhs: &dyn MatView, ) -> Result<OwnedMatView, ImageOpsError>
Element-wise absolute difference of two identically shaped images.
Sourcefn convert_scale_abs(
&self,
src: &dyn MatView,
scale: f64,
offset: f64,
) -> Result<OwnedMatView, ImageOpsError>
fn convert_scale_abs( &self, src: &dyn MatView, scale: f64, offset: f64, ) -> Result<OwnedMatView, ImageOpsError>
Element-wise saturate_u8(|src * scale + offset|).
Sourcefn min_max_loc(&self, src: &dyn MatView) -> Result<MinMaxResult, ImageOpsError>
fn min_max_loc(&self, src: &dyn MatView) -> Result<MinMaxResult, ImageOpsError>
Locate the minimum and maximum pixel values and their first positions.
Sourcefn count_non_zero(&self, src: &dyn MatView) -> Result<u64, ImageOpsError>
fn count_non_zero(&self, src: &dyn MatView) -> Result<u64, ImageOpsError>
Count non-zero pixels in a grayscale image.
Sourcefn resize(
&self,
src: &dyn MatView,
new_width: u32,
new_height: u32,
) -> Result<OwnedMatView, ImageOpsError>
fn resize( &self, src: &dyn MatView, new_width: u32, new_height: u32, ) -> Result<OwnedMatView, ImageOpsError>
Resize src to the given dimensions.