Expand description
Video alignment and registration tools for multi-camera synchronization in OxiMedia.
This crate provides comprehensive tools for aligning and registering video from multiple cameras:
§Temporal Alignment
The temporal module provides time-based synchronization:
- Audio Cross-Correlation - Sync cameras using audio tracks
- Timecode Synchronization - LTC/VITC-based alignment
- Visual Markers - Clapper detection and flash-based sync
- Sub-frame Accuracy - Precise timing down to microseconds
§Spatial Registration
The spatial module provides geometric alignment:
- Homography Estimation - Planar perspective transformation
- Perspective Correction - Remove keystone distortion
- Feature Matching - Correspond points between views
- RANSAC - Robust outlier rejection
§Feature Detection
The features module provides patent-free feature detection and matching:
- FAST Corners - High-speed corner detection
- BRIEF Descriptors - Binary robust independent elementary features
- ORB Features - Oriented FAST and Rotated BRIEF
- Brute-Force Matching - Hamming distance matching
§Lens Distortion
The distortion module corrects lens aberrations:
- Brown-Conrady Model - Radial and tangential distortion
- Fisheye Model - Wide-angle lens correction
- Calibration - Camera intrinsic parameter estimation
- Undistortion - Real-time image correction
§Color Matching
The color module matches color across cameras:
- Color Transfer - Match color distributions
- Histogram Matching - Equalize color histograms
- White Balance - Illuminant estimation
- Color Calibration - ColorChecker-based calibration
§Sync Markers
The markers module detects synchronization markers:
- Clapper Detection - Automatic slate detection
- Flash Detection - Bright flash sync
- LED Markers - Coded light patterns
- Audio Spike - Sharp transient detection
§Rolling Shutter
The rolling_shutter module corrects rolling shutter artifacts:
- Motion Estimation - Per-scanline motion vectors
- Correction - Remove wobble and skew
- Global Shutter Simulation - Temporal interpolation
§Example: Audio-Based Sync
use oximedia_align::temporal::{AudioSync, SyncConfig};
use oximedia_align::AlignResult;
// Configure audio synchronization
let config = SyncConfig {
sample_rate: 48000,
window_size: 480000, // 10 seconds
max_offset: 240000, // ±5 seconds
};
// Create audio sync analyzer
let sync = AudioSync::new(config);
// Find offset between two audio tracks
// let offset = sync.find_offset(&audio1, &audio2)?;§Example: Homography Estimation
use oximedia_align::spatial::{HomographyEstimator, RansacConfig};
use oximedia_align::features::{FeatureMatcher, MatchPair};
// Configure RANSAC for robust estimation
let config = RansacConfig {
threshold: 3.0,
max_iterations: 1000,
min_inliers: 8,
};
let estimator = HomographyEstimator::new(config);
// Estimate homography from matched points
// let (homography, inliers) = estimator.estimate(&matches)?;Modules§
- affine
- Affine transformation for image alignment.
- align_
report - Alignment quality reporting and diagnostics.
- audio_
align - Audio-to-video alignment utilities.
- beat_
align - Beat-grid alignment for music and rhythmic media synchronisation.
- color
- Color matching and calibration for multi-camera alignment.
- confidence_
map - Alignment confidence and quality mapping.
- distortion
- Lens distortion correction.
- drift_
correct - Clock drift correction using PLL-based techniques.
- drift_
correction - Long-form timing drift correction.
- elastic_
align - Elastic (non-rigid) alignment for deformable media registration.
- farneback_
flow - Dense optical flow using the Farneback polynomial expansion method.
- features
- Patent-free feature detection and matching.
- frame_
matcher - Frame-level descriptor matching for video alignment in
OxiMedia. - frequency_
align - Frequency-domain alignment for audio and video streams.
- gradient_
flow - Gradient-based optical flow for video alignment.
- icp
- Iterative Closest Point (ICP) algorithm for point cloud / contour alignment.
- klt_
tracker - Kanade-Lucas-Tomasi (KLT) sparse optical flow tracker.
- lip_
sync - Lip sync alignment for audio/video synchronization.
- markers
- Synchronization marker detection.
- motion_
compensate - Motion compensation for temporal video alignment.
- multi_
stream - Multi-stream alignment for synchronizing groups of audio/video streams.
- multicam_
sync - Multi-camera synchronisation using various sync methods.
- multitrack_
align - Multi-track alignment for synchronizing multiple audio/video tracks.
- optical_
flow - Optical flow computation for frame-to-frame alignment.
- phase_
correlate - Phase correlation for sub-pixel image alignment.
- projective_
warp - Projective (perspective) warp transformations for image alignment.
- prosac
- PROSAC (PROgressive SAmple Consensus) for robust model estimation.
- rigid_
transform - Rigid body (rotation + translation) transformations for alignment.
- rolling_
shutter - Rolling shutter correction.
- spatial
- Spatial registration and geometric alignment.
- stabilize
- Video stabilization pipeline.
- stereo_
depth - Depth estimation from a rectified stereo image pair.
- stereo_
rectify - Stereo image pair rectification for epipolar geometry alignment.
- subframe_
interp - Sub-frame interpolation for precision alignment.
- sync_
score - Sync quality scoring for multi-stream alignment in
OxiMedia. - tempo_
align - Tempo-based audio alignment for music synchronization.
- temporal
- Temporal synchronization for multi-camera alignment.
- temporal_
align - Temporal stream alignment utilities for
OxiMedia. - transform
- Geometric transformations for image alignment.
- warp
- Time warp / time-stretching alignment using Dynamic Time Warping (DTW).
Structs§
- Point2D
- 2D point
- Time
Offset - Time offset between two streams
Enums§
- Align
Error - Errors that can occur during alignment operations
Type Aliases§
- Align
Result - Result type for alignment operations