Open Wavelet303 opened 2 years ago
the first question is resolved. in the LSDMatcher.cpp file, the following condition must be added in line 214: if (ldesc1.rows > 0 && ldesc2.rows > 0) { bfm->knnMatch(ldesc1, ldesc2, lmatches, 2);
double nn_dist_th, nn12_dist_th;
const float minRatio = 1.0f / 1.5f;
lineDescriptorMAD(lmatches, nn_dist_th, nn12_dist_th);
nn12_dist_th = nn12_dist_th * 0.5;
sort(lmatches.begin(), lmatches.end(), sort_descriptor_by_queryIdx());
for (int i = 0; i < lmatches.size(); i++) {
int qdx = lmatches[i][0].queryIdx;
int tdx = lmatches[i][0].trainIdx;
double dist_12 = lmatches[i][0].distance / lmatches[i][1].distance;
if (dist_12 < minRatio) {
MapLine* mapLine = vpMapLinesKF[qdx];
if (mapLine) {
vpMapLineMatches[tdx] = mapLine;
nmatches++;
}
}
}
}
Hi, thanks for your interest and for pointing out issues. Unfortunately, I cannot tell you why relocalization fails as I have to test/debug it myself. I will give an update after having a look.
Hi razayunus, First of all congratulations on your great work. I have successfully migrated the project to Visual Studio 2019. The examples (TUM RGB-D, ICL-NUI; and TAMU RGB-D) work perfectly and in real time (0.05 mean tracking time) on my computer . My configuration is: OpenCV 3.4.5 PCL 1.8.1 Eigen3. 3.3.9 Pangolin DBoW2: Included in Thirdparty folder g2o: Included in Thirdparty folder
Subsequently, I tried to use the application in live time in an indoor room using the Intel RealSense D435 as an RGB-D camera. It works correctly except when the application does not detect any keypoints or lines (e.g. the camera is covered with the hand) in which an error occurs and closes the app. “Error: keypoint list is empty OpenCV: terminate handler is called! The last OpenCV error is: OpenCV(3.4.5) Error: Assertion failed (type == src2.type() && src1.cols == src2.cols && (type == CV_32F || type == CV_8U)) in cv::batchDistance” On the other hand, when the system loses tracking (it occurs very rarely) it is not able to find relocation tracking again.
Do you have any idea why these two things occur?
My configuration file for Intel d435 is: Camera.fy: 617.73 Camera.fy: 618.19 Camera.cx: 317.76 Camera.cy: 248.28 Camera.k1: 0 Camera.k2: 0 Camera.p1: 0 Camera.p2: 0 Camera.k3: 0 Camera.width: 640 Camera.height: 480 Camera.fps: 30.0 Camera.bf: 30.5 Camera.RGB: 1 ThDepth: 40.0 DepthMapFactor: 1000.0 ORBextractor.nFeatures: 1000 ORBextractor.scaleFactor: 1.2 ORBextractor.nLevels: 8
ORBextractor.iniThFAST: 20 ORBextractor.minThFAST: 7 Viewer.KeyFrameSize: 0.05 Viewer.KeyFrameLineWidth: 1 Viewer.GraphLineWidth: 0.9 Viewer.PointSize: 2 Viewer.CameraSize: 0.08 Viewer.CameraLineWidth: 3 Viewer.ViewpointX: 0 Viewer.ViewpointY: -0.7 Viewer.ViewpointZ: -1.8 Viewer.ViewpointF: 500 Plane.AssociationDisRef: 0.05 Plane.AssociationAngRef: 0.985 # 10 degree Plane.VerticalThreshold: 0.08716 # 85 degree Plane.ParallelThreshold: 0.9962 # 5 degree Plane.AngleInfo: 0.5 Plane.DistanceInfo: 50 Plane.Chi: 100 Plane.VPChi: 50 Plane.ParallelInfo: 0.5 Plane.VerticalInfo: 0.5 Plane.DistanceThreshold: 0.04 Plane.MFVerticalThreshold: 0.01 Surfel.distanceFar: 30.0 Surfel.distanceNear: 0.5 SavePath.Keyframe: "KeyFrameTrajectory.txt" SavePath.Frame: "CameraTrajectory.txt"
An the D435-I example code is: /
include
include
include
include
include
include
include <opencv2/core/core.hpp>
include <librealsense2/rs.hpp>
include
void stop_falg_detection();
// A flag to indicate whether a key had been pressed. std::atomic_bool stop_flag(false);
int main(int argc, char** argv) try {
} catch (const rs2::error& e) { // Capture device exception std::cerr << "RealSense error calling " << e.get_failed_function() << "(" << e.get_failed_args() << "):\n " << e.what() << std::endl; return EXIT_FAILURE; } catch (const std::exception& e) { std::cerr << "Other error : " << e.what() << std::endl; return EXIT_FAILURE; }
void stop_falg_detection() { char c; while (!stop_flag) { c = std::getchar(); if (c == 'p') { stop_flag = true;; } } }**
Thanks for everything