Giter Club home page Giter Club logo

dlt's Introduction

Crate dlt for the Rust language

Crates.io Documentation Crate License Dependency status build

DLT (direct linear transform) algorithm for camera calibration

This is typically used for calibrating cameras and requires a minimum of 6 corresponding pairs of 2D and 3D locations.

Testing

Unit tests

To run the unit tests:

cargo test

Test for no_std

Since the thumbv7em-none-eabihf target does not have std available, we can build for it to check that our crate does not inadvertently pull in std. The unit tests require std, so cannot be run on a no_std platform. The following will fail if a std dependency is present:

# install target with: "rustup target add thumbv7em-none-eabihf"
cargo build --no-default-features --target thumbv7em-none-eabihf

Example

use dlt::{dlt_corresponding, CorrespondingPoint};

let points: Vec<CorrespondingPoint<f64>> = vec![
    CorrespondingPoint {
        object_point: [-1., -2., -3.],
        image_point: [219.700, 39.400],
    },
    CorrespondingPoint {
        object_point: [0., 0., 0.],
        image_point: [320.000, 240.000],
    },
    CorrespondingPoint {
        object_point: [1., 2., 3.],
        image_point: [420.300, 440.600],
    },
    CorrespondingPoint {
        object_point: [1.1, 2.2, 3.3],
        image_point: [430.330, 460.660],
    },
    CorrespondingPoint {
        object_point: [4., 5., 6.],
        image_point: [720.600, 741.200],
    },
    CorrespondingPoint {
        object_point: [4.4, 5.5, 6.6],
        image_point: [760.660, 791.320],
    },
    CorrespondingPoint {
        object_point: [7., 8., 9.],
        image_point: [1020.900, 1041.800],
    },
    CorrespondingPoint {
        object_point: [7.7, 8.8, 9.9],
        image_point: [1090.990, 1121.980],
    },
];

let pmat = dlt_corresponding(&points, 1e-10).unwrap();
// could now call `cam_geom::Camera::from_perspective_matrix(&pmat)`

See also

You may also be interested in:

  • cam-geom - Rust crate with 3D camera models which can use the calibration data from DLT.
  • dlt-examples
    • Unpublished crate in the dlt repository which demonstrates usage with cam-geom library.

Regenerate README.md

The README.md file can be regenerated with:

cargo readme > README.md

Code of conduct

Anyone who interacts with this software in any space, including but not limited to this GitHub repository, must follow our code of conduct.

License

Licensed under either of these:

dlt's People

Contributors

astraw avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.