OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
op::Datum Struct Reference

#include <datum.hpp>

Public Member Functions

 Datum ()
 
 Datum (const Datum &datum)
 
Datumoperator= (const Datum &datum)
 
 Datum (Datum &&datum)
 
Datumoperator= (Datum &&datum)
 
virtual ~Datum ()
 
Datum clone () const
 
bool operator< (const Datum &datum) const
 
bool operator> (const Datum &datum) const
 
bool operator<= (const Datum &datum) const
 
bool operator>= (const Datum &datum) const
 
bool operator== (const Datum &datum) const
 
bool operator!= (const Datum &datum) const
 

Public Attributes

unsigned long long id
 
unsigned long long subId
 
unsigned long long subIdMax
 
std::string name
 
unsigned long long frameNumber
 
Matrix cvInputData
 
std::vector< Array< float > > inputNetData
 
Array< float > outputData
 
Matrix cvOutputData
 
Matrix cvOutputData3D
 
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
 
Array< float > poseKeypoints3D
 
Array< float > faceKeypoints3D
 
std::array< Array< float >, 2 > handKeypoints3D
 
Matrix cameraMatrix
 
Matrix cameraExtrinsics
 
Matrix cameraIntrinsics
 
Array< float > poseNetOutput
 
std::vector< double > scaleInputToNetInputs
 
std::vector< Point< int > > netInputSizes
 
double scaleInputToOutput
 
Point< int > netOutputSize
 
double scaleNetToOutput
 
std::pair< int, std::string > elementRendered
 

Detailed Description

Datum: The OpenPose Basic Piece of Information Between Threads Datum is one the main OpenPose classes/structs. The workers and threads share by default a std::shared_ptr<std::vector<Datum>>. It contains all the parameters that the different workers and threads need to exchange.

Definition at line 19 of file datum.hpp.

Constructor & Destructor Documentation

◆ Datum() [1/3]

op::Datum::Datum ( )
explicit

Default constructor struct. It simply initializes the struct, id is temporary set to 0 and each other variable is assigned to its default value.

◆ Datum() [2/3]

op::Datum::Datum ( const Datum datum)

Copy constructor. It performs fast copy: For performance purpose, copying a Datum or Array<T> or cv::Mat just copies the reference, it still shares the same internal data. Modifying the copied element will modify the original one. Use clone() for a slower but real copy, similarly to cv::Mat and Array<T>.

Parameters
datumDatum to be copied.

◆ Datum() [3/3]

op::Datum::Datum ( Datum &&  datum)

Move constructor. It destroys the original Datum to be moved.

Parameters
datumDatum to be moved.

◆ ~Datum()

virtual op::Datum::~Datum ( )
virtual

Destructor class. Declared virtual so that Datum can be inherited.

Member Function Documentation

◆ clone()

Datum op::Datum::clone ( ) const

Clone function. Similar to cv::Mat::clone and Array<T>::clone. It performs a real but slow copy of the data, i.e., even if the copied element is modified, the original one is not.

Returns
The resulting Datum.

◆ operator!=()

bool op::Datum::operator!= ( const Datum datum) const
inline

Not equal comparison operator.

Parameters
datumDatum to be compared.
Returns
Whether the instance satisfies the condition with respect to datum.

Definition at line 395 of file datum.hpp.

◆ operator<()

bool op::Datum::operator< ( const Datum datum) const
inline

Less comparison operator.

Parameters
datumDatum to be compared.
Returns
Whether the instance satisfies the condition with respect to datum.

Definition at line 345 of file datum.hpp.

◆ operator<=()

bool op::Datum::operator<= ( const Datum datum) const
inline

Less or equal comparison operator.

Parameters
datumDatum to be compared.
Returns
Whether the instance satisfies the condition with respect to datum.

Definition at line 365 of file datum.hpp.

◆ operator=() [1/2]

Datum& op::Datum::operator= ( const Datum datum)

Copy assignment. Similar to Datum::Datum(const Datum& datum).

Parameters
datumDatum to be copied.
Returns
The resulting Datum.

◆ operator=() [2/2]

Datum& op::Datum::operator= ( Datum &&  datum)

Move assignment. Similar to Datum::Datum(Datum&& datum).

Parameters
datumDatum to be moved.
Returns
The resulting Datum.

◆ operator==()

bool op::Datum::operator== ( const Datum datum) const
inline

Equal comparison operator.

Parameters
datumDatum to be compared.
Returns
Whether the instance satisfies the condition with respect to datum.

Definition at line 385 of file datum.hpp.

◆ operator>()

bool op::Datum::operator> ( const Datum datum) const
inline

Greater comparison operator.

Parameters
datumDatum to be compared.
Returns
Whether the instance satisfies the condition with respect to datum.

Definition at line 355 of file datum.hpp.

◆ operator>=()

bool op::Datum::operator>= ( const Datum datum) const
inline

Greater or equal comparison operator.

Parameters
datumDatum to be compared.
Returns
Whether the instance satisfies the condition with respect to datum.

Definition at line 375 of file datum.hpp.

Member Data Documentation

◆ cameraExtrinsics

Matrix op::Datum::cameraExtrinsics

3x4 extrinsic parameters of the camera.

Definition at line 204 of file datum.hpp.

◆ cameraIntrinsics

Matrix op::Datum::cameraIntrinsics

3x3 intrinsic parameters of the camera.

Definition at line 209 of file datum.hpp.

◆ cameraMatrix

Matrix op::Datum::cameraMatrix

3x4 camera matrix of the camera (equivalent to cameraIntrinsics * cameraExtrinsics).

Definition at line 199 of file datum.hpp.

◆ cvInputData

Matrix op::Datum::cvInputData

Original image to be processed in cv::Mat uchar format. Size: (input_width x input_height) x 3 channels

Definition at line 45 of file datum.hpp.

◆ cvOutputData

Matrix op::Datum::cvOutputData

Rendered image in cv::Mat uchar format. It has been resized to the desired output resolution (e.g., resolution flag in the demo). If outputData is empty, cvOutputData will also be empty. Size: (output_height x output_width) x 3 channels

Definition at line 72 of file datum.hpp.

◆ cvOutputData3D

Matrix op::Datum::cvOutputData3D

Rendered 3D image in cv::Mat uchar format.

Definition at line 77 of file datum.hpp.

◆ elementRendered

std::pair<int, std::string> op::Datum::elementRendered

Pair with the element key id POSE_BODY_PART_MAPPING on pose/poseParameters.hpp and its mapped value (e.g. 1 and "Neck").

Definition at line 250 of file datum.hpp.

◆ faceHeatMaps

Array<float> op::Datum::faceHeatMaps

Face pose heatmaps (face parts and/or background) for the whole image. Analogous of bodyHeatMaps applied to face. However, there is no PAFs and the size is different. Size: #people x #face parts (70) x output_net_height x output_net_width

Definition at line 150 of file datum.hpp.

◆ faceKeypoints

Array<float> op::Datum::faceKeypoints

Face keypoints (x,y,score) locations for each person in the image. It has been resized to the same resolution as poseKeypoints. Size: #people x #face parts (70) x 3 ((x,y) coordinates + score)

Definition at line 143 of file datum.hpp.

◆ faceKeypoints3D

Array<float> op::Datum::faceKeypoints3D

Face keypoints (x,y,z,score) locations for each person in the image. It has been resized to the same resolution as poseKeypoints3D. Size: #people x #face parts (70) x 4 ((x,y,z) coordinates + score)

Definition at line 186 of file datum.hpp.

◆ faceRectangles

std::vector<Rectangle<float> > op::Datum::faceRectangles

Face detection locations (x,y,width,height) for each person in the image. It is resized to cvInputData.size(). Size: #people

Definition at line 136 of file datum.hpp.

◆ frameNumber

unsigned long long op::Datum::frameNumber

Corresponding frame number. If the producer (e.g., video) starts from frame 0 and does not repeat any frame, then frameNumber should match the field id.

Definition at line 38 of file datum.hpp.

◆ handHeatMaps

std::array<Array<float>, 2> op::Datum::handHeatMaps

Hand pose heatmaps (hand parts and/or background) for the whole image. Analogous of faceHeatMaps applied to face. Size each Array: #people x #hand parts (21) x output_net_height x output_net_width

Definition at line 172 of file datum.hpp.

◆ handKeypoints

std::array<Array<float>, 2> op::Datum::handKeypoints

Hand keypoints (x,y,score) locations for each person in the image. It has been resized to the same resolution as poseKeypoints. handKeypoints[0] corresponds to left hands, and handKeypoints[1] to right ones. Size each Array: #people x #hand parts (21) x 3 ((x,y) coordinates + score)

Definition at line 165 of file datum.hpp.

◆ handKeypoints3D

std::array<Array<float>, 2> op::Datum::handKeypoints3D

Hand keypoints (x,y,z,score) locations for each person in the image. It has been resized to the same resolution as poseKeypoints3D. handKeypoints[0] corresponds to left hands, and handKeypoints[1] to right ones. Size each Array: #people x #hand parts (21) x 4 ((x,y,z) coordinates + score)

Definition at line 194 of file datum.hpp.

◆ handRectangles

std::vector<std::array<Rectangle<float>, 2> > op::Datum::handRectangles

Hand detection locations (x,y,width,height) for each person in the image. It is resized to cvInputData.size(). Size: #people

Definition at line 157 of file datum.hpp.

◆ id

unsigned long long op::Datum::id

Datum ID. Internally used to sort the Datums if multi-threading is used.

Definition at line 22 of file datum.hpp.

◆ inputNetData

std::vector<Array<float> > op::Datum::inputNetData

Original image to be processed in Array<float> format. It has been resized to the net input resolution, as well as reformatted Array<float> format to be compatible with the net. If >1 scales, each scale is right- and bottom-padded to fill the greatest resolution. The scales are sorted from bigger to smaller. Vector size: #scales Each array size: 3 x input_net_height x input_net_width

Definition at line 56 of file datum.hpp.

◆ name

std::string op::Datum::name

Name used when saving the data to disk (e.g., write_images or write_keypoint flags in the demo).

Definition at line 31 of file datum.hpp.

◆ netInputSizes

std::vector<Point<int> > op::Datum::netInputSizes

Size(s) (width x height) of the image(s) fed to the pose deep net. The size of the std::vector corresponds to the number of scales.

Definition at line 229 of file datum.hpp.

◆ netOutputSize

Point<int> op::Datum::netOutputSize

Size (width x height) of the image returned by the deep net.

Definition at line 239 of file datum.hpp.

◆ outputData

Array<float> op::Datum::outputData

Rendered image in Array<float> format. It consists of a blending of the cvInputData and the pose/body part(s) heatmap/PAF(s). If rendering is disabled (e.g., no_render_pose flag in the demo), outputData will be empty. Size: 3 x output_net_height x output_net_width

Definition at line 64 of file datum.hpp.

◆ poseCandidates

std::vector<std::vector<std::array<float,3> > > op::Datum::poseCandidates

Body pose candidates for the whole image. This parameter is by default empty and disabled for performance. It can be enabled with candidates_body. Candidates refer to all the detected body parts, before being assembled into people. Note that the number of candidates is equal or higher than the number of body parts after being assembled into people. Size: #body parts x min(part candidates, POSE_MAX_PEOPLE) x 3 (x,y,score). Rather than vector, it should ideally be: std::array<std::vector<std::array<float,3>>, #BP> poseCandidates;

Definition at line 129 of file datum.hpp.

◆ poseHeatMaps

Array<float> op::Datum::poseHeatMaps

Body pose heatmaps (body parts, background and/or PAFs) for the whole image. This parameter is by default empty and disabled for performance. Each group (body parts, background and PAFs) can be individually enabled. #heatmaps = #body parts (if enabled) + 1 (if background enabled) + 2 x #PAFs (if enabled). Each PAF has 2 consecutive channels, one for x- and one for y-coordinates. Order heatmaps: body parts + background (as appears in POSE_BODY_PART_MAPPING) + (x,y) channel of each PAF (sorted as appears in POSE_BODY_PART_PAIRS). See pose/poseParameters.hpp. The user can choose the heatmaps normalization: ranges [0, 1], [-1, 1] or [0, 255]. Check the heatmaps_scale flag in {OpenPose_path}/doc/advanced/demo_advanced.md for more details. Size: #heatmaps x output_net_height x output_net_width

Definition at line 118 of file datum.hpp.

◆ poseIds

Array<long long> op::Datum::poseIds

People ID It returns a person ID for each body pose, providing temporal consistency. The ID will be the same one for a person across frames. I.e. this ID allows to keep track of the same person in time. If either person identification is disabled or poseKeypoints is empty, poseIds will also be empty. Size: #people

Definition at line 94 of file datum.hpp.

◆ poseKeypoints

Array<float> op::Datum::poseKeypoints

Body pose (x,y,score) locations for each person in the image. It has been resized to the desired output resolution (e.g., resolution flag in the demo). Size: #people x #body parts (e.g., 18 for COCO or 15 for MPI) x 3 ((x,y) coordinates + score)

Definition at line 85 of file datum.hpp.

◆ poseKeypoints3D

Array<float> op::Datum::poseKeypoints3D

Body pose (x,y,z,score) locations for each person in the image. Size: #people x #body parts (e.g., 18 for COCO or 15 for MPI) x 4 ((x,y,z) coordinates + score)

Definition at line 179 of file datum.hpp.

◆ poseNetOutput

Array<float> op::Datum::poseNetOutput

If it is not empty, OpenPose will not run its internal body pose estimation network and will instead use this data as the substitute of its network. The size of this element must match the size of the output of its internal network, or it will lead to core dumped (segmentation) errors. You can modify the pose estimation flags to match the dimension of both elements (e.g., --net_resolution, --scale_number, etc.).

Definition at line 217 of file datum.hpp.

◆ poseScores

Array<float> op::Datum::poseScores

Body pose global confidence/score for each person in the image. It does not only consider the score of each body keypoint, but also the score of each PAF association. Optimized for COCO evaluation metric. It will highly penalyze people with missing body parts (e.g., cropped people on the borders of the image). If poseKeypoints is empty, poseScores will also be empty. Size: #people

Definition at line 104 of file datum.hpp.

◆ scaleInputToNetInputs

std::vector<double> op::Datum::scaleInputToNetInputs

Scale ratio between the input Datum::cvInputData and the net input size.

Definition at line 223 of file datum.hpp.

◆ scaleInputToOutput

double op::Datum::scaleInputToOutput

Scale ratio between the input Datum::cvInputData and the output Datum::cvOutputData.

Definition at line 234 of file datum.hpp.

◆ scaleNetToOutput

double op::Datum::scaleNetToOutput

Scale ratio between the net output and the final output Datum::cvOutputData.

Definition at line 244 of file datum.hpp.

◆ subId

unsigned long long op::Datum::subId

Datum sub-ID. Internally used to sort the Datums if multi-threading is used.

Definition at line 24 of file datum.hpp.

◆ subIdMax

unsigned long long op::Datum::subIdMax

Datum maximum sub-ID. Used to sort the Datums if multi-threading is used.

Definition at line 26 of file datum.hpp.


The documentation for this struct was generated from the following file: