Public Member Functions | Public Attributes | Private Attributes | List of all members
LausTracker Class Reference

Class to manage all information about the labyrinth position and structure as well as the robot positions. More...

#include <laustracker.h>

Public Member Functions

 LausTracker ()
 Constructor. More...
 
 ~LausTracker ()
 Deconstructor. More...
 
bool locate_labyrinth_manually (const Mat &image)
 The user should manually click at every labyrinth corner. More...
 
bool locate_labyrinth_automatically (const Mat &image, bool reddots=false)
 Try to find the labyrinth automatically. More...
 
vector< Point > get_labyrinth_pos ()
 Returns the labyrinth position. More...
 
bool save_labyrinth_pos ()
 Save the labyrinth position to ~/.laustracker/labyrinth_pos.txt. More...
 
bool load_labyrinth_pos ()
 Load the labyrinth position from ~/.laustracker/labyrinth_pos.txt. More...
 
void clear_labyrinth_pos ()
 Clear the labyrinth position. More...
 
void locate_walls (Mat &image)
 Check the existence of walls. More...
 
void locate_black_lines (Mat &image)
 Check the existence of walls by checking the visibility of black lines. More...
 
void update_robot_positions (Mat image)
 Update robot positions. More...
 
void setDebug (int level)
 Show debug information. More...
 
bool labyrinthFound ()
 Is the labyrinth position already available. More...
 
void printMap ()
 Print the labyrinth map. More...
 
Mat improve_image (const Mat &image)
 Improve camera images (undistort, wrap) More...
 
void imshow (const string &windoname, const Mat &image)
 Display a image and automatically crop it if the labyrinth position is known-. More...
 
void set_undistort (bool state)
 Change the undistort setting. More...
 
void set_wrap (bool state)
 The wrap setting, whether a perspective transformation should be done. More...
 
void use_mask_to_locate_walls (String mask_img_filename)
 Set a mask image to locate walls. More...
 

Public Attributes

LabyrinthMap map
 Instance of LabyrinthMap. More...
 
RobotTracker robots
 Instance of RobotTracker. More...
 
ImageUndistort Undistort
 Instance of ImageUndistort. More...
 
String labyrinth_conf_filename
 Path to a labyrinth configuration file. More...
 

Private Attributes

vector< Point > labyrinth_pos
 The labyrinth position. More...
 
int debuglevel
 
bool labyrinth_found
 Was the labyrinth found? More...
 
bool wrap
 Whether a perspective transformation is needed. More...
 
bool undistort
 Undistort the image. More...
 
PerspectiveWrapper Wrapper
 Instance of PerspectiveWrapper. More...
 
bool use_mask
 
String mask_filename
 
string labyrinth_pos_path
 File to save or load the labyrinth position. More...
 

Detailed Description

Class to manage all information about the labyrinth position and structure as well as the robot positions.

Definition at line 62 of file laustracker.h.

Constructor & Destructor Documentation

LausTracker::LausTracker ( )

Constructor.

Initialization

LausTracker::~LausTracker ( )

Deconstructor.

Free memory.

Member Function Documentation

void LausTracker::clear_labyrinth_pos ( )

Clear the labyrinth position.

vector<Point> LausTracker::get_labyrinth_pos ( )

Returns the labyrinth position.

Returns
The labyrinth position.
Mat LausTracker::improve_image ( const Mat &  image)

Improve camera images (undistort, wrap)

Parameters
imageThe source image
Returns
Improved image
void LausTracker::imshow ( const string &  windoname,
const Mat &  image 
)

Display a image and automatically crop it if the labyrinth position is known-.

Parameters
windonameWindow title
imageImage to display
bool LausTracker::labyrinthFound ( )

Is the labyrinth position already available.

Returns
true, if the labyrinth position is known
bool LausTracker::load_labyrinth_pos ( )

Load the labyrinth position from ~/.laustracker/labyrinth_pos.txt.

Returns
true, if the labyrinth position was loaded.
void LausTracker::locate_black_lines ( Mat &  image)

Check the existence of walls by checking the visibility of black lines.

Parameters
imageImage of the labyrinth to check for walls.
bool LausTracker::locate_labyrinth_automatically ( const Mat &  image,
bool  reddots = false 
)

Try to find the labyrinth automatically.

Parameters
imageImage of the labyrinth.
reddotsUse red markers at the labyrinth corners to locate the labyrinth.
Returns
true, if something was found the could be the labyrinth.
bool LausTracker::locate_labyrinth_manually ( const Mat &  image)

The user should manually click at every labyrinth corner.

Parameters
imageImage of the labyrinth.
Returns
true, if the user has selected four corners that form a quad.
void LausTracker::locate_walls ( Mat &  image)

Check the existence of walls.

Parameters
imageImage of the labyrinth to check for walls.
void LausTracker::printMap ( )

Print the labyrinth map.

bool LausTracker::save_labyrinth_pos ( )

Save the labyrinth position to ~/.laustracker/labyrinth_pos.txt.

Returns
true, if the labyrinth position could be saved.
void LausTracker::set_undistort ( bool  state)

Change the undistort setting.

Parameters
stateNew value
void LausTracker::set_wrap ( bool  state)

The wrap setting, whether a perspective transformation should be done.

Parameters
stateNew value
void LausTracker::setDebug ( int  level)

Show debug information.

Parameters
levelDebuglevel
void LausTracker::update_robot_positions ( Mat  image)

Update robot positions.

Parameters
imageImage of the labyrinth to check for robots.
void LausTracker::use_mask_to_locate_walls ( String  mask_img_filename)

Set a mask image to locate walls.

Parameters
mask_img_filenameRelative path to the mask image.

Member Data Documentation

int LausTracker::debuglevel
private

Print debug messages and show debug images.

debuglevel:

  • = 0: No debug output
  • > 0: Enable some debug messages
  • > 1: Additional delay functions
  • > 2: Print debug messages
  • > 3: Show debug images
  • > 4: Additional debug output

Definition at line 81 of file laustracker.h.

String LausTracker::labyrinth_conf_filename

Path to a labyrinth configuration file.

Definition at line 113 of file laustracker.h.

bool LausTracker::labyrinth_found
private

Was the labyrinth found?

Definition at line 84 of file laustracker.h.

vector<Point> LausTracker::labyrinth_pos
private

The labyrinth position.

Definition at line 67 of file laustracker.h.

string LausTracker::labyrinth_pos_path
private

File to save or load the labyrinth position.

Definition at line 99 of file laustracker.h.

LabyrinthMap LausTracker::map

Instance of LabyrinthMap.

Definition at line 104 of file laustracker.h.

RobotTracker LausTracker::robots

Instance of RobotTracker.

Definition at line 107 of file laustracker.h.

bool LausTracker::undistort
private

Undistort the image.

Definition at line 90 of file laustracker.h.

ImageUndistort LausTracker::Undistort

Instance of ImageUndistort.

Definition at line 110 of file laustracker.h.

bool LausTracker::wrap
private

Whether a perspective transformation is needed.

Definition at line 87 of file laustracker.h.

PerspectiveWrapper LausTracker::Wrapper
private

Instance of PerspectiveWrapper.

Definition at line 93 of file laustracker.h.


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