fenjalien / apriltag-rust

High-level AprilTag library in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

apriltag-rust

High-level API for AprilTag library built on top of apriltag-sys.

Usage

Import to your project

Follow the install instructions on official repository to install AprilTag library.

Import apriltag-sys dependency in your Cargo.toml

[dependencies]
apriltag = "0.1.0"

Feature Flags

The feature flags control the supported conversions from/to third-party types. It includes

  • nalgebra: Get type conversions from/to two dimensional byte matrix from nalgebra crate.
  • image: Get type conversions from/to image types from image crate.

Customize the build

If you would like to customize the way to compile the AprilTag library, please read the notes in apriltag-sys README.

Example

The snipplet works with image crate and prints marker detections. You may check the example directory for complete runnable examples.

let image = image::open(&path)?;
let detections = detector.detect(image.to_luma());

println!("# image {}", path.display());

detections.into_iter().enumerate().for_each(|(index, det)| {
    println!(
        "- detection {}\n\
         id: {}\n\
         hamming: {}\n\
         decision_margin: {}\n\
         center: {:?}\n\
         corners: {:?}\n\
         homography: {:?}\n\
         ",
        index,
        det.id(),
        det.hamming(),
        det.decision_margin(),
        det.center(),
        det.corners(),
        det.homography().data()
    );
});

License

BSD 2-Clause License. See LICENSE file.

About

High-level AprilTag library in Rust

License:BSD 2-Clause "Simplified" License


Languages

Language:Rust 100.0%