Ask Your Question
1

Getting the calibration parameters of the Kinect camera

asked 2011-03-07 20:16:17 -0500

Aslund gravatar image

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 flag offensive close merge delete

6 Answers

Sort by ยป oldest newest most voted
4

answered 2011-03-08 00:26:15 -0500

raphael favier gravatar image

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

edit flag offensive delete link more
1

answered 2011-04-10 11:58:42 -0500

Aslund gravatar image

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.

edit flag offensive delete link more

Comments

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.
Patrick Bouffard gravatar image Patrick Bouffard  ( 2011-04-10 14:27:18 -0500 )edit
Damn, that was it, getting the values now :)
Aslund gravatar image Aslund  ( 2011-04-11 00:54:14 -0500 )edit
1

answered 2011-03-07 20:29:55 -0500

raphael favier gravatar image

updated 2011-03-07 20:39:38 -0500

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

edit flag offensive delete link more
0

answered 2011-03-18 13:34:56 -0500

Aslund gravatar image

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.

edit flag offensive delete link more

Comments

Are you using openni_kinect?
dlmypr gravatar image dlmypr  ( 2011-03-20 07:44:45 -0500 )edit
Yes, but downloaded the newest openni_kinect driver and will try it next week
Aslund gravatar image Aslund  ( 2011-03-25 07:42:08 -0500 )edit
you will succeed =)
dlmypr gravatar image dlmypr  ( 2011-03-26 01:08:22 -0500 )edit
0

answered 2011-03-07 21:13:09 -0500

Aslund gravatar image

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

edit flag offensive delete link more
0

answered 2011-03-15 00:32:17 -0500

dlmypr gravatar image

updated 2011-03-15 00:33:52 -0500

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-03-07 20:16:17 -0500

Seen: 18,384 times

Last updated: Apr 10 '11