You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/user_guides/coord_sys_tutorial.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ Despite the variety of datasets and equipment, by summarizing the line of works
48
48
left ------ 0 ------> x right
49
49
```
50
50
51
-
The definition of coordinate systems in this tutorial is actually **more than just defining the three axes**. For a box in the form of `` $$`(x, y, z, dx, dy, dz, r)`$$ ``, our coordinate systems also define how to interpret the box dimensions `` $$`(dx, dy, dz)`$$ ``and the yaw angle `` $$`r`$$ ``.
51
+
The definition of coordinate systems in this tutorial is actually **more than just defining the three axes**. For a box in the form of $(x, y, z, dx, dy, dz, r)$, our coordinate systems also define how to interpret the box dimensions $(dx, dy, dz)$ and the yaw angle $r$.
52
52
53
53
The illustration of the three coordinate systems is shown below:
54
54
@@ -60,13 +60,13 @@ We will stick to the three coordinate systems defined in this tutorial in the fu
60
60
61
61
## Definition of the yaw angle
62
62
63
-
Please refer to [wikipedia](https://en.wikipedia.org/wiki/Euler_angles#Tait%E2%80%93Bryan_angles) for the standard definition of the yaw angle. In object detection, we choose an axis as the gravity axis, and a reference direction on the plane `` $$`\Pi`$$ ``perpendicular to the gravity axis, then the reference direction has a yaw angle of 0, and other directions on `` $$`\Pi`$$ `` have non-zero yaw angles depending on its angle with the reference direction.
63
+
Please refer to [wikipedia](https://en.wikipedia.org/wiki/Euler_angles#Tait%E2%80%93Bryan_angles) for the standard definition of the yaw angle. In object detection, we choose an axis as the gravity axis, and a reference direction on the plane $\Pi$ perpendicular to the gravity axis, then the reference direction has a yaw angle of 0, and other directions on $\Pi$ have non-zero yaw angles depending on its angle with the reference direction.
64
64
65
65
Currently, for all supported datasets, annotations do not include pitch angle and roll angle, which means we need only consider the yaw angle when predicting boxes and calculating overlap between boxes.
66
66
67
67
In MMDetection3D, all three coordinate systems are right-handed coordinate systems, which means the ascending direction of the yaw angle is counter-clockwise if viewed from the negative direction of the gravity axis (the axis is pointing at one's eyes).
68
68
69
-
The figure below shows that, in this right-handed coordinate system, if we set the positive direction of the x-axis as a reference direction, then the positive direction of the y-axis has a yaw angle of `` $$`\frac{\pi}{2}`$$ ``.
69
+
The figure below shows that, in this right-handed coordinate system, if we set the positive direction of the x-axis as a reference direction, then the positive direction of the y-axis has a yaw angle of $\frac{\pi}{2}$.
70
70
71
71
```
72
72
z up y front (yaw=0.5*pi)
@@ -97,9 +97,9 @@ __|____|____|____|______\ x right
97
97
98
98
## Definition of the box dimensions
99
99
100
-
The definition of the box dimensions cannot be disentangled with the definition of the yaw angle. In the previous section, we said that the direction of a box is defined to be parallel with the x-axis if its yaw angle is 0. Then naturally, the dimension of a box which corresponds to the x-axis should be `` $$`dx`$$ ``. However, this is not always the case in some datasets (we will address that later).
100
+
The definition of the box dimensions cannot be disentangled with the definition of the yaw angle. In the previous section, we said that the direction of a box is defined to be parallel with the x-axis if its yaw angle is 0. Then naturally, the dimension of a box which corresponds to the x-axis should be $dx$. However, this is not always the case in some datasets (we will address that later).
101
101
102
-
The following figures show the meaning of the correspondence between the x-axis and `` $$`dx`$$ ``, and between the y-axis and `` $$`dy`$$ ``.
102
+
The following figures show the meaning of the correspondence between the x-axis and $dx$, and between the y-axis and $dy$.
103
103
104
104
```
105
105
y front
@@ -116,7 +116,7 @@ __|____|____|____|______\ x right
116
116
| dy
117
117
```
118
118
119
-
Note that the box direction is always parallel with the edge `` $$`dx`$$ ``.
119
+
Note that the box direction is always parallel with the edge $dx$.
120
120
121
121
```
122
122
y front
@@ -143,20 +143,20 @@ In SECOND, the LiDAR coordinate system for a box is defined as follows (a bird's
For each box, the dimensions are `` $$`(w, l, h)`$$ ``, and the reference direction for the yaw angle is the positive direction of the y axis. For more details, refer to the [repo](https://github.com/traveller59/second.pytorch#concepts).
146
+
For each box, the dimensions are $(w, l, h)$, and the reference direction for the yaw angle is the positive direction of the y axis. For more details, refer to the [repo](https://github.com/traveller59/second.pytorch#concepts).
147
147
148
148
Our LiDAR coordinate system has two changes:
149
149
150
150
- The yaw angle is defined to be right-handed instead of left-handed for consistency;
151
-
- The box dimensions are `` $$`(l, w, h)`$$ ``instead of `` $$`(w, l, h)`$$ ``, since `` $$`w`$$ ``corresponds to `` $$`dy`$$ ``and `` $$`l`$$ ``corresponds to `` $$`dx`$$ `` in KITTI.
151
+
- The box dimensions are $(l, w, h)$ instead of $(w, l, h)$, since $w$ corresponds to $dy$ and $l$ corresponds to $dx$ in KITTI.
152
152
153
153
### Waymo
154
154
155
155
We use the KITTI-format data of Waymo dataset. Therefore, KITTI and Waymo also share the same coordinate system in our implementation.
156
156
157
157
### NuScenes
158
158
159
-
NuScenes provides a toolkit for evaluation, in which each box is wrapped into a `Box` instance. The coordinate system of `Box` is different from our LiDAR coordinate system in that the first two elements of the box dimension correspond to `` $$`(dy, dx)`$$ ``, or `` $$`(w, l)`$$ ``, respectively, instead of the reverse. For more details, please refer to the NuScenes [tutorial](https://github.com/open-mmlab/mmdetection3d/blob/master/docs/en/datasets/nuscenes_det.md#notes).
159
+
NuScenes provides a toolkit for evaluation, in which each box is wrapped into a `Box` instance. The coordinate system of `Box` is different from our LiDAR coordinate system in that the first two elements of the box dimension correspond to $(dy, dx)$, or $(w, l)$, respectively, instead of the reverse. For more details, please refer to the NuScenes [tutorial](https://github.com/open-mmlab/mmdetection3d/blob/master/docs/en/datasets/nuscenes_det.md#notes).
160
160
161
161
Readers may refer to the [NuScenes development kit](https://github.com/nutonomy/nuscenes-devkit/tree/master/python-sdk/nuscenes/eval/detection) for the definition of a [NuScenes box](https://github.com/nutonomy/nuscenes-devkit/blob/2c6a752319f23910d5f55cc995abc547a9e54142/python-sdk/nuscenes/utils/data_classes.py#L457) and implementation of [NuScenes evaluation](https://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes/eval/detection/evaluate.py).
162
162
@@ -188,25 +188,25 @@ Take the conversion between our Camera coordinate system and LiDAR coordinate sy
188
188
189
189
First, for points and box centers, the coordinates before and after the conversion satisfy the following relationship:
190
190
191
-
-`` $$`x_{LiDAR}=z_{camera}`$$ ``
192
-
-`` $$`y_{LiDAR}=-x_{camera}`$$ ``
193
-
-`` $$`z_{LiDAR}=-y_{camera}`$$ ``
191
+
-$x\_{LiDAR}=z\_{camera}$
192
+
-$y\_{LiDAR}=-x\_{camera}$
193
+
-$z\_{LiDAR}=-y\_{camera}$
194
194
195
195
Then, the box dimensions before and after the conversion satisfy the following relationship:
196
196
197
-
-`` $$`dx_{LiDAR}=dx_{camera}`$$ ``
198
-
-`` $$`dy_{LiDAR}=dz_{camera}`$$ ``
199
-
-`` $$`dz_{LiDAR}=dy_{camera}`$$ ``
197
+
-$dx\_{LiDAR}=dx\_{camera}$
198
+
-$dy\_{LiDAR}=dz\_{camera}$
199
+
-$dz\_{LiDAR}=dy\_{camera}$
200
200
201
201
Finally, the yaw angle should also be converted:
202
202
203
-
-`` $$`r_{LiDAR}=-\frac{\pi}{2}-r_{camera}`$$ ``
203
+
-$r\_{LiDAR}=-\frac{\pi}{2}-r\_{camera}$
204
204
205
205
See the code [here](https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/core/bbox/structures/box_3d_mode.py) for more details.
206
206
207
207
### Bird's Eye View
208
208
209
-
The BEV of a camera coordinate system box is `` $$`(x, z, dx, dz, -r)`$$ ``if the 3D box is `` $$`(x, y, z, dx, dy, dz, r)`$$ ``. The inversion of the sign of the yaw angle is because the positive direction of the gravity axis of the Camera coordinate system points to the ground.
209
+
The BEV of a camera coordinate system box is $(x, z, dx, dz, -r)$ if the 3D box is $(x, y, z, dx, dy, dz, r)$. The inversion of the sign of the yaw angle is because the positive direction of the gravity axis of the Camera coordinate system points to the ground.
210
210
211
211
See the code [here](https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/core/bbox/structures/cam_box3d.py) for more details.
212
212
@@ -228,18 +228,18 @@ For each box related op, we have marked the type of boxes to which we can apply
228
228
229
229
No. For example, in KITTI, we need a calibration matrix when converting from Camera coordinate system to LiDAR coordinate system.
230
230
231
-
#### Q3: How does a phase difference of `` $$`2\pi`$$ `` in the yaw angle of a box affect evaluation?
231
+
#### Q3: How does a phase difference of $2\pi$ in the yaw angle of a box affect evaluation?
232
232
233
-
For IoU calculation, a phase difference of `` $$`2\pi`$$ `` in the yaw angle will result in the same box, thus not affecting evaluation.
233
+
For IoU calculation, a phase difference of $2\pi$ in the yaw angle will result in the same box, thus not affecting evaluation.
234
234
235
-
For angle prediction evaluation such as the NDS metric in NuScenes and the AOS metric in KITTI, the angle of predicted boxes will be first standardized, so the phase difference of `` $$`2\pi`$$ `` will not change the result.
235
+
For angle prediction evaluation such as the NDS metric in NuScenes and the AOS metric in KITTI, the angle of predicted boxes will be first standardized, so the phase difference of $2\pi$ will not change the result.
236
236
237
-
#### Q4: How does a phase difference of `` $$`\pi`$$ `` in the yaw angle of a box affect evaluation?
237
+
#### Q4: How does a phase difference of $\pi$ in the yaw angle of a box affect evaluation?
238
238
239
-
For IoU calculation, a phase difference of `` $$`\pi`$$ `` in the yaw angle will result in the same box, thus not affecting evaluation.
239
+
For IoU calculation, a phase difference of $\pi$ in the yaw angle will result in the same box, thus not affecting evaluation.
240
240
241
241
However, for angle prediction evaluation, this will result in the exact opposite direction.
242
242
243
-
Just think about a car. The yaw angle is the angle between the direction of the car front and the positive direction of the x-axis. If we add `` $$`\pi`$$ `` to this angle, the car front will become the car rear.
243
+
Just think about a car. The yaw angle is the angle between the direction of the car front and the positive direction of the x-axis. If we add $\pi$ to this angle, the car front will become the car rear.
244
244
245
-
For categories such as barrier, the front and the rear have no difference, therefore a phase difference of `` $$`\pi`$$ `` will not affect the angle prediction score.
245
+
For categories such as barrier, the front and the rear have no difference, therefore a phase difference of $\pi$ will not affect the angle prediction score.
0 commit comments