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 #include "Math/Math3d.h"
28 
29 
30 namespace 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 "/home/SMBAD/schieben/home/MeinSVN/RobotHandTracking/OI-files/rightHand-David.iv"
56 
57 #ifdef DSHT_USE_ICUB
58 #define DSHT_HAND_MODEL_PATH "/home/SMBAD/schieben/home/armarx/VisionX/source/VisionX/vision_algorithms/HandLocalizationWithFingertips/HandModel/HandModeliCubRight.txt"
59 #elif DSHT_USE_ARMAR3A
60 #define DSHT_HAND_MODEL_PATH "/home/SMBAD/schieben/home/armarx/VisionX/source/VisionX/vision_algorithms/HandLocalizationWithFingertips/HandModel/HandModelArmar3aRight.txt"
61 #else
62 #define DSHT_HAND_MODEL_PATH "/home/SMBAD/schieben/home/armarx/VisionX/source/VisionX/vision_algorithms/HandLocalizationWithFingertips/HandModel/HandModelArmar3bRight-2015.txt"
63 #endif
64 
65  // size of the camera image
66 #define DSHT_IMAGE_WIDTH 640
67 #define DSHT_IMAGE_HEIGHT 480
68 
69 
70  // colors to be segmented
71 
72 #ifdef DSHT_USE_ARMAR3A
73  static const unsigned char default_fingertip_hue = 113;
74  static const unsigned char default_fingertip_hue_tolerance = 20;
75  static const unsigned char default_fingertip_sat_min = 75;
76  static const unsigned char default_fingertip_sat_max = 255;
77  static const unsigned char default_fingertip_val_min = 10;
78  static const unsigned char default_fingertip_val_max = 150;
79 
80  static const unsigned char default_trball_hue = 0;
81  static const unsigned char default_trball_hue_tolerance = 10;
82  static const unsigned char default_trball_sat_min = 135;
83  static const unsigned char default_trball_sat_max = 255;
84  static const unsigned char default_trball_val_min = 35;
85  static const unsigned char default_trball_val_max = 220;
86 #else
87  static const unsigned char default_fingertip_hue = 127;
88  static const unsigned char default_fingertip_hue_tolerance = 50;
89  static const unsigned char default_fingertip_sat_min = 60;
90  static const unsigned char default_fingertip_sat_max = 255;
91  static const unsigned char default_fingertip_val_min = 0;
92  static const unsigned char default_fingertip_val_max = 63;
93 
94  // green3 59 16 65 164 6 109
95  static const unsigned char default_trball_hue = 59;
96  static const unsigned char default_trball_hue_tolerance = 16;
97  static const unsigned char default_trball_sat_min = 65;
98  static const unsigned char default_trball_sat_max = 164;
99  static const unsigned char default_trball_val_min = 6;
100  static const unsigned char default_trball_val_max = 109;
101 #endif
102 
103 
104  // focal length for x/y-direction
105  //const float default_focal_length_x = 896.8084716797;
106  //const float default_focal_length_y = 893.5639648438;
107  //const float fallback_default_focal_length_x = 530.8067016602;
108  //const float fallback_default_focal_length_y = 528.9429321289;
109 
110 
111  // constant for pixel/mm conversion 48mm breit, 36mm hoch
112  // seems to be included in focal length
113  //const float default_pixel_per_mm_factor = 1.0;//40.0/3.0;
114 
115  // principal point of the image
116  //const float default_principal_point_x = 350.6317443848;
117  //const float default_principal_point_y = 257.4656372070;
118  //const float fallback_default_principal_point_x = 355.1824035645;
119  //const float fallback_default_principal_point_y = 226.5831146240;
120 
121 
122  // dimensions of the OI-rendering window
123 #define DSHT_OI_RENDERSIZE_X 760
124 #define DSHT_OI_RENDERSIZE_Y 570
125 
126  // allowed deviations from the model to the sensor values
127  //const double DSHT_default_allowed_deviation[12] = { 100, 100, 100,
128  // M_PI/180*20, M_PI/180*20, M_PI/180*20,
129  // M_PI/180*5, M_PI/180*5, M_PI/180*5,
130  // M_PI/180*5, M_PI/180*5, M_PI/180*5 };
131  const double DSHT_default_allowed_deviation[12] = { 120, 120, 120,
132  M_PI / 180 * 30, M_PI / 180 * 30, M_PI / 180 * 30,
133  M_PI / 180 * 12, M_PI / 180 * 12, M_PI / 180 * 12,
134  M_PI / 180 * 12, M_PI / 180 * 12, M_PI / 180 * 12
135  };
136 }
137 
138 
visionx::DSHT_default_allowed_deviation
const double DSHT_default_allowed_deviation[12]
Definition: HandLocalisationConstants.h:131
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
M_PI
#define M_PI
Definition: MathTools.h:17