This repository was archived by the owner on Feb 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathskeltrack-util.h
131 lines (106 loc) · 4.93 KB
/
skeltrack-util.h
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
* skeltrack-util.h
*
* Skeltrack - A Free Software skeleton tracking library
* Copyright (C) 2012 Igalia S.L.
*
* Authors:
* Joaquim Rocha <jrocha@igalia.com>
* Eduardo Lima Mitev <elima@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License at http://www.gnu.org/licenses/lgpl-3.0.txt
* for more details.
*/
#ifndef __SKELTRACK_UTIL_H__
#define __SKELTRACK_UTIL_H__
#include <glib.h>
#include "skeltrack-joint.h"
typedef struct _Label Label;
typedef struct _Node Node;
struct _Label {
gint index;
Label *parent;
GList *nodes;
Node *bridge_node;
Node *to_node;
gint lower_screen_y;
gint higher_z;
gint lower_z;
gdouble normalized_num_nodes;
};
struct _Node {
gint i;
gint j;
gint x;
gint y;
gint z;
GList *neighbors;
GList *linked_nodes;
Label *label;
};
Node * get_closest_node_to_joint (GList *extremas,
SkeltrackJoint *joint,
gint *distance);
Node * get_closest_node (GList *node_list, Node *from);
Node * get_closest_torso_node (GList *node_list,
Node *from,
Node *head);
Label * get_main_component (GList *node_list,
Node *from,
gdouble min_normalized_nr_nodes);
Label * label_find (Label *label);
void label_union (Label *a, Label *b);
gint get_distance (Node *a, Node *b);
void free_label (Label *label);
void clean_labels (GList *labels);
void free_node (Node *node,
gboolean unlink_node_first);
void clean_nodes (GList *nodes);
GList * remove_nodes_with_label (GList *nodes,
Node **node_matrix,
gint width,
Label *label);
Label * get_lowest_index_label (Label **neighbor_labels);
Label * new_label (gint index);
void join_components_to_main (GList *nodes,
Label *lowest_component_label,
guint horizontal_max_distance,
guint depth_max_distance,
guint graph_distance_threshold);
void set_joint_from_node (SkeltrackJointList *joints,
Node *node,
SkeltrackJointId id,
gint dimension_reduction);
gint * create_new_dist_matrix (gint matrix_size);
gboolean dijkstra_to (GList *nodes,
Node *source,
Node *target,
gint width,
gint height,
gint *distances,
Node **previous);
void convert_screen_coords_to_mm (guint width,
guint height,
guint dimension_reduction,
guint i,
guint j,
gint z,
gint *x,
gint *y);
void convert_mm_to_screen_coords (guint width,
guint height,
guint dimension_reduction,
gint x,
gint y,
gint z,
guint *i,
guint *j);
#endif /* __SKELTRACK_UTIL_H__ */