segmentatio falt error in Sophus

This commit is contained in:
gfuse
2021-08-31 23:04:59 +02:00
parent a6de3e3168
commit c7134d94a7
4 changed files with 4 additions and 5 deletions
@@ -67,7 +67,7 @@ public:
inline bool isInFrame(const Vector2i &obs, int boundary, int level) const
{
if(obs[0] >= boundary && obs.x() < width()/(1<<level)-boundary && obs[1] >= boundary && obs.y() <height()/(1<<level)-boundary)
if((int)obs[0] >= boundary && (int)obs.x() < width()/(1<<level)-boundary && (int)obs[1] >= boundary && (int)obs.y() <height()/(1<<level)-boundary)
return true;
return false;
}
+1 -1
View File
@@ -1,6 +1,6 @@
<launch>
<node pkg="vio" type="vio" name="vio" clear_params="true" output="screen" launch-prefix="xterm -e gdb --args" />
<!-- node pkg="vio" type="vio" name="vio" clear_params="true" output="screen" launch-prefix="xterm -e gdb args" / -->
<!-- Camera topic to subscribe to -->
<param name="vio/cam_topic" value="/CoreNode/grey_img" type="str" />
+1 -1
View File
@@ -142,7 +142,7 @@ bool Matcher::findMatchDirect(
{
ref_ftr_= nullptr;
if(!pt.getCloseViewObs(cur_frame.pos(), ref_ftr_))return false;
if(!ref_ftr_->frame->cam_->isInFrame(ref_ftr_->px.cast<int>()/(1<<ref_ftr_->level), halfpatch_size_+2, ref_ftr_->level))
if(!ref_ftr_->frame->cam_->isInFrame(Vector2d(ref_ftr_->px/(1<<ref_ftr_->level)).cast<int>(), halfpatch_size_+2, ref_ftr_->level))
return false;
if(ref_ftr_->frame->img_pyr_.empty())return false;
if(ref_ftr_->frame->img_pyr_[ref_ftr_->level].empty())return false;
+1 -2
View File
@@ -151,8 +151,7 @@ namespace vio {
extractor->compute(it_frame.item.first->img(), keypoints_kfs, descriptors_ref);
matcher->match(descriptors_ref, descriptors_cur, matches);
for (auto &&f: _for(it_frame.item.first->fts_)) {
if (f.item->point == NULL)
f.item->point = new Point(it_frame.item.first->cam_->cam2world(f.item->px.x(), f.item->px.y()),f.item);
if (f.item->point == NULL)f.item->point = new Point(it_frame.item.first->cam_->cam2world(f.item->px.x(), f.item->px.y()),f.item);
if (f.item->point->last_frame_overlap_id_ == frame->id_)continue;
f.item->point->last_frame_overlap_id_ = frame->id_;
for (auto &&match:matches) {