3 #include <boost/accumulators/accumulators.hpp> 4 #include <boost/accumulators/statistics.hpp> 5 #include <boost/accumulators/statistics/median.hpp> 6 #include <boost/accumulators/statistics/p_square_quantile.hpp> 10 #include <boost/msm/back/state_machine.hpp> 12 #include <boost/msm/front/state_machine_def.hpp> 13 #include <boost/array.hpp> 15 #include <visp3/core/vpImage.h> 16 #include <visp3/core/vpRGBa.h> 17 #include <visp3/core/vpHomogeneousMatrix.h> 18 #include <visp3/core/vpCameraParameters.h> 20 #include <visp3/core/vpDisplay.h> 21 #include <visp3/core/vpHinkley.h> 22 #include <visp3/me/vpMe.h> 26 #include "visp_tracker/MovingEdgeSites.h" 27 #include "visp_tracker/KltPoints.h" 30 #if VISP_VERSION_INT < VP_VERSION_INT(2,10,0) 33 # include <visp/vpDetectorBase.h> 36 #include <visp/vpMbEdgeTracker.h> 41 namespace msm = boost::msm;
42 namespace mpl = boost::mpl;
45 class Tracker_ :
public msm::front::state_machine_def<Tracker_>{
48 boost::accumulators::accumulator_set<
50 boost::accumulators::stats<
51 boost::accumulators::tag::median(boost::accumulators::with_p_square_quantile),
52 boost::accumulators::tag::max,
53 boost::accumulators::tag::mean
55 > var,var_x,var_y,
var_z,var_wx,var_wy,var_wz,checkpoints;
63 #if VISP_VERSION_INT < VP_VERSION_INT(2,10,0) 84 std::vector<vpPoint>
f_;
94 void set_flush_display(
bool val);
95 bool get_flush_display();
96 #if VISP_VERSION_INT < VP_VERSION_INT(2,10,0) 99 vpDetectorBase& get_detector();
101 vpMbTracker& get_mbt();
102 std::vector<vpPoint>& get_points3D_inner();
103 std::vector<vpPoint>& get_points3D_outer();
104 std::vector<vpPoint>& get_points3D_middle();
105 std::vector<vpPoint>& get_flashcode();
109 const T& get_tracking_box();
111 vpImage<vpRGBa>& get_I();
113 vpCameraParameters& get_cam();
120 Tracker_(
CmdLine& cmd, vpDetectorBase* detector, vpMbTracker *tracker_,
bool flush_display =
true);
129 bool model_detected(msm::front::none
const&);
139 void updateMovingEdgeSites(visp_tracker::MovingEdgeSitesPtr sites);
140 void updateKltPoints(visp_tracker::KltPointsPtr klt);
146 g_row< WaitingForInput , input_ready , WaitingForInput , &Tracker_::no_input_selected >,
148 g_row< WaitingForInput , input_ready , DetectFlashcode , &Tracker_::input_selected >,
150 _row< WaitingForInput , select_input , DetectFlashcode >,
152 _row< DetectFlashcode , input_ready , DetectFlashcode >,
154 row< DetectFlashcode , input_ready , DetectModel , &Tracker_::find_flashcode_pos,&Tracker_::flashcode_detected >,
156 _row< DetectModel , msm::front::none , DetectFlashcode >,
158 g_row< DetectModel , msm::front::none , TrackModel , &Tracker_::model_detected >,
160 _row< TrackModel , input_ready , ReDetectFlashcode >,
162 row< TrackModel , input_ready , TrackModel , &Tracker_::track_model ,&Tracker_::mbt_success >,
164 _row< ReDetectFlashcode, input_ready , DetectFlashcode >,
166 row< ReDetectFlashcode, input_ready , DetectModel , &Tracker_::find_flashcode_pos,&Tracker_::flashcode_redetected >,
170 _row< TrackModel , finished , Finished >,
172 _row< DetectModel , finished , Finished >,
174 _row< DetectFlashcode , finished , Finished >,
176 _row< ReDetectFlashcode, finished , Finished >
182 typedef msm::back::state_machine<Tracker_>
Tracker;
186 #endif //__TRACKING_H__
boost::accumulators::accumulator_set< double, boost::accumulators::stats< boost::accumulators::tag::median(boost::accumulators::with_p_square_quantile), boost::accumulators::tag::max, boost::accumulators::tag::mean > > var_z
std::vector< vpPoint > outer_points_3D_bcp_
msm::back::state_machine< Tracker_ > Tracker
std::vector< vpPoint > points3D_inner_
WaitingForInput initial_state
boost::array< vpHinkley, 6 > hinkley_array_t
std::vector< vpPoint > f_
std::vector< vpPoint > points3D_middle_
vpDetectorBase * detector_
vpImagePoint flashcode_center_
vpImage< unsigned char > Igray_
std::vector< vpPoint > points3D_outer_