Template Class WeightedOccupancyGrid

Nested Relationships

Class Documentation

template<typename PointType = WeightedKeypoint<double, double, int>>
class aslam::common::WeightedOccupancyGrid

Constructors/destructors and operators

WeightedOccupancyGrid(CoordinatesType max_input_coordinate_rows, CoordinatesType max_input_coordinate_cols, CoordinatesType cell_size_rows, CoordinatesType cell_size_cols)
void reset()

Methods to add points to the grid.

void addPointUnconditional(const PointType &point)

Unconditionally add a point to the grid.

bool addPointOrReplaceWeakestIfCellFull(const PointType &point, size_t max_points_per_cell)

Add a point to the grid and replace other points in the same cell if the cell is full and this point has a higher score.

void addPointOrReplaceWeakestNearestPoints(const PointType &point, CoordinatesType min_distance)

Add point to the grid and replace other points if they are closer than the specified min.

distance and this point has a higher score.

Methods to query the grid.

size_t getNumPoints() const
size_t getAllPointsInGrid(PointList *points) const
inline PointList &getGridCell(CoordinatesType u_rows, CoordinatesType v_cols)
inline const PointList &getGridCell(CoordinatesType u_rows, CoordinatesType v_cols) const
inline GridCoordinates getFullestGridCell() const
cv::Mat getOccupancyMask(CoordinatesType radius_mask_around_points, size_t max_points_per_cell) const

Return a mask that covers a square of specified size around all points and masked cells if selected.

Methods to manipulate existing points in the grid.

void setConstantWeightForAllPointsInGrid(WeightType weight)

Methods to filter/modify the points in the grid.

size_t removeWeightedPointsFromOverfullCells(size_t max_points_per_cell)

Remove points from cells that contain more points than specified.

Points with the lowest score will be removed first.

size_t removeWeightedPointsFromOverfullCell(const GridCoordinates &grid_coords, size_t max_points_per_cell)
void removePointsFromFullestCellsUntilSize(size_t max_total_num_points)

Remove the weakest point from the fullest cells until the total number of points in the grid is met.

Public Types

typedef PointType::coordinate_type CoordinatesType
typedef PointType::weight_type WeightType
typedef PointType::id_type PointId
typedef PointType Point
typedef std::vector<PointType> PointList

Public Functions