Skip to main content

Crate baracuda_cvcuda

Crate baracuda_cvcuda 

Source
Expand description

Safe Rust wrappers for CV-CUDA (NVCV) — GPU computer-vision primitives.

CV-CUDA is a separately-installed NVIDIA library; this crate wraps the C API surface (not the C++ one). The workhorses are:

  • Resize — bilinear / cubic / area resampling.
  • CvtColor — OpenCV-style colorspace conversion (BGR ↔ RGB ↔ YUV ↔ HSV ↔ grayscale).
  • ConvertTo — dtype reinterpretation with alpha * x + beta.
  • Flip — flip along one or both axes.
  • Normalize(x - base) * scale + shift with optional epsilon (ML normalization).

NVCV tensors are constructed via Tensor::new and reference-counted under the hood; Rust wrappers release their ref on drop.

Modules§

NVCVAdaptiveThresholdType
NVCVAdaptiveThresholdType module.
NVCVBorderType
NVCVBorderType module.
NVCVColorConversionCode
NVCVColorConversionCode — opencv-style color conversion selector. Subset — full enum has ~200 values.
NVCVMorphologyType
NVCVMorphologyType module.
NVCVThresholdType
NVCVThresholdType module.

Structs§

AdaptiveThreshold
Adaptive threshold operator.
AddWeighted
out = α * in1 + β * in2 + γ with saturation.
AdvCvtColor
Advanced colour-space conversion (code + per-frame spec).
AverageBlur
Box / average blur.
BilateralFilter
Bilateral (edge-preserving) filter.
BndBox
Draw bounding boxes on the output image.
BoxFilter
Unnormalized box filter.
BrightnessContrast
Per-channel brightness + contrast adjustment.
Canny
Canny edge detector.
CenterCrop
Center-crop to a target size.
ChannelReorder
Reorder output channels (e.g. BGR→RGB swap).
ColorTwist
Apply a 3×4 / 4×4 color-transform matrix.
Composite
Alpha-mask compositing (out = fg * mask + bg * (1 - mask)).
Conv2D
2D convolution with a user-supplied kernel.
ConvertTo
Convert-to operator (output = alpha * input + beta, with dtype change).
CopyMakeBorder
Constant / reflect / replicate border around input.
CropFlipNormalizeReformat
Fused crop + flip + normalize + layout-reformat — the classic ML video-preproc bundle.
CustomCrop
Arbitrary-rect crop.
CvtColor
Color-conversion operator.
Erase
Erase rectangular regions (random or fixed content).
FindContours
Find contours of binary regions.
Flip
Flip operator. flip_code: 0 = vertical, 1 = horizontal, -1 = both.
GammaContrast
Gamma-correction operator.
Gaussian
Separable Gaussian blur.
GaussianNoise
Gaussian noise.
GuidedFilter
Guided filter — edge-preserving filter that uses guide to steer smoothing of input.
HQResize
High-quality resize for ML preprocessing (separable with anti-aliasing).
HausdorffDistance
Hausdorff distance between two point sets.
Histogram
Compute per-channel histograms.
HistogramEq
Histogram equalization.
Inpaint
Mask-based inpainting.
JointBilateralFilter
Joint bilateral filter — uses a guide image’s edges to preserve structure while smoothing the primary input.
Label
Connected-component labeling.
Laplacian
Laplacian edge filter.
MedianBlur
Median blur.
MinAreaRect
Minimum-area rectangle around each contour.
MinMaxLoc
Find min/max values + locations in a tensor.
Morphology
Erosion / dilation / open / close.
MotionBlur
Directional motion blur.
NVCVFloat2
NVCVFloat2 (FFI binding).
NVCVSize2D
NVCVSize2D (FFI binding).
NonMaxSuppression
Non-maximum suppression over detection boxes + scores.
Normalize
Normalize operator (ML pre-processing: (x - base) * scale + tweaks).
Osd
On-screen display — draw arbitrary text/line/rect overlays.
Pad
Pad an image by top / left border amounts.
PadAndStack
PadAndStack — pad a VarShape batch into a fixed-shape tensor.
PairwiseMatcher
Pairwise feature-descriptor matcher (e.g. for SIFT output).
PillowResize
Pillow-style high-quality resize.
RandomResizedCrop
Random-resized-crop — the PyTorch-style augmentation.
Reformat
Reformat layout (e.g. NHWC → NCHW).
Remap
Remap by sampling a pixel-offset map (optical-flow, undistort).
Resize
Resize operator. Reusable across submissions.
ResizeCropConvertReformat
Fused resize + crop + dtype-convert + layout-reformat.
ResizeVarShape
Resize on a variable-shape image batch (different sizes per item).
RhomboidNoise
Rhomboid noise.
Rotate
Rotate around image center by an angle in degrees.
RotateBatch
Per-frame rotation of a batch tensor.
SaltAndPepperNoise
Salt-and-pepper noise.
Sift
SIFT — scale-invariant feature transform keypoint extractor.
Stack
Stack a VarShape image batch into a single tensor.
Tensor
An NVCV tensor handle. Drop releases the ref.
Threshold
Threshold operator (binary / trunc / tozero / Otsu / triangle).
WarpAffine
2×3 affine warp (output = input @ M).
WarpAffineBatch
Per-frame 2×3 affine warp across a batch tensor.
WarpPerspective
3×3 perspective (projective) warp.

Enums§

Interpolation
Interpolation selector for resampling operators.

Functions§

probe
Verify CV-CUDA is loadable on this host.

Type Aliases§

Error
Error type for CV-CUDA operations.
Result
Result alias.