#include <GridMapCvConverter.hpp>
|
template<typename Type_ , int NChannels_> |
static bool | addColorLayerFromImage (const cv::Mat &image, const std::string &layer, grid_map::GridMap &gridMap) |
|
template<typename Type_ , int NChannels_> |
static bool | addLayerFromImage (const cv::Mat &image, const std::string &layer, grid_map::GridMap &gridMap, const float lowerValue=0.0, const float upperValue=1.0, const double alphaThreshold=0.5) |
|
static bool | initializeFromImage (const cv::Mat &image, const double resolution, grid_map::GridMap &gridMap, const grid_map::Position &position) |
|
template<typename Type_ , int NChannels_> |
static bool | toImage (const grid_map::GridMap &gridMap, const std::string &layer, const int encoding, cv::Mat &image) |
|
template<typename Type_ , int NChannels_> |
static bool | toImage (const grid_map::GridMap &gridMap, const std::string &layer, const int encoding, const float lowerValue, const float upperValue, cv::Mat &image) |
|
Conversions between grid maps and OpenCV images.
Definition at line 24 of file GridMapCvConverter.hpp.
template<typename Type_ , int NChannels_>
static bool grid_map::GridMapCvConverter::addColorLayerFromImage |
( |
const cv::Mat & |
image, |
|
|
const std::string & |
layer, |
|
|
grid_map::GridMap & |
gridMap |
|
) |
| |
|
inlinestatic |
Adds a color layer with data from an image.
- Parameters
-
[in] | image | the image to be added (BGR format). |
[in] | layer | the layer that is filled with the image. |
[out] | gridMap | the grid map to be populated. |
- Returns
- true if successful, false otherwise.
Definition at line 128 of file GridMapCvConverter.hpp.
template<typename Type_ , int NChannels_>
static bool grid_map::GridMapCvConverter::addLayerFromImage |
( |
const cv::Mat & |
image, |
|
|
const std::string & |
layer, |
|
|
grid_map::GridMap & |
gridMap, |
|
|
const float |
lowerValue = 0.0 , |
|
|
const float |
upperValue = 1.0 , |
|
|
const double |
alphaThreshold = 0.5 |
|
) |
| |
|
inlinestatic |
Adds a layer with data from image.
- Parameters
-
[in] | image | the image to be added. If it is a color image (bgr or bgra encoding), it will be transformed in a grayscale image. |
[in] | layer | the layer that is filled with the image data. |
[out] | gridMap | the grid map to be populated. |
[in] | | |
Definition at line 59 of file GridMapCvConverter.hpp.
static bool grid_map::GridMapCvConverter::initializeFromImage |
( |
const cv::Mat & |
image, |
|
|
const double |
resolution, |
|
|
grid_map::GridMap & |
gridMap, |
|
|
const grid_map::Position & |
position |
|
) |
| |
|
inlinestatic |
Initializes the geometry of a grid map from an image. This changes the geometry of the map and deletes all contents of the layers!
- Parameters
-
[in] | image | the image. |
[in] | resolution | the desired resolution of the grid map [m/cell]. |
[out] | gridMap | the grid map to be initialized. |
[in] | | |
Definition at line 36 of file GridMapCvConverter.hpp.
template<typename Type_ , int NChannels_>
static bool grid_map::GridMapCvConverter::toImage |
( |
const grid_map::GridMap & |
gridMap, |
|
|
const std::string & |
layer, |
|
|
const int |
encoding, |
|
|
cv::Mat & |
image |
|
) |
| |
|
inlinestatic |
Creates a cv mat from a grid map layer. This conversion sets the corresponding black and white pixel value to the min. and max. data of the layer data.
- Parameters
-
[in] | grid | map to be added. |
[in] | layer | the layer that is converted to the image. |
[in] | encoding | the desired encoding of the image. |
[in] | lowerValue | the value of the layer corresponding to black image pixels. |
[in] | upperValue | the value of the layer corresponding to white image pixels. |
[out] | image | the image to be populated. |
- Returns
- true if successful, false otherwise.
Definition at line 173 of file GridMapCvConverter.hpp.
template<typename Type_ , int NChannels_>
static bool grid_map::GridMapCvConverter::toImage |
( |
const grid_map::GridMap & |
gridMap, |
|
|
const std::string & |
layer, |
|
|
const int |
encoding, |
|
|
const float |
lowerValue, |
|
|
const float |
upperValue, |
|
|
cv::Mat & |
image |
|
) |
| |
|
inlinestatic |
Creates a cv mat from a grid map layer.
- Parameters
-
[in] | grid | map to be added. |
[in] | layer | the layer that is converted to the image. |
[in] | encoding | the desired encoding of the image. |
[in] | lowerValue | the value of the layer corresponding to black image pixels. |
[in] | upperValue | the value of the layer corresponding to white image pixels. |
[out] | image | the image to be populated. |
- Returns
- true if successful, false otherwise.
Definition at line 192 of file GridMapCvConverter.hpp.
The documentation for this class was generated from the following file: