Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef MULTIMARKERBUNDLE_H
00025 #define MULTIMARKERBUNDLE_H
00026
00034 #include "MultiMarker.h"
00035 #include "Optimization.h"
00036
00037 namespace alvar {
00038
00044 class ALVAR_EXPORT MultiMarkerBundle : public MultiMarker
00045 {
00046 protected:
00047 int optimization_keyframes;
00048 int optimization_markers;
00049 double optimization_error;
00050 bool optimizing;
00051 std::vector<Pose> camera_poses;
00052 std::map<int, PointDouble> measurements;
00053 int measurements_index(int frame, int marker_id, int marker_corner) {
00054
00055 return (int) (frame*marker_indices.size()*4)+(get_id_index(marker_id)*4)+marker_corner;
00056 }
00057
00058 void _MeasurementsAdd(MarkerIterator &begin, MarkerIterator &end, const Pose& camera_pose);
00059
00060 public:
00061
00065 MultiMarkerBundle(std::vector<int>& indices);
00066
00067 ~MultiMarkerBundle();
00068
00072 void MeasurementsReset();
00073
00074 double GetOptimizationError() { return optimization_error; }
00075 int GetOptimizationKeyframes() { return optimization_keyframes; }
00076 int GetOptimizationMarkers() { return optimization_markers; }
00077 bool GetOptimizing() { return optimizing; }
00078
00083 template <class M>
00084 void MeasurementsAdd(const std::vector<M> *markers, const Pose& camera_pose) {
00085 MarkerIteratorImpl<M> begin(markers->begin());
00086 MarkerIteratorImpl<M> end(markers->end());
00087 _MeasurementsAdd(begin, end,
00088 camera_pose);
00089 }
00090
00097 bool Optimize(Camera *_cam, double stop, int max_iter, Optimization::OptimizeMethod method = Optimization::TUKEY_LM);
00098 };
00099
00100 }
00101
00102 #endif