Tracore
Public Member Functions | Friends | List of all members
core::ObjectData Class Reference

#include <ObjectData.h>

Inheritance diagram for core::ObjectData:
core::ObjectData2D core::Tracklet core::ObjectDataAngular core::ObjectDataBox

Public Member Functions

 ObjectData ()
 
 ObjectData (std::size_t frame_index)
 
std::size_t GetFrameIndex () const
 
void SetFrameIndex (size_t index)
 
void SetDetectionScore (double score)
 
double GetDetectionScore () const
 
bool IsVirtual () const
 
virtual double CompareTo (ObjectDataPtr obj) const
 
virtual bool IsWithinConstraints (ObjectDataPtr obj, std::unordered_map< std::string, double > &constraints) const
 
virtual ObjectDataPtr Interpolate (ObjectDataPtr obj, double fraction) const
 
virtual void Visualize (cv::Mat &image, cv::Scalar &color) const
 
virtual std::string ToString (char delimiter) const
 

Friends

std::ostream & operator<< (std::ostream &os, const ObjectData &obj)
 

Detailed Description

Base class for all detected objects. Stores the corresponding frame index.

Constructor & Destructor Documentation

core::ObjectData::ObjectData ( )

Creates a new empty virtual ObjectData

core::ObjectData::ObjectData ( std::size_t  frame_index)

Creates a new ObjectData with the given frame index

Parameters
frame_indexthe index in which the object was detected

Member Function Documentation

double core::ObjectData::CompareTo ( ObjectDataPtr  obj) const
virtual

Compares this object with the given object.

Parameters
objA pointer to the object to compare this object to
Returns
A double value indicating the comparison result

Reimplemented in core::Tracklet, core::ObjectData2D, core::ObjectDataAngular, and core::ObjectDataBox.

double core::ObjectData::GetDetectionScore ( ) const

Gets the detection score

Returns
The detection score
std::size_t core::ObjectData::GetFrameIndex ( ) const

Gets the frame index

Returns
The frame index
ObjectDataPtr core::ObjectData::Interpolate ( ObjectDataPtr  obj,
double  fraction 
) const
virtual

Linearly interpolates between this and the given object. Creates a new object to fit between the two objects.

Parameters
objA pointer to the target object
fractionDescribes where the interpolation should be done. A fraction of zero is a clone of this object, a fraction of one is a clone of the target object.
Returns
The interpolated object

Reimplemented in core::Tracklet, core::ObjectData2D, core::ObjectDataAngular, and core::ObjectDataBox.

bool core::ObjectData::IsVirtual ( ) const

Is this node considered a virtual node

Returns
True, if this node is virtual
bool core::ObjectData::IsWithinConstraints ( ObjectDataPtr  obj,
std::unordered_map< std::string, double > &  constraints 
) const
virtual

Checks if the difference between this object and the specified object is within the constraints specified. The difference is calculated for each constraint separately.

Parameters
objThe object to get the difference to
constraintsThe constraints to assure

Reimplemented in core::ObjectData2D, core::ObjectDataAngular, and core::ObjectDataBox.

void core::ObjectData::SetDetectionScore ( double  score)

Sets the detection score

Parameters
scoreThe detection score
void core::ObjectData::SetFrameIndex ( size_t  index)

Sets the frame index

Parameters
indexThe new frame index
std::string core::ObjectData::ToString ( char  delimiter) const
virtual

Returns a string representing the values of this object data.

Parameters
delimiterThe delimiter used to separate values
Returns
The string containing the values

Reimplemented in core::ObjectData2D, core::ObjectDataAngular, and core::ObjectDataBox.

void core::ObjectData::Visualize ( cv::Mat &  image,
cv::Scalar &  color 
) const
virtual

Visualizes the object in the given image with the given color. This method does nothing, it needs to be overwritten to visualize something.

Parameters
imageThe image to write into
colorThe color to use

Reimplemented in core::Tracklet, core::ObjectData2D, core::ObjectDataAngular, and core::ObjectDataBox.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ObjectData obj 
)
friend

Overrides the << operator for custom output. Calls the print method.

Parameters
osThe stream to write to
objThe object to write into the stream
Returns
The stream written to

The documentation for this class was generated from the following files: