All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
datum.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_CORE_DATUM_HPP
#define OPENPOSE_CORE_DATUM_HPP
#ifdef USE_EIGEN
#include <Eigen/Core>
#endif
#include <opencv2/core/core.hpp> // cv::Mat
#include <openpose/core/common.hpp>
namespace op
{
struct OP_API Datum
{
// ---------------------------------------- ID parameters ---------------------------------------- //
unsigned long long id;
unsigned long long subId;
unsigned long long subIdMax;
std::string name;
unsigned long long frameNumber;
// ------------------------------ Input image and rendered version parameters ------------------------------ //
cv::Mat cvInputData;
std::vector<Array<float>> inputNetData;
Array<float> outputData;
cv::Mat cvOutputData;
// ------------------------------ Resulting Array<float> data parameters ------------------------------ //
Array<float> poseKeypoints;
Array<long long> poseIds;
Array<float> poseScores;
Array<float> poseHeatMaps;
std::vector<std::vector<std::array<float,3>>> poseCandidates;
std::vector<Rectangle<float>> faceRectangles;
Array<float> faceKeypoints;
Array<float> faceHeatMaps;
std::vector<std::array<Rectangle<float>, 2>> handRectangles;
std::array<Array<float>, 2> handKeypoints;
std::array<Array<float>, 2> handHeatMaps;
// ---------------------------------------- 3-D Reconstruction parameters ---------------------------------------- //
Array<float> poseKeypoints3D;
Array<float> faceKeypoints3D;
std::array<Array<float>, 2> handKeypoints3D;
cv::Mat cameraMatrix;
cv::Mat cameraExtrinsics;
cv::Mat cameraIntrinsics;
// ---------------------------------------- Other (internal) parameters ---------------------------------------- //
std::vector<double> scaleInputToNetInputs;
std::vector<Point<int>> netInputSizes;
double scaleInputToOutput;
Point<int> netOutputSize;
double scaleNetToOutput;
std::pair<int, std::string> elementRendered;
// 3D/Adam parameters
// Adam/Unity params
std::vector<double> adamPosePtr;
int adamPoseRows;
std::vector<double> adamTranslationPtr;
std::vector<double> vtVecPtr;
int vtVecRows;
std::vector<double> j0VecPtr;
int j0VecRows;
std::vector<double> adamFaceCoeffsExpPtr;
int adamFaceCoeffsExpRows;
#ifdef USE_EIGEN
// Adam/Unity params
Eigen::Matrix<double, 62, 3, Eigen::RowMajor> adamPose;
Eigen::Vector3d adamTranslation;
// Adam params (Jacobians)
Eigen::Matrix<double, Eigen::Dynamic, 1> vtVec;
Eigen::Matrix<double, Eigen::Dynamic, 1> j0Vec;
Eigen::VectorXd adamFaceCoeffsExp;
#endif
// ---------------------------------------- Functions ---------------------------------------- //
explicit Datum();
Datum(const Datum& datum);
Datum& operator=(const Datum& datum);
Datum(Datum&& datum);
Datum& operator=(Datum&& datum);
virtual ~Datum();
Datum clone() const;
// ---------------------------------------- Comparison operators ---------------------------------------- //
inline bool operator<(const Datum& datum) const
{
// return id < datum.id;
return id < datum.id || (id == datum.id && subId < datum.subId);
}
inline bool operator>(const Datum& datum) const
{
// return id > datum.id;
return id > datum.id || (id == datum.id && subId > datum.subId);
}
inline bool operator<=(const Datum& datum) const
{
// return id <= datum.id;
return id < datum.id || (id == datum.id && subId <= datum.subId);
}
inline bool operator>=(const Datum& datum) const
{
// return id >= datum.id;
return id > datum.id || (id == datum.id && subId >= datum.subId);
}
inline bool operator==(const Datum& datum) const
{
// return id == datum.id;
return id == datum.id && subId == datum.subId;
}
inline bool operator!=(const Datum& datum) const
{
// return id != datum.id;
return id != datum.id || subId != datum.subId;
}
};
// Defines for Datum. Added here rather than in `macros.hpp` to avoid circular dependencies
#define DATUM_BASE_NO_PTR std::vector<Datum>
#define DATUM_BASE std::shared_ptr<DATUM_BASE_NO_PTR>
#define DEFINE_TEMPLATE_DATUM(templateName) template class OP_API templateName<DATUM_BASE>
#define COMPILE_TEMPLATE_DATUM(templateName) extern template class templateName<DATUM_BASE>
}
#endif // OPENPOSE_CORE_DATUM_HPP
op::Datum::j0VecRows
int j0VecRows
Definition: datum.hpp:246
op::Datum::adamPosePtr
std::vector< double > adamPosePtr
Definition: datum.hpp:240
op::Datum::name
std::string name
Definition: datum.hpp:30
op::Datum::scaleInputToOutput
double scaleInputToOutput
Definition: datum.hpp:220
op::Datum::operator==
bool operator==(const Datum &datum) const
Definition: datum.hpp:369
op::Datum::poseIds
Array< long long > poseIds
Definition: datum.hpp:88
op::Datum::inputNetData
std::vector< Array< float > > inputNetData
Definition: datum.hpp:55
op::Datum::adamFaceCoeffsExpRows
int adamFaceCoeffsExpRows
Definition: datum.hpp:248
op::Datum::faceKeypoints3D
Array< float > faceKeypoints3D
Definition: datum.hpp:180
op::Datum::vtVecRows
int vtVecRows
Definition: datum.hpp:244
op::Datum::poseHeatMaps
Array< float > poseHeatMaps
Definition: datum.hpp:112
op::Datum::subId
unsigned long long subId
Definition: datum.hpp:23
op::Datum::cameraMatrix
cv::Mat cameraMatrix
Definition: datum.hpp:193
op::Datum::handHeatMaps
std::array< Array< float >, 2 > handHeatMaps
Definition: datum.hpp:166
op::Datum::scaleNetToOutput
double scaleNetToOutput
Definition: datum.hpp:230
op::Datum::elementRendered
std::pair< int, std::string > elementRendered
Definition: datum.hpp:236
op::Datum::vtVecPtr
std::vector< double > vtVecPtr
Definition: datum.hpp:243
op::Datum::scaleInputToNetInputs
std::vector< double > scaleInputToNetInputs
Definition: datum.hpp:209
op::Datum::poseCandidates
std::vector< std::vector< std::array< float, 3 > > > poseCandidates
Definition: datum.hpp:123
op::Datum::operator!=
bool operator!=(const Datum &datum) const
Definition: datum.hpp:379
op::Datum::subIdMax
unsigned long long subIdMax
Definition: datum.hpp:25
op::Datum::adamTranslationPtr
std::vector< double > adamTranslationPtr
Definition: datum.hpp:242
op::Datum::poseKeypoints3D
Array< float > poseKeypoints3D
Definition: datum.hpp:173
op::Point< int >
op::Datum::handKeypoints3D
std::array< Array< float >, 2 > handKeypoints3D
Definition: datum.hpp:188
op::Datum::faceRectangles
std::vector< Rectangle< float > > faceRectangles
Definition: datum.hpp:130
common.hpp
op::Datum::cameraExtrinsics
cv::Mat cameraExtrinsics
Definition: datum.hpp:198
op::Datum::poseKeypoints
Array< float > poseKeypoints
Definition: datum.hpp:79
op::Datum::handRectangles
std::vector< std::array< Rectangle< float >, 2 > > handRectangles
Definition: datum.hpp:151
op::Datum::adamPoseRows
int adamPoseRows
Definition: datum.hpp:241
op::Datum::operator<
bool operator<(const Datum &datum) const
Definition: datum.hpp:329
op::Datum::outputData
Array< float > outputData
Definition: datum.hpp:63
op::Datum::handKeypoints
std::array< Array< float >, 2 > handKeypoints
Definition: datum.hpp:159
op::Datum::netInputSizes
std::vector< Point< int > > netInputSizes
Definition: datum.hpp:215
op::Datum
Definition: datum.hpp:18
op::Datum::netOutputSize
Point< int > netOutputSize
Definition: datum.hpp:225
op::Datum::faceHeatMaps
Array< float > faceHeatMaps
Definition: datum.hpp:144
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:203
op::Array< float >
op::Datum::adamFaceCoeffsExpPtr
std::vector< double > adamFaceCoeffsExpPtr
Definition: datum.hpp:247
op::Datum::faceKeypoints
Array< float > faceKeypoints
Definition: datum.hpp:137
op::Datum::poseScores
Array< float > poseScores
Definition: datum.hpp:98
op::Datum::id
unsigned long long id
Definition: datum.hpp:21
op::Datum::operator<=
bool operator<=(const Datum &datum) const
Definition: datum.hpp:349
op::Datum::j0VecPtr
std::vector< double > j0VecPtr
Definition: datum.hpp:245
OP_API
#define OP_API
Definition: macros.hpp:19
op::Datum::operator>
bool operator>(const Datum &datum) const
Definition: datum.hpp:339
op::Datum::operator>=
bool operator>=(const Datum &datum) const
Definition: datum.hpp:359
cl::string
std::string string
Definition: cl2.hpp:574
op::Datum::frameNumber
unsigned long long frameNumber
Definition: datum.hpp:37