PosturePerfection
intermediate_structures.h
Go to the documentation of this file.
1 
23 #ifndef SRC_INTERMEDIATE_STRUCTURES_H_
24 #define SRC_INTERMEDIATE_STRUCTURES_H_
25 
26 #include <array>
27 #include <string>
28 
38 enum BodyPart {
57 };
58 
66 enum Joint {
67  Head = 0,
69  Neck = 1,
70  Shoulder = 2,
71  Hip = 3,
72  Knee = 4,
73  Foot = 5,
74  JointMax = Foot
75 };
76 
77 namespace PreProcessing {
91  float* image;
92 };
93 } // namespace PreProcessing
94 
95 namespace PostProcessing {
96 
105 
110 std::string stringStatus(Status s);
111 
122 struct Coordinate {
123  float x;
124  float y;
126 };
127 
147  std::array<Coordinate, JointMax + 1> body_parts;
148 };
149 } // namespace PostProcessing
150 
151 namespace Inference {
152 
162 struct Result {
169  float confidence;
170  size_t x;
171  size_t y;
172 };
173 
183 struct Coordinate {
184  float x;
185  float y;
192  float confidence;
193 };
194 
206  std::array<Coordinate, BodyPartMax + 1> body_parts;
207 };
208 } // namespace Inference
209 
210 #endif // SRC_INTERMEDIATE_STRUCTURES_H_
BodyPart
Defines the order of body parts in the body_parts arrays.
Definition: intermediate_structures.h:38
@ pelvis
Definition: intermediate_structures.h:49
@ left_hip
Definition: intermediate_structures.h:53
@ left_wrist
Definition: intermediate_structures.h:48
@ right_hip
Definition: intermediate_structures.h:50
@ left_ankle
Definition: intermediate_structures.h:55
@ thorax
Definition: intermediate_structures.h:45
@ right_wrist
Definition: intermediate_structures.h:44
@ BodyPartMax
Definition: intermediate_structures.h:56
@ right_knee
Definition: intermediate_structures.h:51
@ right_ankle
Definition: intermediate_structures.h:52
@ right_elbow
Definition: intermediate_structures.h:43
@ left_shoulder
Definition: intermediate_structures.h:46
@ upper_neck
Definition: intermediate_structures.h:41
@ head_top
Definition: intermediate_structures.h:39
@ BodyPartMin
Definition: intermediate_structures.h:40
@ right_shoulder
Definition: intermediate_structures.h:42
@ left_knee
Definition: intermediate_structures.h:54
@ left_elbow
Definition: intermediate_structures.h:47
Joint
Defines order of joints in any body part arrays.
Definition: intermediate_structures.h:66
@ Head
Definition: intermediate_structures.h:67
@ Knee
Definition: intermediate_structures.h:72
@ Shoulder
Definition: intermediate_structures.h:70
@ JointMax
Definition: intermediate_structures.h:74
@ JointMin
Definition: intermediate_structures.h:68
@ Neck
Definition: intermediate_structures.h:69
@ Hip
Definition: intermediate_structures.h:71
@ Foot
Definition: intermediate_structures.h:73
Uses TensorFlow Lite to perform pose estimation on a given image frame to detect noteworthy joints.
Definition: inference_core.cpp:31
Smoothen the results of inference and average body parts since the system assumes a side-on profile.
Definition: intermediate_structures.cpp:23
Status
A PostProcessing::Coordinate's position can be either Untrustworthy or Trustworthy
Definition: intermediate_structures.h:104
@ Trustworthy
Definition: intermediate_structures.h:104
@ Untrustworthy
Definition: intermediate_structures.h:104
std::string stringStatus(Status s)
Converts the Untrustworthy/Trustworthy status to a string.
Definition: intermediate_structures.cpp:25
Responsible for resizing and normalising the input image to a structure suitable for TensorFlow Lite.
Definition: intermediate_structures.h:77
Indicates position and confidence in positioning of a body part node.
Definition: intermediate_structures.h:183
float y
The relative X co-ordinate of the body part detected.
Definition: intermediate_structures.h:185
float x
The relative X co-ordinate of the body part detected.
Definition: intermediate_structures.h:184
float confidence
The confidence in this body part being the one determined from inference. Values are in the range [0....
Definition: intermediate_structures.h:192
Results of running the model for all body parts.
Definition: intermediate_structures.h:199
std::array< Coordinate, BodyPartMax+1 > body_parts
Each element of this array corresponds to a body part with a defined Inference::Coordinate which spec...
Definition: intermediate_structures.h:206
Intermediate result of pose estimation
Definition: intermediate_structures.h:162
size_t y
The absolute Y co-ordinate of the body part detected.
Definition: intermediate_structures.h:171
float confidence
The confidence in this body part being the one determined from inference. Values are in the range [0....
Definition: intermediate_structures.h:169
size_t x
The absolute X co-ordinate of the body part detected.
Definition: intermediate_structures.h:170
Indicates position and trustworthiness of a body part node.
Definition: intermediate_structures.h:122
Status status
A Coordinate is either Trustworthy or Untrustworthy
Definition: intermediate_structures.h:125
float x
The relative X co-ordinate of the detected body part.
Definition: intermediate_structures.h:123
float y
The relative Y co-ordinate of the detected body part.
Definition: intermediate_structures.h:124
The PostProcessing::Coordinate of each body part.
Definition: intermediate_structures.h:139
std::array< Coordinate, JointMax+1 > body_parts
Each element of this array corresponds to a body part with a defined PostProcessing::Coordinate which...
Definition: intermediate_structures.h:147
A structure of the pre processed image.
Definition: intermediate_structures.h:85
float * image
The image array where each pixel is represented by the 3 RGB channels.
Definition: intermediate_structures.h:91