# Getting the calibration parameters of the Kinect camera

Hey everyone

I am working with the Kinect camera and plan to include some marker detection using ArToolKitPlus, but it requires that I provide a calibration file and my question is how I get these information from the Kinect camera. Inside the openni_camera folder under a subfolder info there are some calibration files present, but I am not sure whether the information stored in these file are usable. ArToolKitPlus uses these parameters.

Regards

Sebastian

edit retag close merge delete

Sort by » oldest newest most voted

Sebastian,

#### 1. About finding the correct parameters

##### Focal length + Principal point:

A is called a camera matrix, or a matrix of intrinsic parameters. (cx, cy) is a principal point (that is usually at the image center), and fx, fy are the focal lengths expressed in pixel-related units. In "calibration_rgb.yaml" (for example), you can see the following lines:

camera_matrix:
rows: 3
cols: 3
data: [ 526.37013657, 0.00000000, 313.68782938, 0.00000000, 526.37013657, 259.01834898, 0.00000000, 0.00000000, 1.00000000 ]

##### Skew coefficient:

Skew coefficient: The skew coefficient defining the angle between the x and y pixel axes is stored in the scalar alpha_c. In your case, it should be 90 degrees or PI/2 radians.

##### Distortions:

Distortions: The image distortion coefficients (radial and tangential distortions) are stored in the 5x1 vector kc. In "calibration_rgb.yaml" (for example), you can see the following lines:

distortion_coefficients:
rows: 1
cols: 5
data: [ 0.18126525, -0.39866885, 0.00000000, 0.00000000, 0.00000000 ]


#### 2. About openni and factory calibration

I don't know this driver much. I once heard that it might be reading the factory calibration from the device but I cannot say if this is true or not.

When I check the file openni_camera/launch/openni_kinect.launch, I see that the openni_node needs calibration information contained in a yaml file. So I tend to believe that it reads it from a file, not directly from the device, but this is only an assumption:

<rosparam command="load" file="\$(find openni_camera)/info/openni_params.yaml" />


This is as far as my knowledge goes on the subject. For more information, you might want to explore the kinect and openni mailing lists.

I hope it helps,

Raph

more

Hey everyone

I have not yet been able to retrieve the parameter values of my kinect camera and it is really frustrating since they are essential for my further progress of my project. If I create the following subscriber:

Subscriber para_sub = nh.subscribe("/camera/rgb/camera_info", 1, &processPoint::processInfo, this);

Then no topics are received and if I echo the update rate of the topic, then it cant determine it i.e no topic is present. I am really confused why making topic if nothing is publish on the line, I have also tried using different computers without any result.

more

I came across the same thing the other day. Try subscribing to one of the /camera/rgb/image topics, e.g. do a rostopic hz /camera/rgb/image_mono. I think the driver checks for the number of subscribers to the image topics and if there are none, nothing (even camera_info) is published.
( 2011-04-10 14:27:18 -0500 )edit
Damn, that was it, getting the values now :)
( 2011-04-11 00:54:14 -0500 )edit

Sebastian,

as you said, files in openni_camera/info contain the calibration information for the kinect.

To understand how this information is stored, you should have a look at the camera model of opencv. I believe the matrices you see in those xml files follow the opencv convention. Then it its just a matter of picking the right information for your parameters.

Raph

more

Hey dlmypr

I have earlier tried to rostopic echo camera/depth/camera_info and camera/rgb/camera_info, but was told no information was available.

more

Are you using openni_kinect?
( 2011-03-20 07:44:45 -0500 )edit
( 2011-03-25 07:42:08 -0500 )edit
you will succeed =)
( 2011-03-26 01:08:22 -0500 )edit

Hey

The problem for me is then figuring out which one to use, simply to many files to know which one to pick. Furthermore, then I thought the Kinects was calibrated during manufacturing and the information stored inside it, which OpenNi loads and uses. I therefore guessed that I could use one of topics posted by the openni_camera node to retrieve this information as I am uncertain how precise the files in the info folder is.

Regards

Sebastian

more

camera/depth/camera_info (sensor_msgs/CameraInfo)

Metadata (camera matrix, distortion, rectification, projection) for the infrared depth camera

camera/rgb/camera_info (sensor_msgs/CameraInfo) (camera matrix, distortion, rectification, projection) for the color camera

more