Open loseyourself-gan opened 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()"
@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!!!
Hello, which variable stores the position and camera direction of each moment? Would you like to output it and evaluate it with Evo