AURobotServers  4
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
UResObj3d Class Reference

#include <uresobj3d.h>

Inheritance diagram for UResObj3d:
Inheritance graph

Public Member Functions

void addObstacleParameters ()
 
bool do3dCloudFromSvs (UImg3Dpoints *cloud)
 
bool do3dGroundPlane (UImg3Dpoints *cloud, bool doGndEdgeObst, bool doImg)
 find candidates for human detections. Estimates the ground plane from 3D cloud. More...
 
bool do3dVoxels (UImg3Dpoints *cloud, bool justHuman, bool doImg)
 find candidates for human detections. Estimates the ground plane from 3D cloud. Isolates 3D voxel volumens, and filter human sized volumens. More...
 
void doGndPlaneMask (int maskImgNum, UPlane plane, UImg3Dpoints *cloud, double cellSize, double planeDist, bool erode, bool dilate)
 
bool get3dCloud (const char *source, UImg3Dpoints **cloud)
 Get the point cloud from ing3d cloud source. The cloud is actually stored in the svs module, and a pointer the coud is provided only. Remember to lock it while processing and release after use. More...
 
bool get3dCloudFromSvs (bool getAny, UImg3Dpoints **cloud)
 Get the newest point cloud from svs. The cloud is actually stored in the svs module, and a pointer the coud is provided only. Remember to lock it while processing and release after use. More...
 
UPlane getGroundPlane ()
 get estimated ground plane More...
 
double getGroundPlaneQuality ()
 get the quality of the ground-plane Quality is the relative count of ponts in the ground plane, relative to all points More...
 
virtual void getObstacleGroupSettings (UObj3dGroup *og)
 
virtual void obstDataUpdated (UTime poseTime)
 
virtual const char * print (const char *preString, char *buff, int buffCnt)
 
virtual const char * snprint (const char *preString, char *buff, int buffCnt)
 
 UResObj3d ()
 
virtual ~UResObj3d ()
 
- Public Member Functions inherited from UObj3dPool
void addObstacle (UPolygon *newPoly, UPoseTime odoPose, bool isHuman, bool isGndBased)
 
UObj3dGroupadvanceNewGroup ()
 
void clear ()
 
void clearGrp (int idx)
 
UObj3dGroupgetGroup (int fromNewest)
 
int getGroupsCnt ()
 
UObj3dGroupgetObstGrp (UPoseTime pt)
 
void print (const char *prestr)
 
void setLogFile (FILE *logFile)
 
void setNewGrpDist (double value)
 
void setNewGrpTime (double value)
 
 UObj3dPool ()
 
virtual ~UObj3dPool ()
 
- Public Member Functions inherited from UResVarPool
int addMethod (const char *formalName, const char *paramTypes, const char *comment)
 
int addMethodV (const char *formalName, const char *paramTypes, const char *comment)
 
UVarPooladdStruct (const char *name, const char *comment, bool copy=false)
 
UVariableaddVar (const char *name, const double initialValue, const char *type, const char *comment)
 
UVariableaddVar (const char *name, const char *initialValue, const char *type, const char *comment)
 
UVariableaddVarA (const char *name, const char *initialValue, const char *type, const char *comment)
 
bool callGlobal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt)
 
bool callGlobalV (const char *name, const char *paramOrder, UVariable **params, UDataBase **returnStruct, int *returnStructCnt)
 Call a method from the root var pool scope It may be in the structure direct (no '.') or in any sub-structure that the 'name.subname' indicate. More...
 
bool callLocal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt)
 
bool callVS (const char *function, const char *stringParam)
 
int callVSCD (const char *function, const char *strPar, UDataBase *data, int cooSys)
 
void createBaseVar ()
 
virtual bool createVarSpace (const int varCnt, const int structCnt, const int methCnt, const char *note, bool copy=false)
 
bool getGlobalString (const char *name, const char **value)
 
bool getGlobalValue (const char *name, double *value)
 
bool getGlobalValue (const char *name, const char **value)
 
bool getGlobalValue (const char *name, bool *value)
 
bool getGlobalValue (const char *name, UTime *value)
 
bool getLocalValue (const char *name, double *value)
 get a value in this variable tree More...
 
bool getLocalValue (const char *name, bool *value)
 
bool getLocalValue (const char *name, UTime *value)
 
double getLocalValue (int idx)
 
UPosition getLocalValue3D (int idx)
 
UPosRot getLocalValue6D (int idx)
 
bool getLocalValueBool (int idx)
 
int getLocalValueInt (int idx)
 
UTime getLocalValueTime (int idx)
 
const char * getLogFileName ()
 
const char * getVarDescription (int idx)
 
UVarCalcgetVarPool ()
 
virtual bool gotAllResources (char *missingThese, int missingTheseCnt)
 
bool isLogFileOpen ()
 
bool isLogFileOpen (const char *structName)
 
bool isVarPoolUpdated (int lastCnt, int *newCnt)
 
void logFileClose ()
 
bool logFileOpen ()
 
void logFileStart (const char *structName, bool open)
 
virtual bool methodCall (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct=NULL, int *returnStructCnt=NULL)
 
bool setGlobalVar (const char *name, const double value, bool mayAdd)
 Assigns a value to a variable. The variable may be a part of a structure. More...
 
bool setLocalVar (int idx, double value, const int element)
 
bool setLocalVar (const char *name, const double value, bool mayAdd)
 Assigns a value to a variable. The variable may be a part of a structure. More...
 
bool setLocalVar3D (int idx, UPosition *value)
 
bool setLocalVar6D (int idx, UPosRot *value)
 
bool setLocalVarAdd (int idx, double value, const int element)
 
bool setLocalVarPose (int idx, UPose *value)
 
virtual bool setResource (UResBase *resource, bool remove)
 
void setVarPool (UVarCalc *sharedVarPool)
 
int updateQTvars (int structIdx)
 
 UResVarPool ()
 
virtual ~UResVarPool ()
 
- Public Member Functions inherited from UResBase
void createReplayVar (UVarPool *pool)
 
virtual void createResources ()
 
UCmdExegetCorePointer ()
 
char * getLogFileName (char *fn, const int fnCnt)
 
int getResFuncIdx ()
 
const char * getResID ()
 
int getResVersion ()
 
bool isA (const char *idStr)
 
bool isAlsoA (const char *id)
 
virtual void print (const char *preString)
 
virtual void saveSettings ()
 
void setCorePointer (UCmdExe *serverCore)
 
void setResFuncIdx (int idx)
 
virtual void setResID (const char *id, const int version)
 
virtual void stop (bool)
 
virtual void updateReplayStatus ()
 
 UResBase ()
 
virtual ~UResBase ()
 
- Public Member Functions inherited from UReplay
void addChild (UReplay *child)
 
virtual bool decodeReplayLine (char *)
 
char * getLogFileName (char *fn, const int fnCnt)
 
char * getReplayFileName (char *fn, const int fnCnt)
 
int getReplayLogLine ()
 
bool isReplay ()
 
bool isReplayFileOpen ()
 
void removeChild (UReplay *child)
 
virtual void replayAdvanceTime (UTime untilTime)
 
void replaySetBaseFileName (const char *name, const char *preName="")
 
void replaySetFileName (const char *name)
 
virtual bool replayStep ()
 
int replayStep (int steps)
 
virtual bool replayToTime (UTime untilTime)
 
void setParent (UReplay *parent)
 
bool setReplay (bool value)
 
 UReplay ()
 
virtual ~UReplay ()
 
- Public Member Functions inherited from ULock
bool lock ()
 
void lockInit ()
 
void post ()
 
bool tryLock ()
 
bool tryWait ()
 
 ULock ()
 
void unlock ()
 
bool wait ()
 
 ~ULock ()
 
- Public Member Functions inherited from UVarMethodImplement
virtual bool methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt)
 
virtual ~UVarMethodImplement ()
 

Protected Member Functions

bool addGroundObjects (UImg3Dpoints *cloud, double minZ, double maxZ, double maxX, double maxSep)
 
void approximatePolyLine (const CvPoint pnts[], bool pntOK[], const int pntsCnt, const float toll)
 
int countContourEdges (CvSeq *contours, int *largest)
 
int countContourLimits (CvSeq *contours, int *left, int *right, int *top, int *bottom, bool lookingLeft)
 
int findContour (UImage *imgMask, UImage *dest, CvPoint *flp, int flpMax, bool *tooHigh, bool *tooSmall, bool lookingLeft)
 
float findMostDistantVertex (const CvPoint pnts[], const int pntsCnt, int *idx)
 get most distant vertex from line between endpoints More...
 
CvSeqBlock * findPolygonLargest (UImage *img, int *leftEdge, int *rightEdge)
 
int findPolygons (UImage *img, UImage *imgD, UImg3Dpoint **ps, const int psCnt, int scale)
 Extract polygons for z-slizes in this image. More...
 
int findPolygonsOne (CvSeqBlock *block, UImg3Dpoint **ps, const int psCnt, UImg3Dpoint **pd, const int pdCnt, const int maxPoints, int scale)
 Extract just one polygon. More...
 
int findPolygonsOnEdge (CvSeqBlock *block, UImg3Dpoint **ps, const int psCnt, int scale, int leftEdge, int rightEdge, int distLimit)
 Extract ground edge polygons, as obstacles. The polygons are returned in gnds[gndsCnt] The method is to convert edges on top line of the polygon in 'block' into obstacles, if thay are not on the left or right edge, and not further away than the distance limit (distLimit) More...
 
UImagemakeGroundPlaneProfileImage (int inum1, int inum2, UImg3Dpoint **cloudPts, int cloudPtsCnt, int scale)
 
void paintGndPlane (int imgNum, UImg3Dpoints *cloud, double maxX, double maxZ, bool andBoxes, bool andGndPolygons)
 
void paintPolygonInImage (UImage *img, UImg3Dpoint **pd, const int pdCnt)
 
- Protected Member Functions inherited from UResVarPool
void setDescription (const char *note, bool copy=false)
 
- Protected Member Functions inherited from UResBase
UResBasegetStaticResource (const char *resName, bool mayCreate, bool staticOnly=true)
 get a pointer to a static resource. More...
 

Protected Attributes

UPlane gndPlaneC
 
double gndPlaneQ
 
UPlane gndPlaneR
 
UTime gndPlaneTime
 
UPolygon40gnds [MAX_GND_POLYGONS]
 
int gndsCnt
 
UGrid3Dgrid
 
unsigned int lastSvsSerial
 
ULogFile loghum
 
UObj3dPoolpool
 
CvMemStorage * storage
 
UVariablevarBBmaxDX
 box finder parameter maximum X extend More...
 
UVariablevarBBmaxDY
 max box (human) filter y extend More...
 
UVariablevarBBmaxZ
 maximum height for human finder More...
 
UVariablevarBBmerge
 should bounding boxex be allowed to merge More...
 
UVariablevarBBminVoxCnt
 minimum voxel cound More...
 
UVariablevarBBminX
 humans closer to camera than this is assumed an error More...
 
UVariablevarBBminZ
 humans lower than this are ignored More...
 
UVariablevarCombineDist
 
UVariablevarDistMaxX
 index to maximum usable 3D distance More...
 
UVariablevarGndFilter
 should ground filter on voxels be used More...
 
UVariablevarGndFilterCell
 filter cell size, compared to voxed cell size (0.5 gives 4 times as many cellse) More...
 
UVariablevarGndFilterDilate
 should ground filter on voxels be dilate-eroded More...
 
UVariablevarGndFilterErode
 should ground filter on voxels be eroded 1 more than dilate More...
 
UVariablevarGndMaxZ
 index to maximum Z for gorund finding More...
 
UVariablevarGndMinQ
 minimum quality (share of inliers relative to all) to use plane estamate More...
 
UVariablevarGndMinZ
 index to minimum Z for gorund finding More...
 
UVariablevarGndPolyScale
 number of pixels per ground polygin image pixel before segmentation More...
 
UVariablevarGndRedFac
 point reduction factor for ground estimate (to save time) def = 3 More...
 
UVariablevarGridSize
 voxel cell size (in meter) More...
 
UVariablevarGroup
 
UVariablevarGrpMaxDist
 
UVariablevarGrpMaxTime
 
UVariablevarGrps
 
UVariablevarMinDens
 minimum voxel density per footprint square meter More...
 
UVariablevarMinDensCnt
 minimum voxel density to be tested for voxel blobs with up to this number of cells More...
 
UVariablevarMinRoofHgt
 minimum height for roof obstacles More...
 
UVariablevarObstMerge
 
UVariablevarUpdateTime
 
- Protected Attributes inherited from UObj3dPool
UObj3dGroupgroups [MAX_OBSTACLE_GROUPS]
 
int groupsCnt
 
FILE * logo
 
int newest
 
double newGroupTime
 
double newGrpDist
 
unsigned long nextSerial
 
- Protected Attributes inherited from UResBase
int resFuncIdx
 
char resID [MAX_RESOURCE_ID_LENGTH]
 
char resIsAlso [MAX_RESOURCE_ISALSO_LENGTH]
 
int resVersion
 
- Protected Attributes inherited from UReplay
bool replay
 
FILE * replayFile
 
char replayFileName [REPLAY_FILE_NAME_LENGTH]
 replay filename More...
 
char replayLine [MAX_LOG_LINE_LENGTH]
 
int replayLogLine
 
UReplayreplayParent
 
UTime replayTimeNext
 

Static Protected Attributes

static const int MAX_GND_POLYGONS = 50
 
- Static Protected Attributes inherited from UReplay
static const int MAX_LOG_LINE_LENGTH = 10000
 
static const int REPLAY_FILE_NAME_LENGTH = 264
 max length of replay filename More...
 

Private Member Functions

int getBlockArea (CvSeqBlock *block, int *leftEdge, int *rightEdge)
 
void UResObj3dInit ()
 

Additional Inherited Members

- Static Public Member Functions inherited from UResVarPool
static const char * getResClassID ()
 
- Public Attributes inherited from UReplay
bool replayTimeAdvancePending
 
UTime replayTimeNow
 
- Static Public Attributes inherited from UObj3dPool
static const int MAX_OBSTACLE_GROUPS = 100
 

Detailed Description

This is the shared resource class. It must enherit from the resource base class (or one of its decendent) as shown.

Author
Christian Andersen

Constructor & Destructor Documentation

UResObj3d::UResObj3d ( )
inline

Constructor

UResObj3d::~UResObj3d ( )
virtual

Destructor

Member Function Documentation

bool UResObj3d::addGroundObjects ( UImg3Dpoints cloud,
double  minZ,
double  maxZ,
double  maxX,
double  maxSep 
)
protected
void UResObj3d::addObstacleParameters ( )

Add special variable parameters for obstacle management

void UResObj3d::approximatePolyLine ( const CvPoint  pnts[],
bool  pntOK[],
const int  pntsCnt,
const float  toll 
)
protected
int UResObj3d::countContourEdges ( CvSeq *  contours,
int *  largest 
)
protected

Count edges in contour sequebnce

int UResObj3d::countContourLimits ( CvSeq *  contours,
int *  left,
int *  right,
int *  top,
int *  bottom,
bool  lookingLeft 
)
protected

Find square limits of found contour returns the point cont, and if limit pointers != NULL the left, right, top and bottol limits of the points in the sequence.

bool UResObj3d::do3dCloudFromSvs ( UImg3Dpoints cloud)

Get fresh 3D cloud data from svs system and update the object pool as needed.

Parameters
getAnytakes any data from SVS, if false, then only new data (based on serial number)
Returns
true if processing were successfull - source data is available)

References UResPoseHist::getPoseAtTime(), UImg3Dpoints::time, and UImg3Dpoints::toRobotCoordinates().

bool UResObj3d::do3dGroundPlane ( UImg3Dpoints cloud,
bool  doGndEdgeObst,
bool  doImg 
)

find candidates for human detections. Estimates the ground plane from 3D cloud.

Parameters
cloudthe 3D cloud to be processed.
doGndEdgeObstmake obstacles from edge of ground polygone
doImgif true, then more debug images are produced.
Returns
true if a plane were found. The plane and quality is saved in class.

References UImg3Dpoints::add(), UPlane::clear(), UPosRot::getCamToRobPlane(), UPoseTime::getPoseAtTime(), UImg3Dpoints::getRansacPlane(), UPosRot::getRobToCamPlane(), UTime::getTimePassed(), img, UImg3Dpoints::inSensorCoordinates, UTime::now(), UImg3Dpoints::p3d, UImg3Dpoints::p3dCnt, UImg3Dpoint::pos, UImg3Dpoints::pose, UTime::print(), UImg3Dpoint::q, roundi(), UPoseTime::t, UImg3Dpoints::time, UImg3Dpoints::toRobotCoordinates(), UPosition::x, and UPosition::z.

Referenced by UFuncObj3d::handleCloud().

bool UResObj3d::do3dVoxels ( UImg3Dpoints cloud,
bool  justHuman,
bool  doImg 
)

find candidates for human detections. Estimates the ground plane from 3D cloud. Isolates 3D voxel volumens, and filter human sized volumens.

Parameters
cloudthe 3D cloud to be processed.
justHumansave only those obstacles that are classified human (else all obstacles)
doImgif true, then more debug images are produced.
Returns
true if human voxels were found. The human candidates are saved in the class.

References UGridBBoxes::bb, UGridBBoxes::bbCnt, UImg3Dpoint::blue(), UImage::camDevice, UImage::clear(), UImage::cvArr(), UGridBBox::footprint, UImagePool::getImage(), UResPoseHist::getPoseAtTime(), UTime::getTimePassed(), UImg3Dpoint::gray(), UGridBBox::human, UImage::imageNumber, UImage::imgTime, MAX_IMG_NAME_SIZE, UImage::name, UTime::now(), UImg3Dpoints::p3d, UImg3Dpoints::p3dCnt, UImg3Dpoint::pos, UImg3Dpoint::red(), UImg3Dpoints::serial, UImage::setSize(), UPoseTime::t, UImg3Dpoints::time, UImg3Dpoints::toRobotCoordinates(), UImage::updated(), UGridBBox::valid, and UPosition::x.

Referenced by UFuncObj3d::handleCloud().

void UResObj3d::doGndPlaneMask ( int  maskImgNum,
UPlane  plane,
UImg3Dpoints cloud,
double  cellSize,
double  planeDist,
bool  erode,
bool  dilate 
)

Paint ground plane in-laiers, and do the needed filtering for use as visible ground cells

Parameters
maskImgNumis the image number in inage pool for result mask image
planeis the best estimated ground plane.
cloudis the clouds to include in the mask
cellSizeis the image cell sixe
planeDistis the maximum distance from ground-plane to cloud-point to put in mask
erodeerode one more than dilate
dilatedilate and erode (once)

References UImage::camDevice, UImage::clear(), UImage::cvArr(), UPlane::dist(), UImagePool::getImage(), UImage::imageNumber, UImage::imgTime, MAX_IMG_NAME_SIZE, UImage::name, UImg3Dpoints::p3d, UImg3Dpoints::p3dCnt, UImg3Dpoint::pos, roundi(), UImg3Dpoints::serial, UImage::setPixUChar(), UImage::setSize(), UImg3Dpoints::time, UImage::updated(), UPosition::x, and UPosition::y.

int UResObj3d::findContour ( UImage imgMask,
UImage dest,
CvPoint *  flp,
int  flpMax,
bool *  tooHigh,
bool *  tooSmall,
bool  lookingLeft 
)
protected

Test routine to segment patches of 3D detection

References UImage::cvArr(), and UTime::Now().

float UResObj3d::findMostDistantVertex ( const CvPoint  pnts[],
const int  pntsCnt,
int *  idx 
)
protected

get most distant vertex from line between endpoints

Parameters
pntsis first element in array of (pixel) points
pntsCntis number of elements to be investigated
idxis pointer, where index of most distant vertex is to be returned.
Returns
distance (signed) of most distannt vertex to the line between endpoints.

References U2Dline::distanceSigned(), and U2Dline::set2P().

CvSeqBlock * UResObj3d::findPolygonLargest ( UImage img,
int *  leftEdge,
int *  rightEdge 
)
protected

Find largest blob in this image using openCV segmentation.

Parameters
imgis the 8-bit gray scale image, where contours with value >0 searched.
leftEdgewill retruen the image left edge of the largest polygon if not NULL
rightEdgewill retruen the image right edge of the largest polygon if not NULL
Returns
a pointer to the largest contour block.

References a, and UImage::cvArr().

int UResObj3d::findPolygons ( UImage img,
UImage imgD,
UImg3Dpoint **  ps,
const int  psCnt,
int  scale 
)
protected

Extract polygons for z-slizes in this image.

Parameters
imgis the source BW image
imgDis a potential debug image where to paint the polygon
psis the original slized 3D point cloud
psCntis the number of points in the source point cloud
pdis the destination array for filtered polygon
pdCntis the allocated number of elements in that polygon
scaleis the number of pixels in source image for each pixel in profile image
Returns
number of polygon points in pd.

References UPolygon::add(), UPolygon::clear(), UImage::cvArr(), UPolygon40::MAX_POINTS, and UImg3Dpoint::pos.

int UResObj3d::findPolygonsOne ( CvSeqBlock *  block,
UImg3Dpoint **  ps,
const int  psCnt,
UImg3Dpoint **  pd,
const int  pdCnt,
const int  maxPoints,
int  scale 
)
protected

Extract just one polygon.

Parameters
blockis the structure to be converted
psis the original slized 3D point cloud
psCntis the number of points in the source point cloud
pdis the destination array for filtered polygon
pdCntis the allocated number of elements in pd destination array
scaleis the number of pixels in source image for each pixel in profile image
Returns
number of found points in pd array

References UImg3Dpoint::column, UImg3Dpoint::q, and UImg3Dpoint::row.

int UResObj3d::findPolygonsOnEdge ( CvSeqBlock *  block,
UImg3Dpoint **  ps,
const int  psCnt,
int  scale,
int  leftEdge,
int  rightEdge,
int  distLimit 
)
protected

Extract ground edge polygons, as obstacles. The polygons are returned in gnds[gndsCnt] The method is to convert edges on top line of the polygon in 'block' into obstacles, if thay are not on the left or right edge, and not further away than the distance limit (distLimit)

Parameters
blockis the structure to be converted
psis the original slized 3D point cloud
psCntis the number of points in the source point cloud
scaleis the number of pixels in source image for each pixel in profile image
leftEdgeis the left edge of the obstacle area (visibility limit)
rightEdgeis the right edge of the obstacle area (visibility limit)
distLimitis the distance limit "visibility limit"
Returns
number of found obstacle polygons in gnds

References UPolygon::add(), UPolygon::clear(), UImg3Dpoint::column, UPolygon::extractConvexTo(), UPolygon::getPointsCnt(), UImg3Dpoint::pos, UImg3Dpoint::q, UImg3Dpoint::row, UPosition::x, UPosition::y, and UPosition::z.

bool UResObj3d::get3dCloud ( const char *  source,
UImg3Dpoints **  cloud 
)

Get the point cloud from ing3d cloud source. The cloud is actually stored in the svs module, and a pointer the coud is provided only. Remember to lock it while processing and release after use.

Parameters
sourceis a string with the plug-in name of the source, i.e. a 'source'.get3d() method call must be available (see var 'source').
cloudis where the function returns a pointer to the 3D point cloud, if any is found.
Returns
true if a cloud is found.

References data, and UDataBase::isA().

Referenced by UFuncObj3d::handleCloud().

bool UResObj3d::get3dCloudFromSvs ( bool  getAny,
UImg3Dpoints **  cloud 
)

Get the newest point cloud from svs. The cloud is actually stored in the svs module, and a pointer the coud is provided only. Remember to lock it while processing and release after use.

Parameters
getAnyif false, then an imageset with a new serial number is accepted, else any serial number will do
cloudis where the function returns a pointer to the 3D point cloud, if any is found.
Returns
true if a cloud is found.

References data, UDataBase::isA(), and roundi().

Referenced by UFuncObj3d::handleCloud().

int UResObj3d::getBlockArea ( CvSeqBlock *  block,
int *  leftEdge,
int *  rightEdge 
)
private

Get area of a openCV CvSeqBlk structure. The method is (sum(x1*y2 - x2*y1))/2 for all points and the first as the last. Calculating in integer space.

Parameters
blockis the block in question
Returns
the area (in integer)
UPlane UResObj3d::getGroundPlane ( )
inline

get estimated ground plane

Returns
the estimated plane in robot coordinates

Referenced by UFuncObj3d::handleCloud().

double UResObj3d::getGroundPlaneQuality ( )
inline

get the quality of the ground-plane Quality is the relative count of ponts in the ground plane, relative to all points

Returns
the quality figure.

References img.

Referenced by UFuncObj3d::handleCloud().

void UResObj3d::getObstacleGroupSettings ( UObj3dGroup og)
virtual

Load parameter values from current settings pool to this obstacle group

Reimplemented from UObj3dPool.

References UObj3dGroup::setMergeDistance().

UImage * UResObj3d::makeGroundPlaneProfileImage ( int  inum1,
int  inum2,
UImg3Dpoint **  cloudPts,
int  cloudPtsCnt,
int  scale 
)
protected

Find ground polygons using an image (profile) projection of the pixel inliers for the estimated ground plane,

Parameters
inum1is the image pool number to be used for the source image
inum2is the other image pool number to use for interim data
cloudPtsis the inliers close to the ground plane
cloudPtsCntis the number of points
scaleis the pixel size if the filter image for each source image.
Returns
the image with the ground plane profile in camera coordinates

References UImage::clear(), UImg3Dpoint::column, UImage::cvArr(), UImagePool::getImage(), img, MAX_IMG_NAME_SIZE, UImage::name, UImage::setPixUChar(), UImage::setSize(), and UImage::updated().

void UResObj3d::obstDataUpdated ( UTime  poseTime)
virtual

Obstacle data is updated - tell resource

Reimplemented from UObj3dPool.

Referenced by UFuncObj3d::handleCommand().

void UResObj3d::paintGndPlane ( int  imgNum,
UImg3Dpoints cloud,
double  maxX,
double  maxZ,
bool  andBoxes,
bool  andGndPolygons 
)
protected

Paint all 3D points in the ground plane in xz view and in xy view

Parameters
imgNumis the image pool image number to use
cloudis the cloud of 3D points
maxXis the maximum X value in image
maxZis the maximum Z distance from ground plane to paint
andBoxesshould bounding boxes be painted too
andGndPolygonspaint also the polygons in the gnsd array

References UGridBBoxes::bb, UGridBBoxes::bbCnt, UImage::camDevice, UImage::clear(), UImage::cvArr(), UGridBBox::footprint, UGridBBox::getCol(), UImagePool::getImage(), UPose::getMapToPose(), UResPoseHist::getNewest(), UPolygon::getPoints(), UPolygon::getPointsCnt(), UImage::height(), UGridBBox::human, UImage::imageNumber, UImage::imgTime, MAX_IMG_NAME_SIZE, UImage::name, UImg3Dpoints::p3d, UImg3Dpoints::p3dCnt, UImage::paintGridAligned(), UImg3Dpoint::pos, UGridBBox::roof, roundi(), UImg3Dpoints::serial, UImage::setSize(), UGridBBox::sideView, UImg3Dpoints::time, UPixel::toCvRGB(), UImg3Dpoints::toRobotCoordinates(), UImage::updated(), UGridBBox::valid, UImage::width(), UPosition::x, UPosition::y, and UPosition::z.

void UResObj3d::paintPolygonInImage ( UImage img,
UImg3Dpoint **  pd,
const int  pdCnt 
)
protected

Paint a polyline in this image from these points

References UImg3Dpoint::column, UImage::cvArr(), UImg3Dpoint::row, and UImage::updated().

virtual const char* UResObj3d::print ( const char *  preString,
char *  buff,
int  buffCnt 
)
inlinevirtual

print status to a string buffer

Reimplemented from UResVarPool.

const char * UResObj3d::snprint ( const char *  preString,
char *  buff,
int  buffCnt 
)
virtual

print status to a string buffer

References mini(), and UObstacleGroup::print().

void UResObj3d::UResObj3dInit ( )
private

Remaining initialization

Member Data Documentation

UPlane UResObj3d::gndPlaneC
protected

best groundplane found in camera coordinates

double UResObj3d::gndPlaneQ
protected

quality - percentage of pixels in gndPlane

UPlane UResObj3d::gndPlaneR
protected

best groundplane found in robot coordinates

UTime UResObj3d::gndPlaneTime
protected

detection time for current ground plane estimate

UPolygon40* UResObj3d::gnds[MAX_GND_POLYGONS]
protected

array of polygons

int UResObj3d::gndsCnt
protected

Number of actual polygons

UGrid3D* UResObj3d::grid
protected

voxel grid for filtering in 3D image

unsigned int UResObj3d::lastSvsSerial
protected

Lase serial number for image (svs) source

ULogFile UResObj3d::loghum
protected

human logfile

const int UResObj3d::MAX_GND_POLYGONS = 50
staticprotected
UObj3dPool* UResObj3d::pool
protected

Storage for detected obstacles

CvMemStorage* UResObj3d::storage
protected

Storage used by openCV

UVariable* UResObj3d::varBBmaxDX
protected

box finder parameter maximum X extend

UVariable* UResObj3d::varBBmaxDY
protected

max box (human) filter y extend

UVariable* UResObj3d::varBBmaxZ
protected

maximum height for human finder

UVariable* UResObj3d::varBBmerge
protected

should bounding boxex be allowed to merge

UVariable* UResObj3d::varBBminVoxCnt
protected

minimum voxel cound

UVariable* UResObj3d::varBBminX
protected

humans closer to camera than this is assumed an error

UVariable* UResObj3d::varBBminZ
protected

humans lower than this are ignored

UVariable* UResObj3d::varCombineDist
protected

Index to variable in variable pool for fast access - obstacle merge distance (outdoor)

UVariable* UResObj3d::varDistMaxX
protected

index to maximum usable 3D distance

UVariable* UResObj3d::varGndFilter
protected

should ground filter on voxels be used

UVariable* UResObj3d::varGndFilterCell
protected

filter cell size, compared to voxed cell size (0.5 gives 4 times as many cellse)

UVariable* UResObj3d::varGndFilterDilate
protected

should ground filter on voxels be dilate-eroded

UVariable* UResObj3d::varGndFilterErode
protected

should ground filter on voxels be eroded 1 more than dilate

UVariable* UResObj3d::varGndMaxZ
protected

index to maximum Z for gorund finding

UVariable* UResObj3d::varGndMinQ
protected

minimum quality (share of inliers relative to all) to use plane estamate

UVariable* UResObj3d::varGndMinZ
protected

index to minimum Z for gorund finding

UVariable* UResObj3d::varGndPolyScale
protected

number of pixels per ground polygin image pixel before segmentation

UVariable* UResObj3d::varGndRedFac
protected

point reduction factor for ground estimate (to save time) def = 3

UVariable* UResObj3d::varGridSize
protected

voxel cell size (in meter)

UVariable* UResObj3d::varGroup
protected

newest obstacle group

UVariable* UResObj3d::varGrpMaxDist
protected

Index to variable in variable pool for fast access - max pose distance in one group

UVariable* UResObj3d::varGrpMaxTime
protected

Index to variable in variable pool for fast access - max time spend in one group

UVariable* UResObj3d::varGrps
protected

number of obstacle groups in pool

UVariable* UResObj3d::varMinDens
protected

minimum voxel density per footprint square meter

UVariable* UResObj3d::varMinDensCnt
protected

minimum voxel density to be tested for voxel blobs with up to this number of cells

UVariable* UResObj3d::varMinRoofHgt
protected

minimum height for roof obstacles

UVariable* UResObj3d::varObstMerge
protected

Index to variable in variable pool for fast access - should obstacles actually be merged (mostly for debug if false)

UVariable* UResObj3d::varUpdateTime
protected

Time (tod) of last obstacle update


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