31 MultiMarkerFiltered::MultiMarkerFiltered(std::vector<int>& indices)
35 for (
size_t i=0; i<indices.size()*4*3; i++) {
49 CvPoint3D64f corners[4];
51 for(
size_t j = 0; j < 4; ++j) {
53 if (id_index < 0)
continue;
54 int index = id_index*4*3 + j*3;
71 if (
_GetPose(begin, end, cam, pose, NULL) == -1)
return -1;
77 int id = marker->
GetId();
79 if (index < 0)
continue;
87 CvMat cam_mat = cvMat(4, 4, CV_64F, cam_posed);
88 CvMat mar_mat = cvMat(4, 4, CV_64F, mar_posed);
93 cvInvert(&cam_mat, &cam_mat);
94 cvMatMul(&cam_mat, &mar_mat, &mar_mat);
103 return _GetPose(begin, end, cam, pose, image);
void PointCloudAverage(int marker_id, double edge_length, Pose &pose)
Updates the 3D point cloud by averaging the calculated results.
void PointCloudCorners3d(double edge_length, Pose &pose, CvPoint3D64f corners[4])
Calculates 3D coordinates of marker corners relative to given pose (camera).
void SetMatrix(const CvMat *mat)
~MultiMarkerFiltered()
Destructor.
virtual unsigned long GetId() const
Get id for this marker This is used e.g. in MarkerDetector to associate a marker id with an appropria...
This file implements an approximation algorithm to create a multi-marker field configuration.
std::vector< int > marker_status
double _Update(MarkerIterator &begin, MarkerIterator &end, Camera *cam, Pose &pose, IplImage *image)
Base class for using MultiMarker.
TFSIMD_FORCE_INLINE const tfScalar & y() const
std::map< int, CvPoint3D64f > pointcloud
int get_id_index(int id, bool add_if_missing=false)
Simple Camera class for calculating distortions, orientation or projections with pre-calibrated camer...
int pointcloud_index(int marker_id, int marker_corner, bool add_if_missing=false)
Pose pose
The current marker Pose.
Pose representation derived from the Rotation class
static const int filter_buffer_max
TFSIMD_FORCE_INLINE const tfScalar & x() const
Basic 2D Marker functionality.
void PointCloudAdd(int marker_id, double edge_length, Pose &pose)
Adds marker corners to 3D point cloud of multi marker.
TFSIMD_FORCE_INLINE const tfScalar & z() const
Iterator type for traversing templated Marker vector without the template.
double GetMarkerEdgeLength() const
Get edge length (to support different size markers.
FilterMedian * pointcloud_filtered
void GetMatrix(CvMat *mat) const
double _GetPose(MarkerIterator &begin, MarkerIterator &end, Camera *cam, Pose &pose, IplImage *image)
virtual MarkerIterator & reset()=0