aboutsummaryrefslogtreecommitdiff
path: root/docs/user_guide/ar_environment/environment_setup.md
blob: bbfdbd6dfab31b1e702beddfe33280ee60c0e2c9 (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
69
70
71
72
73
74
75
76
77
Environment Setup
=================

[ArEnvironment](/argaze/#argaze.ArFeatures.ArEnvironment) setup is loaded from JSON file format.

Each [ArEnvironment](/argaze/#argaze.ArFeatures.ArEnvironment) defines a unique [ArUcoDetector](/argaze/#argaze.ArUcoMarkers.ArUcoDetector.ArUcoDetector) dedicated to detection of markers from a specific [ArUcoMarkersDictionary](/argaze/#argaze.ArUcoMarkers.ArUcoMarkersDictionary) and with a given size. However, it is possible to load multiple [ArScene](/argaze/#argaze.ArFeatures.ArScene) into a same [ArEnvironment](/argaze/#argaze.ArFeatures.ArEnvironment).

Here is JSON environment file example where it is assumed that mentioned .obj files are located relatively to the environment file on disk.

```
{
    "name": "my AR environment",
    "aruco_detector": {
    	"dictionary": {
            "name": "DICT_APRILTAG_16h5"
    	}
    	"marker_size": 5,
    	"optic_parameters": {
            "rms": 0.6,
            "dimensions": [
                1920,
                1080
            ],
            "K": [
                [
                    1135,
                    0.0,
                    956
                ],
                [
                    0.0,
                    1135,
                    560
                ],
                [
                    0.0,
                    0.0,
                    1.0
                ]
            ],
            "D": [
                0.01655492265003404,
                0.1985524264972037,
                0.002129965902489484,
                -0.0019528582922179365,
                -0.5792910353639452
            ]
        },
        "parameters": {
            "cornerRefinementMethod": 3,
            "aprilTagQuadSigma": 2,
            "aprilTagDeglitch": 1
        }
    },
    "scenes": {
        "my first AR scene" : {
            "aruco_scene": "./first_scene/markers.obj",
            "aoi_scene": "./first_scene/aoi.obj",
            "angle_tolerance": 15.0,
            "distance_tolerance": 2.54
        },
        "my second AR scene" : {
            "aruco_scene": "./second_scene/markers.obj",
            "aoi_scene": "./second_scene/aoi.obj",
            "angle_tolerance": 15.0,
            "distance_tolerance": 2.54
        }
    }
}
```

```python
from argaze import ArFeatures

# Load AR environment
ar_environment = ArFeatures.ArEnvironment.from_json('./environment.json')
```