AURobotServers
4
|
#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) |
UGridBBoxes * | getBoxes () |
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 | |
UGridBBoxes * | boxes |
UGridSegs * | segc |
UImg3Dpoint ** | voxels |
int | voxelsCnt |
double | voxelSize |
int | xDepth |
int | yWidth |
int | zHeight |
a 3D voxel grid for 3D-blob estimation
UGrid3D::UGrid3D | ( | ) |
constructor
UGrid3D::~UGrid3D | ( | ) |
Destructor
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
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
minCellCnt | minimum filled cells inside box |
maxDX | the maximum size of the human in z-direction - must be large due to stereo uncertanty |
maxDY | the maximum size of the human across the camera view |
maxZ | the maximum height of a human |
minZ | the smallest obstacle classified as a human |
minX | is the closest a human should be detected from the camera (false correlation remover) |
roogHgt | is 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. |
minDens | is the mean density of voxels per square meter |
minDensCnt | minimum density is to be applied for boxes with up to this number of cells |
References roundi().
|
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)
ix,iy,iz | is the index to the cell, all index are zero or positive |
size | is the size of the actual cell |
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)
ix,iy,iz | is the index to the cell, all index are zero or positive |
size | is the size of the actual cell |
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)
ix,iy,iz | is the index to the cell, all index are zero or positive |
size | is the size of the actual cell |
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)
vx | voxel number in depth direction |
vy | is voxel number left or right - left is positive |
vz | is voxel in the height direction. |
void UGrid3D::logBB | ( | ULogFile * | lf, |
bool | validOnly | ||
) |
log bounding boxes to this logfile
lf | is a pointer to the logfile object |
validOnly | log 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.
img | is the image to paint into |
minQValue | paint only thise cells that has at least this q-value |
andBBoxes | paint also bounding boxes |
minCellCnt | paint 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.
cellSize | side size in meters - e.g 0.1 m. |
depth | x-size of volumen in meters - 0.0 is camera |
width | y-size of volumen in meters - 0.0 at centre. |
height | z-size in meters - lower limit is 0.0 |
References UGridSegEq::clear(), and roundi().
void UGrid3D::setVoxel | ( | UPlane * | plane, |
UImg3Dpoint * | pnt | ||
) |
Set voxel at this point to point to this image point.
plane | is the ground plane, uset to calculate z-distance (height) |
pnt | the 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
minZ | is the minimum z that should be segmentated |
maskImg | is a bW image in same dimension as voxel planes if masked, then voxel is not used for segmentation. |
maskSideMult | is multiplier from voxel x,y to mask r,c |
References UGridBBox::addCell(), UImage::getUCharRef(), UImg3Dpoint::q, and roundi().
|
protected |
Bounding box list
|
protected |
segmentation collisions
|
protected |
Pointer to data area
|
protected |
Data area size (in pointers)
|
protected |
Side length of voxel in meters.
|
protected |
depth (x direction) of volumen in voxels
|
protected |
width (y-direction) of volumen in voxels
|
protected |
height (z-direction) of volumen in voxels