|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
|
PUBLIC |
VTNearC::VTNearC(void)
VTNearC::VTNearC(VTRingC,int,int)
VTNearC::VTNearC(const VTNearC &)
VTNearC::operator=(const VTNearC &)
VTNearC::~VTNearC(void)
VTNearC::ExhaustNearest(Vector3dC)
VTNearC::Nearest(Vector3dC)
VTNearC::MakeMap(char *,char *,BooleanT)
VTNearC::Encode(int)
VTNearC::NearestOnBorder(Vector3dC,int,int,int,int)
VTNearC::Nearest(Vector3dC,int,int)
VTNearC::Unmark(int,int,int,int)
VTNearC::DistToBoxWall(Vector3dC,int,int)
VTNearC::ExpandBox(int &,int &,int &,int &)
VTNearC::Inside(int,int)
VTNearC::VectToRowCol(Vector3dC,int &,int &)
VTNearC::PerpDistToBoxMiddle(Vector3dC)
|
Comments:
-------------------------------------------------------------------------
-------------------------------------------------------------------------
This class is used to find the nearest point on a VTRingC triangulated
surface by means of a spatial partioning. It is not intended to be
optimal but is a simple implementation of a fast technique. It is
good when the points are close to the surface but becomes as bad
as an exhaustive search when points are far away.
The search is based on projecting all triangles into a plane
divided into squares. For each square a list holds the (integer)
number of each triangle that projects into it. When it is time to
search the query point is projected into a square and the search
expands to include larger neighbourhoods until it is not possible for
any unsearched squares to contain a closer point.
It is possible to convert the squares to hold lists of pointers
which would mean that the VTRingC could be modified without needing
the lookup table to be reconstructed from scratch
***NB*** The faces on the VTRingC are renumbered.
This code is based on a algorithm first used at Surrey by Adrian Hilton.
The method works well when the point is near the surface, but
can be very poor away from the surface
This should be improved to use planes other than the xy plane!
***NB*** This code uses the already established scheme for converting XY to rc of
the RangeC
The onbound flag is crude in the sense that it uses FaceOnBound; it should be
improved into a rigorous point on boundary test
-------------------------------------------------------------------------
********** VTNearC *****************************************************
-------------------------------------------------------------------------
Variables:
- int trace;
-
- int nrows;
-
- int ncols;
-
- Vector3dC min;
-
- Vector3dC max;
-
- Vector3dC gridmin;
-
- Vector3dC gridmax;
-
- double gridsize;
-
- SArray1dC> table;
-
- SArray1dC done;
-
- SArray1dC lookup;
-
- VTRingC vt;
-
just a handle!!
Methods:
- VTNearC()
-
Null Constructor
- VTNearC(VTRingC vtin,int nbins = 50,int tr = 0)
-
Constructor; Uses renumber faces on vt
- VTNearC(const VTNearC & b)
-
Copy Constructor
- VTNearC & operator=(const VTNearC & b)
-
- ~VTNearC()
-
Destructor
- VTNearestPointC ExhaustNearest(Vector3dC query)
-
find the nearest point on surface to query; exhaustive search
- VTNearestPointC Nearest(Vector3dC query)
-
find the nearest point on surface to query
- void MakeMap(char * vecfil,char * mapfil,BooleanT exhaust)
-
given a vectorset produce the mape file
- void Encode(int nbins)
-
encode the vt into a bucket structure
Uses renumber faces on vt
- VTNearestPointC NearestOnBorder(Vector3dC query,int rmin,int cmin,int rmax,int cmax)
-
Look in the set of border pixels for the nearest
***NB*** Efficiency could be improved
- VTNearestPointC Nearest(Vector3dC query,int r,int c)
-
find the nearest point on a face that has not previously been processed
- int Unmark(int rmin,int cmin,int rmax,int cmax)
-
unmark all the faces in the specified buckets
- double DistToBoxWall(Vector3dC vect,int rmin,int rmax)
-
smallest distance to a wall
- void ExpandBox(int & rmin,int & cmin,int & rmax,int & cmax)
-
expand box by 1 in all directions
- BooleanT Inside(int r,int c)
-
is bucket inside
- void VectToRowCol(Vector3dC v,int & r,int & c)
-
scheme for converting xy to rc; same as rangeC
- double PerpDistToBoxMiddle(Vector3dC v)
-
project point to plane and find its box, then give largest perp
distance to box center.
|
Programmer:Andrew Stoddart, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|