Added marker pose estimation. Not tested yet.

This commit is contained in:
2014-05-13 18:30:32 -04:30
parent ea33f1e725
commit b0151e85e9
4 changed files with 166 additions and 63 deletions

View File

@@ -22,20 +22,30 @@
namespace nxtar{
typedef std::vector<cv::Point2f> points_vector;
class Marker;
typedef std::vector<cv::Point2f> points_vector;
typedef std::vector<Marker> markers_vector;
/**
* A class representing a marker with the geometric transformations needed to
* render something on top of it.
*/
class Marker{
public:
~Marker();
int code;
points_vector points;
int code;
cv::Mat translation;
cv::Mat rotation;
};
/**
* Detect all 5x5 markers in the input image and return their codes in the
* output vector.
*/
void getAllMarkers(std::vector<int> &, cv::Mat &);
void getAllMarkers(markers_vector &, cv::Mat &);
/**
* Find a chessboard calibration pattern in the input image. Returns true
@@ -51,6 +61,14 @@ bool findCalibrationPattern(points_vector &, cv::Mat &);
*/
double getCameraParameters(cv::Mat &, cv::Mat &, std::vector<points_vector> &, cv::Size);
/**
* Obtains the necesary geometric transformations necessary to move a reference
* unitary polygon to the position and rotation of the markers passed as input.
* The obtained transformations are given relative to a camera centered in the
* origin and are saved inside the input markers.
*/
void estimateMarkerPosition(markers_vector &, cv::Mat &, cv::Mat &);
} // namespace nxtar
#endif // MARKER_HPP