stereolabs / zed-ros-wrapper

ROS wrapper for the ZED SDK
https://www.stereolabs.com/docs/ros/
MIT License
447 stars 391 forks source link

> Hi @pavloblindnology, #866

Closed leiwanporsche closed 1 year ago

leiwanporsche commented 1 year ago

Hi @pavloblindnology,

The first one

  1. Rotational matrix = Rodrigues([Rx, Ry, Rz]).

So, for instance something like this using OpenCV Rodrigues : cv::Rodrigues([Rx, Ry, Rz] /*in*/, RotMatrix3x3 /*out*/)

Hello, I have a question about this stereo parameter. Is this the transform matrix between left camera frame and right camera frame? Or is it between optical frame?

Originally posted by @leiwanporsche in https://github.com/stereolabs/zed-ros-wrapper/issues/39#issuecomment-1255057038

leiwanporsche commented 1 year ago

Hi, I have a question about the stereo parameter. Is the Stereo parameter describing the transform between left camera optical frame and the right camera optical frame? And is it the transform from right to left? image

Myzhar commented 1 year ago

I'm sorry, but this issue is not valid because it's not a bug or a feature request, but a support request. Please write an email to support@stereolabs.com or ask on the èStereolabs community forum](https://community.stereolabs.com)

JzHuai0108 commented 2 months ago

Hi friend,

I have a very late answer. Hope you already solved this problem two years ago. The above parameters express the transform between the left camera and the right camera as below.

rotvec = np.array([RX_HD, CV_HD, RZ_HD])
R_p_L = np.array([-Baseline, TY, TZ])
R_R_L, _ = cv2.Rodrigues(rotvec)

For a point in left camera frame L, pL, its coordinates in the right camera frame R, pR is

pR = R_R_L * pL + R_p_L.

Why? Refer to a tangible example and Yves's clarification and the notions about CV Also note the camera calibration toolbox for matlab uses the right down forward coordinate frame for cameras.