gaoxiang12 / ORB-YGZ-SLAM

Other
470 stars 224 forks source link

将opencv换成opencv4出现数组越界 #27

Closed huzhanxiaoxue closed 1 year ago

huzhanxiaoxue commented 1 year ago

I0423 10:45:20.048502 19680 Tracking.cc:1638] Search by projection returns 53 Stack trace (most recent call last):

8 Object "", at 0xffffffffffffffff, in

7 Object "/home/wh/Desktop/mygitlab/svo-orb-1/Examples/Stereo/stereo_euroc_line", at 0x5629369fb3bd, in _start

6 Source "../csu/libc-start.c", line 308, in __libc_start_main [0x7fc53d73c082]

5 Source "/home/wh/Desktop/mygitlab/svo-orb-1/Examples/Stereo/stereo_euroc_line.cc", line 180, in main [0x5629369fc626]

    177: #endif
    178: 
    179:         // Pass the images to the SLAM system
  > 180:         SLAM.TrackStereo(imLeftRect,imRightRect,tframe);
    181: 
    182: #ifdef COMPILEDWITHC11
    183:         std::chrono::steady_clock::time_point t2 = std::chrono::steady_clock::now();

4 Source "/home/wh/Desktop/mygitlab/svo-orb-1/src/System.cc", line 242, in TrackStereo [0x7fc5420daa1d]

    239:             }
    240:         }
    241:         //用矩阵Tcw来保存估计的相机 位姿,运动追踪器的GrabImageStereo函数才是真正进行运动估计的函数
  > 242:         SE3f Tcw = mpTracker->GrabImageStereo(imLeft, imRight, timestamp);
    243:         //给运动追踪状态上锁
    244:         unique_lock<mutex> lock2(mMutexState);
    245:         //获取运动追踪状态

3 Source "/home/wh/Desktop/mygitlab/svo-orb-1/src/Tracking.cc", line 263, in GrabImageStereo [0x7fc542105a72]

    260:         mCurrentFrame = Frame(mImGray, imGrayRight, timestamp, mpORBextractorLeft, mpORBextractorRight, mpORBVocabulary,
    261:                               mK, mDistCoef, mbf, mThDepth);
    262:         // Step 3 :跟踪
  > 263:         Track();
    264:         //返回位姿
    265:         return mCurrentFrame.mTcw;
    266:     }

2 Source "/home/wh/Desktop/mygitlab/svo-orb-1/src/Tracking.cc", line 525, in Track [0x7fc54210703d]

    522:                             bOK = TrackLocalMap();
    523:                         } else {
    524:                             // 未提特征,用Direct方法比较
  > 525:                             bOK = TrackLocalMapDirect();
    526:                             if (!bOK) {
    527:                                 // Track local map 数量少,可能是前一步位姿估计的不准,也可能是视觉上匹配的就是太少
    528:                                 // clear the features and try search in local map

1 Source "/home/wh/Desktop/mygitlab/svo-orb-1/src/Tracking.cc", line 2180, in TrackLocalMapDirect [0x7fc54210f56f]

   2177:         if (mSensor == System::RGBD)
   2178:             mCurrentFrame.ComputeStereoFromRGBD(mCurrentFrame.mImDepth);
   2179:         else if (mSensor == System::STEREO)
  >2180:             mCurrentFrame.ComputeStereoMatches();
   2181: 
   2182:         // 优化当前帧的位姿,确定 inlier
   2183:         // Optimize pose

0 Source "/home/wh/Desktop/mygitlab/svo-orb-1/src/Frame.cc", line 671, in ComputeStereoMatches [0x7fc5424709ee]

    668:         }
    669: 
    670:         sort(vDistIdx.begin(), vDistIdx.end());
  > 671:         const float median = vDistIdx[vDistIdx.size() / 2].first;
    672:         const float thDist = 1.5f * 1.4f * median;
    673: 
    674:         for (int i = vDistIdx.size() - 1; i >= 0; i--) {

段错误 (地址没有映射到对象 [(nil)])

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)