symao / pnpl Goto Github PK
View Code? Open in Web Editor NEWPerspective n Point and Line for camera pose estimation.
Perspective n Point and Line for camera pose estimation.
Hi, @symao . Thanks for sharing the code.
I can run this ./demo_pnptrans succeefully. But when I run ./demo_pnpl, it have an error "Segmentation fault (core dumped)"
Hi,
Thanks for the contribution.
This is a rather general question. But does your PnPL algorithm use RANSAC to filter outliers?
Regards,
Alex
Is there any python binding for the same?
MIT
, please--if I have any say :)
Hi, thank you for sharing the code!
I can run your code on my own computer. But when I modify the initial value of the translation part to 0, that is Eigen::Vector3d trans(0.0, 0.0, 0.0); in the line 148 of src/pnpnl.cpp file, I met this following error:
buildSystem(): NaN within Jacobian for edge 0x56163c2901e0 for vertex 1
And when I use Google to find this error, they said this reason is that the wrong order of the function setVertex(). But the error I met has nothing to do with the function setVertex().
Got a building error, the compile output shows below:
Scanning dependencies of target demo_pnptrans
[ 16%] Building CXX object CMakeFiles/demo_pnptrans.dir/src/demo_pnptrans.cpp.o
[ 33%] Building CXX object CMakeFiles/demo_pnptrans.dir/src/pnp.cpp.o
[ 50%] Linking CXX executable demo_pnptrans
/usr/bin/ld: CMakeFiles/demo_pnptrans.dir/src/demo_pnptrans.cpp.o: undefined reference to symbol '_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3'
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [demo_pnptrans] Error 1
make[1]: *** [CMakeFiles/demo_pnptrans.dir/all] Error 2
make: *** [all] Error 2
I found it only show up when I build it with 'clang'. However everything was ok when build with 'gcc'
I got several error message in pnpl.cpp. It seems that after the line
typedef Eigen::Matrix<double,6,1,Eigen::ColMajor> Vector6D;
Vector4D 3D 2D shoule also be defined.
After I fixed this, I got problems with the API of G2O. So I changed to link an early version G2O, and it is OK now.
/home/rick/SLAMProjects/PnPL/src/pnpl.cpp: In function ‘void PnPL(const std::vector<cv::Point3_ >&, const std::vector<cv::Point_ >&, const std::vector<cv::Vec<float, 6> >&, const std::vector<cv::Vec<float, 4> >&, const cv::Mat&, cv::Mat&, cv::Mat&)’:
/home/rick/SLAMProjects/PnPL/src/pnpl.cpp:143:78: error: no matching function for call to ‘g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::BlockSolver(g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::LinearSolverType*&)’
g2o::BlockSolver_6_3 * solver_ptr = new g2o::BlockSolver_6_3(linearSolver);
^
In file included from /usr/local/include/g2o/core/block_solver.h:199:0,
from /home/rick/SLAMProjects/PnPL/src/pnpl.cpp:4:
/usr/local/include/g2o/core/block_solver.hpp:40:1: note: candidate: g2o::BlockSolver::BlockSolver(std::unique_ptr) [with Traits = g2o::BlockSolverTraits<6, 3>; typename Traits::LinearSolverType = g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> >]
BlockSolver::BlockSolver(std::unique_ptr linearSolver)
^
/usr/local/include/g2o/core/block_solver.hpp:40:1: note: no known conversion for argument 1 from ‘g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::LinearSolverType* {aka g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> >}’ to ‘std::unique_ptr<g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> >, std::default_delete<g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> > > >’
/home/rick/SLAMProjects/PnPL/src/pnpl.cpp:144:101: error: no matching function for call to ‘g2o::OptimizationAlgorithmLevenberg::OptimizationAlgorithmLevenberg(g2o::BlockSolver_6_3&)’
g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg(solver_ptr);
^
In file included from /home/rick/SLAMProjects/PnPL/src/pnpl.cpp:7:0:
/usr/local/include/g2o/core/optimization_algorithm_levenberg.h:47:16: note: candidate: g2o::OptimizationAlgorithmLevenberg::OptimizationAlgorithmLevenberg(std::unique_ptrg2o::Solver)
explicit OptimizationAlgorithmLevenberg(std::unique_ptr solver);
^
/usr/local/include/g2o/core/optimization_algorithm_levenberg.h:47:16: note: no known conversion for argument 1 from ‘g2o::BlockSolver_6_3* {aka g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >*}’ to ‘std::unique_ptrg2o::Solver’
CMakeFiles/demo_pnpl.dir/build.make:86: recipe for target 'CMakeFiles/demo_pnpl.dir/src/pnpl.cpp.o' failed
make[2]: *** [CMakeFiles/demo_pnpl.dir/src/pnpl.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/demo_pnpl.dir/all' failed
make[1]: *** [CMakeFiles/demo_pnpl.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Hello! I am studying your code, is there any corresponding theoretical materials? Thank you and look forward to your reply.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.