solve segmentation fault error
This commit is contained in:
@@ -145,14 +145,12 @@ void Frame::removeKeyPoint(Feature* ftr)
|
||||
bool Frame::isVisible(const Vector3d& xyz_w) const
|
||||
{
|
||||
if(!id_)return false;
|
||||
std::cerr<<"148is\t";
|
||||
usleep(1000);
|
||||
SE3 tem=this->se3();
|
||||
std::cerr<<"150is\t";
|
||||
assert(!xyz_w.hasNaN());
|
||||
Vector3d xyz_f = tem*xyz_w;
|
||||
std::cerr<<"152is\t";
|
||||
if(xyz_f.z() < 0.0)
|
||||
return false; // point is behind the camera
|
||||
std::cerr<<"153is\t";
|
||||
Vector2d px = f2c(xyz_f);
|
||||
if(px[0] >= 0.0 && px[1] >= 0.0 && px[0] < cam_->width() && px[1] < cam_->height())
|
||||
return true;
|
||||
|
||||
@@ -168,7 +168,7 @@ FrameHandlerBase::UpdateResult FrameHandlerMono::processFrame()
|
||||
new_frame_->Cov_ = init_f.first;
|
||||
// sparse image align
|
||||
SparseImgAlignGpu img_align(Config::kltMaxLevel(), Config::kltMinLevel(),30, SparseImgAlignGpu::GaussNewton, false,gpu_fast_);
|
||||
img_align.run(last_frame_, new_frame_);
|
||||
if(!img_align.run(last_frame_, new_frame_))new_frame_->T_f_w_=init_f.second;
|
||||
reprojector_.reprojectMap2(new_frame_, last_frame_,overlap_kfs_);
|
||||
//assert (false);
|
||||
int n_point=0;
|
||||
|
||||
@@ -120,6 +120,7 @@ void Map::getCloseKeyframes(
|
||||
{
|
||||
if(keypoint == nullptr)
|
||||
continue;
|
||||
if(keypoint->point==NULL)continue;
|
||||
if(frame->isVisible(keypoint->point->pos_))
|
||||
{
|
||||
close_kfs.push_back(
|
||||
|
||||
@@ -124,6 +124,7 @@ namespace vio {
|
||||
FramePtr frame,
|
||||
FramePtr last_frame,
|
||||
std::vector<std::pair<FramePtr, std::size_t> > &overlap_kfs) {
|
||||
if(frame->id_<1)return;
|
||||
resetGrid();
|
||||
cv::Mat descriptors_cur;
|
||||
std::vector<cv::KeyPoint> keypoints_cur;
|
||||
|
||||
Reference in New Issue
Block a user