• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

/home/hauberg/Dokumenter/Capture/humim-tracker-0.1/src/options.h

Go to the documentation of this file.
00001 // Copyright (C) 2011 Soren Hauberg
00002 //
00003 // This program is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU General Public License
00005 // as published by the Free Software Foundation; either version 3
00006 // of the License, or (at your option) any later version.
00007 //
00008 // This program is distributed in the hope that it will be useful, but
00009 // WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, see <http://www.gnu.org/licenses/>.
00015  
00016 #ifndef OPTIONS_H
00017 #define OPTIONS_H
00018 
00019 #include <stdexcept>
00020 #include <string>
00021 #include <map>
00022 #include "math_types.h"
00023 
00028 enum tracker_state_type
00029 {
00030   ANGLE_STATE,
00031   PIK_STATE,
00032   PROJECTION_STATE,
00033   TANGENT_STATE,
00034   KBK_STICK_STATE,
00035   STICK_STATE,
00036   STICK2D_STATE,
00037   BROWNIAN_STICK_STATE,
00038   PIK_STICK_STATE,
00039   BROWNIAN_STATE,
00040   BGSUB_STATE,
00041   ANGLE_BGSUB_STATE,
00042   HULL_STATE
00043 };
00044 
00048 enum tracker_observation_type
00049 {
00050   POINT_CLOUD,
00051   POINT_CLOUD_AND_STICK,
00052   KINECT_CLOUD,
00053   TRICLOPS_CLOUD
00054 };
00055 
00060 class missing_option : public std::runtime_error
00061 {
00062 public:
00063   missing_option (const std::string &message = "")
00064     : std::runtime_error (message)
00065   {
00066   }
00067 };
00068 
00084 class options
00085 {
00086 public:
00098   options (const std::string filename);
00099   
00100   // Input data
00112   std::string data_template () const;
00113   int data_start_idx () const;
00114   std::string left_image_template () const;
00115   std::string right_image_template () const;
00116   std::string background_image () const;
00117   
00118   // Output data
00119   std::string output_directory () const;
00120   
00121   // Tracker options
00122   tracker_state_type state_type () const;
00123   int num_particles () const;
00124   std::string initial_pose () const;
00125   double pred_noise () const;
00126   bool extrapolate () const;
00127   double convex_lambda () const;
00128   
00129   // Camera calibration
00130   const matrix3& intrinsic_matrix () const;
00131   double data_scaling () const;
00132   
00133   std::string external_view () const;
00134   const vector3& external_translation () const;
00135   const matrix3& external_rotation () const;
00136   
00137   const std::string& kinect_calibration () const;
00138   const std::string& depth_background () const;
00139   
00140   std::string skeleton_xsf () const;
00141   
00142   // Bone appearance
00143   std::string bone_appearance () const;
00144   double bone_size (const std::string name) const;
00145   
00146   std::string joint_limits () const;
00147   
00148   // Bumblebee
00149   std::string bumblebee_configuration () const;
00150   
00151   // Measurement
00152   tracker_observation_type observation_type () const;
00153   double measure_threshold () const;
00154   double measure_variance () const;
00155   double depth_threshold () const;
00156   int measure_downsampling () const;
00157   
00158   // Stick info
00159   std::string stick_filename () const;
00160   
00161   // MoCap validation data
00162   std::string mocap_filename () const;
00163 
00164 private:
00165   // Input data template
00166   std::string val_data_template;
00167   bool valid_data_template;
00168   int val_data_start_idx;
00169   bool valid_data_start_idx;
00170   std::string val_left_image_template;
00171   bool valid_left_image_template;
00172   std::string val_right_image_template;
00173   bool valid_right_image_template;
00174   std::string val_background_image;
00175   bool valid_background_image;
00176   
00177   // Output data
00178   std::string val_output_directory;
00179   bool valid_output_directory;
00180   
00181   // Tracker options
00182   tracker_state_type val_state_type;
00183   bool valid_state_type;
00184   int val_num_particles;
00185   bool valid_num_particles;
00186   std::string val_initial_pose;
00187   bool valid_initial_pose;
00188   double val_pred_noise;
00189   bool valid_pred_noise;
00190   bool val_extrapolate;
00191   bool valid_convex_lambda;
00192   double val_convex_lambda;
00193   
00194   // Camera calibration
00195   std::string val_external_view;
00196   vector3 val_external_translation;
00197   matrix3 val_external_rotation;
00198   matrix3 val_intrinsic_matrix;
00199   bool valid_intrinsic_matrix;
00200   double val_data_scaling;
00201   
00202   bool valid_external_view;
00203   bool valid_external_translation;
00204   bool valid_external_rotation;
00205   
00206   // Kinect stuff
00207   std::string val_kinect_calibration;
00208   bool valid_kinect_calibration;
00209   std::string val_depth_background;
00210   bool valid_depth_background;
00211 
00212   // Skeleton definition
00213   std::string val_skeleton_xsf;
00214   bool valid_skeleton_xsf;
00215 
00216   // Bone appearance
00217   std::string val_bone_appearance;
00218   bool valid_bone_appearance;
00219   std::map<const std::string, double> val_bone_size;
00220   
00221   bool valid_joint_limits;
00222   std::string val_joint_limits;
00223   
00224   // Bumblebee
00225   std::string val_bumblebee_configuration;
00226   bool valid_bumblebee_configuration;
00227   
00228   // Measurement
00229   tracker_observation_type val_observation_type;
00230   double val_measure_threshold;
00231   double val_measure_variance;
00232   double val_depth_threshold;
00233   bool valid_observation_type;
00234   bool valid_measure_threshold;
00235   bool valid_measure_variance;
00236   bool valid_depth_threshold;
00237   int val_measure_downsampling;
00238   
00239   // Stick info
00240   std::string val_stick_filename;
00241   bool valid_stick_filename;
00242   
00243   // MoCap validation data
00244   std::string val_mocap_filename;
00245   bool valid_mocap_filename;
00246   
00247   // Helper functions
00248   void read_camera_calibration (const std::string filename);
00249   void read_bone_appearance (const std::string filename);
00250   bool read_external_view (const std::string filename);
00251 };
00252 
00253 #endif // OPTIONS_H

Generated on Thu Dec 1 2011 12:54:02 for HUMIM Tracker by  doxygen 1.7.1