#image #image-conversion #apriltag #computer-vision #from-to #type

apriltag-image

用于 apriltag 的图像类型之间的转换

1 个不稳定版本

0.1.0 2023 年 1 月 28 日

#3#from-to

每月下载量 27 次

BSD-2-Clause 许可协议

51KB
1K SLoC

apriltag-image

它是 apriltag 库的一个扩展,为 apriltag 库添加了从/到 [image] 库的图像转换。

示例

use apriltag::{Detector, Family, Image};
use apriltag_image::prelude::*;

fn main() -> anyhow::Result<()> {
    let path = "test_data/DICT_APRILTAG_16h5-2x2-500-10-0.8-29,12,22,2.jpg";
    let reader = image::io::Reader::open(path)?;
    let image_buf = reader.decode()?.to_luma8();
    let image = Image::from_image_buffer(&image_buf);
    let mut detector = Detector::builder()
        .add_family_bits(Family::tag_16h5(), 1)
        .build()?;
    let detections = detector.detect(&image);
    Ok(())
}

lib.rs:

为 [apriltag] 库添加了从/到 [image] 库的图像转换。

示例

use apriltag::{Detector, Family, Image};
use apriltag_image::prelude::*;

fn main() -> anyhow::Result<()> {
    let path = "test_data/DICT_APRILTAG_16h5-2x2-500-10-0.8-29,12,22,2.jpg";
    let reader = image::io::Reader::open(path)?;
    let image_buf = reader.decode()?.to_luma8();
    let image = Image::from_image_buffer(&image_buf);
    let mut detector = Detector::builder()
        .add_family_bits(Family::tag_16h5(), 1)
        .build()?;
    let detections = detector.detect(&image);
    Ok(())
}

依赖关系

~19MB
~273K SLoC