My Project
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
MultiMarkerFiltered Class Reference

Multi marker that is constructed by first calculating the marker poses directly relative to base marker and then filtering the results using e.g. median filter. More...

#include <MultiMarkerFiltered.h>

Inheritance diagram for MultiMarkerFiltered:
MultiMarker

Public Member Functions

 MultiMarkerFiltered (std::vector< int > &indices)
 Constructor. More...
 
 ~MultiMarkerFiltered ()
 Destructor.
 
void PointCloudAverage (int marker_id, double edge_length, Pose &pose)
 Updates the 3D point cloud by averaging the calculated results. More...
 
template<class M >
double Update (const std::vector< M > *markers, Camera *cam, Pose &pose, cv::Mat &image)
 Updates the marker field and camera pose. More...
 
void MeasurementsReset ()
 Reset the measurements.
 
- Public Member Functions inherited from MultiMarker
virtual void Reset ()
 Resets the multi marker.
 
bool Save (const char *fname, FILE_FORMAT format=FILE_FORMAT_DEFAULT)
 Saves multi marker configuration to a text file. More...
 
bool Load (const char *fname, FILE_FORMAT format=FILE_FORMAT_DEFAULT)
 Loads multi marker configuration from a text file. More...
 
 MultiMarker (std::vector< int > &indices)
 Constructor. More...
 
 MultiMarker ()
 Default constructor.
 
template<class M >
double GetPose (const std::vector< M > *markers, Camera *cam, Pose &pose, cv::Mat &image)
 Calculates the pose of the camera from multi marker. Method uses the true 3D coordinates of markers to get the initial pose and then optimizes it by minimizing the reprojection error. More...
 
template<class M >
double GetPose (const std::vector< M > *markers, Camera *cam, Pose &pose)
 
template<class M >
double Update (const std::vector< M > *markers, Camera *cam, Pose &pose, cv::Mat &image)
 Calls GetPose to obtain camera pose.
 
template<class M >
double Update (const std::vector< M > *markers, Camera *cam, Pose &pose)
 
void PointCloudReset ()
 Reserts the 3D point cloud of the markers.
 
void PointCloudCorners3d (double edge_length, Pose &pose, cv::Point3d corners[4])
 Calculates 3D coordinates of marker corners relative to given pose (camera). More...
 
void PointCloudAdd (int marker_id, double edge_length, Pose &pose)
 Adds marker corners to 3D point cloud of multi marker. More...
 
void PointCloudCopy (const MultiMarker *m)
 Copies the 3D point cloud from other multi marker object.
 
bool PointCloudIsEmpty ()
 Returns true if the are not points in the 3D opint cloud.
 
size_t Size ()
 Return the number of markers added using PointCloudAdd.
 
void PointCloudGet (int marker_id, int point, double &x, double &y, double &z)
 Returns 3D co-ordinates of one corner point of a marker. More...
 
bool IsValidMarker (int marker_id)
 Returns true if the marker is in the point cloud. More...
 
template<class M >
int SetTrackMarkers (MarkerDetector< M > &marker_detector, Camera *cam, Pose &pose, cv::Mat &image)
 Set new markers to be tracked for MarkerDetector Sometimes the MultiMarker implementation knows more about marker locations compared to MarkerDetector . Then this method can be used to reset the internal state of MarkerDetector for tracking also these markers.
 

Protected Member Functions

double _Update (MarkerIterator &begin, MarkerIterator &end, Camera *cam, Pose &pose, cv::Mat &image)
 
- Protected Member Functions inherited from MultiMarker
int pointcloud_index (int marker_id, int marker_corner, bool add_if_missing=false)
 
int get_id_index (int id, bool add_if_missing=false)
 
double _GetPose (MarkerIterator &begin, MarkerIterator &end, Camera *cam, Pose &pose, cv::Mat &image)
 
double _GetPose (MarkerIterator &begin, MarkerIterator &end, Camera *cam, Pose &pose)
 
int _SetTrackMarkers (MarkerDetectorImpl &marker_detector, Camera *cam, Pose &pose, cv::Mat &image)
 

Protected Attributes

FilterMedianpointcloud_filtered
 
- Protected Attributes inherited from MultiMarker
std::map< int, cv::Point3d > pointcloud
 
std::vector< int > marker_indices
 
std::vector< int > marker_status
 

Static Protected Attributes

static const int filter_buffer_max = 15
 

Detailed Description

Multi marker that is constructed by first calculating the marker poses directly relative to base marker and then filtering the results using e.g. median filter.

This can be used to initialize the marker field for MultiMarkerBundle class.

Definition at line 45 of file MultiMarkerFiltered.h.

Constructor & Destructor Documentation

◆ MultiMarkerFiltered()

MultiMarkerFiltered ( std::vector< int > &  indices)

Constructor.

Parameters
indicesVector of marker codes that are included into multi marker. The first element defines origin.

Member Function Documentation

◆ PointCloudAverage()

void PointCloudAverage ( int  marker_id,
double  edge_length,
Pose pose 
)

Updates the 3D point cloud by averaging the calculated results.

Parameters
marker_idThe id of the marker whose corner positions are updated.
edge_lengthThe edge length of the marker.
poseCurrent camera pose that is used to estimate the marker position.

◆ Update()

double Update ( const std::vector< M > *  markers,
Camera cam,
Pose pose,
cv::Mat &  image 
)
inline

Updates the marker field and camera pose.

Parameters
markersMarkers seen by the camera.
cameraCamera object used to detect markers.
poseCurrent camera pose. This is also updated.
imageIf != 0 some visualization will be drawn.

Definition at line 78 of file MultiMarkerFiltered.h.


The documentation for this class was generated from the following file: