zed-sdk icon indicating copy to clipboard operation
zed-sdk copied to clipboard

how to get the camera parameters like other cameras(realsense)

Open anchao1997 opened this issue 2 years ago • 4 comments

when I use realsense cameras,I use "rs-enumerate-devices -c" to get all the camera parameters so I wonder if there is the similar command or method to get the camera parameters thanks

anchao1997 avatar May 12 '22 04:05 anchao1997

Hi,

you can use the sl::Camera::getDeviceList() static function to get the available cameras with their properties See here : https://www.stereolabs.com/docs/api/classsl_1_1Camera.html#a1768d383f5e78746f58eda9d2c60b33e

obraun-sl avatar May 13 '22 11:05 obraun-sl

sorry I explain that I want to get the exact rotation matrix,translation vector between camera1 to camera2, camera1 to imu. and the K matrix between every camera. by the way I use the camera zed2 so can I use that website to get these parameters thank you very much

anchao1997 avatar May 16 '22 04:05 anchao1997

Ok. In this case, you can use this sample to extract camera parameters https://github.com/stereolabs/zed-opencv-native

This will load the SNxxxx.conf file where those information are stored.

obraun-sl avatar May 16 '22 05:05 obraun-sl

thank you and I have another question: when i use the zed2 camera with the "zed_ros_wrapper" to start the camera. I use "rostopic echo /zed2/zed_node/left/camera_info"(for example), I got the parameters as these: header: seq: 89 stamp: secs: 1652754983 nsecs: 82060487 frame_id: "zed2_left_camera_optical_frame" height: 360 width: 640 distortion_model: "plumb_bob" D: [0.0, 0.0, 0.0, 0.0, 0.0] K: [265.8936767578125, 0.0, 315.818115234375, 0.0, 265.8936767578125, 191.2515869140625, 0.0, 0.0, 1.0] R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0] P: [265.8936767578125, 0.0, 315.818115234375, 0.0, 0.0, 265.8936767578125, 191.2515869140625, 0.0, 0.0, 0.0, 1.0, 0.0] binning_x: 0 binning_y: 0 roi: x_offset: 0 y_offset: 0 height: 0 width: 0 do_rectify: False

but I use "https://github.com/stereolabs/zed-opencv-native" to get parameters like this: Calibration file found. Loading... Camera Matrix L: [528.9149780273438, 0, 633.8599853515625; 0, 528.530029296875, 378.9454956054688; 0, 0, 1]

Camera Matrix R: [529.0999755859375, 0, 639.5050048828125; 0, 528.9299926757812, 373.0660095214844; 0, 0, 1]

Camera Matrix L: [531.7795920418395, 0, 632.5348663330078, 0; 0, 531.7795920418395, 382.4968872070312, 0; 0, 0, 1, 0]

Camera Matrix R: [531.7795920418395, 0, 632.5348663330078, 63605.09435374335; 0, 531.7795920418395, 382.4968872070312, 0; 0, 0, 1, 0]

I guess I should truth the parameters from "zed_ros_wrapper",right? or could you tell why the differences happen (that the image width and height changed make the results, I think) and the meanings of the second group of " Camera Matrix L , Camera Matrix R" in https://github.com/stereolabs/zed-opencv-native. thanks for your wonderful products.

anchao1997 avatar May 18 '22 11:05 anchao1997