-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License header.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move #ifdef HAVE_EIGEN
here to remove (void)(&readG2OFile);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
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.