changed interface of feature detector. now it returns directly a list of features instead of only corners

This commit is contained in:
Christian Forster
2014-04-28 16:43:00 +02:00
parent 5e48a22f4d
commit 42a7222b43
13 changed files with 96 additions and 121 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ struct Seed
float z_range; //!< Max range of the possible depth.
float sigma2; //!< Variance of normal distribution.
Matrix2d patch_cov; //!< Patch covariance in reference image.
Seed(Feature* ftr, float angle, float depth_mean, float depth_min);
Seed(Feature* ftr, float depth_mean, float depth_min);
};
/// Depth filter implements the Bayesian Update proposed in:
+9 -8
View File
@@ -52,15 +52,19 @@ public:
virtual ~AbstractDetector() {};
virtual void detect(
Frame* frame,
const ImgPyr& img_pyr,
const Features& fts,
const double detection_threshold,
Corners* corners) = 0;
Features& fts) = 0;
/// Notify the detector that a cell already has a feature before detection.
/// Flag the grid cell as occupied
void setGridOccpuancy(const Vector2d& px);
/// Set grid cells of existing features as occupied
void setExistingFeatures(const Features& fts);
protected:
static const int border_ = 8; //!< no feature should be within 8px of border.
const int cell_size_;
const int n_pyr_levels_;
@@ -70,14 +74,11 @@ protected:
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;
@@ -94,10 +95,10 @@ public:
virtual ~FastDetector() {}
virtual void detect(
Frame* frame,
const ImgPyr& img_pyr,
const Features& fts,
const double detection_threshold,
Corners* corners);
Features& fts);
};
} // namespace feature_detection
+1 -1
View File
@@ -79,7 +79,7 @@ public:
void removeKeyPoint(Feature* ftr);
/// Return number of point observations.
size_t nObs() const;
inline size_t nObs() const { return fts_.size(); }
/// Check if a point in (w)orld coordinate frame is visible in the image.
bool isVisible(const Vector3d& xyz_w) const;
+2 -1
View File
@@ -56,7 +56,8 @@ public:
int n_succeeded_reproj_; //!< Number of succeeded reprojections. Used to assess the quality of the point.
int last_structure_optim_; //!< Timestamp of last point optimization
Point(Vector3d pos);
Point(const Vector3d& pos);
Point(const Vector3d& pos, Feature* ftr);
~Point();
/// Add a reference to a frame.