aboutsummaryrefslogtreecommitdiff
path: root/docs/user_guide/aruco_marker_pipeline/aoi_3d_description.md
blob: 78a513aa6eb53f1e047731a82e75de2d389fe107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Describe 3D AOI
===============

Now that the [scene pose is estimated](aruco_marker_description.md) considering the ArUco markers description, [areas of interest (AOI)](../../argaze.md/#argaze.AreaOfInterest.AOIFeatures.AreaOfInterest) need to be described into the same 3D referential.

In the example scene, the two screens—the control panel and the window—are considered to be areas of interest.

![3D AOI description](../../img/aoi_3d_description.png)

All AOI need to be described from the same origin as markers on a [right-handed 3D axis](https://robotacademy.net.au/lesson/right-handed-3d-coordinate-frame/), where:

* +X is pointing to the right,
* +Y is pointing to the top,
* +Z is pointing backward.

!!! warning
	All AOI spatial values must be given in **centimeters**.

### Edit OBJ file description

OBJ file format could be exported from most 3D editors.

``` obj
o Left_Screen
v 0.000000 -0.000000 -0.000000
v 15.000000 -0.000000 -0.000000
v 0.000000 18.963333 -6.355470
v 15.000000 18.963333 -6.355470
f 1 2 4 3
o Right_Screen
v 20.000000 0.000000 -0.000000
v 35.000000 0.000000 -0.000000
v 20.000000 18.963337 -6.355472
v 35.000000 18.963337 -6.355472
f 5 6 8 7
o Control_Panel
v 49.500000 30.000000 18.333333
v 55.500000 30.000000 18.333333
v 49.500000 38.000000 18.333333
v 55.500000 38.000000 18.333333
f 9 10 12 11
o Window
v -57.800000 5.500000 -33.500000
v 46.000000 15.500000 -35.000000
v 1.500000 53.000000 -1.000000
v 50.200000 61.000000 6.000000
v -35.850000 35.000000 -15.000000
f 13 14 16 15 17
```

Here are some common OBJ file features needed to describe AOI:  

* Object line (starting with the *o* key) indicates AOI name.
* Vertice line (starting with the *v* key) indicates AOI vertices.
* Face line (starting with the *f* key) links vertices together.

### Edit JSON file description

The JSON file format allows for the description of AOI vertices.

``` json
{
    "Left_Screen": [[0, 0, 0], [15, 0, 0], [0, 18.963333, -6.355470], [15, 18.963333, -6.355470]],
    "Right_Screen": [[20, 0, 0], [35, 0, 0], [20, 18.963337, -6.355472], [35, 18.963337, -6.355472]],
    "Control_Panel": [[49.5, 30, 18.333333], [55.5, 30, 18.333333], [49.5, 38, 18.333333], [55.5, 38, 18.333333]],
    "Window": [[-57.8, 5.5, -33.5], [46, 15.5, -35], [1.5, 53, -1], [50.2, 61, 6], [-35.85, 35, -15]]
}
```