Expand description
Image processing primitives for yscv.
Structs§
- BBox
- Axis-aligned bounding box. Bounding box with confidence for NMS.
- Brief
Descriptor - 256-bit BRIEF binary descriptor. BRIEF descriptor: 256-bit binary descriptor stored as 32 bytes.
- Camera
Intrinsics - Camera intrinsic parameters (fx, fy, cx, cy, distortion coefficients). Camera intrinsic parameters including radial and tangential distortion coefficients.
- Canny
Scratch - Pre-allocated scratch buffers for
canny_with_scratch. Canny edge detection on a single-channel HWC image. - Component
Stats - 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.
- Draw
Detection - Detection result for drawing (bounding box, label, confidence). A detection result for drawing purposes.
- Farneback
Config - Configuration for Farneback dense optical flow. Configuration for Farneback dense optical flow.
- Harris
Keypoint - Harris corner keypoint with location and response strength. Detected corner/interest point.
- Hough
Line - Hough line in (rho, theta) form. Detected line in Hough parameter space.
- Image
F32 - 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.
- Region
Prop - Properties of a labeled image region. Properties for a labelled region.
- Stereo
Config - Configuration for stereo block matching. Configuration for stereo block matching.
- Surf
Keypoint - SURF keypoint. SURF keypoint with position, scale, orientation, and response.
- Template
Match Result - Result of template matching (location + score). Template matching result: top-left location and score.
Enums§
- ImgProc
Error - Template
Match Method - Method selection for template matching. Template matching method.
Constants§
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_threshandhigh_threshare 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 tosize × 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 (dilatefollowed byerode) 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. ReturnsVec<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. ReturnsVec<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]f32tensor 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]f32tensor with values in[0, 1]. - imwrite
- Write an
ImageU8to a file. Format inferred from extension (png, jpg, bmp, etc.). Write a[H, W, C]f32tensor (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.meanandstdslices must have length equal toC. 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 (erodefollowed bydilate) 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 magnitudesqrt(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. Slidestemplateoverimagecomputing 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: outputsmax_valwhere value > threshold, else0.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: outputs0.0where value > threshold, elsemax_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 abovethreshold. - 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§
- Surf
Descriptor - SURF descriptor. SURF descriptor (64-element vector).