added helper function to abstract feature extractor class

This commit is contained in:
Christian Forster
2014-04-27 23:34:59 +02:00
parent d905a9ff72
commit 692cb1b47f
+10
View File
@@ -61,13 +61,23 @@ public:
void setGridOccpuancy(const Vector2d& px); void setGridOccpuancy(const Vector2d& px);
protected: protected:
static const int border_ = 8; //!< no feature should be within 8px of border.
const int cell_size_; const int cell_size_;
const int n_pyr_levels_; const int n_pyr_levels_;
const int grid_n_cols_; const int grid_n_cols_;
const int grid_n_rows_; const int grid_n_rows_;
vector<bool> grid_occupancy_; vector<bool> grid_occupancy_;
void resetGrid(); void resetGrid();
void setExistingFeatures(const Features& fts); 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; typedef boost::shared_ptr<AbstractDetector> DetectorPtr;