File size: 6,058 Bytes
2f0cbc9
 
2116cd1
 
2f0cbc9
2116cd1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3167d61
2116cd1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
license: cc-by-4.0
size_categories:
- 100K<n<1M
---

# 3D Reconstruction Asset Insepction Benchmark

This is the official dataset repository for: A 3D Reconstruction Benchmark for Asset Inspection (coming soon).

The directory structure of each scene follows this pattern:
```
├── scene
    ├── cam_params
    │   ├── traj=proxy_surface_X.tar
    │   ├── traj=proxy_surface_Y.tar
    │   ├── traj=proxy_surface_Z.tar
    │   └── traj=trendspek.tar
    ├── depths
    │   ├── traj=proxy_surface_X.tar
    │   ├── traj=proxy_surface_Y.tar
    │   ├── traj=proxy_surface_Z.tar
    │   └── traj=trendspek.tar
    ├── masks
    │   ├── traj=proxy_surface_X.tar
    │   ├── traj=proxy_surface_Y.tar
    │   ├── traj=proxy_surface_Z.tar
    │   └── traj=trendspek.tar
    ├── night
    │   ├── soil=verylow,traj=proxy_surface_X.tar
    │   ├── soil=verylow,traj=proxy_surface_Y.tar
    │   ├── soil=verylow,traj=proxy_surface_Z.tar
    │   └── soil=verylow,traj=trendspek.tar
    ├── overcast
    │   ├── soil=verylow,traj=proxy_surface_X.tar
    │   ├── soil=verylow,traj=proxy_surface_Y.tar
    │   ├── soil=verylow,traj=proxy_surface_Z.tar
    │   └── soil=verylow,traj=trendspek.tar
    ├── scene_accuracy.glb
    ├── scene.blend
    ├── scene_completeness.glb
    ├── sunny
    │   ├── soil=verylow,traj=proxy_surface_X.tar
    │   ├── soil=verylow,traj=proxy_surface_Y.tar
    │   ├── soil=verylow,traj=proxy_surface_Z.tar
    │   └── soil=verylow,traj=trendspek.tar
    └── sunrise
        ├── soil=verylow,traj=proxy_surface_X.tar
        ├── soil=verylow,traj=proxy_surface_Y.tar
        ├── soil=verylow,traj=proxy_surface_Z.tar
        └── soil=verylow,traj=trendspek.tar
```
Each lighting condition, night, overcast, sunny and sunrise contains .tar files containing each sequence of images. These lighting conditions correspond to dusk, cloudy, midday and sunrise respectively in the paper. The soiling and reflectivity settings are specified by the directory name. 

The camera trajectories are also specified by the directory name. The trendspek trajectory refers to the manual capture trajectory in the paper as it was a manually animated trajectory that followed the trendspek capture guidelines. 

## Evaluation Pipeline

A working evaluation pipeline is available at: [https://github.com/RoboticImaging/inspection_dataset_tools](https://github.com/RoboticImaging/inspection_dataset_tools).

## Depth Maps

`depths` contains the depth maps. These are .exr files which store the metric depth. Each pixel has a three values each of which is the depth. To open a .exr file, one can use the [OpenEXR](https://openexr.com/en/latest/) python library or the image viewer [tev](https://github.com/Tom94/tev). A function for opening .exr files using OpenEXR in python is included below :

``` python
import OpenEXR
def open_exr(f_name: str):
    with OpenEXR.File(f_name) as infile:
        header = infile.header()
        channels = infile.channels()
        keys = list(channels.keys())
        if keys == ["RGB"]:
            img = channels["RGB"].pixels
        if keys == ["RGBA"]:
            img = channels["RGBA"].pixels
        elif keys == ["X", "Y", "Z"]:
            X = channels["X"].pixels
            Y = channels["Y"].pixels
            Z = channels["Z"].pixels
            height, width = Z.shape
            img = np.empty((height, width, 3))
            img[..., 0] = X
            img[..., 1] = Y
            img[..., 2] = Z
    return img, header
```

Each pixel of the depth map contains the metric depth in each of the three channels. Therefore, if we return to the previous code and `img[..., 0]` will get the depth for each pixel in the image.

## Camera Intrinsics and Extrinsics

Camera intrinsics and extrinsics for each frame are included in `cam_parameters`. Each frame number has an individual .json file which is formatted as follows:

``` json
{
 "name": "Camera",
 "loc": [
  world_x_position,
  world_y_position,
  world_z_position
 ],
 "rot": [
    w,
    x,
    y,
    z
 ],
 "focal_length": f_mm,
 "sensor_width": sensor_width_mm,
 "clip_end": max_dist_m,
 "clip_start": min_dist_m
}
```

The `loc` field refers to the position of the camera in the blender world coordinate frame. The `rot` field refers to the rotation quaternion in the blender world coordinate frame (in scalar first format (w, x, y, z)). `focal_length` refers to the focal length of the camera in millimetres. `sensor_width` refers to the width of the camera sensor in mm. `clip_start` and `clip_end` are the minimum and maximum distance settings that blender renders.

To convert these coordinates into the familiar COLMAP coordinate system, one can use the following lines of code:

``` python
from scipy.spatial.transform import Rotation
colmap_rot = [rot[1], rot[0],
              rot[3], -rot[2]]
colmap_transform = Rotation.from_quat(colmap_rot, scalar_first=True)
T_vec = -colmap_transform.apply(loc)
```

## Mesh model

For each scene, we exported a mesh model. To produce a ground truth point cloud, we sampled the mesh using [Open3D](https://www.open3d.org/). To replicate this, one can use:

```python
import open3d as o3d
mesh = o3d.io.read_triangle_mesh(glb_file_path)
pointcloud_sampled = mesh.sample_points_uniformly(
    number_of_points=1000000)
```

## Blender Scenes

These blender scenes were constructed in Blender 5.0.1 from assets from BlenderKit. To render the office building with different soiling settings, use the render_office.py script which can be done using Blender's in built scripting capability or with the following shell command:

```bash
blender -b scene.blend --python render_pipeline.py
```