mexopencv  3.4.1
MEX interface for OpenCV library
drawAxis.cpp
Go to the documentation of this file.
1 
8 #include "mexopencv.hpp"
9 #include "mexopencv_aruco.hpp"
10 #include "opencv2/aruco.hpp"
11 using namespace std;
12 using namespace cv;
13 using namespace cv::aruco;
14 
22 void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
23 {
24  // Check the number of arguments
25  nargchk(nrhs==6 && nlhs<=1);
26 
27  // Argument vector
28  vector<MxArray> rhs(prhs, prhs+nrhs);
29 
30  // Process
31  Mat image(rhs[0].toMat()),
32  cameraMatrix(rhs[1].toMat(CV_64F)),
33  distCoeffs(rhs[2].toMat(CV_64F)),
34  rvec(rhs[3].toMat(CV_64F)),
35  tvec(rhs[4].toMat(CV_64F));
36  float length = rhs[5].toFloat();
37  drawAxis(image, cameraMatrix, distCoeffs, rvec, tvec, length);
38  plhs[0] = MxArray(image);
39 }
STL namespace.
struct mxArray_tag mxArray
Forward declaration for mxArray.
Definition: matrix.h:259
Common definitions for the aruco module.
#define CV_64F
mxArray object wrapper for data conversion and manipulation.
Definition: MxArray.hpp:123
void nargchk(bool cond)
Alias for input/output arguments number check.
Definition: mexopencv.hpp:181
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Definition: drawAxis.cpp:22
STL class.
Global constant definitions.
cv::Mat toMat() const
void drawAxis(InputOutputArray image, InputArray cameraMatrix, InputArray distCoeffs, InputArray rvec, InputArray tvec, float length)