pub struct Image { /* private fields */ }Expand description
Dense pixels with explicit axis-order and channel-order semantics.
Image composes a Matrix instead of erasing its numeric dtype and
storage behavior. Construction validates all metadata once; the matrix is
thereafter exposed immutably so the image contract cannot be invalidated.
Implementations§
Source§impl Image
impl Image
Sourcepub fn new(
data: Matrix,
layout: ImageLayout,
format: ImageFormat,
) -> Result<Self>
pub fn new( data: Matrix, layout: ImageLayout, format: ImageFormat, ) -> Result<Self>
Attach checked image semantics to a dense matrix.
Zero-sized dimensions are legal. They remain useful for shape propagation and carry no special allocation promise beyond the backing matrix contract.
§Errors
Returns an error when the matrix rank does not match layout, the channel
axis does not match format, or an Hw image is assigned a non-gray
format.
Sourcepub const fn as_matrix(&self) -> &Matrix
pub const fn as_matrix(&self) -> &Matrix
Borrow the backing dense matrix without copying storage.
Sourcepub fn into_matrix(self) -> Matrix
pub fn into_matrix(self) -> Matrix
Remove image semantics and return the backing matrix.
Sourcepub fn batch_size(&self) -> usize
pub fn batch_size(&self) -> usize
Return the batch extent, or one for an unbatched layout.
Sourcepub const fn layout(&self) -> ImageLayout
pub const fn layout(&self) -> ImageLayout
Return the image axis order.
Sourcepub const fn format(&self) -> ImageFormat
pub const fn format(&self) -> ImageFormat
Return the logical channel order.
Source§impl Image
impl Image
Sourcepub fn resize(
&self,
target_width: u32,
target_height: u32,
interpolation: InterpolationMode,
) -> Result<Self>
pub fn resize( &self, target_width: u32, target_height: u32, interpolation: InterpolationMode, ) -> Result<Self>
Resize an FP32 channel-first image while preserving its layout and format.
Delegates to crate::image::resize.
Sourcepub fn crop(&self, x: u32, y: u32, width: u32, height: u32) -> Result<Self>
pub fn crop(&self, x: u32, y: u32, width: u32, height: u32) -> Result<Self>
Extract a region, clipping its right and bottom edges to the source extent.
Delegates to crate::image::crop.
Sourcepub fn flip(&self, horizontal: bool, vertical: bool) -> Result<Self>
pub fn flip(&self, horizontal: bool, vertical: bool) -> Result<Self>
Flip an image horizontally, vertically, or along both axes.
Delegates to crate::image::flip.
Sourcepub fn rotate(&self, degrees: u32) -> Result<Self>
pub fn rotate(&self, degrees: u32) -> Result<Self>
Rotate clockwise by a multiple of 90 degrees.
Delegates to crate::image::rotate.
Sourcepub fn pad(
&self,
left: u32,
right: u32,
top: u32,
bottom: u32,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn pad( &self, left: u32, right: u32, top: u32, bottom: u32, border: BorderMode, border_value: f32, ) -> Result<Self>
Add asymmetric padding with an explicit border policy.
Delegates to crate::image::pad.
Sourcepub fn center_crop(&self, width: u32, height: u32) -> Result<Self>
pub fn center_crop(&self, width: u32, height: u32) -> Result<Self>
Extract a centered region with the requested exact extent.
Delegates to crate::image::center_crop.
Sourcepub fn remap(
&self,
map: &Matrix,
interpolation: InterpolationMode,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn remap( &self, map: &Matrix, interpolation: InterpolationMode, border: BorderMode, border_value: f32, ) -> Result<Self>
Resample an image from an FP32 absolute-coordinate map shaped
Delegates to crate::image::remap.
Sourcepub fn warp_affine(
&self,
transform: &Matrix,
width: u32,
height: u32,
interpolation: InterpolationMode,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn warp_affine( &self, transform: &Matrix, width: u32, height: u32, interpolation: InterpolationMode, border: BorderMode, border_value: f32, ) -> Result<Self>
Apply an inverse FP32 2x3 affine transform to an image.
Delegates to crate::image::warp_affine.
Sourcepub fn warp_perspective(
&self,
transform: &Matrix,
width: u32,
height: u32,
interpolation: InterpolationMode,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn warp_perspective( &self, transform: &Matrix, width: u32, height: u32, interpolation: InterpolationMode, border: BorderMode, border_value: f32, ) -> Result<Self>
Apply an inverse FP32 3x3 perspective transform to an image.
Delegates to crate::image::warp_perspective.
Sourcepub fn threshold_binary(&self, threshold: f32, max_value: f32) -> Result<Self>
pub fn threshold_binary(&self, threshold: f32, max_value: f32) -> Result<Self>
Replace values above threshold with max_value and all others with zero.
Delegates to crate::image::threshold_binary.
Sourcepub fn threshold_binary_inv(
&self,
threshold: f32,
max_value: f32,
) -> Result<Self>
pub fn threshold_binary_inv( &self, threshold: f32, max_value: f32, ) -> Result<Self>
Replace values at or below threshold with max_value and all others with zero.
Delegates to crate::image::threshold_binary_inv.
Sourcepub fn threshold_truncate(&self, threshold: f32) -> Result<Self>
pub fn threshold_truncate(&self, threshold: f32) -> Result<Self>
Truncate values above threshold.
Delegates to crate::image::threshold_truncate.
Sourcepub fn threshold_to_zero(&self, threshold: f32) -> Result<Self>
pub fn threshold_to_zero(&self, threshold: f32) -> Result<Self>
Replace values at or below threshold with zero.
Delegates to crate::image::threshold_to_zero.
Sourcepub fn threshold_to_zero_inv(&self, threshold: f32) -> Result<Self>
pub fn threshold_to_zero_inv(&self, threshold: f32) -> Result<Self>
Replace values above threshold with zero.
Delegates to crate::image::threshold_to_zero_inv.
Sourcepub fn in_range(&self, low: f32, high: f32, true_value: f32) -> Result<Self>
pub fn in_range(&self, low: f32, high: f32, true_value: f32) -> Result<Self>
Produce true_value for values inside the inclusive interval and zero outside it.
Delegates to crate::image::in_range.
Sourcepub fn clamp(&self, low: f32, high: f32) -> Result<Self>
pub fn clamp(&self, low: f32, high: f32) -> Result<Self>
Clamp every pixel to the inclusive interval.
Delegates to crate::image::clamp.
Sourcepub fn invert(&self, max_value: f32) -> Result<Self>
pub fn invert(&self, max_value: f32) -> Result<Self>
Invert every value around max_value.
Delegates to crate::image::invert.
Sourcepub fn brightness_contrast(
&self,
brightness: f32,
contrast: f32,
) -> Result<Self>
pub fn brightness_contrast( &self, brightness: f32, contrast: f32, ) -> Result<Self>
Apply value * contrast + brightness.
Delegates to crate::image::brightness_contrast.
Sourcepub fn gamma_contrast(&self, gamma: f32, gain: f32) -> Result<Self>
pub fn gamma_contrast(&self, gamma: f32, gain: f32) -> Result<Self>
Apply max(value, 0)^gamma * gain.
Delegates to crate::image::gamma_contrast.
Sourcepub fn solarize(&self, threshold: f32, max_value: f32) -> Result<Self>
pub fn solarize(&self, threshold: f32, max_value: f32) -> Result<Self>
Invert values at or above threshold around max_value.
Delegates to crate::image::solarize.
Sourcepub fn posterize(&self, levels: u32, low: f32, high: f32) -> Result<Self>
pub fn posterize(&self, levels: u32, low: f32, high: f32) -> Result<Self>
Quantize [low, high] to levels evenly spaced values using round-half-up.
Delegates to crate::image::posterize.
Sourcepub fn grayscale(&self) -> Result<Self>
pub fn grayscale(&self) -> Result<Self>
Convert an RGB or RGBA image to Rec.709 grayscale.
Delegates to crate::image::grayscale.
Sourcepub fn alpha_blend(&self, right: &Image, alpha: f32) -> Result<Self>
pub fn alpha_blend(&self, right: &Image, alpha: f32) -> Result<Self>
Blend two equal semantic images using left * (1-alpha) + right * alpha.
Delegates to crate::image::alpha_blend.
Sourcepub fn composite(&self, right: &Image, mask: &Image) -> Result<Self>
pub fn composite(&self, right: &Image, mask: &Image) -> Result<Self>
Composite two equal images with a clamped Gray or per-channel mask.
Delegates to crate::image::composite.
Sourcepub fn erase(
&self,
x: u32,
y: u32,
width: u32,
height: u32,
value: f32,
) -> Result<Self>
pub fn erase( &self, x: u32, y: u32, width: u32, height: u32, value: f32, ) -> Result<Self>
Fill the intersection of a rectangle and the image with one finite value.
Delegates to crate::image::erase.
Sourcepub fn color_twist(&self, transform: &Matrix) -> Result<Self>
pub fn color_twist(&self, transform: &Matrix) -> Result<Self>
Apply one shared FP32 [3, 4] affine color transform to RGB channels.
Delegates to crate::image::color_twist.
Sourcepub fn channel_reorder(
&self,
order: [u32; 4],
output_format: ImageFormat,
) -> Result<Self>
pub fn channel_reorder( &self, order: [u32; 4], output_format: ImageFormat, ) -> Result<Self>
Reorder one to four channels and explicitly assign the resulting format.
Delegates to crate::image::channel_reorder.
Sourcepub fn gaussian_noise(&self, mean: f32, stddev: f32, seed: u64) -> Result<Self>
pub fn gaussian_noise(&self, mean: f32, stddev: f32, seed: u64) -> Result<Self>
Add explicit-seed Philox Gaussian noise to every pixel.
Delegates to crate::image::gaussian_noise.
Sourcepub fn salt_pepper_noise(
&self,
probability: f32,
salt_value: f32,
pepper_value: f32,
seed: u64,
) -> Result<Self>
pub fn salt_pepper_noise( &self, probability: f32, salt_value: f32, pepper_value: f32, seed: u64, ) -> Result<Self>
Replace a seeded fraction of pixels with salt or pepper values.
Delegates to crate::image::salt_pepper_noise.
Sourcepub fn convolve_2d(
&self,
kernel: &Matrix,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn convolve_2d( &self, kernel: &Matrix, border: BorderMode, border_value: f32, ) -> Result<Self>
Apply same-shape 2D cross-correlation with an odd FP32 kernel up to 31×31.
Delegates to crate::image::convolve_2d.
Sourcepub fn separable_convolve_2d(
&self,
kernel_x: &Matrix,
kernel_y: &Matrix,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn separable_convolve_2d( &self, kernel_x: &Matrix, kernel_y: &Matrix, border: BorderMode, border_value: f32, ) -> Result<Self>
Apply horizontal and vertical odd FP32 vector kernels up to length 31.
Delegates to crate::image::separable_convolve_2d.
Sourcepub fn average_blur(
&self,
width: u32,
height: u32,
border: BorderMode,
) -> Result<Self>
pub fn average_blur( &self, width: u32, height: u32, border: BorderMode, ) -> Result<Self>
Average an odd rectangular neighborhood up to 31×31.
Delegates to crate::image::average_blur.
Sourcepub fn sobel(&self, dx: u32, dy: u32, border: BorderMode) -> Result<Self>
pub fn sobel(&self, dx: u32, dy: u32, border: BorderMode) -> Result<Self>
Compute one first-order Sobel derivative.
Delegates to crate::image::sobel.
Sourcepub fn scharr(&self, dx: u32, dy: u32, border: BorderMode) -> Result<Self>
pub fn scharr(&self, dx: u32, dy: u32, border: BorderMode) -> Result<Self>
Compute one first-order Scharr derivative.
Delegates to crate::image::scharr.
Sourcepub fn laplacian(&self, border: BorderMode) -> Result<Self>
pub fn laplacian(&self, border: BorderMode) -> Result<Self>
Apply the four-neighbor discrete Laplacian.
Delegates to crate::image::laplacian.
Sourcepub fn erode(
&self,
width: u32,
height: u32,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn erode( &self, width: u32, height: u32, border: BorderMode, border_value: f32, ) -> Result<Self>
Erode with an odd rectangular structuring element up to 31×31.
Delegates to crate::image::erode.
Sourcepub fn dilate(
&self,
width: u32,
height: u32,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn dilate( &self, width: u32, height: u32, border: BorderMode, border_value: f32, ) -> Result<Self>
Dilate with an odd rectangular structuring element up to 31×31.
Delegates to crate::image::dilate.
Sourcepub fn morphology_open(
&self,
width: u32,
height: u32,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn morphology_open( &self, width: u32, height: u32, border: BorderMode, border_value: f32, ) -> Result<Self>
Erode and then dilate with the same rectangular element.
Delegates to crate::image::morphology_open.
Sourcepub fn morphology_close(
&self,
width: u32,
height: u32,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn morphology_close( &self, width: u32, height: u32, border: BorderMode, border_value: f32, ) -> Result<Self>
Dilate and then erode with the same rectangular element.
Delegates to crate::image::morphology_close.
Sourcepub fn morphology_gradient(
&self,
width: u32,
height: u32,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn morphology_gradient( &self, width: u32, height: u32, border: BorderMode, border_value: f32, ) -> Result<Self>
Return dilation minus erosion.
Delegates to crate::image::morphology_gradient.
Sourcepub fn gaussian_blur(&self, sigma: f32, kernel_size: u32) -> Result<Self>
pub fn gaussian_blur(&self, sigma: f32, kernel_size: u32) -> Result<Self>
Apply a normalized Gaussian blur with replicate borders.
Delegates to crate::image::gaussian_blur.
Sourcepub fn sharpen(&self, amount: f32, border: BorderMode) -> Result<Self>
pub fn sharpen(&self, amount: f32, border: BorderMode) -> Result<Self>
Apply a nonnegative four-neighbor sharpening amount.
Delegates to crate::image::sharpen.
Sourcepub fn median_blur(&self, kernel_size: u32, border: BorderMode) -> Result<Self>
pub fn median_blur(&self, kernel_size: u32, border: BorderMode) -> Result<Self>
Select the median of an odd square neighborhood up to 15×15.
Delegates to crate::image::median_blur.
Sourcepub fn bilateral_filter(
&self,
kernel_size: u32,
sigma_color: f32,
sigma_space: f32,
border: BorderMode,
) -> Result<Self>
pub fn bilateral_filter( &self, kernel_size: u32, sigma_color: f32, sigma_space: f32, border: BorderMode, ) -> Result<Self>
Apply a bilateral neighborhood filter.
Delegates to crate::image::bilateral_filter.
Sourcepub fn unsharp_mask(
&self,
sigma: f32,
amount: f32,
kernel_size: u32,
) -> Result<Self>
pub fn unsharp_mask( &self, sigma: f32, amount: f32, kernel_size: u32, ) -> Result<Self>
Apply an unsharp mask using a Gaussian detail estimate.
Delegates to crate::image::unsharp_mask.
Sourcepub fn morphology_top_hat(
&self,
width: u32,
height: u32,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn morphology_top_hat( &self, width: u32, height: u32, border: BorderMode, border_value: f32, ) -> Result<Self>
Return the source minus its morphological opening.
Delegates to crate::image::morphology_top_hat.
Sourcepub fn morphology_black_hat(
&self,
width: u32,
height: u32,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn morphology_black_hat( &self, width: u32, height: u32, border: BorderMode, border_value: f32, ) -> Result<Self>
Return the morphological closing minus the source.
Delegates to crate::image::morphology_black_hat.
Sourcepub fn adaptive_threshold_mean(
&self,
kernel_size: u32,
c: f32,
max_value: f32,
border: BorderMode,
) -> Result<Self>
pub fn adaptive_threshold_mean( &self, kernel_size: u32, c: f32, max_value: f32, border: BorderMode, ) -> Result<Self>
Threshold against the local arithmetic mean minus c.
Delegates to crate::image::adaptive_threshold_mean.
Sourcepub fn adaptive_threshold_gaussian(
&self,
kernel_size: u32,
c: f32,
max_value: f32,
sigma: f32,
border: BorderMode,
) -> Result<Self>
pub fn adaptive_threshold_gaussian( &self, kernel_size: u32, c: f32, max_value: f32, sigma: f32, border: BorderMode, ) -> Result<Self>
Threshold against a local Gaussian-weighted mean minus c.
Delegates to crate::image::adaptive_threshold_gaussian.
Sourcepub fn normalize(&self, parameters: NormalizationConfig) -> Result<Self>
pub fn normalize(&self, parameters: NormalizationConfig) -> Result<Self>
Apply (pixel - mean[channel]) / std[channel] to up to three channels.
Delegates to crate::image::normalize.
Sourcepub fn convert_color(&self, destination_format: ImageFormat) -> Result<Self>
pub fn convert_color(&self, destination_format: ImageFormat) -> Result<Self>
Convert between three-channel RGB and BGR semantics, including identity.
Delegates to crate::image::convert_color.
Sourcepub fn resize_normalize(
&self,
width: u32,
height: u32,
parameters: NormalizationConfig,
) -> Result<Self>
pub fn resize_normalize( &self, width: u32, height: u32, parameters: NormalizationConfig, ) -> Result<Self>
Bilinearly resize and normalize in one semantic and executable operation.
Delegates to crate::image::resize_normalize.
Sourcepub fn segmentation_overlay(
&self,
mask: &Matrix,
palette: &Matrix,
alpha: f32,
) -> Result<Self>
pub fn segmentation_overlay( &self, mask: &Matrix, palette: &Matrix, alpha: f32, ) -> Result<Self>
Blend a class palette over an RGB/RGBA image using an I32 label map.
Delegates to crate::image::segmentation_overlay.
Sourcepub fn calc_hist(&self, bins: u32, lower: f32, upper: f32) -> Result<Matrix>
pub fn calc_hist(&self, bins: u32, lower: f32, upper: f32) -> Result<Matrix>
Accumulate a per-plane histogram over an FP32 NCHW or CHW image.
Delegates to crate::image::calc_hist.
Sourcepub fn equalize_hist(&self) -> Result<Self>
pub fn equalize_hist(&self) -> Result<Self>
Equalize a normalized FP32 image histogram per (batch, channel) plane.
Delegates to crate::image::equalize_hist.
Sourcepub fn pyr_down(&self) -> Result<Self>
pub fn pyr_down(&self) -> Result<Self>
Halve an FP32 image with the pyrDown Gaussian-decimate contract.
Delegates to crate::image::pyr_down.
Sourcepub fn pyr_up(&self) -> Result<Self>
pub fn pyr_up(&self) -> Result<Self>
Double an FP32 image with the pyrUp interpolate-blur contract.
Delegates to crate::image::pyr_up.
Sourcepub fn threshold_auto(
&self,
method: AutoThreshold,
max_value: f32,
) -> Result<(Image, Matrix)>
pub fn threshold_auto( &self, method: AutoThreshold, max_value: f32, ) -> Result<(Image, Matrix)>
Binary-threshold an FP32 image with a histogram-selected level.
Delegates to crate::image::threshold_auto.
Sourcepub fn integral(&self) -> Result<Matrix>
pub fn integral(&self) -> Result<Matrix>
Compute the per-plane summed-area table of an FP32 image.
Delegates to crate::image::integral.
Sourcepub fn cvt_color(&self, conversion: ColorConversion) -> Result<Self>
pub fn cvt_color(&self, conversion: ColorConversion) -> Result<Self>
Convert an FP32 image between color spaces following cvtColor.
Delegates to crate::image::cvt_color.
Sourcepub fn apply_color_map(&self, colormap: ColorMap) -> Result<Self>
pub fn apply_color_map(&self, colormap: ColorMap) -> Result<Self>
Map a single-channel FP32 image to RGB through a colormap.
Delegates to crate::image::apply_color_map.
Sourcepub fn calc_back_project(
&self,
histogram: &Matrix,
lower: f32,
upper: f32,
) -> Result<Self>
pub fn calc_back_project( &self, histogram: &Matrix, lower: f32, upper: f32, ) -> Result<Self>
Back-project a per-plane U32 histogram onto an FP32 image.
Delegates to crate::image::calc_back_project.
Sourcepub fn clahe(
&self,
clip_limit: f32,
tile_width: u32,
tile_height: u32,
) -> Result<Self>
pub fn clahe( &self, clip_limit: f32, tile_width: u32, tile_height: u32, ) -> Result<Self>
Contrast-limited adaptive histogram equalization per plane.
Delegates to crate::image::clahe.
Sourcepub fn accumulate(&self, accumulator: &Image) -> Result<Self>
pub fn accumulate(&self, accumulator: &Image) -> Result<Self>
Add one image to a running accumulation image elementwise,
Delegates to crate::image::accumulate.
Sourcepub fn accumulate_weighted(
&self,
accumulator: &Image,
alpha: f32,
) -> Result<Self>
pub fn accumulate_weighted( &self, accumulator: &Image, alpha: f32, ) -> Result<Self>
Blend an image into a running average as
Delegates to crate::image::accumulate_weighted.
Sourcepub fn moments(&self) -> Result<Matrix>
pub fn moments(&self) -> Result<Matrix>
Compute the ten spatial moments `m00, m10, m01, m20, m11, m02,
Delegates to crate::image::moments.
Sourcepub fn psnr(&self, second: &Image, peak_value: f32) -> Result<Matrix>
pub fn psnr(&self, second: &Image, peak_value: f32) -> Result<Matrix>
Peak signal-to-noise ratio per image plane in decibels,
Delegates to crate::image::psnr.
Sourcepub fn ssim(&self, second: &Image) -> Result<Matrix>
pub fn ssim(&self, second: &Image) -> Result<Matrix>
Global structural similarity per image plane through a serial
Delegates to crate::image::ssim.
Sourcepub fn match_template(
&self,
template: &Image,
method: MatchTemplate,
) -> Result<Matrix>
pub fn match_template( &self, template: &Image, method: MatchTemplate, ) -> Result<Matrix>
Slide a single-plane template over each image plane and write the
Delegates to crate::image::match_template.
Sourcepub fn warp_polar(
&self,
center_x: f32,
center_y: f32,
max_radius: f32,
out_width: u32,
out_height: u32,
mode: PolarMode,
interpolation: InterpolationMode,
border: BorderMode,
border_value: f32,
) -> Result<Self>
pub fn warp_polar( &self, center_x: f32, center_y: f32, max_radius: f32, out_width: u32, out_height: u32, mode: PolarMode, interpolation: InterpolationMode, border: BorderMode, border_value: f32, ) -> Result<Self>
Warp each image plane to polar coordinates about a center, following
Delegates to crate::image::warp_polar.
Sourcepub fn canny(
&self,
low_threshold: f32,
high_threshold: f32,
hysteresis_passes: u32,
) -> Result<Self>
pub fn canny( &self, low_threshold: f32, high_threshold: f32, hysteresis_passes: u32, ) -> Result<Self>
Canny edge detection per plane: 3x3 Sobel gradient magnitude,
Delegates to crate::image::canny.
Sourcepub fn connected_components(
&self,
threshold: f32,
connectivity: Connectivity,
propagation_passes: u32,
) -> Result<Matrix>
pub fn connected_components( &self, threshold: f32, connectivity: Connectivity, propagation_passes: u32, ) -> Result<Matrix>
Connected-component labeling per plane, following
Delegates to crate::image::connected_components.
Sourcepub fn distance_transform(
&self,
threshold: f32,
distance: DistanceType,
propagation_passes: u32,
) -> Result<Matrix>
pub fn distance_transform( &self, threshold: f32, distance: DistanceType, propagation_passes: u32, ) -> Result<Matrix>
Distance transform per plane, following distanceTransform:
Delegates to crate::image::distance_transform.
Sourcepub fn hough_lines(
&self,
edge_threshold: f32,
rho_step: f32,
theta_step: f32,
threshold: u32,
max_lines: u32,
) -> Result<Matrix>
pub fn hough_lines( &self, edge_threshold: f32, rho_step: f32, theta_step: f32, threshold: u32, max_lines: u32, ) -> Result<Matrix>
Standard Hough line transform per plane, following
Delegates to crate::image::hough_lines.
Sourcepub fn hough_lines_p(
&self,
edge_threshold: f32,
rho_step: f32,
theta_step: f32,
threshold: u32,
max_lines: u32,
min_line_length: f32,
max_line_gap: u32,
) -> Result<Matrix>
pub fn hough_lines_p( &self, edge_threshold: f32, rho_step: f32, theta_step: f32, threshold: u32, max_lines: u32, min_line_length: f32, max_line_gap: u32, ) -> Result<Matrix>
Probabilistic Hough segment transform per plane, following
Delegates to crate::image::hough_lines_p.
Sourcepub fn find_contours(
&self,
threshold: f32,
connectivity: Connectivity,
max_contours: u32,
max_points: u32,
propagation_passes: u32,
) -> Result<(Matrix, Matrix)>
pub fn find_contours( &self, threshold: f32, connectivity: Connectivity, max_contours: u32, max_points: u32, propagation_passes: u32, ) -> Result<(Matrix, Matrix)>
External contour extraction per plane, following findContours
Delegates to crate::image::find_contours.
Sourcepub fn flood_fill(
&self,
seed_x: u32,
seed_y: u32,
value: f32,
lo_diff: f32,
up_diff: f32,
connectivity: Connectivity,
propagation_passes: u32,
) -> Result<Self>
pub fn flood_fill( &self, seed_x: u32, seed_y: u32, value: f32, lo_diff: f32, up_diff: f32, connectivity: Connectivity, propagation_passes: u32, ) -> Result<Self>
Floating-range flood fill per plane, following floodFill:
Delegates to crate::image::flood_fill.
Sourcepub fn draw_line(
&self,
x1: f32,
y1: f32,
x2: f32,
y2: f32,
color: f32,
thickness: f32,
) -> Result<Self>
pub fn draw_line( &self, x1: f32, y1: f32, x2: f32, y2: f32, color: f32, thickness: f32, ) -> Result<Self>
Draw a straight segment over a copy of the input, following line:
Delegates to crate::image::draw_line.
Sourcepub fn draw_rectangle(
&self,
x: f32,
y: f32,
width: f32,
height: f32,
color: f32,
thickness: f32,
) -> Result<Self>
pub fn draw_rectangle( &self, x: f32, y: f32, width: f32, height: f32, color: f32, thickness: f32, ) -> Result<Self>
Draw a rectangle border or fill over a copy of the input, following
Delegates to crate::image::draw_rectangle.
Sourcepub fn draw_circle(
&self,
cx: f32,
cy: f32,
radius: f32,
color: f32,
thickness: f32,
) -> Result<Self>
pub fn draw_circle( &self, cx: f32, cy: f32, radius: f32, color: f32, thickness: f32, ) -> Result<Self>
Draw a circle ring or disk over a copy of the input, following
Delegates to crate::image::draw_circle.
Sourcepub fn fill_polygon(&self, points: &Matrix, color: f32) -> Result<Self>
pub fn fill_polygon(&self, points: &Matrix, color: f32) -> Result<Self>
Fill a polygon over a copy of the input, following fillPoly: the
Delegates to crate::image::fill_polygon.
Sourcepub fn corner_score(
&self,
block_size: u32,
k: f32,
score_type: CornerScore,
) -> Result<Self>
pub fn corner_score( &self, block_size: u32, k: f32, score_type: CornerScore, ) -> Result<Self>
Per-pixel corner response over each plane: 3x3 Sobel gradients feed
Delegates to crate::image::corner_score.
Sourcepub fn corner_fast(&self, arc_length: u32) -> Result<Self>
pub fn corner_fast(&self, arc_length: u32) -> Result<Self>
FAST corner response per plane on the radius-3 circle of 16
Delegates to crate::image::corner_fast.
Sourcepub fn good_features_to_track(
&self,
max_corners: u32,
quality: f32,
min_distance: f32,
) -> Result<(Matrix, Matrix)>
pub fn good_features_to_track( &self, max_corners: u32, quality: f32, min_distance: f32, ) -> Result<(Matrix, Matrix)>
Bounded goodFeaturesToTrack selection over a per-plane corner
Delegates to crate::image::good_features_to_track.
Sourcepub fn orb(
&self,
max_features: u32,
quality: f32,
min_distance: f32,
levels: u32,
edge: u32,
) -> Result<(Matrix, Matrix, Matrix)>
pub fn orb( &self, max_features: u32, quality: f32, min_distance: f32, levels: u32, edge: u32, ) -> Result<(Matrix, Matrix, Matrix)>
Bounded ORB keypoint + steered rBRIEF descriptor pipeline,
Delegates to crate::image::orb.
Sourcepub fn optical_flow_pyr_lk(
&self,
next: &Image,
points: &Matrix,
levels: u32,
window: u32,
iterations: u32,
min_eigen: f32,
) -> Result<(Matrix, Matrix, Matrix)>
pub fn optical_flow_pyr_lk( &self, next: &Image, points: &Matrix, levels: u32, window: u32, iterations: u32, min_eigen: f32, ) -> Result<(Matrix, Matrix, Matrix)>
Sparse Lucas-Kanade optical flow with image pyramids,
Delegates to crate::image::optical_flow_pyr_lk.
Sourcepub fn optical_flow_farneback(
&self,
next: &Image,
levels: u32,
window: u32,
iterations: u32,
poly_n: u32,
poly_sigma: f32,
) -> Result<Matrix>
pub fn optical_flow_farneback( &self, next: &Image, levels: u32, window: u32, iterations: u32, poly_n: u32, poly_sigma: f32, ) -> Result<Matrix>
Dense Farneback optical flow over a 2x image pyramid,
Delegates to crate::image::optical_flow_farneback.
Sourcepub fn stereo_bm(
&self,
right: &Image,
num_disparities: u32,
block_size: u32,
uniqueness: u32,
) -> Result<Matrix>
pub fn stereo_bm( &self, right: &Image, num_disparities: u32, block_size: u32, uniqueness: u32, ) -> Result<Matrix>
Block-matching stereo disparity over the horizontal search
Delegates to crate::image::stereo_bm.
Sourcepub fn fast_nl_means_denoising(
&self,
h: f32,
template_window: u32,
search_window: u32,
) -> Result<Self>
pub fn fast_nl_means_denoising( &self, h: f32, template_window: u32, search_window: u32, ) -> Result<Self>
Non-local means denoising over a search window,
Delegates to crate::image::fast_nl_means_denoising.
Sourcepub fn pyr_mean_shift_filtering(
&self,
sp: f32,
sr: f32,
max_level: u32,
) -> Result<Self>
pub fn pyr_mean_shift_filtering( &self, sp: f32, sr: f32, max_level: u32, ) -> Result<Self>
Pyramid mean-shift edge-preserving smoothing, following
Delegates to crate::image::pyr_mean_shift_filtering.