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

Active search tesselation grid for segments. More...


Detailed Description

Active search tesselation grid for segments.

Author:
bhautboi

Definition at line 38 of file activeSegmentSearch.hpp.

#include <activeSegmentSearch.hpp>

List of all members.

Public Types

typedef std::vector
< std::vector
< observation_ptr_t > > 
Grid

Public Member Functions

 ActiveSegmentSearchGrid (const int &imgSize_h, const int &imgSize_v, const int &nCells_h, const int &nCells_v, const int &margin=0, const int &separation=0)
 Constructor.
void clear ()
 Clear grid.
void renew ()
 Clear grid and position it at a new random location.
void addObs (const vec4 &pix, observation_ptr_t obsPtr)
 Add a projected segment to the grid.
bool getRoi (image::ConvexRoi &roi)
 Get ROI of a random empty cell.
void setFailed (const image::ConvexRoi &roi)
 Call this after getRoi if no point was found in the roi in order to avoid searching again in it.

Public Attributes

Grid projections

Private Member Functions

template<class Vec >
veci4 pix2cell (const Vec &pix)
 Get cell corresponding to pixel.
veci2 cellOrigin (const veci2 &cell)
 Get cell origin (exact pixel)
vec2 cellCenter (const veci2 &cell)
 Get cell center (can be decimal if size of cell is an odd number of pixels)
bool pickEmptyCell (veci2 &cell)
 Get one random empty cell.
void cell2roi (const veci2 &cell, image::ConvexRoi &roi)
 Get the region of interest, reduced by a margin.

Private Attributes

veci2 imgSize
veci2 gridSize
veci2 cellSize
veci2 offset
mati projectionsCount
mati emptyCellsTile_tmp
int separation
int margin
int cells_h

Friends

std::ostream & operator<< (std::ostream &s, ActiveSegmentSearchGrid const &grid)

Constructor & Destructor Documentation

jafar::rtslam::ActiveSegmentSearchGrid::ActiveSegmentSearchGrid ( const int &  imgSize_h,
const int &  imgSize_v,
const int &  nCells_h,
const int &  nCells_v,
const int &  margin = 0,
const int &  separation = 0 
)

Constructor.

Parameters:
imgSize_hhorizontal image size, in pixels.
imgSize_vvertical image size.
nCells_hhorizontal number of cells per image width.
nCells_vvertical number of cells per image height.
separationminimum separation between existing and new points.

Member Function Documentation

void jafar::rtslam::ActiveSegmentSearchGrid::addObs ( const vec4 pix,
observation_ptr_t  obsPtr 
)

Add a projected segment to the grid.

Parameters:
pixthe segment to add.

Clear grid.

Sets all cell counters to zero.

Get ROI of a random empty cell.

Parameters:
roithe resulting ROI
Returns:
true if ROI exists.

Clear grid and position it at a new random location.

Sets all cell counters to zero and sets a new random grid position.

Call this after getRoi if no point was found in the roi in order to avoid searching again in it.

Parameters:
roithe ROI where nothing was found

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:44 for Jafar by doxygen 1.7.6.1
LAAS-CNRS