Giter Site home page Giter Site logo

p3p's Introduction

rust-photogrammetry/p3p

Camera pose estimation given 3D points and corresponding pixel coordinates.

Implementation based on "Lambda Twist: An Accurate Fast Robust Perspective Three Point (P3P) Solver" Persson, M. and Nordberg, K. ECCV 2018.

Reference implementation available on the author github repository.

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

This rewrite is based on the adaptation of the original code (GPL-3.0) into OpenMVG, published under MPL-2.0 with the original author agreement.

Contributions

All forms of contributions are welcomed, preferably first as github issues.

  • Questions
  • Documentation
  • Tests
  • Benchmarks
  • Features

In case of contribution to source code, it needs to use rustfmt and clippy. To run clippy:

touch src/lib.rs; cargo clippy -- -W clippy::all -W clippy::nursery -W clippy::pedantic

To build the documentation with math formatted by katex:

RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps

p3p's People

Contributors

mpizenberg avatar vadixidav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

p3p's Issues

Z-value of `bearing_vectors` unclear

Hello @mpizenberg ๐Ÿ‘‹,

I have a question regarding the bearing_vectors as input for the solve function in the nordberg module. As I understand the documentation, each bearing vector should contain one vertex of the triangle in image-space, i.e., (u_i, v_i, 1). However, in the test-cases the z-values of the bearing_vectors are different from 1:

let p1_cam = [-0.228_125, -0.061_458_334, 1.0];
let p2_cam = [0.418_75, -0.581_25, 2.0];
let p3_cam = [1.128_125, 0.878_125, 3.0];

Moreover, I am confused to read _cam or "camera coordinates" in the test-cases and not "image coordinates". Is there a misconception from my side, is the documentation misguiding about z-value or are the test-cases incorrect?

Nice!

Thank for your launching the rust-photogrammetry initiative. Appreciated you cited all the previous work done around the p3p solver and ports.

I wonder what is your motivation behind porting it to rust.

  • Do you have any particular example of performance (time vs. accuracy for C++ vs rust)?
  • Do you plan to add some unit test, to ensure people could trust the implementation before incorporating it in their platform?

Quickcheck test fails quite frequently

Dear all,

I just noticed that the quickcheck test non_degenerate_case fails quite frequently, e.g.:

running 2 tests
test nordberg::tests::manual_case ... ok
test nordberg::tests::non_degenerate_case ... FAILED

failures:

---- nordberg::tests::non_degenerate_case stdout ----
thread 'nordberg::tests::non_degenerate_case' panicked at '[quickcheck] TEST FAILED. Arguments: ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 41.0, 0.0), (25.49968, 97.0, 59.0), (38.101242, 91.147705, -97.73874))', /Users/michaelp/.cargo/registry/src/github.com-1ecc6299db9ec823/quickcheck-0.8.5/src/tester.rs:176:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    nordberg::tests::non_degenerate_case

or

...
thread 'nordberg::tests::non_degenerate_case' panicked at '[quickcheck] TEST FAILED (runtime error). Arguments: ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 21.0, 0.0), (25.0, 47.0, 61.0), (-86.0, -10.0, 47.0))
Error: "assertion failed: !poses.is_empty()"', /Users/michaelp/.cargo/registry/src/github.com-1ecc6299db9ec823/quickcheck-0.8.5/src/tester.rs:176:28
...

Running tests with QUICKCHECK_TESTS=10000 cargo test reliably produces a failure for me on every run.

Best
Michael

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.