Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
jafar::dtm::Dtm Class Reference

A wrapper for the calife DTM data struct. More...


Detailed Description

A wrapper for the calife DTM data struct.

Definition at line 22 of file Dtm.hpp.

#include <Dtm.hpp>

List of all members.

Public Types

enum  file_method { DTM_ASCII, DTM_ARCGIS, DTM_BIN }
 List of different method used to load / save a dtm Used by to_file and from_file. More...
enum  fill_method { DTM_FILL_BASIC, DTM_FILL_QUAD, DTM_FILL_DYNAMIC }
 List of algorithm used to compute the dtm Used by fuse.
enum  gdhe_method { DTM_GDHE_FULL, DTM_GDHE_UPDATE }
 List of method used to fill a gdhe dtm file Use by to_gdhe.
enum  image_method {
  DTM_NB_POINTS, DTM_Z_MOYEN, DTM_SIGMA_Z, DTM_CONFIDENCE,
  DTM_HSTATE, DTM_VISIBILITY, DTM_HSTATE_VISIBILITY
}
 List of way to fill a dtm image Use by to_image. More...

Public Member Functions

 Dtm (const std::string conf_file=default_conf_file, dtm_type type=DTM_FIXED, dtm_stockage stockage=X_LIGNES, const fill_method fill_way=DTM_FILL_BASIC)
 Dtm (const Dtm &)
void dup (const Dtm &a)
 Make a true copy of dtm a.
void dup_empty (const Dtm &a)
 Make a copy of the structure of dtm a (It means that we don't copy the value stored in the dtm, only its caracteristics)
void to_file (const std::string &path, const file_method way) const
 Write the current dtm in a file.
void from_file (const std::string &path, const file_method way)
 Read a dtm from a file.
void set_gdhe_display_params (double scale, double offset, int luminance)
 Modify the display parameters for gdhe (aka _zscale, _zoffset, and _luminance)
int to_gdhe (const std::string &path, const gdhe_method way) const
 Dump the current DTM in a gdhe file (to future gdhe display)
void from_gdhe (const std::string &path)
 Read a DTM from a gdhe file (mainly for debug)
int fuse (jafar::calife::Image3d &im3d, jafar::geom::T3D &t3d, jafar::geom::T3D &s2o)
 Integrage one image to the dtm.
int prepare_dynamic_fuse (jafar::calife::Image3d &im3d, jafar::geom::T3D &left, jafar::geom::T3D &right, double *intrinsec_rectified_param, int reduction, double max_depth)
 Prepare local dtm to be used for further step of DTM_FILL_DYNAMIC It must be called only one time, before the first call to fuse.
bool is_ready_for_dynamic_fuse ()
 A quick test to check that the object is ready to dynamicly fuse image.
int get_imax () const
 Get the max line number in the DTM.
int get_jmax () const
 Get the max column number in the DTM.
bool get_z (int i, int j, float *z) const
 Get the current z for a cell of the DTM.
void set_z (int i, int j, float)
 Set the z for a cell of the DTM.
double get_scale () const
 Get the scale factor for DTM.
double get_x_orig () const
 Get the the x origin of the DTM.
double get_y_orig () const
 Get the the y origin of the DTM.
void min_max ()
 Compute the min_max of the DTM (aka the differents bounds.
void print_info () const
 Print different informations for the DTM (things like size, scales, min/max z, ...)
void print_cell_info (int i, int j) const
 Print different informations for a cell of the DTM (actual height, its positions ...)
DTM * get_data () const
 Return the internal DTM data struct.
void write_image (jafar::image::Image &img, const image_method &method, bool global=true) const
 This function generate a rgb image representing some interesting values stored in the dtm.
jafar::image::Imageto_image (const image_method &method, bool global=true) const
 This function generate a rgb image representating some interesting value stored in the dtm.

Static Public Member Functions

static void scaleZ (const std::string &orig, double scale, const std::string &res)
 This function generate a new dtm changing the scale_z setting (so it will expand or reduce the relief).

Static Public Attributes

static std::string default_conf_file

Private Member Functions

void to_image_nb_points (jafar::image::Image &, DTM *) const
void to_image_z_moyen (jafar::image::Image &, DTM *) const
void to_image_sigma_z (jafar::image::Image &, DTM *) const
void to_image_hstate (jafar::image::Image &, DTM *) const
void to_image_visibility (jafar::image::Image &, DTM *) const
void to_image_hstate_visibility (jafar::image::Image &, DTM *) const
void _write_image (jafar::image::Image &, const image_method &, DTM *) const

Private Attributes

DTM * pdtm
 internal ptr on the calife data struct
DTM * local_pdtm
double _zscale
 temp dtm used by the DTM_FILL_DYNAMIC, NULL in other case
double _zoffset
int _luminance
fill_method _way
 Method used to fill image.

Member Enumeration Documentation

List of different method used to load / save a dtm Used by to_file and from_file.

Enumerator:
DTM_ASCII 

ASCII file (readable by human.

DTM_ARCGIS 

ARCGIS file (classic data file, only avaiblable for reading.

DTM_BIN 

Binary file (not readable by human so)

Definition at line 28 of file Dtm.hpp.

List of way to fill a dtm image Use by to_image.

Enumerator:
DTM_NB_POINTS 

Will represent nb points by cell.

DTM_Z_MOYEN 

Z_moyen by cell.

DTM_SIGMA_Z 

sigma_z by cell

DTM_CONFIDENCE 

confidance by cell (only make sense with DTM_FILL_QUAD

DTM_HSTATE 

vertical or flat

DTM_VISIBILITY 

Visibility field (only make sense in DTM_FILL_DYNAMIC and local_dtm.

DTM_HSTATE_VISIBILITY 

Visibility field + (vertical or flat)

Definition at line 54 of file Dtm.hpp.


Member Function Documentation

void jafar::dtm::Dtm::dup ( const Dtm a)

Make a true copy of dtm a.

Parameters:
ais the origin dtm
Returns:
nothing. The current dtm is now equal to a
void jafar::dtm::Dtm::dup_empty ( const Dtm a)

Make a copy of the structure of dtm a (It means that we don't copy the value stored in the dtm, only its caracteristics)

Parameters:
ais the origin dtm
Returns:
nothing. The current dtm is empty but has the same properties than a
void jafar::dtm::Dtm::from_file ( const std::string &  path,
const file_method  way 
)

Read a dtm from a file.

Parameters:
pathis a constant string representing the file to read
wayis a constant file_method which describes how to read the file
Returns:
Nothing.
pdtm is modified.
void jafar::dtm::Dtm::from_gdhe ( const std::string &  path)

Read a DTM from a gdhe file (mainly for debug)

Parameters:
pathis a constant string representanting the file to read.
Returns:
Nothing.
pdtm is modified.

Integrage one image to the dtm.

Parameters:
im3dis the image to integrate
t3dis the transformation between the global frame and the robot frame (not so important)
s2ois the transformation between the global frame and the sensor frame (only useful if way = DTM_FILL_DYNAMIC
Returns:
0 for success and pdtm is modified.
-1 otherwise.
DTM* jafar::dtm::Dtm::get_data ( ) const

Return the internal DTM data struct.

It is useful when we need to call directly some calife function.

Returns:
the internal dtm This funciton must be called in context which only read the dtm structure (or if you know exactly what it doest).

Get the max line number in the DTM.

Returns:
the max line number

Get the max column number in the DTM.

Returns:
the max column number
double jafar::dtm::Dtm::get_scale ( ) const

Get the scale factor for DTM.

Returns:
the scale between length and cell into the DTM
double jafar::dtm::Dtm::get_x_orig ( ) const

Get the the x origin of the DTM.

Returns:
the x origin of the DTM
double jafar::dtm::Dtm::get_y_orig ( ) const

Get the the y origin of the DTM.

Returns:
the y origin of the DTM
bool jafar::dtm::Dtm::get_z ( int  i,
int  j,
float *  z 
) const

Get the current z for a cell of the DTM.

Parameters:
iis the line index in the DTM
jis the column index in the DTM
zis the resulting z
Returns:
False if any error or if the cell is not filled,
True otherwise and z is filled

A quick test to check that the object is ready to dynamicly fuse image.

Returns:
true if it is ready (false otherwise)

Definition at line 195 of file Dtm.hpp.

References _way.

Compute the min_max of the DTM (aka the differents bounds.

Returns:
Nothing.
pdtm is modified.
int jafar::dtm::Dtm::prepare_dynamic_fuse ( jafar::calife::Image3d im3d,
jafar::geom::T3D left,
jafar::geom::T3D right,
double *  intrinsec_rectified_param,
int  reduction,
double  max_depth 
)

Prepare local dtm to be used for further step of DTM_FILL_DYNAMIC It must be called only one time, before the first call to fuse.

(you may need to recall it if you change roll / pitch of the camera)

Parameters:
im3dis a reference image (mainly used for its size ...)
leftis the transformation between left camera and robot (yaw must be 0)
rightis the transformation between right camera and robot (yaw must be 0)
intrinsec_rectified_paramis the intrinsec rectified matrix for stereo
reductionis the reduction between the full size image and the image currenlty threated
max_depthis the maximum depth of the computed view field
Returns:
0 in case of success : local_pdtm has a valid value
-1 in case of error : local_pdtm is NULL, and so you can't fuse any image
void jafar::dtm::Dtm::print_cell_info ( int  i,
int  j 
) const

Print different informations for a cell of the DTM (actual height, its positions ...)

Parameters:
iis the line index of the DTM
jis the column index of the DTM
Returns:
Nothing

Print different informations for the DTM (things like size, scales, min/max z, ...)

Returns:
Nothing
static void jafar::dtm::Dtm::scaleZ ( const std::string &  orig,
double  scale,
const std::string &  res 
) [static]

This function generate a new dtm changing the scale_z setting (so it will expand or reduce the relief).

Parameters:
origis a const string representing the path of the dtm file origin
scaleis the new scale
resis a const string representing the path of the dtm result file
Returns:
File res is written with the new dtm.
void jafar::dtm::Dtm::set_z ( int  i,
int  j,
float   
)

Set the z for a cell of the DTM.

Parameters:
iis the line index in the DTM
jis the column index in the DTM
zis the value we want to set for this cell
Returns:
Nothing.
pdtm is modified.
Warning:
Use this only to write 'virtual' dtm, not to modify a 'real' dtm.
void jafar::dtm::Dtm::to_file ( const std::string &  path,
const file_method  way 
) const

Write the current dtm in a file.

Parameters:
pathis a constant string representing the file we need to write
wayis a constant file_method which describes how to write the file
Returns:
Nothing.
int jafar::dtm::Dtm::to_gdhe ( const std::string &  path,
const gdhe_method  way 
) const

Dump the current DTM in a gdhe file (to future gdhe display)

Parameters:
pathis a constant string representing the file to write
wayis a const gdhe_method which describes how to write the file
Returns:
Nothing.
jafar::image::Image* jafar::dtm::Dtm::to_image ( const image_method method,
bool  global = true 
) const

This function generate a rgb image representating some interesting value stored in the dtm.

Parameters:
methodprecise which information will be represented
global: if true, gave an image from the full dtm, if false the local dtm (only make sense in DTM_FILL_DYNAMIC
Returns:
the generated image
void jafar::dtm::Dtm::write_image ( jafar::image::Image img,
const image_method method,
bool  global = true 
) const

This function generate a rgb image representing some interesting values stored in the dtm.

Parameters:
imgrepresents the image that will be written. It must be as large as the dtm
methodprecise which information will be represented
global: if true, gave an image from the full dtm, if false the local dtm (only make sense in DTM_FILL_DYNAMIC
Returns:
nothing. img has been modified.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:35 for Jafar by doxygen 1.7.6.1
LAAS-CNRS