|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
This is an implementation or body class. As a result the handle class
RegBoundaryC should be used.
Used by RegOrderedGrowC to represent intermediate stages in the region
growing process. It stores a labelled image of the region as well as
statistics of the region and boundary. The statistics are updated
incrementally when a pixel is added to the region.
Parent Classes:
Enumerated types:
- enum RegLabelsT { LabelExternal = 0, LabelCurrent, LabelInternal, LabelRegion } ;
-
Scratch growing buffer value definitions
| ind | Index of types of intererest. |
Variables:
- PriQueueLC _queue;
-
Priority queue of points in current boundary
| ind | Index of types of intererest. |
Top of queue is the next point on the boundary to be added to the region
- ByteImageC _image;
-
Scratch buffer which represents the region
| ind | Index of types of intererest. |
Pixels are labelled according to whether they are background, current
boundary, internal boundary or region. Note that points in the internal
boundary are also in the region.
- ImageRectangleC _limit;
-
Bounding box for growing the current boundary
| ind | Index of types of intererest. |
The segmentation algorithm will not include points outside this boundary.
- ImageRectangleC _bound;
-
Bounding box on the region
| ind | Index of types of intererest. |
- NumLabelC _label;
-
Label assigned to the region
| ind | Index of types of intererest. |
- NumLabelC _cluster;
-
Label assigned during motion clustering
| ind | Index of types of intererest. |
- Vector2dC _meanPos;
-
Centre of mass of the region
| ind | Index of types of intererest. |
- Vector2dC _motion;
-
Estimated motion vector for the region
| ind | Index of types of intererest. |
- Moments012d2C _moments;
-
2nd order moments of the region
| ind | Index of types of intererest. |
- BRCPtrC _previous;
-
Handle to region in previous image.
| ind | Index of types of intererest. |
- RealT _regionAverage;
-
Average intensity of the region
| ind | Index of types of intererest. |
- RealT _currentAverage;
-
Average intensity of the current boundary
| ind | Index of types of intererest. |
- RealT _internalAverage;
-
Average intensity of the internal boundary
| ind | Index of types of intererest. |
- UIntT _numRegionPixels;
-
Number of pixels in the region
| ind | Index of types of intererest. |
- UIntT _numCurrentPixels;
-
Number of pixels in the current boundary
| ind | Index of types of intererest. |
- UIntT _numInternalPixels;
-
Number of pixels in the internal boundary
| ind | Index of types of intererest. |
Methods:
- void AddRegion(RealT val,const PixelC & pos)
-
Adds a pixel to the region statistics
| ind | Index of types of intererest. |
- void AddCurrent(RealT val,const PixelC & pos)
-
Adds a pixel to the current boundary statistics
| ind | Index of types of intererest. |
- void SubCurrent(RealT val)
-
Removes a pixel from the current boundary statistics
| ind | Index of types of intererest. |
- void AddInternal(RealT val)
-
Adds a pixel to the internal boundary statistics
| ind | Index of types of intererest. |
- void SubInternal(RealT val)
-
Removes a pixel from the internal boundary statistics
| ind | Index of types of intererest. |
- RegBoundaryBC(const ImageRectangleC & rect,const NumLabelC & label)
-
Constructor
| ind | Index of types of intererest. |
- RegBoundaryBC(const RegBoundaryBC & oth)
-
Copy constructor clips label image
| ind | Index of types of intererest. |
Makes a completely new copy.
- RegBoundaryBC & Copy() const
-
Makes a deep copy
| ind | Index of types of intererest. |
- void AddPixel(const PixelC & pos,const ByteImageC & scene)
-
| ind | Index of types of intererest. |
- RealT AverageContrast() const
-
| ind | Index of types of intererest. |
- RealT GradientContrast() const
-
| ind | Index of types of intererest. |
- RealT Compactness() const
-
Ratio of perimeter to area
| ind | Index of types of intererest. |
- const PixelC GetNextPixel()
-
Finds next pixel from the current boundary
| ind | Index of types of intererest. |
Uses a priority queue to do this. Points are added to the queue in
AddPixel but it is removed here.
- void AddRegionToImage(ImageC<NumLabelC> & image) const
-
Inserts labelled region into image
| ind | Index of types of intererest. |
The region is labelled with the value specified in the constructor. The
boundary is labelled with the same value with bit 16 set.
- void AddOverlayToImage(RGBImageC & scene,const ByteRGBValueC & colour) const
-
Inserts overlay of region into image
| ind | Index of types of intererest. |
The internal boundary of the region is labelled in the scene image as
pixels with the specified colour.
- NumLabelC GetLabel() const
-
Access to the label of the region
| ind | Index of types of intererest. |
- void SetLabel(const NumLabelC & label)
-
Specify a label value for the region
| ind | Index of types of intererest. |
- NumLabelC GetCluster() const
-
Access to the motion cluster of the region
| ind | Index of types of intererest. |
- void SetCluster(const NumLabelC & label)
-
Specify a motion cluster value for the region
| ind | Index of types of intererest. |
- UIntT GetRegionSize() const
-
The number of pixels in the region
| ind | Index of types of intererest. |
- Vector2dC GetMeanPos() const
-
Centre of mass of the region
| ind | Index of types of intererest. |
- Vector2dC GetMotion() const
-
Motion vector of the region
| ind | Index of types of intererest. |
- void SetMotion(Vector2dC motion)
-
Specify the motion vector of the region
| ind | Index of types of intererest. |
- Matrix2d2C GetMoments() const
-
Gets 2nd order moments of region as a covariance matrix
| ind | Index of types of intererest. |
- void SetPreviousRegion(RegBoundaryBC & previous)
-
Sets a handle to previous region
| ind | Index of types of intererest. |
This is used to track the history of the region. At each point in time
there is a handle to the region at the previous point in time. This is
set during motion tracking.
- RegBoundaryBC & PreviousRegion()
-
Gets handle to same region in previous image
| ind | Index of types of intererest. |
- IndexNeigh2dC GetNeighbourhood() const
-
Returns neighbourhood list of pixels in the region
| ind | Index of types of intererest. |
- void AddReference()
-
Another reference to the object has been created.
- void RemoveReference()
-
One reference to the object was deleted.
Locking scheme
--------------
The object is possible to lock (to make constant). The scheme
assumes that the object is created, it can be locked, after that
it can only be destroyed. The locked object cannot be unlocked.
This locking scheme is very useful
during debugging, using assert() function,
when it is necassary to check that object
is treated as constant and the constancy is not violated by
any casting or passing through the copy constructor of shared
objects.
- void SetConst(void) const
-
This locks the object.
Often objects you wish to lock are already const.
- void SetConst(void)
-
This locks the object.
- BooleanT IsConst(void) const
-
Returns TRUE if the object is locked, ie. it is assumed to be constant.
- BooleanT IsNotConst(void) const
-
Returns TRUE if the object is unlocked.
ie. there is no special
information if the object is constant or not.
Counter state information
-------------------------
- BooleanT ToBeDeleted() const
-
Returns TRUE if there is only one reference to the object and the whole object or its reference counting part can be deleted.
- BooleanT ToBeDeletedRemoveIgnoreNoRemove()
-
Decrement refrence by 1 return true if this leaves no refrences to the object.
- BooleanT ToBeDeletedRemove()
-
Decrement refrence by 1 return true if this leaves no refrences to the object. This also checks the NoRemove flag.
- BooleanT BodyMightBeDeleted() const
-
Returns TRUE if the reference counted part of the object can be deleted, ie. flag NOREMOVE is false .
- BooleanT IsCountZero() const
-
Are there any refrences left ?
- BooleanT BRCPtrCanDeleteObject() const
-
Used by BRRCPtrC to establish if an object has ZERO refrences and can be deleted.
- IntT Count() const
-
Returns the current state of the counter, ie. how many references to this object exist.
- const BodyRefCounterC & operator=(const BodyRefCounterC & b)
-
It has not meaning to assign object 'b' to this object because it would destroy a history of the object which is counted. So this is a dummy function.
- BooleanT IsValidObject() const
-
Test if object is valid.
When amma check is disabled this always returns true.
- BooleanT UserBitTest(IntT x) const
-
Test user flag.
- void UserBitSet(IntT x,BooleanT setit = TRUE)
-
Test user flag.
- void UserBitZero(IntT x)
-
Set bit to zero.
- void ReportBRCError(char * Msg)
-
Report error, used in BRCPtrC.
- UIntT Hash() const
-
Hash on address of object.
- void SetUndeletable()
-
Make object undeletable.
Usefull to prevent recursive deleting in graph structures.
Only hackers need this function.
- void ReportInvalidObject(char * Msg = 0) const
-
Tell user about validation failure.
- LabelT Label() const
-
Returns the label of this reference counter.
The member function
is useful mainly to recognize objects during debugging.
The value of the label is uniquely defined pointer.
|
Programmer:Robert Crida, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|