Places features into grid cells and discards the weakest features in each cell. More...
#include <grid_filter.hpp>
Public Member Functions | |
void | filter (std::vector< KeyPoint > *keypoints) |
GridKeyPointFilter (int img_width, int img_height, int bucket_width, int bucket_height, int max_keypoints_per_bucket) | |
Private Attributes | |
int | _bucket_height |
int | _bucket_width |
std::vector< std::vector < KeyPoint > > | _buckets |
int | _grid_cols |
int | _grid_rows |
int | _img_height |
int | _img_width |
int | _max_keypoints_per_bucket |
Places features into grid cells and discards the weakest features in each cell.
Definition at line 14 of file grid_filter.hpp.
fovis::GridKeyPointFilter::GridKeyPointFilter | ( | int | img_width, |
int | img_height, | ||
int | bucket_width, | ||
int | bucket_height, | ||
int | max_keypoints_per_bucket | ||
) | [inline] |
Construct a keypoint filter.
Conceptually, lays down a grid over the image and sorts keypoints into a grid cell based on their image locations. Then removes the weakest keypoints in each cell (using the Keypoint::score field) until there are at most max_keypoints_per_bucket
in each grid cell.
img_width | the width of the input image. |
img_height | the height of the input image. |
bucket_width | the width of each bucket. |
bucket_height | the height of each bucket. |
max_keypoints_per_bucket | the maximum number of keypoints in each grid cell after filtering. |
Definition at line 32 of file grid_filter.hpp.
void fovis::GridKeyPointFilter::filter | ( | std::vector< KeyPoint > * | keypoints | ) |
filters the specified vector of keypoints.
keypoints | input/output parameter. On output, the weakest keypoints in each grid cell will have been removed from this vector. |
Definition at line 20 of file grid_filter.cpp.
int fovis::GridKeyPointFilter::_bucket_height [private] |
Definition at line 55 of file grid_filter.hpp.
int fovis::GridKeyPointFilter::_bucket_width [private] |
Definition at line 54 of file grid_filter.hpp.
std::vector<std::vector<KeyPoint> > fovis::GridKeyPointFilter::_buckets [private] |
Definition at line 59 of file grid_filter.hpp.
int fovis::GridKeyPointFilter::_grid_cols [private] |
Definition at line 58 of file grid_filter.hpp.
int fovis::GridKeyPointFilter::_grid_rows [private] |
Definition at line 57 of file grid_filter.hpp.
int fovis::GridKeyPointFilter::_img_height [private] |
Definition at line 53 of file grid_filter.hpp.
int fovis::GridKeyPointFilter::_img_width [private] |
Definition at line 52 of file grid_filter.hpp.
int fovis::GridKeyPointFilter::_max_keypoints_per_bucket [private] |
Definition at line 56 of file grid_filter.hpp.