AURobotServers  4
Public Member Functions | Protected Attributes | List of all members
UGrid3D Class Reference

#include <uresobj3d.h>

Public Member Functions

int addEquvivalent (int *mee, int meeCnt)
 
void clear ()
 
int countNonZeroVoxels ()
 
int filter (int minCellCnt, double maxDX, double maxDY, double maxZ, double minZ, double minX, double roofHgt, double minDens, int minDensCnt)
 
UGridBBoxesgetBoxes ()
 
UPosition getCellCenter (int ix, int iy, int iz, double *size)
 
UPosition getCellFTL (int ix, int iy, int iz, double *size)
 
UPosition getCellNBR (int ix, int iy, int iz, double *size)
 
UImg3Dpoint ** getVoxelPnt (int vx, int vy, int vz)
 
void logBB (ULogFile *lf, bool validOnly)
 
int mergeOverlappingBBs ()
 
void paintVoxels (UImage *img, int minQValue, bool andBBoxes, int minCellCnt)
 
bool setVolumen (double cellSize, double depth, double width, double height)
 
void setVoxel (UPlane *plane, UImg3Dpoint *pnt)
 
 UGrid3D ()
 
int voxelSegmentation (double minZ, UImage *maskImg, double maskSideMult)
 
 ~UGrid3D ()
 

Protected Attributes

UGridBBoxesboxes
 
UGridSegssegc
 
UImg3Dpoint ** voxels
 
int voxelsCnt
 
double voxelSize
 
int xDepth
 
int yWidth
 
int zHeight
 

Detailed Description

a 3D voxel grid for 3D-blob estimation

Constructor & Destructor Documentation

UGrid3D::UGrid3D ( )

constructor

UGrid3D::~UGrid3D ( )

Destructor

Member Function Documentation

int UGrid3D::addEquvivalent ( int *  mee,
int  meeCnt 
)

Resolve the equvivalent numbers in this array, and assign a cluster number to this voxel in return. The equvivalens tabel should be updated.

void UGrid3D::clear ( void  )

Clear all voxels

int UGrid3D::countNonZeroVoxels ( )

Count voxels with non-zero content

Returns
count of voxels that is not NULL
int UGrid3D::filter ( int  minCellCnt,
double  maxDX,
double  maxDY,
double  maxZ,
double  minZ,
double  minX,
double  roofHgt,
double  minDens,
int  minDensCnt 
)

Filter the found bounding boxes after size

Parameters
minCellCntminimum filled cells inside box
maxDXthe maximum size of the human in z-direction - must be large due to stereo uncertanty
maxDYthe maximum size of the human across the camera view
maxZthe maximum height of a human
minZthe smallest obstacle classified as a human
minXis the closest a human should be detected from the camera (false correlation remover)
roogHgtis the minimum height of the bottom of obstacles to be considered an obstacle, else it is assumed to be a part ot the roof or tree tops etc.
minDensis the mean density of voxels per square meter
minDensCntminimum density is to be applied for boxes with up to this number of cells
Returns
number of humans detected in view

References roundi().

UGridBBoxes* UGrid3D::getBoxes ( )
inline

Get bounding boxes

UPosition UGrid3D::getCellCenter ( int  ix,
int  iy,
int  iz,
double *  size 
)

Get the position of the center of this cell (and the cell size)

Parameters
ix,iy,izis the index to the cell, all index are zero or positive
sizeis the size of the actual cell
Returns
the center position in meters

References UPosition::x, UPosition::y, and UPosition::z.

UPosition UGrid3D::getCellFTL ( int  ix,
int  iy,
int  iz,
double *  size 
)

Get the position of the Far Top Left of this cell (and the cell size)

Parameters
ix,iy,izis the index to the cell, all index are zero or positive
sizeis the size of the actual cell
Returns
the center position in meters

References UPosition::x, UPosition::y, and UPosition::z.

UPosition UGrid3D::getCellNBR ( int  ix,
int  iy,
int  iz,
double *  size 
)

Get the position of the Near Bottom Right of this cell (and the cell size)

Parameters
ix,iy,izis the index to the cell, all index are zero or positive
sizeis the size of the actual cell
Returns
the center position in meters

References UPosition::x, UPosition::y, and UPosition::z.

UImg3Dpoint ** UGrid3D::getVoxelPnt ( int  vx,
int  vy,
int  vz 
)

Get pointer to voxel cell (a pointer cell is a pointer too)

Parameters
vxvoxel number in depth direction
vyis voxel number left or right - left is positive
vzis voxel in the height direction.
Returns
a pointer to the cell, if within voxel volumen.
void UGrid3D::logBB ( ULogFile lf,
bool  validOnly 
)

log bounding boxes to this logfile

Parameters
lfis a pointer to the logfile object
validOnlylog valid bounding boxes only (from filter process)

References bool2str(), UGridBBox::maxx, UGridBBox::maxy, UGridBBox::maxz, UGridBBox::minx, UGridBBox::miny, UGridBBox::minz, UGridBBox::valid, UPosition::x, UPosition::y, and UPosition::z.

int UGrid3D::mergeOverlappingBBs ( )

Merge bounding boxes that has an overlap. The search for overlap is done once only, so there could be untested overlap of merged boxes.

References roundi().

void UGrid3D::paintVoxels ( UImage img,
int  minQValue,
bool  andBBoxes,
int  minCellCnt 
)

Paint all vixels in top and side view Paint a grid and the selected cells.

Parameters
imgis the image to paint into
minQValuepaint only thise cells that has at least this q-value
andBBoxespaint also bounding boxes
minCellCntpaint only bounding boxes with at least this number of valid cells

References UImg3Dpoint::blue(), UImage::cvArr(), UGridBBox::filtered, UGridBBox::footprint, UGridBBox::getDensity(), UPolygon::getPoints(), UPolygon::getPointsCnt(), UImg3Dpoint::green(), UGridBBox::hitCnt, UGridBBox::human, UGridBBox::maxx, UGridBBox::maxy, UGridBBox::maxz, UGridBBox::minx, UGridBBox::miny, UGridBBox::minz, UImage::paintGridAligned(), UImg3Dpoint::q, UImg3Dpoint::red(), UGridBBox::roof, roundi(), UGridBBox::valid, UImage::width(), UPosition::x, UPosition::y, and UPosition::z.

bool UGrid3D::setVolumen ( double  cellSize,
double  depth,
double  width,
double  height 
)

Set volumen with empty voxels.

Parameters
cellSizeside size in meters - e.g 0.1 m.
depthx-size of volumen in meters - 0.0 is camera
widthy-size of volumen in meters - 0.0 at centre.
heightz-size in meters - lower limit is 0.0
Returns
true if memory is allocated (or reallocated)

References UGridSegEq::clear(), and roundi().

void UGrid3D::setVoxel ( UPlane plane,
UImg3Dpoint pnt 
)

Set voxel at this point to point to this image point.

Parameters
planeis the ground plane, uset to calculate z-distance (height)
pntthe image point to place.

References UPlane::distSigned(), UImg3Dpoint::pos, UImg3Dpoint::q, roundi(), UPosition::x, and UPosition::y.

int UGrid3D::voxelSegmentation ( double  minZ,
UImage maskImg,
double  maskSideMult 
)

Segment the voxel volument in an 8 connectivity test

Parameters
minZis the minimum z that should be segmentated
maskImgis a bW image in same dimension as voxel planes if masked, then voxel is not used for segmentation.
maskSideMultis multiplier from voxel x,y to mask r,c
Returns
number of cluster segments

References UGridBBox::addCell(), UImage::getUCharRef(), UImg3Dpoint::q, and roundi().

Member Data Documentation

UGridBBoxes* UGrid3D::boxes
protected

Bounding box list

UGridSegs* UGrid3D::segc
protected

segmentation collisions

UImg3Dpoint** UGrid3D::voxels
protected

Pointer to data area

int UGrid3D::voxelsCnt
protected

Data area size (in pointers)

double UGrid3D::voxelSize
protected

Side length of voxel in meters.

int UGrid3D::xDepth
protected

depth (x direction) of volumen in voxels

int UGrid3D::yWidth
protected

width (y-direction) of volumen in voxels

int UGrid3D::zHeight
protected

height (z-direction) of volumen in voxels


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