forked from ANYbotics/grid_map
/
InpaintFilter.hpp
65 lines (50 loc) · 1.2 KB
/
InpaintFilter.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* InpaintFilter.hpp
*
* Created on: May 6, 2017
* Author: Tanja Baumann, Peter Fankhauser
* Institute: ETH Zurich, ANYbotics
*/
#pragma once
#include <filters/filter_base.hpp>
//OpenCV
#include "grid_map_cv/grid_map_cv.hpp"
#include <opencv2/opencv.hpp>
#include <vector>
#include <string>
namespace grid_map {
/*!
* Uses OpenCV function to inpaint/fill holes in the input layer.
*/
template<typename T>
class InpaintFilter : public filters::FilterBase<T> {
public:
/*!
* Constructor
*/
InpaintFilter();
/*!
* Destructor.
*/
virtual ~InpaintFilter();
/*!
* Configures the filter from parameters on the Parameter Server
*/
virtual bool configure();
/*!
* Adds a new output layer to the map.
* Uses the OpenCV function inpaint holes in the input layer.
* Saves to filled map in the outputlayer.
* @param mapIn grid map containing input layer
* @param mapOut grid map containing mapIn and inpainted input layer.
*/
virtual bool update(const T& mapIn, T& mapOut);
private:
//! Inpainting radius.
double radius_;
//! Input layer name.
std::string inputLayer_;
//! Output layer name.
std::string outputLayer_;
};
} /* namespace */