ArUco Marker on image plane

asked 2017-07-16 19:52:02 -0600

I am trying to use a single ArUco marker to land an AR drone 2.0. Due to time constraints, the best approach I see is more of a " 2D approach": detecting the marker through the bottom camera, center the drone over the marker, and land. I want to obtain the x and y coordinates of ArUco marker's center (or corners), in reference to the camera's image plane. With the ArUco module, I have been able to detect markers and draw out there axis (x,y, & z)in the world using the cv::aruco::detectMarkers and cv::aruco::estimatePoseSingleMarkers functions. As the documentation indicates, I receive translational and rotational vectors, but I do not know how to use them for centering the drone. I have been told that the solvePNP function can give me the 2D coordinates, but I don't know what argument to pass in for the "objectPoints". I am quite new to OpenCV 3.2 and would appreciate any help.

edit retag flag offensive close merge delete

Comments

With estimatePoseSingleMarkers, you can pass _objPoints and get the 3D coordinates of the marker corners in the object frame. You can then compute the centroid in the object frame and use rvec and tvec to compute the 3D coordinate of the centroid in the camera frame.

Eduardo gravatar imageEduardo ( 2017-07-17 04:37:47 -0600 )edit

@Eduardo I looked at the documentation for the estimatePoseSingleMarkers and tried to pass the optional argument _objPoints of type std::vector<cv::Vec3d>. I receive a build error saying that too many arguments were passed to the function. Is this because I am using the wrong data type or for some other reason?

Ghost3576 gravatar imageGhost3576 ( 2017-07-17 09:03:23 -0600 )edit

It is only available in the master branch not in OpenCV 3.2 or previous.

Eduardo gravatar imageEduardo ( 2017-07-18 04:22:26 -0600 )edit