Public Member Functions | Private Member Functions | Private Attributes | List of all members
tuw::WorldScopedMaps Class Reference

#include <world_scoped_maps.h>

Inheritance diagram for tuw::WorldScopedMaps:
Inheritance graph
[legend]

Public Member Functions

template<typename T >
void circle (T &map, const Point2D &p, int radius, const cv::Scalar &color, int thickness=1, int lineType=CV_AA) const
 
template<typename T >
cv::Scalar_< T > get (cv::Mat_< T > &map, const Point2D &p) const
 
int height () const
 
std::string infoHeader () const
 
void init (int width_pixel, int height_pixel, double min_y, double max_y, double min_x, double max_x, double rotation=0)
 
template<typename T >
void init (const T &metadata)
 
bool initialized ()
 
template<typename T >
void line (T &map, const Point2D &p0, const Point2D &p1, const cv::Scalar &color, int thickness=1, int lineType=CV_AA) const
 
Point2D m2w (const Point2D &src) const
 
Point2D m2w (double x, double y) const
 
Point2Dm2w (const Point2D &src, Point2D &des) const
 
double max_x () const
 
double max_y () const
 
double min_x () const
 
double min_y () const
 
const cv::Matx33d & Mm2w () const
 
const cv::Matx33d & Mw2m () const
 
WorldScopedMapsoperator= (const WorldScopedMaps &)=default
 
WorldScopedMapsoperator= (WorldScopedMaps &&)=default
 
double scale_w2m (double v) const
 
double scale_x () const
 
double scale_y () const
 
Point2D w2m (const Point2D &src) const
 
Point2D w2m (double x, double y) const
 
Point2Dw2m (const Point2D &src, Point2D &des) const
 
int width () const
 
 WorldScopedMaps ()
 
 WorldScopedMaps (const WorldScopedMaps &)=default
 
 WorldScopedMaps (WorldScopedMaps &&)=default
 
virtual ~WorldScopedMaps ()=default
 

Private Member Functions

void init ()
 initializes the transformation matrices More...
 

Private Attributes

double dx_
 
double dy_
 dimension of the visualized space More...
 
int height_pixel_
 dimensions of the canvas in pixel More...
 
double max_x_
 
double max_y_
 
double min_x_
 
double min_y_
 
cv::Matx33d Mm2w_
 transformation map to world More...
 
cv::Matx33d Mw2m_
 transformation world to map More...
 
double mx_
 
double my_
 offset of the visualized space More...
 
double ox_
 
double oy_
 image offset More...
 
double rotation_
 area and rotation of the visualized space More...
 
double sx_
 
double sy_
 scale More...
 
int width_pixel_
 

Detailed Description

class to visualize information using OpenCV matrices

Definition at line 17 of file world_scoped_maps.h.

Constructor & Destructor Documentation

WorldScopedMaps::WorldScopedMaps ( )

Definition at line 13 of file world_scoped_maps.cpp.

virtual tuw::WorldScopedMaps::~WorldScopedMaps ( )
virtualdefault
tuw::WorldScopedMaps::WorldScopedMaps ( const WorldScopedMaps )
default
tuw::WorldScopedMaps::WorldScopedMaps ( WorldScopedMaps &&  )
default

Member Function Documentation

template<typename T >
void tuw::WorldScopedMaps::circle ( T &  map,
const Point2D p,
int  radius,
const cv::Scalar &  color,
int  thickness = 1,
int  lineType = CV_AA 
) const
inline

draws a circle given in the visualization space (meter, ....) into a pixel map

Parameters
mapopencv matrix
plocation
radiusradius
colorcolor –>
See also
opencv
Parameters
thicknessline thickness –>
See also
opencv
Parameters
lineTypeline type –>
See also
opencv

Definition at line 108 of file world_scoped_maps.h.

template<typename T >
cv::Scalar_<T> tuw::WorldScopedMaps::get ( cv::Mat_< T > &  map,
const Point2D p 
) const
inline

return a copy of the value located at p in the visual space (meter, ....)

Parameters
mapopencv matrix
plocation

Definition at line 118 of file world_scoped_maps.h.

int WorldScopedMaps::height ( ) const
Returns
canvas (image) height

Definition at line 102 of file world_scoped_maps.cpp.

std::string WorldScopedMaps::infoHeader ( ) const

returns information about the maps metadata

Parameters
formatusing printf format
Returns
string

Definition at line 109 of file world_scoped_maps.cpp.

void WorldScopedMaps::init ( )
private

initializes the transformation matrices

Definition at line 24 of file world_scoped_maps.cpp.

void WorldScopedMaps::init ( int  width_pixel,
int  height_pixel,
double  min_y,
double  max_y,
double  min_x,
double  max_x,
double  rotation = 0 
)

used to initialize the figure

Parameters
width_pixelpixel size of the canvas
height_pixelpixel size of the canvas
min_yminimal y of the visualized space
max_ymaximal y of the visualized space
min_xminimal x of the visualized space
max_xmaximal x of the visualized space
rotationrotation of the visualized spaces

Definition at line 44 of file world_scoped_maps.cpp.

template<typename T >
void tuw::WorldScopedMaps::init ( const T &  metadata)
inline

used to initialize the figure based on a ROS nav_msgs/MapMetaData

Parameters
Tnav_msgs/MapMetaData

Definition at line 54 of file world_scoped_maps.h.

bool WorldScopedMaps::initialized ( )
Returns
true if the figure is initialized

Definition at line 20 of file world_scoped_maps.cpp.

template<typename T >
void tuw::WorldScopedMaps::line ( T &  map,
const Point2D p0,
const Point2D p1,
const cv::Scalar &  color,
int  thickness = 1,
int  lineType = CV_AA 
) const
inline

draws a line given in the visualization space (meter, ....) into a pixel map

Parameters
mapopencv matrix
p0start point
p1end point
colorcolor –>
See also
opencv
Parameters
thicknessline thickness –>
See also
opencv
Parameters
lineTypeline type –>
See also
opencv

Definition at line 95 of file world_scoped_maps.h.

Point2D WorldScopedMaps::m2w ( const Point2D src) const

transforms a point from the image space to visualization space (map -> world)

Parameters
srcpoint in image space (map [pixel])
Returns
point in visualization space (world)

Definition at line 71 of file world_scoped_maps.cpp.

Point2D WorldScopedMaps::m2w ( double  x,
double  y 
) const

transforms a point from the image space to visualization space (map -> world)

Parameters
xx coordinate in image space eg. [pixel]
yy coordinate in image space eg. [pixel]
Returns
point in visualization space (world) eg. [m]

Definition at line 74 of file world_scoped_maps.cpp.

Point2D & WorldScopedMaps::m2w ( const Point2D src,
Point2D des 
) const

transforms a point from the image space to visualization space (map -> world)

Parameters
srcpoint in image space (map [pixel])
despoint in visualization space (world)
Returns
reference to des

Definition at line 77 of file world_scoped_maps.cpp.

double WorldScopedMaps::max_x ( ) const
Returns
maximal x of the visualized space

Definition at line 81 of file world_scoped_maps.cpp.

double WorldScopedMaps::max_y ( ) const
Returns
maximal y of the visualized space

Definition at line 90 of file world_scoped_maps.cpp.

double WorldScopedMaps::min_x ( ) const
Returns
minimal x of the visualized space

Definition at line 84 of file world_scoped_maps.cpp.

double WorldScopedMaps::min_y ( ) const
Returns
minimal y of the visualized space

Definition at line 93 of file world_scoped_maps.cpp.

const cv::Matx33d & WorldScopedMaps::Mm2w ( ) const
Returns
transformation matrix from the image space to visualization space (map -> world)

Definition at line 58 of file world_scoped_maps.cpp.

const cv::Matx33d & WorldScopedMaps::Mw2m ( ) const
Returns
transformation matrix from the visualization space to image space (world -> map)

Definition at line 55 of file world_scoped_maps.cpp.

WorldScopedMaps& tuw::WorldScopedMaps::operator= ( const WorldScopedMaps )
default
WorldScopedMaps& tuw::WorldScopedMaps::operator= ( WorldScopedMaps &&  )
default
double WorldScopedMaps::scale_w2m ( double  v) const

returns a distance measure scaled

Parameters
vvalue to be scaledt
Returns
distance

Definition at line 106 of file world_scoped_maps.cpp.

double WorldScopedMaps::scale_x ( ) const
Returns
computed x scale

Definition at line 87 of file world_scoped_maps.cpp.

double WorldScopedMaps::scale_y ( ) const
Returns
computed y scale

Definition at line 96 of file world_scoped_maps.cpp.

Point2D WorldScopedMaps::w2m ( const Point2D src) const

transforms a point from the visualization space to image space (world -> map)

Parameters
srcpoint in visualization space (world)
Returns
point in image space (map [pixel])

Definition at line 61 of file world_scoped_maps.cpp.

Point2D WorldScopedMaps::w2m ( double  x,
double  y 
) const

transforms a point from the visualization space to image space (world -> map)

Parameters
xx coordinate in visualization space (world) eg. [m]
yy coordinate in visualization space (world) eg. [m]
Returns
point in image space eg. [pixel]

Definition at line 64 of file world_scoped_maps.cpp.

Point2D & WorldScopedMaps::w2m ( const Point2D src,
Point2D des 
) const

transforms a point from the visualization space to image space (world -> map)

Parameters
srcpoint in visualization space (world)
despoint in image space (map [pixel])
Returns
reference to des

Definition at line 67 of file world_scoped_maps.cpp.

int WorldScopedMaps::width ( ) const
Returns
canvas (image) width

Definition at line 99 of file world_scoped_maps.cpp.

Member Data Documentation

double tuw::WorldScopedMaps::dx_
private

Definition at line 22 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::dy_
private

dimension of the visualized space

Definition at line 22 of file world_scoped_maps.h.

int tuw::WorldScopedMaps::height_pixel_
private

dimensions of the canvas in pixel

Definition at line 20 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::max_x_
private

Definition at line 21 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::max_y_
private

Definition at line 21 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::min_x_
private

Definition at line 21 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::min_y_
private

Definition at line 21 of file world_scoped_maps.h.

cv::Matx33d tuw::WorldScopedMaps::Mm2w_
private

transformation map to world

Definition at line 19 of file world_scoped_maps.h.

cv::Matx33d tuw::WorldScopedMaps::Mw2m_
private

transformation world to map

Definition at line 18 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::mx_
private

Definition at line 24 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::my_
private

offset of the visualized space

Definition at line 24 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::ox_
private

Definition at line 23 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::oy_
private

image offset

Definition at line 23 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::rotation_
private

area and rotation of the visualized space

Definition at line 21 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::sx_
private

Definition at line 25 of file world_scoped_maps.h.

double tuw::WorldScopedMaps::sy_
private

scale

Definition at line 25 of file world_scoped_maps.h.

int tuw::WorldScopedMaps::width_pixel_
private

Definition at line 20 of file world_scoped_maps.h.


The documentation for this class was generated from the following files:


tuw_geometry
Author(s): Markus Bader
autogenerated on Mon Jun 10 2019 15:33:09