Table of Contents
Fetching ...

Kornia-rs: A Low-Level 3D Computer Vision Library In Rust

Edgar Riba, Jian Shi, Aditya Kumar, Andrew Shen, Gary Bradski

TL;DR

Kornia-rs addresses the need for a safe, high-performance 3D computer vision library in Rust by delivering a native, memory-safe implementation with a typed tensor system and strongly-typed image structures. The library adopts zero-copy views and pre-allocated buffers to satisfy real-time constraints, and uses modular crates to enable fine-grained dependencies and easy integration with Rust-based robotics and ML pipelines. Empirical results show $3\sim5$-fold improvements over Rust-native alternatives and competitive performance with C++ wrappers, with Python bindings delivering near-native throughput for image decoding and processing. The work demonstrates practical applicability through ICP-based 3D alignment, camera stream processing, and integration with robotics frameworks, and outlines a concrete path toward GPU acceleration, DL model integration, and classic CV algorithms like SLAM in future work.

Abstract

We present \textit{kornia-rs}, a high-performance 3D computer vision library written entirely in native Rust, designed for safety-critical and real-time applications. Unlike C++-based libraries like OpenCV or wrapper-based solutions like OpenCV-Rust, \textit{kornia-rs} is built from the ground up to leverage Rust's ownership model and type system for memory and thread safety. \textit{kornia-rs} adopts a statically-typed tensor system and a modular set of crates, providing efficient image I/O, image processing and 3D operations. To aid cross-platform compatibility, \textit{kornia-rs} offers Python bindings, enabling seamless and efficient integration with Rust code. Empirical results show that \textit{kornia-rs} achieves a 3~ 5 times speedup in image transformation tasks over native Rust alternatives, while offering comparable performance to C++ wrapper-based libraries. In addition to 2D vision capabilities, \textit{kornia-rs} addresses a significant gap in the Rust ecosystem by providing a set of 3D computer vision operators. This paper presents the architecture and performance characteristics of \textit{kornia-rs}, demonstrating its effectiveness in real-world computer vision applications.

Kornia-rs: A Low-Level 3D Computer Vision Library In Rust

TL;DR

Kornia-rs addresses the need for a safe, high-performance 3D computer vision library in Rust by delivering a native, memory-safe implementation with a typed tensor system and strongly-typed image structures. The library adopts zero-copy views and pre-allocated buffers to satisfy real-time constraints, and uses modular crates to enable fine-grained dependencies and easy integration with Rust-based robotics and ML pipelines. Empirical results show -fold improvements over Rust-native alternatives and competitive performance with C++ wrappers, with Python bindings delivering near-native throughput for image decoding and processing. The work demonstrates practical applicability through ICP-based 3D alignment, camera stream processing, and integration with robotics frameworks, and outlines a concrete path toward GPU acceleration, DL model integration, and classic CV algorithms like SLAM in future work.

Abstract

We present \textit{kornia-rs}, a high-performance 3D computer vision library written entirely in native Rust, designed for safety-critical and real-time applications. Unlike C++-based libraries like OpenCV or wrapper-based solutions like OpenCV-Rust, \textit{kornia-rs} is built from the ground up to leverage Rust's ownership model and type system for memory and thread safety. \textit{kornia-rs} adopts a statically-typed tensor system and a modular set of crates, providing efficient image I/O, image processing and 3D operations. To aid cross-platform compatibility, \textit{kornia-rs} offers Python bindings, enabling seamless and efficient integration with Rust code. Empirical results show that \textit{kornia-rs} achieves a 3~ 5 times speedup in image transformation tasks over native Rust alternatives, while offering comparable performance to C++ wrapper-based libraries. In addition to 2D vision capabilities, \textit{kornia-rs} addresses a significant gap in the Rust ecosystem by providing a set of 3D computer vision operators. This paper presents the architecture and performance characteristics of \textit{kornia-rs}, demonstrating its effectiveness in real-world computer vision applications.
Paper Structure (14 sections, 2 figures)

This paper contains 14 sections, 2 figures.

Figures (2)

  • Figure 1: Performance demonstrations. Upper: We compare common image processing operations between kornia-rs and image-rs. Lower: We compare image I/O operations against OpenCV, PIL, and TensorFlow.
  • Figure 2: Point cloud alignment using kornia-rs ICP implementation. The figure shows the source point cloud (rgb color) and the aligned result (blue).