#include <MedianFillFilter.hpp>
Public Member Functions | |
virtual bool | configure () |
MedianFillFilter () | |
virtual bool | update (const T &mapIn, T &mapOut) |
virtual | ~MedianFillFilter () |
Public Member Functions inherited from filters::FilterBase< T > | |
bool | configure (const std::string ¶m_name, ros::NodeHandle node_handle=ros::NodeHandle()) |
bool | configure (XmlRpc::XmlRpcValue &config) |
FilterBase () | |
const std::string & | getName () |
std::string | getType () |
virtual | ~FilterBase () |
Protected Member Functions | |
void | addCvMatAsLayer (T &gridMap, const cv::Mat &cvLayer, const std::string &layerName) |
cv::Mat_< bool > | cleanedMask (const cv::Mat_< bool > &inputMask) |
Eigen::MatrixXf | computeAndAddFillMask (const Eigen::MatrixXf &inputMap, T &mapOut) |
cv::Mat_< bool > | fillHoles (const cv::Mat_< bool > &isValidMask, const size_t numDilationClosingIterations) |
float | getMedian (Eigen::Ref< const grid_map::Matrix > inputMap, const grid_map::Index ¢erIndex, const size_t radiusInPixels, const grid_map::Size bufferSize) |
Protected Member Functions inherited from filters::FilterBase< T > | |
bool | getParam (const std::string &name, std::string &value) |
bool | getParam (const std::string &name, XmlRpc::XmlRpcValue &value) |
bool | getParam (const std::string &name, double &value) |
bool | getParam (const std::string &name, std::vector< double > &value) |
bool | getParam (const std::string &name, unsigned int &value) |
bool | getParam (const std::string &name, int &value) |
bool | getParam (const std::string &name, std::vector< std::string > &value) |
bool | getParam (const std::string &name, bool &value) |
bool | loadConfiguration (XmlRpc::XmlRpcValue &config) |
Private Attributes | |
bool | debug_ |
If set, the filtered grid_map is augmented with additional debug layers. More... | |
std::string | debugInfillMaskLayer_ = "debug_infill_mask" |
Layer used to visualize the intermediate, sparse outlier removed fill mask. More... | |
double | existingValueRadius_ |
Median filtering radius for existing values in the input. More... | |
double | fillHoleRadius_ |
Median filtering radius of NaN values in the input. More... | |
std::string | fillMaskLayer_ = "should_fill" |
Layer containing indicating which areas to fill, will be computed if not present. More... | |
bool | filterExistingValues_ |
Flag indicating whether to also filter finite values. More... | |
std::string | inputLayer_ |
Input layer name. More... | |
std::string | outputLayer_ |
Output layer name. More... | |
Additional Inherited Members | |
Protected Attributes inherited from filters::FilterBase< T > | |
bool | configured_ |
std::string | filter_name_ |
std::string | filter_type_ |
string_map_t | params_ |
Uses std::nth_element to fill holes in the input layer by the median of the surrounding values. The result is put into the output_layer. Note: Only values for which the fill_layer is true will be filled. The fill_layer is auto computed if not present in the input.
Definition at line 26 of file MedianFillFilter.hpp.
grid_map::MedianFillFilter< T >::MedianFillFilter | ( | ) |
Constructor
Definition at line 28 of file MedianFillFilter.cpp.
|
virtualdefault |
Destructor.
|
protected |
Adds a float cv matrix as layer to a given map.
[in,out] | gridMap | The map to add the layer. |
[in] | cvLayer | The cv matrix to add. |
[in] | layerName | The layer name |
Definition at line 247 of file MedianFillFilter.cpp.
|
protected |
Remove sparse valid regions by morphological opening.
inputMask | Initial mask possibly containing also sparse valid regions that will be removed. |
Definition at line 216 of file MedianFillFilter.cpp.
|
protected |
Computes a mask of which cells to fill-in based on the validity of input cells. I.e small holes between (and including) valid cells are marked to be filled.
inputMap | The input layer, used to check which cells contain valid values. |
mapOut | The output GridMap will contain the additional fill_mask layer afterwards. |
Definition at line 191 of file MedianFillFilter.cpp.
|
virtual |
Configures the filter from parameters on the Parameter Server
Implements filters::FilterBase< T >.
Definition at line 34 of file MedianFillFilter.cpp.
|
protected |
Performs morphological closing on a boolean cv matrix mask.
[in] | isValidMask | A 2d mask where holes up to a certain size will be filled. |
[in] | numDilationClosingIterations | Algorithm specific parameter. Higher means that bigger holes will still be filled. |
Definition at line 231 of file MedianFillFilter.cpp.
|
protected |
Returns the median of the values in inputData in the neighbourhood around the centerIndex. The size of the quadratic neighbourhood is specified by radiusInPixels. If the number of values is even the "lower center" value is taken, eg with four values the second lowest is taken as median.
inputMap | The data layer to compute a local median. |
centerIndex | The center cell of the neighbourhood. |
radiusInPixels | The maximum L_inf distance from index. |
bufferSize | The buffer size of the input |
Definition at line 155 of file MedianFillFilter.cpp.
|
virtual |
Adds a new output layer to the map. Uses the Boost accumulator median in the input layer. Saves the filter output in mapOut[output_layer].
mapIn | grid map containing input layer |
mapOut | grid map containing mapIn and median filtered input layer. |
Implements filters::FilterBase< T >.
Definition at line 107 of file MedianFillFilter.cpp.
|
private |
If set, the filtered grid_map is augmented with additional debug layers.
Definition at line 126 of file MedianFillFilter.hpp.
|
private |
Layer used to visualize the intermediate, sparse outlier removed fill mask.
Definition at line 123 of file MedianFillFilter.hpp.
|
private |
Median filtering radius for existing values in the input.
Definition at line 108 of file MedianFillFilter.hpp.
|
private |
Median filtering radius of NaN values in the input.
Definition at line 105 of file MedianFillFilter.hpp.
|
private |
Layer containing indicating which areas to fill, will be computed if not present.
Definition at line 120 of file MedianFillFilter.hpp.
|
private |
Flag indicating whether to also filter finite values.
Definition at line 111 of file MedianFillFilter.hpp.
|
private |
Input layer name.
Definition at line 114 of file MedianFillFilter.hpp.
|
private |
Output layer name.
Definition at line 117 of file MedianFillFilter.hpp.