apriltag_image/
lib.rs

1//! Adds image conversion from/to [image] crate for [apriltag] crate.
2//!
3//! # Example
4//!
5//! ```rust
6//! use apriltag::{Detector, Family, Image};
7//! use apriltag_image::prelude::*;
8//!
9//! fn main() -> anyhow::Result<()> {
10//!     let path = "test_data/DICT_APRILTAG_16h5-2x2-500-10-0.8-29,12,22,2.jpg";
11//!     let reader = image::io::Reader::open(path)?;
12//!     let image_buf = reader.decode()?.to_luma8();
13//!     let image = Image::from_image_buffer(&image_buf);
14//!     let mut detector = Detector::builder()
15//!         .add_family_bits(Family::tag_16h5(), 1)
16//!         .build()?;
17//!     let detections = detector.detect(&image);
18//!     Ok(())
19//! }
20//! ```
21
22mod image_buf;
23
24pub use crate::image_buf::ImageExt;
25pub use image;
26
27pub mod prelude {
28    pub use crate::ImageExt as _;
29}