27#include <boost/multi_index/mem_fun.hpp>
28#include <boost/multi_index/ordered_index.hpp>
29#include <boost/multi_index_container.hpp>
33#include <VisionX/interface/components/OpenPoseEstimationInterface.h>
38 checkInput(std::initializer_list<float> f)
43 <<
"Within KeypointManager it is asserted that every value is greater than or "
44 "equal to zero. That is not true for "
70 return std::isnan(
_x) || std::isnan(
_y);
82 const std::string& name,
83 float confidence = 0.0f);
86 const std::string& name,
87 float confidence = 0.0f);
91 const std::string& name,
92 float confidence = 0.0f);
112 unsigned int getId()
const;
123 DrawColor24Bit _dominantColor;
130 using boost::multi_index_container;
131 using namespace boost::multi_index;
134 indexed_by<ordered_unique<const_mem_fun<Keypoint, unsigned int, &Keypoint::getId>>,
135 ordered_non_unique<const_mem_fun<Keypoint, std::string, &Keypoint::getName>>>>;
140 using IdNameMap =
const std::map<unsigned int, std::string>&;
158 typename KeypointSetById::const_iterator
begin()
const;
159 typename KeypointSetById::const_iterator
end()
const;
183 class KeypointManager;
206 std::vector<KeypointObjectPtr>&
218 Keypoint2DMapList
toIce2D()
const;
227 std::vector<KeypointObjectPtr> _objects;
Keypoint3DMapList toIce3D(const VirtualRobot::RobotPtr &) const
std::vector< KeypointObjectPtr > & getData()
void filterToNearestN(unsigned int n)
IdNameMap getIdNameMap() const
~KeypointManager()
KeypointManager Destructor.
Keypoint2DMapList toIce2D_normalized(int width, int height) const
KeypointManager()=delete
KeypointManager Constructor.
void matchWith(const KeypointManagerPtr other)
Keypoint2DMapList toIce2D() const
std::string toString2D() const
KeypointSetById::const_iterator begin() const
KeypointSetById::const_iterator end() const
void matchWith(const KeypointObjectPtr object)
float getAverageDepth() const
KeypointPtr getNode(const std::string &nodeName) const
Keypoint2DMap toIce2D(IdNameMap idNameMap) const
void removeNode(const std::string &nodeName)
Keypoint3DMap toIce3D(IdNameMap idNameMap, const VirtualRobot::RobotPtr &) const
void insertNode(const KeypointPtr point)
std::string toString2D() const
void set2D(const Point2D &point)
void setDominantColor(const DrawColor24Bit &color)
void set3D(FramedPositionPtr pose)
void setConfidence(float confidence)
std::pair< Point2D, Point2D > getStereo2D() const
void setStereo2D(const Point2D &left, const Point2D &right)
std::string getName() const
DrawColor24Bit getDominantColor() const
FramedPositionPtr get3D() const
float getConfidence() const
unsigned int getId() const
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
std::shared_ptr< class Robot > RobotPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
typename KeypointSet::nth_index< 1 >::type KeypointSetByName
IceInternal::Handle< FramedPosition > FramedPositionPtr
std::shared_ptr< KeypointManager > KeypointManagerPtr
std::shared_ptr< Keypoint > KeypointPtr
multi_index_container< KeypointPtr, indexed_by< ordered_unique< const_mem_fun< Keypoint, unsigned int, &Keypoint::getId > >, ordered_non_unique< const_mem_fun< Keypoint, std::string, &Keypoint::getName > > > > KeypointSet
std::shared_ptr< KeypointObject > KeypointObjectPtr
const std::map< unsigned int, std::string > & IdNameMap
typename KeypointSet::nth_index< 0 >::type KeypointSetById
Point2D(float x, float y)