# Kitti

### Understanding the Calibration file

This file basically contains all the transform between between different frames of camera such as velodyne, camera, etc.&#x20;

Use following links to understand it:

{% file src="<https://1877261540-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LFDuA0A2VRqmT31Blrq%2F-M34hZA0S0IldFFriDFr%2F-M34iTYr_mVAfccr3o5m%2FKitti.pdf?alt=media&token=2332acef-333c-4a2c-ba0c-3e894d1ad21b>" %}
Kitti official Data Discription
{% endfile %}

{% embed url="<https://medium.com/test-ttile/kitti-3d-object-detection-dataset-d78a762b5a4>" %}

![This is what is given in readme.md](https://1877261540-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LFDuA0A2VRqmT31Blrq%2F-M2_vqzjLCxQJ3WV4agp%2F-M2ezZuvShzJCcda5PVF%2FIMG_20200317_193930.jpg?alt=media\&token=cc3a9001-1c21-4701-ba86-6a01b9f279ce)

#### Main equation for transformation&#x20;

$$
y = P\_{rect}^i x^{rect}
$$

In the `calib.txt` file, the $$P\_0, P\_1, P\_2, P\_3$$matrices are the projection matrix which project the 3D point $$x\_{rect}$$in rectified camera coordinate frame to image coordinates of camera $$i$$. Please note that rectified camera coordinate frame is not related to any camera $$i$$. So basically these $$P\_i$$given in calib.txt are actually$$P\_{rect}^i$$ and takes points in rectifies camera coordinate and not points in $$i^{th}$$camera coordinate frames.&#x20;

$$
y = P\_{rect}^i R\_{rect}^0 Tr^{velo-to-cam0} x^{velo}
$$

This is one of the main equation given in the readme.md file for transformations of points. Here $$x^{velo}$$is 3D point in velodyne coordinate frame. $$Tr^{velo-to-cam0}$$ transform an point from velodyne to reference camera (cam0) coordinate frame. ie. $$x^{cam0} = Tr^{velo-to-cam0}x^{velo}$$. $$x^{cam0}$$is in cam0 coordinate frame, cam0 is reference camera in kitti.&#x20;

$$
x^{rect}= R\_{rect}^0x^{cam0}
$$

We need $$x$$in rectified frame to be worked with $$P\_{rect}^i$$. Hence we use $$R\_{rect}^0$$which transform point from cam0 coordinate frame to rectified coordinate frame.&#x20;

### &#x20;Different Packages for using Kitti Dataset

Python Package to read Kitti data.&#x20;

{% embed url="<https://github.com/utiasSTARS/pykitti>" %}

Covert Kitti dataset to ROS Bag or Publish as ROS topics.&#x20;

{% embed url="<https://github.com/tomas789/kitti2bag>" %}
