-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy patheHposemodel.h
More file actions
96 lines (83 loc) · 2.71 KB
/
eHposemodel.h
File metadata and controls
96 lines (83 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/** @file eHposemodel.h
* @brief Human body/pose detection model and operations
* @sa Y. Yang, D. Ramanan, "Articulated Pose Estimation using Flexible Mixtures of Parts". In CVPR 2011.
*
* @author Hang Su
* @date 2012-08
*/
#ifndef EHPOSEMODEL_H
#define EHPOSEMODEL_H
#include <vector>
#include "eHimage.h"
#include "eHfilter.h"
#include "eHbbox.h"
using std::vector;
typedef struct deformation_pose {
int i;
int anchor[3];
double w[4];
} posedef_t;
typedef struct part_pose {
int* biasid; /*numpar x num (except for root, which is 1)*/
int* defid; /*num (except for root, which is NULL)*/
int* filterid; /*num*/
int num;
int numpar;
int parent;
/* infos not directly from file */
int* sizy; /*num*/
int* sizx;/*num*/
int scale;
int step;
int* startx;/*num*/
int* starty;/*num*/
} posepart_t;
typedef struct bias_pose {
int i;
double w;
} posebias_t;
/** @struct eHposemodel
* @brief Human body/pose mdoel
*/
struct eHposemodel {
vector<posebias_t> biases; /**< @brief bias towards part combinations */
vector<filter_t> filters; /**< @brief part filters @note all filters should be of the same size */
vector<posedef_t> defs; /**< @brief deformation params */
vector<posepart_t> parts; /**< @brief part configurations */
int maxsize[2]; /**< @brief XXX */
int len; /**< @brief not used */
int interval; /**< @brief interval of feature pyramid */
int sbin; /**< @brief bin for building hog feature */
double thresh; /**< @brief threshold for detection score */
double obj; /**< @brief not used */
};
/** @typedef posemode_t
* @brief Human body/pose model
*/
typedef struct eHposemodel posemodel_t;
/** @brief Parse body/pose model from xml style string
* @note xmlstr is modified during parsing, this can be avoided by
* using Non-Destrutive Mode of rapidxml
*/
posemodel_t* posemodel_parseXml(char* xmlstr);
/** @brief Read body/pose model from file
* @sa posemodel_parseXml()
*/
posemodel_t* posemodel_readFromFile(const char* filepath);
/** @brief Perform body/pose detection
* @param model pose detection model
* @param img where to find human poses from
* @param thrs threshold used for pruning results
* @return array of detected poses (together with part locations)
*/
vector<bbox_t> posemodel_detect(const posemodel_t* model, const image_ptr img, double thrs);
/** @brief Perform body/pose detection using default threshold
* @param model pose detection model
* @param img where to find human poses from
* @return array of detected poses (together with part locations)
*/
vector<bbox_t> posemodel_detect(const posemodel_t* model, const image_ptr img);
/** @brief Delete a pose model, release related memory
*/
void posemodel_delete(posemodel_t* model);
#endif