HeYijia / svo_edgelet

A more robust SVO with edgelet feature
GNU General Public License v2.0
434 stars 175 forks source link

evaluate it with Evo #33

Open loseyourself-gan opened 3 years ago

loseyourself-gan commented 3 years ago

Hello, which variable stores the position and camera direction of each moment? Would you like to output it and evaluate it with Evo

HeYijia commented 3 years ago

you can save the pose with " vo_->lastFrame()->T_fw.inverse() ". Furthermore, the translation vector is “vo_->lastFrame()->T_fw.inverse().translation()”, the rotation matrix is "vo_->lastFrame()->T_fw.inverse().rotationMatrix()"

loseyourself-gan commented 3 years ago

@HeYijia Thank you for your reply I made this change to the code int nImages = vstrImageFilenames.size(); cv::Mat img; ofstream f; const string filename = "gan"; f.open(filename.c_str()); f<<fixed; for(int ni=0; ni<nImages; ni++) { std::string img_path = filepath+"/"+vstrImageFilenames[ni]; img = cv::imread(img_path.c_str(),CV_LOAD_IMAGE_GRAYSCALE); assert(!img.empty());

      // process frame
      //cv::Mat unimg;
      //cam_pinhole_->undistortImage(img,unimg);
      //vo_->addImage(unimg, vTimestamps[ni]);
      vo_->addImage(img, vTimestamps[ni]);

      if(vo_->lastFrame() != NULL)
      {
      f<<vTimestamps[ni]<<" "<<vo_->lastFrame()->T_f_w_.inverse().translation()<<" "<<vo_->lastFrame()->T_f_w_.inverse().rotationMatrix();

        std::cout << "Frame-Id: " << vo_->lastFrame()->id_ << " \t"
                    << "#Features: " << vo_->lastNumObservations() << " \n";

      }

} f.close();

But there was this mistake Frame-Id: 797 #Features: 181 [INFO] DepthFilter stop thread invoked. [INFO] DepthFilter interrupt and join thread... [INFO] DepthFilter destructed. [INFO] SVO destructor invoked [INFO] Map destructed new_frame: Fatal IO error 11 (Resource temporarily unavailable) on X server U . 段错误 (核心已转储)

How can I solve it? Thanks!!!