0

I am working with ArUco markers from the Python OpenCV library, and I am trying to find the angle between two markers I have attached to a bending robot (see image). The image is cropped as there is a lot of clutter in the background. I am able to detect the markers in still images taken from video footage, however I now want to compute the angle between the base of the robot (marker 2 in this case) and the tip of the robot (marker 3). I have annotated the angle θ I am trying to find in the image as well, it is the angle between the X-axis from marker 2 and the line between marker 2 and marker 3. The/my difficulty lies in that the markers are not perfectly parallel to the camera, meaning the plane the robot is bending on is at an angle which I am not aware of. The two markers are along the same plane and oriented in the same way. Thank you!

Robot labeled with ArUco markers and desired angle theta

EDIT: To improve my question, I have added the full image that I am working with as well as the rvecs and tvecs of my two markers in my image. I hope the way I formatted the vectors is helpful.

full view of robot with two computer vision markers

Marker 2:

m2_tvec = np.array([88.18194349, 45.92650021, 174.73579493])
m2_rvec = np.array([0.71979241, -3.20812963, -0.21489815])

Marker 3:

m3_tvec = np.array([191.85975519, 148.9780962, 303.74133035])
m3_rvec = np.array([-1.43217426, 2.15352541, 0.201143075])
CharlieD
  • 21
  • 6
  • the angle of the markers to the camera __does not matter__. compose rvec and tvec into a 4x4 matrix (use Rodrigues). then you can move between coordinate frames. you should call such a matrix `T_cam_m2` (transforms from m2 to camera frame). now you need `T_m3_m2 = T_m3_cam @ T_cam_m2 = np.linalg.inv(T_cam_m3) @ T_cam_m2`. -- if you need a more detailed answer, I'm gonna need a better picture (without scribbles on it), or the rvecs and tvecs of those markers. – Christoph Rackwitz Feb 18 '22 at 11:12
  • Thank you @ChristophRackwitz! I have updated my question with the parts you asked for. – CharlieD Feb 18 '22 at 16:36
  • oh, typo, what's needed is T_m2_m3, and I'm sure you can adapt the math. -- those tvecs look implausible. utterly different Z distances, and the X and Y don't make sense either. what are the units of distance you use for camera calibration? -- add **ALL** the detail required to reproduce the values. that means [mre]. – Christoph Rackwitz Feb 18 '22 at 16:59
  • I measured the distance in millimeters, using the MATLAB Camera Calibration app to calibrate my camera using a checkerboard (20mm squares). – CharlieD Feb 18 '22 at 17:21
  • insufficient. I need to see all values, all matrices. your calibration may be junk. upload all your calibration pictures somewhere so I can see them. – Christoph Rackwitz Feb 18 '22 at 19:50

0 Answers0