Pose of camera from the pose of marker

asked 2018-07-23 05:39:42 -0600

slayer2309 gravatar image

am currently working on a task to localize a vehicle using computer vision. Iḿ using openCV with c++. I implemented ArUco marker to get the pose of the camera placed on the vehicle.

I used "cv::aruco::estimatePoseSingleMarkers(markerCorners, markerLength, camMatrix, distCoeffs, rvecs,tvecs)" function to estimate pose of the marker. Later I found out that rvecs and tvecs are 1x1 arrays with 3 channels.(openCVDataType=CV_8UC3).

Now, I get R(3x3) matrix from cv::Rodrigues function say itś Ri. In order to get the pose of the camera wrt to marker, after a considerable amount of research I found out that the inverse transforms have to be taken. I got inverse if Ri. Now to get inverse of translation vector it is just the multiplication of the above inverse with the translation vector (tvecs). I am fairly new to c++ and my issues are: *

  • Is my approach correct in finding the pose of camera w.r.t marker.?

  • I am unable to change the tvecs into a mat object so that there is no multiplication error. How do I go about this?

I'm grateful for the suggestions/help received.

edit retag flag offensive close merge delete

Comments

@slayer2309 you absolutely right. If you are getting so much confused with rotation and translation. Then just create 4 x 4 transformation matrix using rotation matrix and translation matrix(tvecs only) like this [R|T] with [0 ,0 ,0,1] at the bottom. Now just inverted the transformation matrix by taking inverse. Now decompose rotation and translation from that

ak1 gravatar imageak1 ( 2018-09-05 01:33:08 -0600 )edit