VisionObjectEvent Class Reference#include <VisionObjectEvent.h>
Inheritance diagram for VisionObjectEvent:
[legend]List of all members.
Detailed Description
Extends EventBase to also include location in the visual field and distance (though distance is not implimented yet).
Definition at line 8 of file VisionObjectEvent.h.
|
Calculated Attributes |
|
float | getDistanceEstimate (float diaMajor, float diaMinor=0) const |
| | returns an estimate of how far away the object is if its major (larger) physical dimension is diaMajor and the other dimension is diaMinor; pass 0 if to only use the major dimension
|
|
float | getCenterX () const |
| | returns the center along x
|
|
float | getCenterY () const |
| | returns the center along y
|
|
float | getWidth () const |
| | return width along x
|
|
float | getHeight () const |
| | return height along y
|
|
float | getBoundaryArea () const |
| | returns the area of the bounding box, just multiplication of width*height, (multiply by the major camera resolution to get pixel area)
|
|
float | getXrange () const |
| | returns the maximum x value
|
|
float | getYrange () const |
| | returns the maximum y value
|
|
unsigned int | getFrame () const |
| | returns number of frame when the event was generated
|
|
static float | calcDistance (float visArc, float physDia) |
| | returns the distance of an object, given that it takes up visArc of the camera's visual arc, and the physical crossection is physDia
|
Public Member Functions |
| | VisionObjectEvent (unsigned int sid=0, EventTypeID_t tid=EventBase::deactivateETID) |
| | Constructor, pass a source id and type id -- mainly useful for deactivate events since all object parameters are going to be set to 0.
|
| | VisionObjectEvent (unsigned int sid, EventTypeID_t tid, float x1, float x2, float y1, float y2, float objarea, float rx, float ry) |
| | Constructor, pass the type id, source id, left, right, top, bottom, x range, and y range.
|
| | VisionObjectEvent (unsigned int sid, EventTypeID_t tid, float x1, float x2, float y1, float y2, float objarea, float rx, float ry, unsigned int frame) |
| | Constructor, pass the type id, source id, left, right, top, bottom, x range, y range, and frame_number.
|
|
virtual | ~VisionObjectEvent () |
| | destructor
|
| virtual EventBase * | clone () const |
| | allows a copy to be made of an event, supporting polymorphism
|
| virtual unsigned int | getClassTypeID () const |
| | All subclasses should override this and return a unique ID for their class.
|
| virtual std::string | getDescription (bool showTypeSpecific=true, unsigned int verbosity=0) const |
| | generates a description of the event with variable verbosity
|
|
virtual unsigned int | getBinSize () const |
| | should return the minimum size needed if using binary format (i.e. not XML)
|
|
virtual unsigned int | loadBinaryBuffer (const char buf[], unsigned int len) |
| | load from binary format
|
|
virtual unsigned int | saveBinaryBuffer (char buf[], unsigned int len) const |
| | save to binary format
|
|
virtual void | loadXML (xmlNode *node) |
| | load from XML format
|
|
virtual void | saveXML (xmlNode *node) const |
| | save to XML format
|
|
|
float | getLeft () const |
| | returns the initial x (_x1) coordinate of the Bounding Box (inclusive value)
|
|
VisionObjectEvent & | setLeft (float x1) |
| | sets the initial x (_x1) coordinate of the Bounding Box
|
|
float | getRight () const |
| | returns the final x (_x2) coordinate of the Bounding Box (inclusive value)
|
|
VisionObjectEvent & | setRight (float x2) |
| | sets the final x (_x2) coordinate of the Bounding Box
|
|
float | getTop () const |
| | returns the initial y (_y1) coordinate of the Bounding Box (inclusive value)
|
|
VisionObjectEvent & | setTop (float y1) |
| | sets the initial y (_y1) coordinate of the Bounding Box
|
|
float | getBottom () const |
| | returns the final y (_y2) coordinate of the Bounding Box (inclusive value)
|
|
VisionObjectEvent & | setBottom (float y2) |
| | sets the final y (_y2) coordinate of the Bounding Box
|
|
float | getObjectArea () const |
| | returns the object's _area within the camera, in squared generalized coordinates. Multiply by the square of the major camera resolution (normally RobotInfo::CameraResolutionX if using full resolution) and divide by 4.0 to get pixel area.
|
|
VisionObjectEvent & | setObjectArea (float objarea) |
| | sets the object's _area within the camera, in squared generalized coordinates (multiply by the major camera resolution to get pixel area)
|
|
|
bool | isClippedLeft () const |
| | returns _clipLeft
|
|
bool | isClippedRight () const |
| | returns _clipRight
|
|
bool | isClippedTop () const |
| | returns _clipTop
|
|
bool | isClippedBottom () const |
| | returns _clipBottom
|
|
void | setClipping (bool left, bool right, bool top, bool bottom) |
| | sets clipping boundaries
|
Protected Attributes |
|
float | _x1 |
| | a value representing location in visual field - from -1 if on the left edge to 1 if it's on the right edge
|
|
float | _x2 |
| | a value representing location in visual field - from -1 if on the left edge to 1 if it's on the right edge
|
|
float | _y1 |
| | top boundary, in range of ) for ERS-7; actual values vary depending on aspect ratio to keep square coordinates
|
|
float | _y2 |
| | bottom boundary, in approximately for ERS-7; actual values vary depending on aspect ratio to keep square coordinates
|
|
float | _area |
| | area of the actual object within bounding box as set by generator, in same units as getBoundaryArea(). Multiply by the square of the major camera resolution (normally RobotInfo::CameraResolutionX if using full resolution) and divide by 4.0 to get pixel area.
|
|
bool | _clipLeft |
| | flag to indicate left boundary is on or beyond the camera image's boundary
|
|
bool | _clipRight |
| | flag to indicate right boundary is on or beyond the camera image's boundary
|
|
bool | _clipTop |
| | flag to indicate top boundary is on or beyond the camera image's boundary
|
|
bool | _clipBottom |
| | flag to indicate bottom boundary is on or beyond the camera image's boundary
|
|
float | _xRange |
| | Max range of X dimension (typically 1.0 for AIBO).
|
|
float | _yRange |
| | Max range of Y dimension (typically around 0.8 for AIBO due to camera aspect ratio).
|
|
unsigned int | _frame |
| | Number of frame when the event was generated.
|
Constructor & Destructor Documentation
| VisionObjectEvent::VisionObjectEvent |
( |
unsigned int |
sid = 0, |
|
|
EventTypeID_t |
tid = EventBase::deactivateETID | |
|
) |
| | [inline, explicit] |
Constructor, pass a source id and type id -- mainly useful for deactivate events since all object parameters are going to be set to 0.
- Parameters:
-
| sid | The source ID for the object being detected -- you can define your own values, some are already set in ProjectInterface, but can be reassigned during your project's startup |
| tid | The type ID for the event |
Definition at line 14 of file VisionObjectEvent.h.
Referenced by clone().
| VisionObjectEvent::VisionObjectEvent |
( |
unsigned int |
sid, |
|
|
EventTypeID_t |
tid, |
|
|
float |
x1, |
|
|
float |
x2, |
|
|
float |
y1, |
|
|
float |
y2, |
|
|
float |
objarea, |
|
|
float |
rx, |
|
|
float |
ry | |
|
) |
| | [inline] |
Constructor, pass the type id, source id, left, right, top, bottom, x range, and y range.
- Parameters:
-
| sid | The source ID for the object being detected -- you can define your own values, some are already set in ProjectInterface, but can be reassigned during your project's startup |
| tid | The type ID for the event |
| x1 | The leftmost extent of the object, in generalized coordinates (see _x1) |
| x2 | The rightmost extent of the object in generalized coordinates (see _x2) |
| y1 | The topmost extent of the object, in generalized coordinates (see _y1) |
| y2 | The bottommost extent of the object, in generalized coordinates (see _y2) |
| objarea | The area of the object being detected, in squared generalized coordinates (see _area) |
| rx | The plus/minus range of the x coordinates (generally xres/xres for cameras which are wider than they are high) |
| ry | The plus/minus range of the y coordinates (camera yres/xres for cameras which are wider than they are high) |
Definition at line 32 of file VisionObjectEvent.h.
| VisionObjectEvent::VisionObjectEvent |
( |
unsigned int |
sid, |
|
|
EventTypeID_t |
tid, |
|
|
float |
x1, |
|
|
float |
x2, |
|
|
float |
y1, |
|
|
float |
y2, |
|
|
float |
objarea, |
|
|
float |
rx, |
|
|
float |
ry, |
|
|
unsigned int |
frame | |
|
) |
| | [inline] |
Constructor, pass the type id, source id, left, right, top, bottom, x range, y range, and frame_number.
- Parameters:
-
| sid | The source ID for the object being detected -- you can define your own values, some are already set in ProjectInterface, but can be reassigned during your project's startup |
| tid | The type ID for the event |
| x1 | The leftmost extent of the object, in generalized coordinates (see _x1) |
| x2 | The rightmost extent of the object in generalized coordinates (see _x2) |
| y1 | The topmost extent of the object, in generalized coordinates (see _y1) |
| y2 | The bottommost extent of the object, in generalized coordinates (see _y2) |
| objarea | The area of the object being detected, in squared generalized coordinates (see _area) |
| rx | The plus/minus range of the x coordinates (generally xres/xres for cameras which are wider than they are high) |
| ry | The plus/minus range of the y coordinates (camera yres/xres for cameras which are wider than they are high) |
| frame | The camera frame number the object was detected in (see _frame) |
Definition at line 51 of file VisionObjectEvent.h.
Member Function Documentation
| virtual EventBase* VisionObjectEvent::clone |
( |
|
) |
const [inline, virtual] |
allows a copy to be made of an event, supporting polymorphism
Must be overridden by all subclasses to allow this to happen
I would like to switch this over to the cloneable interface once the compiler gets updated out of the 3.3 branch... see Cloneable::clone() for a discussion of the issue and implementation notes.
Reimplemented from EventBase.
Definition at line 61 of file VisionObjectEvent.h.
| virtual unsigned int VisionObjectEvent::getClassTypeID |
( |
|
) |
const [inline, virtual] |
All subclasses should override this and return a unique ID for their class.
All IDs corresponding to all-capital letters are reserved for future framework expansion. (Thus, user subclasses should contain at least one lower-case letter.) This code can be used when serializing to allow quick identification of the class type by the receiver.
Reimplemented from EventBase.
Definition at line 63 of file VisionObjectEvent.h.
| std::string VisionObjectEvent::getDescription |
( |
bool |
showTypeSpecific = true, |
|
|
unsigned int |
verbosity = 0 | |
|
) |
| | const [virtual] |
generates a description of the event with variable verbosity
- Parameters:
-
| showTypeSpecific | should be read by subclasses to add additional information |
| verbosity | can be one of the following values:
- 0 - Basic: event_name \t generator_id \t source_id \t type_id
- 1 - Numerics: event_name \t generator_id \t source_id \t type_id
- 2 - Timing: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp
- 3 and above - Full: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp \t magnitude if showTypeSpecific, additional fields will be added after the common fields listed above.
|
Reimplemented from EventBase.
Definition at line 9 of file VisionObjectEvent.cc.
The documentation for this class was generated from the following files:
|