Skip to content

Commit

Permalink
added helper function to abstract feature extractor class
Browse files Browse the repository at this point in the history
  • Loading branch information
cfo committed Apr 27, 2014
1 parent d905a9f commit 692cb1b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions svo/include/svo/feature_detection.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,23 @@ class AbstractDetector
void setGridOccpuancy(const Vector2d& px);

protected:
static const int border_ = 8; //!< no feature should be within 8px of border.
const int cell_size_;
const int n_pyr_levels_;
const int grid_n_cols_;
const int grid_n_rows_;
vector<bool> grid_occupancy_;

void resetGrid();

void setExistingFeatures(const Features& fts);

inline int getCellIndex(int x, int y, int level)
{
const int scale = (1<<level);
return (scale*y)/cell_size_*grid_n_cols_ + (scale*x)/cell_size_;
}

};
typedef boost::shared_ptr<AbstractDetector> DetectorPtr;

Expand Down

0 comments on commit 692cb1b

Please sign in to comment.