HandLocalisationConstants.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package
19 * @author
20 * @date
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#pragma once
25
26#include <math.h>
27
28#include "Math/Math3d.h"
29
30namespace visionx
31{
32
33 // define the used hand model
34
35 //#define DSHT_USE_ARMAR3A
36#define DSHT_USE_ARMAR3B
37 //#define DSHT_USE_ICUB
38
39#define DSHT_NUM_FINGERS 5
40
41#ifdef DSHT_USE_ICUB
42#define DSHT_MAX_POLYGON_CORNERS 12
43#elif DSHT_USE_ARMAR3A
44#define DSHT_MAX_POLYGON_CORNERS 22
45#else
46#define DSHT_MAX_POLYGON_CORNERS 18
47#endif
48
49#define DSHT_USE_EDGE_DIRECTION
50
51 //#define DSHT_USE_OLD_HAND_MODEL
52
53#define DSHT_NUM_PARAMETERS 12
54
55#define DSHT_OI_FILE_PATH \
56 "/home/SMBAD/schieben/home/MeinSVN/RobotHandTracking/OI-files/rightHand-David.iv"
57
58#ifdef DSHT_USE_ICUB
59#define DSHT_HAND_MODEL_PATH \
60 "/home/SMBAD/schieben/home/armarx/VisionX/source/VisionX/vision_algorithms/" \
61 "HandLocalizationWithFingertips/HandModel/HandModeliCubRight.txt"
62#elif DSHT_USE_ARMAR3A
63#define DSHT_HAND_MODEL_PATH \
64 "/home/SMBAD/schieben/home/armarx/VisionX/source/VisionX/vision_algorithms/" \
65 "HandLocalizationWithFingertips/HandModel/HandModelArmar3aRight.txt"
66#else
67#define DSHT_HAND_MODEL_PATH \
68 "/home/SMBAD/schieben/home/armarx/VisionX/source/VisionX/vision_algorithms/" \
69 "HandLocalizationWithFingertips/HandModel/HandModelArmar3bRight-2015.txt"
70#endif
71
72 // size of the camera image
73#define DSHT_IMAGE_WIDTH 640
74#define DSHT_IMAGE_HEIGHT 480
75
76
77 // colors to be segmented
78
79#ifdef DSHT_USE_ARMAR3A
80 static const unsigned char default_fingertip_hue = 113;
81 static const unsigned char default_fingertip_hue_tolerance = 20;
82 static const unsigned char default_fingertip_sat_min = 75;
83 static const unsigned char default_fingertip_sat_max = 255;
84 static const unsigned char default_fingertip_val_min = 10;
85 static const unsigned char default_fingertip_val_max = 150;
86
87 static const unsigned char default_trball_hue = 0;
88 static const unsigned char default_trball_hue_tolerance = 10;
89 static const unsigned char default_trball_sat_min = 135;
90 static const unsigned char default_trball_sat_max = 255;
91 static const unsigned char default_trball_val_min = 35;
92 static const unsigned char default_trball_val_max = 220;
93#else
94 static const unsigned char default_fingertip_hue = 127;
95 static const unsigned char default_fingertip_hue_tolerance = 50;
96 static const unsigned char default_fingertip_sat_min = 60;
97 static const unsigned char default_fingertip_sat_max = 255;
98 static const unsigned char default_fingertip_val_min = 0;
99 static const unsigned char default_fingertip_val_max = 63;
100
101 // green3 59 16 65 164 6 109
102 static const unsigned char default_trball_hue = 59;
103 static const unsigned char default_trball_hue_tolerance = 16;
104 static const unsigned char default_trball_sat_min = 65;
105 static const unsigned char default_trball_sat_max = 164;
106 static const unsigned char default_trball_val_min = 6;
107 static const unsigned char default_trball_val_max = 109;
108#endif
109
110
111 // focal length for x/y-direction
112 //const float default_focal_length_x = 896.8084716797;
113 //const float default_focal_length_y = 893.5639648438;
114 //const float fallback_default_focal_length_x = 530.8067016602;
115 //const float fallback_default_focal_length_y = 528.9429321289;
116
117
118 // constant for pixel/mm conversion 48mm breit, 36mm hoch
119 // seems to be included in focal length
120 //const float default_pixel_per_mm_factor = 1.0;//40.0/3.0;
121
122 // principal point of the image
123 //const float default_principal_point_x = 350.6317443848;
124 //const float default_principal_point_y = 257.4656372070;
125 //const float fallback_default_principal_point_x = 355.1824035645;
126 //const float fallback_default_principal_point_y = 226.5831146240;
127
128
129 // dimensions of the OI-rendering window
130#define DSHT_OI_RENDERSIZE_X 760
131#define DSHT_OI_RENDERSIZE_Y 570
132
133 // allowed deviations from the model to the sensor values
134 //const double DSHT_default_allowed_deviation[12] = { 100, 100, 100,
135 // M_PI/180*20, M_PI/180*20, M_PI/180*20,
136 // M_PI/180*5, M_PI/180*5, M_PI/180*5,
137 // M_PI/180*5, M_PI/180*5, M_PI/180*5 };
138 const double DSHT_default_allowed_deviation[12] = {120,
139 120,
140 120,
141 M_PI / 180 * 30,
142 M_PI / 180 * 30,
143 M_PI / 180 * 30,
144 M_PI / 180 * 12,
145 M_PI / 180 * 12,
146 M_PI / 180 * 12,
147 M_PI / 180 * 12,
148 M_PI / 180 * 12,
149 M_PI / 180 * 12};
150} // namespace visionx
#define M_PI
Definition MathTools.h:17
ArmarX headers.
const double DSHT_default_allowed_deviation[12]