Closed bhack closed 9 years ago
@bhack Thanks for your PR. Since OpenCV3 changed quite a lot over the last few months, our support for it needs indeed some update.
Can you please fence the opencv3 changes inside the #ifdef OPENCV3
macro? (see for instance here)
OK.. What kind of new available PNP solvers do you want to set by default?
Just a bit of heads up here: passage from cv::ITERATIVE
to cv::SOLVEPNP_ITERATIVE
(and friends) is not specifically OpenCV 3 but an intermediary API change. In other words, you won't find cv::SOLVEPNP_*
in for example the 3.0.0-alpha1
tag.
Edit: By intermediary I don't mean temporary, but it's very new that's not in a tag yet.
EPNP
is not new (it is also available in opencv 2.4) and in my experience, it was not significantly better than ITERATIVE
. To confirm possible (accuracy and/or speed) gains, we first need adequate benchmarks, which are not very easy to design for 3D reconstruction (because the ground truth is difficult to measure -- we probably should do it via CGI-generated images).
So, to summarize, I would keep ITERATIVE
for now, and once we have benchmarks, test the other options. Or have you good evidence EPNP
is indeed better?
[This](http://docs.opencv.org/trunk/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html?highlight=solvepnp#bool solvePnP%28InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess, int flags%29) is the full list of solvers in master now.
Regarding the 3d reconstruction benchmark, how about measuring the reprojection error on a known tag configuration, like they do in the camera calibration ?
@bhack UPNP
could be interesting since it also estimate the camera focal length: no need for camera calibration anymore (in most cases)!
@qbonnard Sounds like a good idea, indeed!
@qbonnard I think that you can find something similar in opencv/test of the calibration module.
I think that's where I found it yes. Actually, I started a chilitags-based calibration tool, but didn't finish it up yet. It was based on the chessboard/dots calibration sample by OpenCV, and includes a reprojection measurement... Pretty easy to do actually. I just need to finish up ;)
Hey @bhack !
Thanks again for your PR and sorry about the delay.
I've amended your commit with the fences Séverin was talking about, the cv::ITERATIVE
PnP parameter, at least until we can evaluate its effect more seriously.
I pushed your amended commit on my fork's master branch https://github.com/qbonnard/chilitags
Would you like to try it and tell me if I can merge it to the official repository ?
Quentin
Sorry I haven't time to wrap myself and commit. Seems fine to me now.
This seems to be merged, closing.
I've made some little fix for opencv 3.0. We could wrap this for let be still compatibile with 2.4.x series?