stores a visual event as a sequence of tokens with additional information More...
#include <MBARI/VisualEvent.H>
Public Member Functions | |
VisualEvent (Token tk, int maxDist) | |
constructor | |
VisualEvent (std::istream &is) | |
read the VisualEvent from the input stream is | |
void | writeToStream (std::ostream &os) const |
write the entire VisualEvent to the output stream os | |
void | readFromStream (std::istream &is) |
read the VisualEvent from the input stream is | |
void | writePositions (std::ostream &os) const |
write all the positions for this event to the output stream os | |
Point2D< int > | predictedLocation () const |
get the prediction for the location of the next token | |
bool | isTokenOk (const Token &tk) const |
is this token allowed as the next one? | |
float | getCost (const Token &tk) const |
returns the cost of associating tk with this event | |
void | assign (const Token &tk, const Vector2D &foe) |
assign tk to this event, use foe as the focus of expansion | |
bool | doesIntersect (const BitObject &obj, int frameNum) const |
if the BitObject intersects with the one for this event at frameNum | |
void | close () |
mark this event as "closed" | |
bool | isClosed () |
whether this event is closed | |
uint | getEventNum () const |
return the event identification number of this event | |
uint | getStartFrame () const |
return the frame number of the first token | |
uint | getEndFrame () const |
return the frame number of the last token | |
uint | getNumberOfFrames () const |
return the number of frames that this event spans | |
int | getMaxSize () const |
return the maximum object size of any of the tokens | |
Token | getMaxSizeToken () const |
return the token that has the maximum object size | |
Token | getToken (const uint frame_num) const |
return a token based on a frame number | |
bool | isFrameOk (const uint frame_num) const |
return whether frame_num is between start frame and end frame | |
std::vector< float > | getPropertyVector () |
return a vector that contains a bunch of numbers that describe the event | |
Dims | getMaxObjectDims () const |
returns the maximum dimensions of the tracked object in any of the frames |
stores a visual event as a sequence of tokens with additional information
Definition at line 147 of file VisualEvent.H.
VisualEvent::VisualEvent | ( | Token | tk, | |
int | maxDist | |||
) |
constructor
tk | the first token for this event |
Definition at line 178 of file VisualEvent.C.
References Token::bitObject, BitObject::getArea(), Token::location, Vector2D::x(), and Vector2D::y().
VisualEvent::VisualEvent | ( | std::istream & | is | ) |
read the VisualEvent from the input stream is
Definition at line 198 of file VisualEvent.C.
References readFromStream().
assign tk to this event, use foe as the focus of expansion
Definition at line 287 of file VisualEvent.C.
References Vector2D::angle(), ASSERT, Token::bitObject, Token::frame_nr, BitObject::getArea(), KalmanFilter::getEstimate(), isTokenOk(), Vector2D::isValid(), Token::location, KalmanFilter::update(), Vector2D::x(), and Vector2D::y().
void VisualEvent::close | ( | ) | [inline] |
mark this event as "closed"
Definition at line 361 of file VisualEvent.H.
bool VisualEvent::doesIntersect | ( | const BitObject & | obj, | |
int | frameNum | |||
) | const |
if the BitObject intersects with the one for this event at frameNum
Definition at line 317 of file VisualEvent.C.
References Token::bitObject, BitObject::doesIntersect(), getToken(), and isFrameOk().
float VisualEvent::getCost | ( | const Token & | tk | ) | const |
returns the cost of associating tk with this event
Definition at line 273 of file VisualEvent.C.
References KalmanFilter::getCost(), KalmanFilter::getEstimate(), isTokenOk(), Token::location, Vector2D::x(), and Vector2D::y().
uint VisualEvent::getEndFrame | ( | ) | const [inline] |
return the frame number of the last token
Definition at line 377 of file VisualEvent.H.
uint VisualEvent::getEventNum | ( | ) | const [inline] |
return the event identification number of this event
Definition at line 369 of file VisualEvent.H.
Referenced by getPropertyVector(), and MbariResultViewer::saveSingleEventFrame().
Dims VisualEvent::getMaxObjectDims | ( | ) | const |
returns the maximum dimensions of the tracked object in any of the frames
Definition at line 390 of file VisualEvent.C.
int VisualEvent::getMaxSize | ( | ) | const [inline] |
return the maximum object size of any of the tokens
Definition at line 385 of file VisualEvent.H.
Token VisualEvent::getMaxSizeToken | ( | ) | const [inline] |
return the token that has the maximum object size
Definition at line 389 of file VisualEvent.H.
References getToken().
Referenced by getPropertyVector().
uint VisualEvent::getNumberOfFrames | ( | ) | const [inline] |
return the number of frames that this event spans
Definition at line 381 of file VisualEvent.H.
std::vector< float > VisualEvent::getPropertyVector | ( | ) |
return a vector that contains a bunch of numbers that describe the event
see source code for details
Definition at line 325 of file VisualEvent.C.
References Token::angle, Token::bitObject, BitObject::getArea(), BitObject::getElongation(), getEventNum(), BitObject::getMajorAxis(), BitObject::getMaxMinAvgIntensity(), getMaxSizeToken(), BitObject::getMinorAxis(), BitObject::getOriAngle(), BitObject::getSecondMoments(), and BitObject::isValid().
uint VisualEvent::getStartFrame | ( | ) | const [inline] |
return the frame number of the first token
Definition at line 373 of file VisualEvent.H.
return a token based on a frame number
Definition at line 393 of file VisualEvent.H.
References ASSERT, and isFrameOk().
Referenced by doesIntersect(), and getMaxSizeToken().
bool VisualEvent::isClosed | ( | ) | [inline] |
whether this event is closed
Definition at line 365 of file VisualEvent.H.
bool VisualEvent::isFrameOk | ( | const uint | frame_num | ) | const [inline] |
return whether frame_num is between start frame and end frame
Definition at line 400 of file VisualEvent.H.
Referenced by doesIntersect(), getToken(), and MbariResultViewer::saveSingleEventFrame().
bool VisualEvent::isTokenOk | ( | const Token & | tk | ) | const |
is this token allowed as the next one?
Definition at line 267 of file VisualEvent.C.
References Token::frame_nr.
Point2D< int > VisualEvent::predictedLocation | ( | ) | const |
get the prediction for the location of the next token
Definition at line 259 of file VisualEvent.C.
References KalmanFilter::getEstimate().
void VisualEvent::readFromStream | ( | std::istream & | is | ) |
read the VisualEvent from the input stream is
Definition at line 226 of file VisualEvent.C.
References KalmanFilter::readFromStream().
Referenced by VisualEvent().
void VisualEvent::writePositions | ( | std::ostream & | os | ) | const |
write all the positions for this event to the output stream os
Definition at line 250 of file VisualEvent.C.
void VisualEvent::writeToStream | ( | std::ostream & | os | ) | const |
write the entire VisualEvent to the output stream os
Definition at line 204 of file VisualEvent.C.
References KalmanFilter::writeToStream().