Pose Graph rewritten without Ceres#2892
Conversation
1. Pose3d done w/o Eigen types; 2. PoseGraph nodes vector<Node> -> map<int, Node> 3. Eigen is not used in cost function or parametrization 4. Cost function debugged & fixed (original one was wrong), rewritten from Automatic to Analytic
|
@alalek Is there a good way to avoid unreachable code warnings? I disabled them with pragma for cases when there's no Eigen enabled. |
modules/rgbd/src/pose_graph.cpp
Outdated
| #include <ceres/ceres.h> | ||
| // a very stupid workaround against unreachable code warning | ||
| #if defined(_MSC_VER) | ||
| #pragma warning(disable : 4702) |
There was a problem hiding this comment.
It makes sense to put PoseGraph::optimize() under #ifdef HAVE_EIGEN condition if Eigen is mandatory here.
BTW, Accurate condition should have && !defined(HAVE_EIGEN) too.
|
👍 |
|
@alalek |
| if (verbose) | ||
| { | ||
| cv::utils::logging::setLogLevel(cv::utils::logging::LogLevel::LOG_LEVEL_INFO); | ||
| } |
There was a problem hiding this comment.
Please do not touch logging level in tests.
It may be configured externally, e.g. OPENCV_LOG_LEVEL=INFO environment (so even verbose parameter is not needed and should be removed)
| // Turn if off if you don't need log messages | ||
| static const bool verbose = true; | ||
|
|
||
| #if !defined(_DEBUG) && defined(HAVE_EIGEN) |
There was a problem hiding this comment.
Use this for test filtering:
- Debug
applyTestTag(
CV_TEST_TAG_LONG, // 15sec in release
CV_TEST_TAG_DEBUG_VERYLONG // 400 sec in debug
)
- Eigen
#ifdef HAVE_EIGEN
...
#else
throw SkipTestException("Build with Eigen is required");
#endif
| if (writeToObjFile) | ||
| { |
There was a problem hiding this comment.
Use if (cvtest::debugLevel > 0) instead (to emit extra files).
See opencv/opencv#18955 for details.
| @@ -0,0 +1,58 @@ | |||
| #ifndef OPENCV_RGBD_GRAPH_NODE_H | |||
| std::string filename = cvtest::TS::ptr()->get_data_path() + "rgbd/sphere_bignoise_vertex3.g2o"; | ||
| Ptr<kinfu::detail::PoseGraph> pg = readG2OFile(filename); | ||
|
|
||
| // You may change logging level to view detailed optimization report |
There was a problem hiding this comment.
Move #ifdef HAVE_EIGEN here to remove (void)(&readG2OFile);
Pose graph from Large KinFu rewritten using manual analytic differentiation and custom LevMarq solver based on naive block sparse matrix implementation solved by Eigen library.
Connected test data PR: opencv/opencv_extra#869
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.