|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
This structure allows the sum of the values in any rectangle to
found with very little computation. The major cost is setting
up the structure which involves suming every value in the input
image.
Derived Classes:
Variables:
- IntImageC Map;
-
Methods:
- IntDensity2dC()
-
Construct an empty map.
- IntDensity2dC(const ByteImageC & Img)
-
Construct from a byte image.
- IntDensity2dC(const IntDensity2dC & Img)
-
Copy constructor.
- const IntDensity2dC & operator=(const IntDensity2dC & oth)
-
Assignment.
- const IntDensity2dC & operator=(const ByteImageC & Img)
-
Assign to a byte image.
- void Build(const ByteImageC & Img)
-
Build a new map from Image ByteImageC,
- IntT Sum(ImageRectangleC Rect) const
-
Get sum of pixel in Rect.
Rect is clipped to lie within Map.
- RealT Density(ImageRectangleC Rect) const
-
Get the density of points within the rectangle.
Any part of the rectangle outside the image
is considered to contain nothing.
- ImageRectangleC GetRandomRect(ImageRectangleC Rect,IntT MinArea = 12) const
-
Pick a Rectangle inside 'Rect' with a probality propoportional
the magnatude the sum of the pixels in that area.
This is for making a more efficent 'GetRandomPix' when dealing with
binary images. When the area drops below MinArea it is more efficent
to scan the image an pick from the pixels found.
NB. - The returned rectangle isn't random in posision !!
- The returned rectangle may not be entirly inside the map if the original
rectangle wasn't.
- PixelC GetRandomPix(ImageRectangleC Rect) const
-
Pick a pixel inside 'Rect' with a probality propoportional
the magnatude of the pixel.
|
Programmer:Charles Galambos, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|