Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
anchao1997 opened this issue May 12, 2022 · 4 comments
Open

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

anchao1997 opened this issue May 12, 2022 · 4 comments

Comments

@anchao1997
Copy link

anchao1997 commented May 12, 2022

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

@obraun-sl
Copy link
Member

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

@anchao1997
Copy link
Author

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

@obraun-sl
Copy link
Member

obraun-sl commented May 16, 2022

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.

@anchao1997
Copy link
Author

anchao1997 commented May 18, 2022

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Development

No branches or pull requests

2 participants