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

  PUBLIC
ByteRangeC::ByteRangeC(void)
ByteRangeC::ByteRangeC(char *)
ByteRangeC::ByteRangeC(int,int)
ByteRangeC::ByteRangeC(const ByteImageC &)
ByteRangeC::ByteRangeC(const ByteRangeC &)
ByteRangeC::ByteRangeC(const FloatRangeC &)
ByteRangeC::ByteRangeC(const VectRangeC &)
ByteRangeC::operator=(const ByteRangeC &)
ByteRangeC::~ByteRangeC(void)
ByteRangeC::Copy(void) const
ByteRangeC::ImageHandle(void)
ByteRangeC::operator[](const PixelC &)
ByteRangeC::GetByteZ(const PixelC &) const
ByteRangeC::GetFloatZ(const PixelC &) const
ByteRangeC::GetVect(const PixelC &) const
ByteRangeC::PutByteZ(const PixelC &,ByteGreyValueT)
ByteRangeC::PutFloatZ(const PixelC &,float)
ByteRangeC::PutVect(const PixelC &,Vector3dC)
ByteRangeC::IsValid(const PixelC &) const
ByteRangeC::SoftLoad(char *)
ByteRangeC::Load(char *)
ByteRangeC::SoftSave(char *)
ByteRangeC::Save(char *)
ByteRangeC::LoadPgm(char *)
ByteRangeC::LoadDep(char *)
ByteRangeC::LoadRis(char *)
ByteRangeC::LoadZim(char *)
ByteRangeC::SavePgm(char *)
ByteRangeC::SaveDep(char *)
ByteRangeC::SaveRis(char *)
ByteRangeC::SubImage(const ImageRectangleC &) const
ByteRangeC::ScaleImage(double,int,int) const
ByteRangeC::CalculateExtremes(void)
ByteRangeC::ExportZasByte(int)
ByteRangeC::ExportDXasByte(void)
ByteRangeC::ExportDYasByte(void)
ByteRangeC::operator<<(ostream &,const ByteRangeC &)
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 &)
ByteRangeC
 
Range images with one byte per pixel.
 
include "amma/ByteRange.hh"
User Level:Default
Library:Range
Example: poltool.cc
Section:3D Surface.Range Images
In Scope:std

Comments:
ByteRangeC 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=-MAXFLOAT is invalid.

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 .XYZim
                   written      .pgm .dep .ris
 

Parent Classes: Variables:
const ByteGreyValueT InvalidZ;

const ByteGreyValueT InvalidZ = 0;

Methods:
ByteRangeC()
Constructs an empty Range image

ByteRangeC(char * fname)
Constructs and use .Load

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

ByteRangeC(const ByteImageC & image)
Constructs a Range from a byte image

ByteRangeC(const ByteRangeC & range)
Copy constructor

ByteRangeC(const FloatRangeC & range)
Construct a byte range image from a float one

ByteRangeC(const VectRangeC & range)
Construct a byte range image from a vector one
This will round down positions of points to the lower left grid position by storing in byte image.

ByteRangeC & operator=(const ByteRangeC & range)
Assignment

~ByteRangeC()
Destructor

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

Access to parameters


ByteImageC & ImageHandle()
Access to the internal image, use sparingly!

ByteGreyValueT & 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 LoadPgm(char * fname)
load .pgm file, if error then return 0 else 1

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

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

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

void SavePgm(char * fname)
save .pgm file

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

void SaveRis(char * fname)
save .ris file

Image manipulation


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

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

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.

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

ostream & operator<<(ostream & s,const ByteRangeC & 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