User Documentation
Centre for Vision, Speech & Signal Processing
DEVELOP IN NAMESPACE AMMA TREE ROOT AMMA SEARCH AMMA HOME
 

  PUBLIC
VectRangeC::VectRangeC(void)
VectRangeC::VectRangeC(char *)
VectRangeC::VectRangeC(int,int)
VectRangeC::VectRangeC(const VectRangeC &)
VectRangeC::VectRangeC(const ByteRangeC &)
VectRangeC::VectRangeC(const FloatRangeC &)
VectRangeC::operator=(const VectRangeC &)
VectRangeC::~VectRangeC(void)
VectRangeC::Copy(void) const
VectRangeC::ImageHandle(void)
VectRangeC::operator[](const PixelC &)
VectRangeC::GetByteZ(const PixelC &) const
VectRangeC::GetFloatZ(const PixelC &) const
VectRangeC::GetVect(const PixelC &) const
VectRangeC::PutByteZ(const PixelC &,ByteGreyValueT)
VectRangeC::PutFloatZ(const PixelC &,float)
VectRangeC::PutVect(const PixelC &,Vector3dC)
VectRangeC::IsValid(const PixelC &) const
VectRangeC::SoftLoad(char *)
VectRangeC::Load(char *)
VectRangeC::SoftSave(char *)
VectRangeC::Save(char *)
VectRangeC::LoadDep(char *)
VectRangeC::LoadTxt(char *)
VectRangeC::LoadRis(char *)
VectRangeC::LoadVec(char *)
VectRangeC::LoadJrc(char *)
VectRangeC::LoadZim(char *)
VectRangeC::SaveDep(char *)
VectRangeC::SaveRis(char *)
VectRangeC::MapToGrid(void) const
VectRangeC::CalculateExtremes(void)
VectRangeC::SubImage(const ImageRectangleC &) const
VectRangeC::ScaleImage(double,int,int) const
VectRangeC::ExportZasByte(int)
VectRangeC::operator<<(ostream &,const VectRangeC &)
BaseRangeC::operator=(const BaseRangeC &)
BaseRangeC::NRows(void) const
BaseRangeC::NCols(void) const
BaseRangeC::Min(void) const
BaseRangeC::Max(void) const
BaseRangeC::GridMin(void) const
BaseRangeC::GridMax(void) const
BaseRangeC::GridSize(void) const
BaseRangeC::GetByteZ(const PixelC &) const
BaseRangeC::GetFloatZ(const PixelC &) const
BaseRangeC::GetVect(const PixelC &) const
BaseRangeC::PutByteZ(const PixelC &,ByteGreyValueT)
BaseRangeC::PutFloatZ(const PixelC &,float)
BaseRangeC::PutVect(const PixelC &,Vector3dC)
BaseRangeC::PutVect(const Vector3dC)
BaseRangeC::IsValid(const PixelC &) const
BaseRangeC::IsInside(const Vector3dC) const
BaseRangeC::IsInsideXY(const Vector3dC) const
BaseRangeC::OfVect(const Vector3dC) const
BaseRangeC::SetXGridExtremes(double,double)
BaseRangeC::SetYGridExtremes(double,double)
BaseRangeC::SetZGridExtremes(double,double)
BaseRangeC::SoftLoad(char *)
BaseRangeC::Load(char *)
BaseRangeC::SoftSave(char *)
BaseRangeC::Save(char *)
BaseRangeC::CalculateExtremes(void)
BaseRangeC::ExportZasByte(int)
BaseRangeC::ExportDXasByte(void)
BaseRangeC::ExportDYasByte(void)
BaseRangeC::ExportValidasByte(void)
BaseRangeC::ExportPol(double)
BaseRangeC::ExportPol2(double)
BaseRangeC::operator<<(ostream &,const BaseRangeC &)
VectRangeC
 
Range image stored using a vector for each point, ie full
 
include "amma/VectRange.hh"
User Level:Default
Library:Range
Example: poltool.cc
Section:3D Surface.Range Images
In Scope:std

Comments:
VectRangeC is a BIG object.

The i/o routines do have basic error checks.

A valid image point is one in which a range measurement is available. How it is stored is dependent on the data structure but can be checked by calling the function IsValid(). In byte format, 0 is invalid and in vector format, z=-1e38 is invalid.

With each range image, the minimum and maximum x, y and z values are stored. In each case, the values are obtained by scanning all of the valid image points and finding the extremes in each dimension. These values are kept in xmin,xmax,ymin,ymax,zmin,zmax.

In addition, the minimum and maximum x and y values of the sample grid are obtained if available from the input data file. This is required for converting between vector and byte format and mapping the range image onto a grid. gridxmin,gridxmax,gridymin,gridymax are defined to have the same values as those stored in the .dep file format. This is assumed to be that the min and max are both the rounded down corners of the extreme bins.

Any conversion from a vector representation will result in a rounding down of the x and y values to the grid positions. To compensate for this conversion from byte to vector will round up the positions to the centre of the grid boxes.

All loads are soft except Load, soft means no exit on error.

 Files that can be read    .pgm .dep .ris
                   written      .pgm .dep
 

Parent Classes: Variables:
const double InvalidZ;

const double InvalidZ = -1e38;

Methods:
VectRangeC()
Constructs an empty Range image

VectRangeC(char * fname)
Constructs and use .Load

VectRangeC(int rows,int cols)
Constructs a Range with space allocated

VectRangeC(const VectRangeC & range)
Copy constructor

VectRangeC(const ByteRangeC & range)
Constructs a Vector range from a byte one
This rounds up the position to the centre of a grid box to cancel the bias introduced by ConvertToByte().

VectRangeC(const FloatRangeC & range)
Constructs a Vector range image from a float one

VectRangeC & operator=(const VectRangeC & range)
Assignment

~VectRangeC()
Destructor

VectRangeC Copy(void) const
Returns a new copy (big object!)

Access to parameters


ImageC<Vector3dC> & ImageHandle()
Access to the internal image, use sparingly!

Vector3dC & operator[](const PixelC & pxl)
Access operator with reference

ByteGreyValueT GetByteZ(const PixelC & pxl) const
Access depth given position

float GetFloatZ(const PixelC & pxl) const
Access depth given position

Vector3dC GetVect(const PixelC & pxl) const
Access vector given grid position

void PutByteZ(const PixelC & pxl,ByteGreyValueT z)
Set depth at given position

void PutFloatZ(const PixelC & pxl,float z)
Set depth at given position

void PutVect(const PixelC & pxl,Vector3dC vect)
Set vector at given position

int IsValid(const PixelC & pixel) const
Determine whether given pixel is valid

Saving and Loading


int SoftLoad(char * fname)
load from any file, if error then return 0 else 1

void Load(char * fname)
load from any file, if error then exit

int SoftSave(char * fname)
save to file, if error then return 0 else 1

void Save(char * fname)
save to file

int LoadDep(char * fname)
load .dep bae file, if error then return 0 else 1

int LoadTxt(char * fname)
load .txt msu file, if error then return 0 else 1

int LoadRis(char * fname)
load .ris file, if error then return 0 else 1

int LoadVec(char * fname)
load .vec file, if error then return 0 else 1

int LoadJrc(char * fname)
load .jrc file, if error then return 0 else 1

int LoadZim(char * fname)
load .Zim file, if error then return 0 else 1

void SaveDep(char * fname)
save .dep bae file

void SaveRis(char * fname)
save .ris file

Image manipulation


VectRangeC MapToGrid() const
Maps vector representation onto an orthogonal grid
Offset of a point between min and max as a factor equals offset divided by gap=(max-min). New position is factor*range and range equals (npoints-1) so that factor==1 -> highest index range.

void CalculateExtremes()
Determines extreme values of x,y and z

VectRangeC SubImage(const ImageRectangleC & rect) const
extract and create a new subimage

VectRangeC ScaleImage(double f,int dx = 0,int dy = 0) const
change scale by factor f using resampling with an offset of (dx,dy)

Conversion to other representations


ByteImageC ExportZasByte(int reversevideo = 0)
generate a byteimage of the z data

ostream & operator<<(ostream & s,const VectRangeC & range)

#include "amma/BaseRange.hh"
BaseRangeC & operator=(const BaseRangeC & range)
Assignment

int NRows() const
Access number of rows

int NCols() const
Access number of cols

Vector3dC Min() const
Access minimum corner of bounding box

Vector3dC Max() const
Access maximum corner of bounding box

Vector3dC GridMin() const
Access minimum corner of grid bounding box

Vector3dC GridMax() const
Access maximum corner of grid bounding box

Vector3dC GridSize() const
Access spacing of the grid

ByteGreyValueT GetByteZ(const PixelC & pxl) const
Access depth given position

float GetFloatZ(const PixelC & pxl) const
Access depth given position

Vector3dC GetVect(const PixelC & pxl) const
Access vector given grid position

void PutByteZ(const PixelC & pxl,ByteGreyValueT z)
Set depth at given position

void PutFloatZ(const PixelC & pxl,float z)
Set depth at a given position

void PutVect(const PixelC & pxl,Vector3dC vect)
Set vector at given position

void PutVect(const Vector3dC vect)
Determines position in array and inserts vector. Must pass IsInside()

int IsValid(const PixelC & pixel) const
Determine whether given pixel is valid

int IsInside(const Vector3dC vect) const
Determines whether a vector is within the grid extremes

int IsInsideXY(const Vector3dC vect) const
Determines whether x,y of vect is within the grid extremes

PixelC OfVect(const Vector3dC vect) const
Determines pixel position in array of a vector

void SetXGridExtremes(double xmin,double xmax)
Sets extremes and determines spacing

void SetYGridExtremes(double ymin,double ymax)
Sets extremes and determines spacing

void SetZGridExtremes(double zmin,double zmax)
Sets extremes and determines spacing

Loading and Saving


int SoftLoad(char * fname)
load from any file, if error then return 0 else 1

void Load(char * fname)
load from any file, if error then exit

int SoftSave(char * fname)
save to file, if error then return 0 else 1

void Save(char * fname)
save to file

void CalculateExtremes()
Determines extreme values of x,y and z
This determines the max and min x,y,z values for the valid image points. If the image is not gridded then grid min and max values are extrapolated to give result that would be achieved if the invalid points had been included in the calculation.

Conversion to other representations


ByteImageC ExportZasByte(int reversevideo = 0)
generate a byteimage of the z data

ByteImageC ExportDXasByte()
generate a byteimage of the x data

ByteImageC ExportDYasByte()
generate a byteimage of the y data

ByteImageC ExportValidasByte()
generate a byte image of the valid points

PolopsC ExportPol(double steepestslope = 100.0)
generate a polops class of the data.
Steepest slope is a ratio of dz/sqrt(dx^2+dy*2)

PolopsC ExportPol2(double steepestslope = 100.0)
generate a triangulation mesh.
steepest slope is max angle of triangle to z-axis. NB: Trianglation indexed without using Polops().Purify() for effieciency

ostream & operator<<(ostream & s,const BaseRangeC & range)


Programmer:Robert Crida lib=Range, Documentation by CxxDoc: Tue Mar 20 10:48:08 2001