26 #include <boost/multi_index/mem_fun.hpp>
27 #include <boost/multi_index/ordered_index.hpp>
28 #include <boost/multi_index_container.hpp>
31 #include <VisionX/interface/components/OpenPoseEstimationInterface.h>
35 static void checkInput(std::initializer_list<float> f)
39 ARMARX_CHECK_EXPRESSION(fe >= 0.0f) <<
"Within KeypointManager it is asserted that every value is greater than or equal to zero. That is not true for " << fe;
63 return std::isnan(
_x) || std::isnan(
_y);
72 Keypoint(
float x,
float y,
unsigned int id,
const std::string& name,
float confidence = 0.0f);
73 Keypoint(
const Point2D& point,
unsigned int id,
const std::string& name,
float confidence = 0.0f);
74 Keypoint(
const Point2D& left,
const Point2D& right,
unsigned int id,
const std::string& name,
float confidence = 0.0f);
91 unsigned int getId()
const;
102 DrawColor24Bit _dominantColor;
108 using boost::multi_index_container;
109 using namespace boost::multi_index;
113 ordered_unique < const_mem_fun<Keypoint, unsigned int, &Keypoint::getId> >,
114 ordered_non_unique < const_mem_fun<Keypoint, std::string, &Keypoint::getName> >
121 using IdNameMap =
const std::map<unsigned int, std::string>& ;
133 typename KeypointSetById::const_iterator begin()
const;
134 typename KeypointSetById::const_iterator end()
const;
136 KeypointPtr getNode(
const std::string& nodeName)
const;
139 void removeNode(
const std::string& nodeName);
140 void removeNode(
unsigned int id);
142 float getAverageDepth()
const;
144 Keypoint2DMap toIce2D(
IdNameMap idNameMap)
const;
151 std::string toString2D()
const;
158 class KeypointManager;
190 Keypoint2DMapList toIce2D()
const;
191 Keypoint2DMapList toIce2D_normalized(
int width,
int height)
const;
196 void filterToNearestN(
unsigned int n);
199 std::vector<KeypointObjectPtr> _objects;