9 releases (4 breaking)

new 0.5.0 Apr 13, 2025
0.4.1 Apr 6, 2025
0.3.2 Apr 2, 2025
0.3.1 Dec 6, 2024
0.1.0 Dec 2, 2024

#306 in Robotics

Download history 2/week @ 2024-12-22 1/week @ 2025-02-02 6/week @ 2025-02-16 6/week @ 2025-02-23 3/week @ 2025-03-02 5/week @ 2025-03-09 8/week @ 2025-03-16 2/week @ 2025-03-23 198/week @ 2025-03-30 203/week @ 2025-04-06

412 downloads per month
Used in camera-intrinsic-calibrat…

Apache-2.0

72KB
1.5K SLoC

camera-intrinsic-model

crate

A pure rust camera intrinsic model library. Including

  • project / unproject points
  • undistort and remap image

Supported camera models are

  • Extended Unified (EUCM)
  • Extended Unified with Tangential (EUCMT)
  • Unified Camera Model (UCM)
  • Kannala Brandt (KB4) aka OpenCV Fisheye
  • OpenCV (OPENCV5) aka plumb_bob in ROS
  • F-theta (FTHETA) by NVidia
  • Fov Camera (FOV_CAMERA)

For calibration to get the precise parameters. Please use camera-intrinsic-calibration

Examples

# undistort and remap
cargo run -r --example remap

# undistort and rectify
cargo run -r --example stereo_rectify

Benchmark

Remapping to 1024x1024 on m4 mac mini.

╭───────────────────────────────────────────────────────────────────────╮
│                                 remap                                 │
├────────────────┬──────┬───────────┬───────────┬───────────┬───────────┤
│ benchmark      │ args │   fastest │    median │      mean │    stddev │
├────────────────┼──────┼───────────┼───────────┼───────────┼───────────┤
│ mono8 normal   │ None732.17 µs │ 827.00 µs │ 858.60 µs │  94.88 µs │
│ mono8 fast     │ None272.00 µs │ 342.25 µs │ 360.68 µs │ 228.13 µs │
│ rgb8 normal    │ None1.87 ms │   2.00 ms │   2.04 ms │ 143.60 µs │
│ rgb8 fast      │ None751.67 µs │ 824.54 µs │ 851.30 µs │  79.45 µs │
╰────────────────┴──────┴───────────┴───────────┴───────────┴───────────╯

Acknowledgements

Links:

Papers:

  • Usenko, Vladyslav, Nikolaus Demmel, and Daniel Cremers. "The double sphere camera model." 2018 International Conference on 3D Vision (3DV). IEEE, 2018.
  • Frédréric, Devernay, and Faugeras Olivier. "Straight lines have to be straight: Automatic calibration and removal of distortion from scenes of structured enviroments." Mach. Vision Appl 13.1 (2001): 14-24.

TODO

  • Stereo Rectify
  • FTheta Model
  • Python bindings

Dependencies

~7MB
~147K SLoC