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

#include <ObjectDataBox.h>

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

Public Member Functions

 ObjectDataBox (size_t frame_index, cv::Point2d center, cv::Point2d size)
 
cv::Point2d GetSize () const
 
virtual double CompareTo (ObjectDataPtr obj) const override
 
virtual bool IsWithinConstraints (ObjectDataPtr obj, std::unordered_map< std::string, double > &constraints) const override
 
virtual ObjectDataPtr Interpolate (ObjectDataPtr obj, double fraction) const override
 
virtual void Visualize (cv::Mat &image, cv::Scalar &color) const override
 
virtual std::string ToString (char delimiter) const override
 
- Public Member Functions inherited from core::ObjectData2D
 ObjectData2D (size_t frame_index, cv::Point2d position)
 
void SetTemporalWeight (double weight)
 
void SetSpatialWeight (double weight)
 
cv::Point2d GetPosition () const
 
double GetTemporalWeight () const
 
double GetSpatialWeight () const
 
- Public Member Functions inherited from core::ObjectData
 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
 

Detailed Description

Class for storing an object detection with an bounding box.

Constructor & Destructor Documentation

core::ObjectDataBox::ObjectDataBox ( size_t  frame_index,
cv::Point2d  center,
cv::Point2d  size 
)

Creates a new detection with an bounding box of the given size.

Parameters
frame_indexThe frame index of the detection
centerThe center of the bounding box
sizeThe size of the bounding box

Member Function Documentation

double core::ObjectDataBox::CompareTo ( ObjectDataPtr  obj) const
overridevirtual

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 from core::ObjectData2D.

cv::Point2d core::ObjectDataBox::GetSize ( ) const

Gets the size of the bounding box.

Returns
The size of the bounding box
ObjectDataPtr core::ObjectDataBox::Interpolate ( ObjectDataPtr  obj,
double  fraction 
) const
overridevirtual

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 from core::ObjectData2D.

bool core::ObjectDataBox::IsWithinConstraints ( ObjectDataPtr  obj,
std::unordered_map< std::string, double > &  constraints 
) const
overridevirtual

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 from core::ObjectData2D.

std::string core::ObjectDataBox::ToString ( char  delimiter) const
overridevirtual

Returns a string representing the values of this object data.

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

Reimplemented from core::ObjectData2D.

void core::ObjectDataBox::Visualize ( cv::Mat &  image,
cv::Scalar &  color 
) const
overridevirtual

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 from core::ObjectData2D.


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