Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <RegionGenerator.h>
Inheritance diagram for RegionGenerator:
Uses the CMVision library for main processing.
Uses fields in the RLEGenerator's runs to store region information. This means we don't have to make an extra copy of the data, but unfortunately also means these two stages are tightly coupled...
Similarly, this also accesses the color information of the runs, so the events received must be a SegmentedColorFilterBankEvents so that it can interpret the color information. Some statistical information will then be stored in the color struct to report the min region area, max region area, and number of regions.
Definition at line 23 of file RegionGenerator.h.
Public Types | |
typedef CMVision::region | region |
using the CMVision library's region information | |
typedef CMVision::color_class_state | region_stats |
using the CMVision library's color struct to store the region info | |
Public Member Functions | |
RegionGenerator (EventBase::EventGeneratorID_t gid, unsigned int sid, unsigned int mysid) | |
constructor | |
virtual | ~RegionGenerator () |
destructor | |
virtual void | freeCaches () |
deletes storage of cached images and marks it invalid | |
virtual void | processEvent (const EventBase &event) |
see class notes above for what data this can handle | |
virtual unsigned int | getBinSize () const |
calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work. | |
virtual unsigned int | LoadBuffer (const char buf[], unsigned int len) |
virtual unsigned int | SaveBuffer (char buf[], unsigned int len) const |
Save to a given buffer. | |
virtual const FilterBankGenerator * | getSourceGenerator () const |
returns the FilterBankGenerator this is receiving events from | |
Static Public Member Functions | |
std::string | getClassDescription () |
Gives a short description of what this class of behaviors does... you should override this (but don't have to). | |
Protected Types | |
typedef SegmentedColorFilterBankEvent::color_class_state | color_class_state |
use the same color info as SegmentedColorFilterBankEvent (since that's what's supplying the color info) | |
Protected Member Functions | |
virtual void | setDimensions () |
resets the width, height, skip and stride parameters | |
virtual void | setNumImages (unsigned int nLayers, unsigned int nChannels) |
resizes the filter bank information storage area, you should override this to do your setup and call it from your constructor | |
virtual unsigned char * | createImageCache (unsigned int layer, unsigned int chan) const |
create new image data storage area for the cache - this is only called when the corresponding entry in images is NULL | |
virtual void | calcImage (unsigned int layer, unsigned int chan) const |
should calculate new image data, only called when imageValids indicates the image being requested is dirty | |
virtual void | destruct () |
deletes the arrays | |
Protected Attributes | |
const FilterBankGenerator * | src |
the generator of the last FilterBankEvent received | |
unsigned int | srcNumColors |
number of colors available (from src->src, which should be SegmentedColorGenerator...) | |
color_class_state * | srcColors |
colors information (from src->src, which should be SegmentedColorGenerator...) | |
region *** | regions |
data storage for region information | |
Static Protected Attributes | |
const unsigned int | MAX_REGIONS = 176*144/16 |
maximum number of regions, value is from historical Vision sources | |
Private Member Functions | |
RegionGenerator (const RegionGenerator &fbk) | |
don't call | |
const RegionGenerator & | operator= (const RegionGenerator &fbk) |
don't call |
|
use the same color info as SegmentedColorFilterBankEvent (since that's what's supplying the color info)
Definition at line 48 of file RegionGenerator.h. |
|
using the CMVision library's region information
Definition at line 25 of file RegionGenerator.h. Referenced by createImageCache(), LoadBuffer(), SaveBuffer(), and setNumImages(). |
|
using the CMVision library's color struct to store the region info
Definition at line 26 of file RegionGenerator.h. Referenced by calcImage(), createImageCache(), LoadBuffer(), and SaveBuffer(). |
|
constructor
Definition at line 10 of file RegionGenerator.cc. |
|
destructor
Definition at line 16 of file RegionGenerator.cc. |
|
don't call
|
|
should calculate new image data, only called when imageValids indicates the image being requested is dirty This is where you'll want to put your user-specific code for calculating the image data Implements FilterBankGenerator. Definition at line 223 of file RegionGenerator.cc. |
|
create new image data storage area for the cache - this is only called when the corresponding entry in images is NULL You should return the pointer you want stored in images to be returned by any calls to getFirstRow. Interpretation of the data it points to is dependant on the the generator which creates it Implements FilterBankGenerator. Definition at line 214 of file RegionGenerator.cc. Referenced by LoadBuffer(). |
|
deletes the arrays
Reimplemented from FilterBankGenerator. Definition at line 239 of file RegionGenerator.cc. Referenced by ~RegionGenerator(). |
|
deletes storage of cached images and marks it invalid you should override this if the images cache pointer isn't actually an array of bytes... Don't forget to call it in your subclass's destructor or your version won't get called... Reimplemented from FilterBankGenerator. Definition at line 22 of file RegionGenerator.cc. Referenced by LoadBuffer(), processEvent(), and ~RegionGenerator(). |
|
calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work.
Reimplemented from FilterBankGenerator. Definition at line 61 of file RegionGenerator.cc. |
|
Gives a short description of what this class of behaviors does... you should override this (but don't have to).
Reimplemented from BehaviorBase. Definition at line 33 of file RegionGenerator.h. |
|
returns the FilterBankGenerator this is receiving events from
Definition at line 45 of file RegionGenerator.h. |
|
The LoadBuffer() functions of the included subclasses aren't tested, so don't assume they'll work without a little debugging... Reimplemented from FilterBankGenerator. Definition at line 74 of file RegionGenerator.cc. |
|
don't call
|
|
see class notes above for what data this can handle
Reimplemented from FilterBankGenerator. Definition at line 32 of file RegionGenerator.cc. |
|
Save to a given buffer.
Reimplemented from FilterBankGenerator. Definition at line 144 of file RegionGenerator.cc. |
|
resets the width, height, skip and stride parameters
Definition at line 206 of file RegionGenerator.cc. Referenced by processEvent(). |
|
resizes the filter bank information storage area, you should override this to do your setup and call it from your constructor In general, it isn't expected that FilterBankGenerator's should necessarily be dynamically resizeable (although it would be nice), which is why this isn't public. If yours is, just add some pubic accessor functions which call this. In general, the included subclasses should be able to handle being resized, but there's no reason to do so since the system won't be changing its available resolutions at run time. Reimplemented from FilterBankGenerator. Definition at line 194 of file RegionGenerator.cc. Referenced by processEvent(), and RegionGenerator(). |
|
maximum number of regions, value is from historical Vision sources
Definition at line 49 of file RegionGenerator.h. Referenced by calcImage(), createImageCache(), getBinSize(), and LoadBuffer(). |
|
data storage for region information
Definition at line 61 of file RegionGenerator.h. Referenced by calcImage(), createImageCache(), destruct(), freeCaches(), LoadBuffer(), and setNumImages(). |
|
the generator of the last FilterBankEvent received
Definition at line 57 of file RegionGenerator.h. Referenced by getSourceGenerator(), processEvent(), and setDimensions(). |
|
colors information (from src->src, which should be SegmentedColorGenerator...)
Definition at line 60 of file RegionGenerator.h. Referenced by createImageCache(), and processEvent(). |
|
number of colors available (from src->src, which should be SegmentedColorGenerator...)
Definition at line 59 of file RegionGenerator.h. Referenced by calcImage(), createImageCache(), LoadBuffer(), processEvent(), and SaveBuffer(). |
Tekkotsu v2.0 |
Generated Wed Jan 21 03:23:23 2004 by Doxygen 1.3.4 |