OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
datum.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_CORE_DATUM_HPP
2 #define OPENPOSE_CORE_DATUM_HPP
3
4 #ifdef USE_EIGEN
5 #include <Eigen/Core>
6 #endif
7 #include <opencv2/core/core.hpp> // cv::Mat
8 #include <openpose/core/common.hpp>
9
10 namespace op
11 {
18 struct OP_API Datum
19 {
20 // ---------------------------------------- ID parameters ---------------------------------------- //
21 unsigned long long id;
23 unsigned long long subId;
25 unsigned long long subIdMax;
30 std::string name;
31
37 unsigned long long frameNumber;
38
39 // ------------------------------ Input image and rendered version parameters ------------------------------ //
44 cv::Mat cvInputData;
45
55 std::vector<Array<float>> inputNetData;
56
63 Array<float> outputData;
64
71 cv::Mat cvOutputData;
72
76 cv::Mat cvOutputData3D;
77
78 // ------------------------------ Resulting Array<float> data parameters ------------------------------ //
84 Array<float> poseKeypoints;
85
93 Array<long long> poseIds;
94
103 Array<float> poseScores;
104
117 Array<float> poseHeatMaps;
118
128 std::vector<std::vector<std::array<float,3>>> poseCandidates;
129
135 std::vector<Rectangle<float>> faceRectangles;
136
142 Array<float> faceKeypoints;
143
149 Array<float> faceHeatMaps;
150
156 std::vector<std::array<Rectangle<float>, 2>> handRectangles;
157
164 std::array<Array<float>, 2> handKeypoints;
165
171 std::array<Array<float>, 2> handHeatMaps;
172
173 // ---------------------------------------- 3-D Reconstruction parameters ---------------------------------------- //
178 Array<float> poseKeypoints3D;
179
185 Array<float> faceKeypoints3D;
186
193 std::array<Array<float>, 2> handKeypoints3D;
194
198 cv::Mat cameraMatrix;
199
203 cv::Mat cameraExtrinsics;
204
208 cv::Mat cameraIntrinsics;
209
210 // ---------------------------------------- Other (internal) parameters ---------------------------------------- //
214 std::vector<double> scaleInputToNetInputs;
215
220 std::vector<Point<int>> netInputSizes;
221
225 double scaleInputToOutput;
226
230 Point<int> netOutputSize;
231
235 double scaleNetToOutput;
236
241 std::pair<int, std::string> elementRendered;
242
243 // 3D/Adam parameters
244 // Adam/Unity params
245 std::vector<double> adamPosePtr;
246 int adamPoseRows;
247 std::vector<double> adamTranslationPtr;
248 std::vector<double> vtVecPtr;
249 int vtVecRows;
250 std::vector<double> j0VecPtr;
251 int j0VecRows;
252 std::vector<double> adamFaceCoeffsExpPtr;
253 int adamFaceCoeffsExpRows;
254 #ifdef USE_EIGEN
255 // Adam/Unity params
256 Eigen::Matrix<double, 62, 3, Eigen::RowMajor> adamPose;
257 Eigen::Vector3d adamTranslation;
258 // Adam params (Jacobians)
259 Eigen::Matrix<double, Eigen::Dynamic, 1> vtVec;
260 Eigen::Matrix<double, Eigen::Dynamic, 1> j0Vec;
261 Eigen::VectorXd adamFaceCoeffsExp;
262 #endif
263
264
265
266
267
268 // ---------------------------------------- Functions ---------------------------------------- //
274 explicit Datum();
275
284 Datum(const Datum& datum);
285
292 Datum& operator=(const Datum& datum);
293
299 Datum(Datum&& datum);
300
307 Datum& operator=(Datum&& datum);
308
313 virtual ~Datum();
314
322 Datum clone() const;
323
324
325
326
327
328 // ---------------------------------------- Comparison operators ---------------------------------------- //
334 inline bool operator<(const Datum& datum) const
335 {
336 // return id < datum.id;
337 return id < datum.id || (id == datum.id && subId < datum.subId);
338 }
344 inline bool operator>(const Datum& datum) const
345 {
346 // return id > datum.id;
347 return id > datum.id || (id == datum.id && subId > datum.subId);
348 }
354 inline bool operator<=(const Datum& datum) const
355 {
356 // return id <= datum.id;
357 return id < datum.id || (id == datum.id && subId <= datum.subId);
358 }
364 inline bool operator>=(const Datum& datum) const
365 {
366 // return id >= datum.id;
367 return id > datum.id || (id == datum.id && subId >= datum.subId);
368 }
374 inline bool operator==(const Datum& datum) const
375 {
376 // return id == datum.id;
377 return id == datum.id && subId == datum.subId;
378 }
384 inline bool operator!=(const Datum& datum) const
385 {
386 // return id != datum.id;
387 return id != datum.id || subId != datum.subId;
388 }
389 };
390
391 // Defines for Datum. Added here rather than in `macros.hpp` to avoid circular dependencies
392 #define DATUM_BASE_NO_PTR std::vector<Datum>
393 #define DATUM_BASE std::shared_ptr<DATUM_BASE_NO_PTR>
394 #define DEFINE_TEMPLATE_DATUM(templateName) template class OP_API templateName<DATUM_BASE>
395 #define COMPILE_TEMPLATE_DATUM(templateName) extern template class templateName<DATUM_BASE>
396 }
397
398 #endif // OPENPOSE_CORE_DATUM_HPP
op::Datum::j0VecRows
int j0VecRows
Definition: datum.hpp:251
op::Datum::adamPosePtr
std::vector< double > adamPosePtr
Definition: datum.hpp:245
op::Datum::name
std::string name
Definition: datum.hpp:30
op::Datum::scaleInputToOutput
double scaleInputToOutput
Definition: datum.hpp:225
op::Datum::operator==
bool operator==(const Datum &datum) const
Definition: datum.hpp:374
op::Datum::poseIds
Array< long long > poseIds
Definition: datum.hpp:93
op::Datum::inputNetData
std::vector< Array< float > > inputNetData
Definition: datum.hpp:55
op::Datum::adamFaceCoeffsExpRows
int adamFaceCoeffsExpRows
Definition: datum.hpp:253
op::Datum::faceKeypoints3D
Array< float > faceKeypoints3D
Definition: datum.hpp:185
op::Datum::vtVecRows
int vtVecRows
Definition: datum.hpp:249
op::Datum::poseHeatMaps
Array< float > poseHeatMaps
Definition: datum.hpp:117
op::Datum::subId
unsigned long long subId
Definition: datum.hpp:23
op::Datum::cameraMatrix
cv::Mat cameraMatrix
Definition: datum.hpp:198
op::Datum::handHeatMaps
std::array< Array< float >, 2 > handHeatMaps
Definition: datum.hpp:171
op::Datum::scaleNetToOutput
double scaleNetToOutput
Definition: datum.hpp:235
op::Datum::elementRendered
std::pair< int, std::string > elementRendered
Definition: datum.hpp:241
op::Datum::vtVecPtr
std::vector< double > vtVecPtr
Definition: datum.hpp:248
op::Datum::scaleInputToNetInputs
std::vector< double > scaleInputToNetInputs
Definition: datum.hpp:214
op::Datum::poseCandidates
std::vector< std::vector< std::array< float, 3 > > > poseCandidates
Definition: datum.hpp:128
op::Datum::operator!=
bool operator!=(const Datum &datum) const
Definition: datum.hpp:384
op::Datum::subIdMax
unsigned long long subIdMax
Definition: datum.hpp:25
op::Datum::adamTranslationPtr
std::vector< double > adamTranslationPtr
Definition: datum.hpp:247
op::Datum::poseKeypoints3D
Array< float > poseKeypoints3D
Definition: datum.hpp:178
op::Point< int >
op::Datum::handKeypoints3D
std::array< Array< float >, 2 > handKeypoints3D
Definition: datum.hpp:193
op::Datum::faceRectangles
std::vector< Rectangle< float > > faceRectangles
Definition: datum.hpp:135
common.hpp
op::Datum::cameraExtrinsics
cv::Mat cameraExtrinsics
Definition: datum.hpp:203
op::Datum::poseKeypoints
Array< float > poseKeypoints
Definition: datum.hpp:84
op::Datum::handRectangles
std::vector< std::array< Rectangle< float >, 2 > > handRectangles
Definition: datum.hpp:156
op::Datum::adamPoseRows
int adamPoseRows
Definition: datum.hpp:246
op::Datum::operator<
bool operator<(const Datum &datum) const
Definition: datum.hpp:334
op::Datum::outputData
Array< float > outputData
Definition: datum.hpp:63
op::Datum::handKeypoints
std::array< Array< float >, 2 > handKeypoints
Definition: datum.hpp:164
op::Datum::netInputSizes
std::vector< Point< int > > netInputSizes
Definition: datum.hpp:220
op::Datum
Definition: datum.hpp:18
op::Datum::netOutputSize
Point< int > netOutputSize
Definition: datum.hpp:230
op::Datum::faceHeatMaps
Array< float > faceHeatMaps
Definition: datum.hpp:149
op::Datum::cvInputData
cv::Mat cvInputData
Definition: datum.hpp:44
op::Datum::cvOutputData
cv::Mat cvOutputData
Definition: datum.hpp:71
op::Datum::cameraIntrinsics
cv::Mat cameraIntrinsics
Definition: datum.hpp:208
op::Array< float >
op::Datum::adamFaceCoeffsExpPtr
std::vector< double > adamFaceCoeffsExpPtr
Definition: datum.hpp:252
op::Datum::faceKeypoints
Array< float > faceKeypoints
Definition: datum.hpp:142
op::Datum::poseScores
Array< float > poseScores
Definition: datum.hpp:103
op::Datum::id
unsigned long long id
Definition: datum.hpp:21
op::Datum::operator<=
bool operator<=(const Datum &datum) const
Definition: datum.hpp:354
op::Datum::j0VecPtr
std::vector< double > j0VecPtr
Definition: datum.hpp:250
OP_API
#define OP_API
Definition: macros.hpp:19
op::Datum::operator>
bool operator>(const Datum &datum) const
Definition: datum.hpp:344
op::Datum::operator>=
bool operator>=(const Datum &datum) const
Definition: datum.hpp:364
op::Datum::cvOutputData3D
cv::Mat cvOutputData3D
Definition: datum.hpp:76
cl::string
std::string string
Definition: cl2.hpp:574
op::Datum::frameNumber
unsigned long long frameNumber
Definition: datum.hpp:37