Classes | |
struct | Pixel |
Independent (i.e. not OpenCV) representation of a Pixel. More... | |
Functions | |
nav_grid::VectorNavGrid< unsigned char > | classicLoadMapFromFile (const std::string &filepath, const double resolution, const bool negate_param, const double occ_th, const double free_th, const std::string &mode) |
Load an image from a file, mimicking map_server's loading style Resulting values are [0, 100] and -1. More... | |
nav_grid::VectorNavGrid< unsigned char > | getCostmapFromImage (const std::string &filepath, bool flip_y_axis=true) |
Load an image from a file and return values [0, 255]. More... | |
template<typename T > | |
nav_grid::VectorNavGrid< Pixel > | getImage (const cv::Mat &cv_img, bool flip_y_axis=false) |
nav_grid::VectorNavGrid< Pixel > | getImage (const std::string &filepath, bool flip_y_axis=true) |
Load an image as a NavGrid of pixels. More... | |
nav_grid::VectorNavGrid< double > | getImageIntensity (const std::string &filepath, bool flip_y_axis=true) |
Load an image from a file and return the image intensity at each pixel. More... | |
template<typename T > | |
double | scaleNumber (T raw_value) |
nav_grid::VectorNavGrid< unsigned char > nav_grid_server::classicLoadMapFromFile | ( | const std::string & | filepath, |
const double | resolution, | ||
const bool | negate_param, | ||
const double | occ_th, | ||
const double | free_th, | ||
const std::string & | mode | ||
) |
Load an image from a file, mimicking map_server's loading style Resulting values are [0, 100] and -1.
filepath | Path to image file |
resolution | resolution of resulting NavGrid |
negate_param | Whether to negate all the values |
occ_th | Threshold above which values are 100 (if mode!="raw") |
free_th | Threshold below which values are 0 (if mode!="raw") |
mode | If mode is "raw", no interpretation of values is done. If mode is "trinary", the thresholds will be used, and everything else is marked as -1. Otherwise, the thresholds are used and everything else is scaled from [1, 99]. |
Definition at line 161 of file image_loader.cpp.
nav_grid::VectorNavGrid< unsigned char > nav_grid_server::getCostmapFromImage | ( | const std::string & | filepath, |
bool | flip_y_axis = true |
||
) |
Load an image from a file and return values [0, 255].
Transparent pixels are saved as 255 (i.e. UNKNOWN). Other values are scaled [0, 255]
Definition at line 140 of file image_loader.cpp.
nav_grid::VectorNavGrid<Pixel> nav_grid_server::getImage | ( | const cv::Mat & | cv_img, |
bool | flip_y_axis = false |
||
) |
Definition at line 56 of file image_loader.cpp.
nav_grid::VectorNavGrid< Pixel > nav_grid_server::getImage | ( | const std::string & | filepath, |
bool | flip_y_axis = true |
||
) |
Load an image as a NavGrid of pixels.
filepath | Path to image file |
flip_y_axis | Flag for whether to flip the values on their y axis |
Images are typically defined with their top left corner being (0,0) with increasing x values to the right and increasing y values as you go down in the image.
However, the standard coordinate frame still has x values increasing to the right, but increasing y values go "up" now. Hence, the default behavior is to flip the y axis so that the map grid looks the same as the image when put onto the coordinate frame.
Definition at line 88 of file image_loader.cpp.
nav_grid::VectorNavGrid< double > nav_grid_server::getImageIntensity | ( | const std::string & | filepath, |
bool | flip_y_axis = true |
||
) |
Load an image from a file and return the image intensity at each pixel.
Resulting values are [0.0, 1.0] plus -1.0 if the image is transparent.
Definition at line 114 of file image_loader.cpp.
double nav_grid_server::scaleNumber | ( | T | raw_value | ) |
Definition at line 50 of file image_loader.cpp.