Skip to main content

Crate yscv_imgproc

Crate yscv_imgproc 

Source
Expand description

Image processing primitives for yscv.

Structs§

BBox
Axis-aligned bounding box. Bounding box with confidence for NMS.
BriefDescriptor
256-bit BRIEF binary descriptor. BRIEF descriptor: 256-bit binary descriptor stored as 32 bytes.
CameraIntrinsics
Camera intrinsic parameters (fx, fy, cx, cy, distortion coefficients). Camera intrinsic parameters including radial and tangential distortion coefficients.
CannyScratch
Pre-allocated scratch buffers for canny_with_scratch. Canny edge detection on a single-channel HWC image.
ComponentStats
Statistics for a connected component region. Statistics for a single connected component.
Contour
Contour represented as a sequence of (row, col) points. A contour as an ordered list of (x, y) boundary pixel coordinates.
DrawDetection
Detection result for drawing (bounding box, label, confidence). A detection result for drawing purposes.
FarnebackConfig
Configuration for Farneback dense optical flow. Configuration for Farneback dense optical flow.
HarrisKeypoint
Harris corner keypoint with location and response strength. Detected corner/interest point.
HoughLine
Hough line in (rho, theta) form. Detected line in Hough parameter space.
ImageF32
HWC f32 image wrapper: (width, height, channels, Vec<f32>). Simple f32 image wrapper (HWC layout, row-major). Zero overhead.
ImageU8
HWC u8 image wrapper: (width, height, channels, Vec<u8>). Simple u8 image wrapper (HWC layout, row-major).
Keypoint
Detected keypoint with location, response, and scale. A detected keypoint with orientation and scale information.
OrbConfig
Configuration for ORB feature detector. Configuration for the ORB feature detector.
OrbDescriptor
ORB binary descriptor (256-bit). ORB descriptor: 256-bit binary descriptor stored as 32 bytes.
OrbFeature
Combined ORB keypoint + descriptor. ORB feature: oriented FAST keypoint paired with a rotated BRIEF descriptor.
RegionProp
Properties of a labeled image region. Properties for a labelled region.
StereoConfig
Configuration for stereo block matching. Configuration for stereo block matching.
SurfKeypoint
SURF keypoint. SURF keypoint with position, scale, orientation, and response.
TemplateMatchResult
Result of template matching (location + score). Template matching result: top-left location and score.

Enums§

ImgProcError
TemplateMatchMethod
Method selection for template matching. Template matching method.

Constants§

CRATE_ID

Functions§

adaptive_threshold_gaussian
Adaptive threshold using Gaussian-weighted local mean. Input: [H, W] grayscale. Adaptive threshold using a Gaussian-weighted local window.
adaptive_threshold_mean
Adaptive threshold using box-filter local mean. Input: [H, W] grayscale. Adaptive threshold using a local mean window.
add_weighted
Alpha-blend two images with weights. Input: [H, W, C] f32. Alpha-blend two images: dst = alpha * a + beta * b + gamma.
adjust_gamma
Gamma correction. Input: [H, W] or [H, W, C]. Applies gamma correction to each pixel: pixel^gamma.
adjust_log
Logarithmic intensity adjustment. Applies logarithmic transform: log(1 + pixel), normalized to [0, 1].
approx_poly_dp
Approximate a contour with fewer vertices (Ramer-Douglas-Peucker). Douglas-Peucker contour approximation.
arc_length
Compute the arc length (perimeter) of a contour. Computes the perimeter (arc length) of a contour.
bilateral_filter
Edge-preserving bilateral filter. Input: [H, W] or [H, W, C]. Bilateral filter on a single-channel [H, W, 1] image.
bilateral_filter_u8
Bilateral filter on u8 image. Bilateral filter operating directly on u8 pixel data.
bitwise_and
Bitwise AND of two binary/grayscale images. Elementwise AND of two single-channel binary masks.
bitwise_not
Bitwise NOT of a binary/grayscale image. Elementwise NOT of a single-channel binary mask.
bitwise_or
Bitwise OR of two binary/grayscale images. Elementwise OR of two single-channel binary masks.
blob_log
Laplacian-of-Gaussian blob detection. Input: [H, W] grayscale. Laplacian-of-Gaussian blob detection on a grayscale [H, W, 1] image.
bounding_rect
Compute the bounding rectangle of a contour. Computes the axis-aligned bounding rectangle of a contour.
box_blur_3x3
3x3 box blur (mean filter). Input: [H, W] or [H, W, C] f32. Applies zero-padded 3x3 box blur over each channel.
box_blur_3x3_f32
3x3 box blur on f32 image. 3x3 box blur on single-channel f32 image. Direct [1,1,1]x[1,1,1]/9 kernel. Replicate border.
box_blur_3x3_u8
3x3 box blur on u8 image. 3x3 box blur on single-channel u8 image. Direct single-pass approach using vextq for horizontal shifts (no intermediate buffer). Division by 9: (sum * 3641 + 16384) >> 15 (3641/32768 ≈ 1/9.005). Edge pixels use replicate (clamp) border.
build_integral_image
Build integral image (summed area table) for SURF. Build integral image for fast box filter computation.
canny
Canny edge detector. Input: [H, W] grayscale f32, thresholds in image intensity range. Returns binary edge map [H, W] with edges = 1.0.
canny_u8
Canny edge detection on u8 grayscale image. Canny edge detection on single-channel u8 image. Full pipeline: Gaussian blur → Sobel L1 magnitude + direction → NMS + threshold → iterative hysteresis. low_thresh and high_thresh are in [0, 255].
canny_with_scratch
Canny edge detection with pre-allocated scratch buffers for zero-alloc hot paths. Canny edge detection with reusable scratch buffers.
center_crop
Center crop to target size. Input: [H, W, C] or [H, W]. Center-crop an [H, W, C] image to size × size.
chw_to_hwc
Convert CHW tensor layout to HWC. Convert an image from [C, H, W] (CHW) layout to [H, W, C] (HWC) layout.
clahe
Contrast-limited adaptive histogram equalization. Input: [H, W] grayscale. Applies CLAHE to a grayscale [H, W, 1] image.
clahe_u8
CLAHE on u8 grayscale image. CLAHE operating entirely in u8 domain — no float conversion in the hot loop.
closing_3x3
Morphological closing (dilate then erode) with 3x3 structuring element. Input: [H, W] grayscale f32. Applies a 3x3 closing (dilate followed by erode) per channel.
color_jitter
Random color jitter augmentation (brightness, contrast, saturation, hue). Apply random color jitter: brightness, contrast, saturation, hue adjustments.
compute_brief
Compute BRIEF binary descriptors at given keypoints. Input: [H, W] grayscale. Compute BRIEF descriptors for keypoints on a grayscale [H, W, 1] image.
compute_gradient_orientation
Compute gradient orientation from Sobel gradients. Computes image gradients and orientation for descriptor construction. Returns a gradient magnitude + orientation pair per pixel.
compute_surf_descriptors
Compute SURF descriptors at detected keypoints. Compute SURF descriptors for detected keypoints.
connected_components_4
4-connected component labeling. Input: [H, W] binary. Connected-component labeling on a binary single-channel HWC image (4-connectivity).
connected_components_with_stats
Connected components with statistics (area, bounding box, centroid). Connected-component labelling with per-component statistics.
contour_area
Compute contour area (signed, using shoelace formula). Computes the area of a polygon defined by its vertices using the Shoelace formula.
convex_hull
Compute the convex hull of a set of 2D points. Computes the convex hull of 2D points using Andrew’s monotone chain algorithm.
corner_sub_pix
Sub-pixel corner refinement. Refines corner locations to sub-pixel accuracy using gradient-based method.
crop
Crop a region from an image tensor. Input: [H, W, C] or [H, W]. Crops an HWC tensor to [crop_h, crop_w, C] starting at (top, left).
dense_optical_flow
Dense optical flow (Farneback method). Input: two consecutive [H, W] grayscale frames. Dense optical flow estimation between two grayscale [H,W,1] frames.
detect_orb
Detect ORB features (keypoints + descriptors). Input: [H, W] grayscale f32. Returns Vec<OrbFeature>. Detect ORB features: oriented FAST keypoints + rotated BRIEF descriptors.
detect_surf_keypoints
Detect SURF keypoints using fast Hessian response. Detect SURF keypoints using box-filter approximation of Hessian.
dilate
Morphological dilation with arbitrary structuring element. Dilate a single-channel [H, W, 1] image with an arbitrary structuring element.
dilate_3x3
Morphological dilation with 3x3 square structuring element. Input: [H, W] grayscale f32. Applies a 3x3 grayscale/RGB dilation (local maximum per channel).
dilate_3x3_f32
3x3 dilation on f32 image. 3x3 dilation (max) on single-channel f32 image.
dilate_3x3_u8
3x3 dilation on u8 image. 3x3 dilation on single-channel u8 image.
distance_transform
Euclidean distance transform. Input: [H, W] binary f32. L1 distance transform on a binary single-channel [H, W, 1] image.
distance_transform_u8
Distance transform on u8 binary image. L1 distance transform on binary u8 image. Non-zero pixels get distance 0, zero pixels get the L1 distance to the nearest non-zero pixel. Returns result as a flat Vec<u16> (max distance = h + w).
draw_circle
Draw a circle on a u8 image. Draw a circle using the midpoint circle algorithm on a [H, W, 3] image tensor.
draw_detections
Draw detection boxes with labels on a u8 image. Draw detections (bounding boxes + labels) on a [H, W, 3] image tensor.
draw_line
Draw a line on a u8 image. Draw a line using Bresenham’s algorithm on a [H, W, 3] image tensor.
draw_polylines
Draw polylines on a u8 image. Draw connected line segments on a [H, W, 3] image tensor.
draw_rect
Draw a rectangle on a u8 image. Draw a rectangle on a [H, W, 3] image tensor (values [0, 1]).
draw_text
Draw text on a u8 image. Draw text on a [H, W, 3] image tensor using an embedded 8×8 bitmap font.
draw_text_scaled
Draw scaled text on a u8 image. Draw text with integer scaling (nearest-neighbor scaled 8x8 bitmap font).
elastic_transform
Elastic deformation augmentation. Elastic distortion transform.
erode
Morphological erosion with arbitrary structuring element. Erode a single-channel [H, W, 1] image with an arbitrary structuring element.
erode_3x3
Morphological erosion with 3x3 square structuring element. Input: [H, W] grayscale f32. Applies a 3x3 grayscale/RGB erosion (local minimum per channel).
erode_3x3_u8
3x3 erosion on u8 image. 3x3 erosion on single-channel u8 image.
farneback_flow
Farneback dense optical flow between two frames. Compute dense optical flow using Farneback’s polynomial expansion method.
fast9_detect
FAST-9 corner detector. Input: [H, W] f32 grayscale. Returns Vec<Keypoint> of detected corners above the threshold. FAST-9 corner detection on a single-channel [H, W, 1] image.
fast9_detect_u8
FAST-9 corner detection on u8 grayscale image. FAST-9 corner detection on u8 single-channel image. Returns keypoints as (x, y) coordinates.
fast_corners
FAST corner detection (configurable arc length). FAST-9 corner detector on a single-channel [H, W, 1] image.
fill_poly
Fill a polygon region on a u8 image. Fill a polygon using scanline fill on a [H, W, 3] image tensor.
filter2d
Generic 2D convolution with a custom kernel. 2D convolution of a single-channel [H, W, 1] image with an arbitrary kernel [KH, KW, 1].
find_contours
Find contours in a binary image. Input: [H, W] binary. Finds external contours in a binary single-channel [H, W, 1] image.
fit_ellipse
Fit an ellipse to a set of 2D points (least-squares). Fits an axis-aligned ellipse to a set of 2D points using the method of moments.
flip_horizontal
Flip image horizontally. Input: [H, W, C] or [H, W]. Flips an HWC tensor horizontally (mirror over vertical axis).
flip_vertical
Flip image vertically. Input: [H, W, C] or [H, W]. Flips an HWC tensor vertically (mirror over horizontal axis).
gaussian_blur_3x3
3x3 Gaussian blur (sigma approx 0.85). Input: [H, W] or [H, W, C] f32. Applies zero-padded 3x3 Gaussian blur per channel. Kernel: [[1,2,1],[2,4,2],[1,2,1]] / 16.
gaussian_blur_3x3_f32
3x3 Gaussian blur on f32 image. 3x3 Gaussian blur on single-channel f32 image. Direct [1,2,1]x[1,2,1]/16 kernel. Replicate border.
gaussian_blur_3x3_u8
3x3 Gaussian blur on u8 image. 3x3 Gaussian blur on single-channel u8 image. Uses [1,2,1] separable kernel with u16 intermediate. Tiled processing: H-pass and V-pass are fused within tiles of 8 rows, so the u16 tile buffer (10 rows * w * 2 bytes) fits in L1 cache. Rayon parallelism across tiles when image is large enough.
gaussian_blur_5x5
5x5 Gaussian blur (sigma approx 1.0). Input: [H, W] or [H, W, C] f32. Applies zero-padded 5x5 Gaussian blur per channel.
gaussian_pyramid
Gaussian image pyramid (successive half-resolution blurred images). Builds a Gaussian image pyramid by repeated 2x downsampling.
good_features_to_track
Shi-Tomasi / Good Features to Track corner detector. Shi-Tomasi corner detection (minimum eigenvalue approach).
grayscale_f32
Convert f32 RGB image to grayscale. Converts RGB f32 image [H,W,3] to grayscale [H,W,1]. Uses BT.601: gray = 0.299R + 0.587G + 0.114*B.
grayscale_u8
Convert u8 RGB image to grayscale.
hamming_distance
Hamming distance between two binary descriptors. Hamming distance between two BRIEF descriptors.
harris_corners
Harris corner detector. Input: [H, W] grayscale f32. Returns corner response map [H, W]. Harris corner detector on a single-channel [H, W, 1] image.
harris_corners_u8
Harris corner detection on u8 image. Harris corner detection operating directly on u8 grayscale image data.
histogram_256
Compute 256-bin grayscale histogram. Input: [H, W] f32 with values in [0, 255]. Computes a 256-bin histogram for a single-channel [H, W, 1] image. Assumes values in [0, 1] range.
histogram_equalize
Histogram equalization. Input: [H, W] grayscale. Histogram equalization for single-channel [H, W, 1] images with values in [0, 1].
histogram_u8
Compute 256-bin histogram from u8 grayscale data. Computes a 256-bin histogram from raw u8 data.
hog_cell_descriptor
HOG (Histogram of Oriented Gradients) cell descriptor. Histogram of Oriented Gradients (HOG) descriptor for a single cell.
homography_4pt
Compute 4-point homography (direct linear transform). Computes a 3x3 homography matrix from 4 source/destination point correspondences using the Direct Linear Transform (DLT) algorithm.
hough_circles
Hough circle detection. Input: [H, W] edge/binary image. Hough circle transform on a binary/edge single-channel [H, W, 1] image.
hough_lines
Hough line detection. Input: [H, W] edge/binary image. Standard Hough line transform on a binary/edge single-channel [H, W, 1] image.
hsv_to_rgb
Convert HSV to RGB. Input/output: [H, W, 3] f32. Converts HSV [H, W, 3] to RGB [H, W, 3]. Expects H in [0, 1], S in [0, 1], V in [0, 1].
hu_moments
Compute Hu’s seven moment invariants from a binary/grayscale image. Computes the 7 Hu invariant moments from a single-channel [H, W, 1] image.
hwc_to_chw
Convert HWC tensor layout to CHW. Convert an image from [H, W, C] (HWC) layout to [C, H, W] (CHW) layout.
imagenet_preprocess
ImageNet-standard preprocessing (resize 256, center crop 224, normalize). Standard ImageNet preprocessing pipeline.
imread
Read an image file as ImageU8. Supports PNG, JPEG, BMP, GIF, TIFF, WebP. Read an image from disk and return it as a [H, W, C] f32 tensor with values in [0, 1].
imread_gray
Read an image file as grayscale ImageU8. Read an image as grayscale and return it as a [H, W, 1] f32 tensor with values in [0, 1].
imwrite
Write an ImageU8 to a file. Format inferred from extension (png, jpg, bmp, etc.). Write a [H, W, C] f32 tensor (values in [0, 1]) to disk.
in_range
Check if pixel values fall within a per-channel range. Create a binary mask where each pixel is 1.0 if all channels are within [lower, upper] (inclusive), 0.0 otherwise.
inpaint_telea
Inpaint missing regions using Telea’s fast marching method. Telea-style fast marching inpainting.
integral_image
Compute integral image (summed area table). Input: [H, W]. Computes the integral (summed-area table) image from a [H, W, 1] tensor.
lab_to_rgb
Convert CIE Lab* to RGB. Input/output: [H, W, 3]. Converts CIE LAB [H, W, 3] to RGB [H, W, 3].
laplacian_3x3
3x3 Laplacian filter. Input: [H, W] grayscale f32. Applies 3x3 Laplacian edge detection per channel.
lucas_kanade_optical_flow
Lucas-Kanade sparse optical flow. Sparse Lucas-Kanade optical flow between two grayscale [H,W,1] frames.
match_features
Match feature descriptors between two sets by brute-force nearest neighbor. Match ORB features between two sets using brute-force Hamming distance.
match_surf_descriptors
Match two sets of SURF descriptors. Match SURF descriptors between two sets using nearest-neighbor ratio test.
median_blur_3x3
3x3 median blur. Input: [H, W] or [H, W, C] f32. Applies 3x3 median filter per channel.
median_blur_3x3_u8
3x3 median blur on u8 image. 3x3 median filter on single-channel u8 image. 3x3 median blur on single-channel u8 image. Uses a SIMD sorting network (NEON) to find the median of 9 elements, processing 16 pixels at a time. Scalar fallback for non-NEON and border pixels.
median_filter
Median filter with arbitrary window size. Applies NxN median filter on a single-channel [H, W, 1] image.
min_area_rect
Minimum area rotated rectangle of a set of 2D points. Computes the minimum-area bounding rectangle for a set of 2D points using the rotating calipers approach on the convex hull.
morph_blackhat
Morphological black-hat transform (closing - input). Black-hat transform: closing(input) - input.
morph_gradient_3x3
Morphological gradient (dilation - erosion) with 3x3 element. Applies a 3x3 morphological gradient (dilate - erode) per channel.
morph_tophat
Morphological top-hat transform (input - opening). Top-hat transform: input - opening(input).
nms
Non-maximum suppression on bounding boxes by IoU threshold. Greedy non-maximum suppression on bounding boxes.
normalize
Normalize image channels: (pixel - mean) / std. Input: [H, W, C] f32. mean and std slices must have length equal to C. Per-channel normalize in HWC layout: (x - mean[c]) / std[c].
normalize_image
Normalize u8 image to [0, 1] f32 then apply mean/std normalization. Per-channel normalization: (pixel - mean[c]) / std[c] for an HWC image.
opening_3x3
Morphological opening (erode then dilate) with 3x3 structuring element. Input: [H, W] grayscale f32. Applies a 3x3 opening (erode followed by dilate) per channel.
orb_descriptors
Compute ORB descriptors at given keypoints. Computes ORB descriptors for keypoints on a grayscale [H,W,1] image.
orb_hamming_distance
Hamming distance between two ORB descriptors. Hamming distance between two ORB descriptors.
orb_match
Match ORB features between two sets. Brute-force ORB descriptor matching. Returns (idx_a, idx_b, distance).
pad_constant
Pad image borders with a constant value. Pads an HWC tensor with a constant value on all sides.
project_points
Project 3D points to 2D using camera intrinsics. Project 3-D world points to 2-D pixel coordinates using a pinhole camera model (no extrinsic rotation/translation — assumes camera-frame coordinates).
random_crop
Random crop augmentation. Randomly crop a [H, W, C] image to (out_h, out_w).
random_erasing
Random erasing (cutout) augmentation. Random erasing (cutout): randomly erase a rectangular region with probability p.
random_horizontal_flip
Random horizontal flip augmentation (50% probability). Randomly flip horizontally with probability p.
random_rotation
Random rotation augmentation. Rotate image by a random angle in [-max_degrees, max_degrees].
random_vertical_flip
Random vertical flip augmentation (50% probability). Randomly flip vertically with probability p.
ransac_homography
Estimate homography via RANSAC. RANSAC-based homography estimation from point correspondences.
region_props
Compute region properties (area, centroid, bbox) from a labeled image. Compute region properties from a label image.
remove_small_objects
Remove small connected components below a size threshold. Removes connected components with area less than min_size.
rescale_intensity
Rescale intensity to [0, 1] or a target range. Linearly rescales pixel intensities from [in_min, in_max] to [out_min, out_max].
resize_bilinear
Resize using bilinear interpolation. Input: [H, W, C] or [H, W] f32. Resizes HWC tensor with bilinear interpolation.
resize_bilinear_u8
Bilinear resize on u8 image. Bilinear resize on u8 image [H,W,C] to target dimensions. Uses fixed-point arithmetic (8-bit fractional) for speed. Single-channel: NEON gather + blend, 8 pixels at a time. Multi-channel: separable H-pass (scalar gather into u16 buf) then NEON-vectorized V-pass on contiguous data, with row caching.
resize_nearest
Resize using nearest-neighbor interpolation. Input: [H, W, C] or [H, W] f32. Resizes HWC tensor with nearest-neighbor sampling.
resize_nearest_u8
Nearest-neighbor resize on u8 image. Nearest-neighbour resize on u8 image [H,W,C] to target dimensions.
rgb_to_bgr
Convert RGB to BGR channel order. Input/output: [H, W, 3]. Converts RGB [H, W, 3] to BGR [H, W, 3] (channel swap).
rgb_to_grayscale
Convert RGB to grayscale using ITU-R BT.601 luminance weights. Input: [H, W, 3], output: [H, W]. Converts RGB image [H, W, 3] to grayscale [H, W, 1].
rgb_to_hsv
Convert RGB to HSV color space. Input/output: [H, W, 3] f32. Converts RGB [H, W, 3] to HSV [H, W, 3]. H is in [0, 1] (scaled from [0, 360]), S and V are in [0, 1].
rgb_to_hsv_u8
RGB to HSV conversion on u8 image. Converts RGB u8 image to HSV u8 image.
rgb_to_lab
Convert RGB to CIE Lab*. Input/output: [H, W, 3]. Converts RGB [H, W, 3] to CIE LAB [H, W, 3].
rgb_to_yuv
Convert RGB to YUV. Input/output: [H, W, 3]. Converts RGB [H, W, 3] to YUV [H, W, 3] using BT.601 coefficients.
rotate90_cw
Rotate image 90 degrees clockwise. Rotates an HWC tensor 90 degrees clockwise.
scharr_3x3_gradients
3x3 Scharr gradient (dx, dy). Input: [H, W] grayscale. Computes 3x3 Scharr gradients (gx, gy) per channel.
scharr_3x3_magnitude
3x3 Scharr gradient magnitude. Input: [H, W] grayscale. Computes the Scharr gradient magnitude: sqrt(gx^2 + gy^2).
sift_descriptor
Compute SIFT-style descriptor at a keypoint. SIFT-like 128-element descriptor for a keypoint on a grayscale [H,W,1] image.
sift_match
Match SIFT descriptors. Matches SIFT descriptors using Euclidean distance with Lowe’s ratio test.
skeletonize
Morphological skeletonization. Input: [H, W] binary. Zhang-Suen thinning algorithm on a binary single-channel [H, W, 1] image.
sobel_3x3_f32
3x3 Sobel gradient magnitude on f32 image. 3x3 Sobel gradient magnitude on single-channel f32 image. Returns |Gx| + |Gy| approximation. Border pixels are zero.
sobel_3x3_gradients
3x3 Sobel gradient (dx, dy). Input: [H, W] grayscale f32. Computes 3x3 Sobel gradients (gx, gy) per channel.
sobel_3x3_magnitude
3x3 Sobel gradient magnitude. Input: [H, W] grayscale f32. Computes 3x3 Sobel gradient magnitude sqrt(gx^2 + gy^2) per channel.
sobel_3x3_magnitude_u8
3x3 Sobel gradient magnitude on u8 image. 3x3 Sobel gradient magnitude on single-channel u8 image. Returns gradient magnitude clamped to [0, 255].
stereo_block_matching
Stereo block matching for disparity estimation. Compute a disparity map from a rectified stereo pair using block matching (SAD).
template_match
Template matching. Input: [H, W] image and [TH, TW] template. Slides template over image computing a similarity map, returns the best match.
threshold_binary
Binary threshold: output 1.0 where input >= thresh, else 0.0. Input: [H, W]. Binary threshold: outputs max_val where value > threshold, else 0.0.
threshold_binary_f32
Binary threshold on f32 image. Binary threshold on single-channel f32 image. Pixels > thresh become max_val, otherwise 0.
threshold_binary_inv
Inverse binary threshold: output 1.0 where input < thresh. Input: [H, W]. Inverse binary threshold: outputs 0.0 where value > threshold, else max_val.
threshold_otsu
Otsu’s automatic threshold. Input: [H, W] grayscale with values in [0, 255]. Otsu threshold for single-channel [H, W, 1] images. Returns (threshold, thresholded_image).
threshold_truncate
Truncate threshold: clamp values above thresh. Input: [H, W]. Truncate threshold: caps values above threshold.
triangulate_points
Triangulate 3D points from two camera views. Triangulate 3-D points from corresponding 2-D observations in a rectified stereo pair.
undistort_points
Undistort 2D points using camera intrinsics. Remove lens distortion from a set of 2-D pixel coordinates.
warp_affine
Apply an affine warp transform. Input: [H, W, C] or [H, W]. Applies a 2x3 affine transformation to an HWC image using bilinear interpolation.
warp_perspective
Apply a perspective warp (homography). Input: [H, W, C] or [H, W]. Applies a 3x3 perspective (homography) transformation to an [H, W, C] image.
warp_perspective_u8
Perspective warp on u8 image. Warp u8 single-channel image using a 3x3 homography matrix. Uses bilinear interpolation. Out-of-bounds pixels are set to 0.
watershed
Watershed segmentation. Input: [H, W] grayscale, markers: [H, W] integer labels. Marker-based watershed segmentation on a grayscale [H,W,1] image.
yuv_to_rgb
Convert YUV to RGB. Input/output: [H, W, 3]. Converts YUV [H, W, 3] to RGB [H, W, 3] using BT.601 coefficients.

Type Aliases§

SurfDescriptor
SURF descriptor. SURF descriptor (64-element vector).