ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

calibration data to orb salm 2

asked 2020-11-24 06:10:58 -0600

dinesh gravatar image

updated 2020-11-24 06:11:16 -0600

I'v just calibrated my logetechC270 camera with camera calibration package. And generated a yaml file as below: camera.yaml

image_width: 1280
image_height: 960
camera_name: camera
camera_matrix:
  rows: 3
  cols: 3
  data: [2070.952323240658, 0, 615.4211500075771, 0, 2296.141297958174, 348.9518547206778, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [3.061750588587568, -23.95749705432321, 0.03743614604700891, 0.08119813176043622, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [2250.499267578125, 0, 658.697510417187, 0, 0, 2595.73291015625, 357.1287660120288, 0, 0, 0, 1, 0]

Now how do i add this data into orb slam 2 camera parameters? As i saw the orb slam configuration needs fx, fy, cx, cz data. So how do i fill them? Is it possible to load the camera.yaml file directly in orb slam 2?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-11-24 13:14:46 -0600

tryan gravatar image

I haven't looked at it in awhile, so someone correct me if I'm wrong or fill in missing details. As far as I know, you can't directly put that YAML file into ORB_SLAM2. The GitHub repo provides documentation and some example configuration files, where the camera section looks like this:

#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------

# Camera calibration and distortion parameters (OpenCV) 
Camera.fx: 517.306408
Camera.fy: 516.469215
Camera.cx: 318.643040
Camera.cy: 255.313989

Camera.k1: 0.262383
Camera.k2: -0.953104
Camera.p1: -0.005358
Camera.p2: 0.002628
Camera.k3: 1.163314

# Camera frames per second 
Camera.fps: 30.0

# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
Camera.RGB: 1

To help translate between this format and the one you already have, you can use the sensor_msgs/CameraInfo documentation as a cheat sheet. The first 4 parameters are in your camera_matrix, which is formatted as K = [fx 0 cx 0 fy cy 0 0 1]. The next 5 are your distortion_coefficients, which is formatted as D = [k1 k2 p1 p2 k3].

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-11-24 06:10:58 -0600

Seen: 852 times

Last updated: Nov 24 '20