File size: 7,134 Bytes
8eb3e76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# HandNet data dictionary

Each `Data*.mat` example contains images, measured sensor poses and frame metadata. The native image grid is **240 rows by 320 columns**. Arrays retain their stored MATLAB shapes when loaded with `scipy.io.loadmat`; avoid blindly squeezing every array.

The schema below combines the original viewer/preparation code with inspection of seven examples across five ZIP archives. Dtypes can vary across transformations. The original RAR training examples were not individually inspected for this dictionary.

| Field | Observed shape / type | Interpretation |
| --- | --- | --- |
| `depth` | `(240, 320)`, `uint16` | Depth in millimetres; zero indicates no depth measurement. |
| `ir` | `(240, 320)`, `uint8` | Monochrome infrared image, not RGB. |
| `pos` | `(3, 6)`, `float32` | Six measured, placement-adjusted sensor positions in camera-space millimetres. Rows are X, Y, Z. |
| `rot` | `(3, 3, 6)`, `float32` | Six sensor orientation matrices; columns of each matrix are the sensor's local axes in camera coordinates. |
| `lbl` | `(240, 320)`, `uint8` or `uint32` | Generated pixel labels, with observed IDs 0 through 7. These encode projected hand/fingertip regions, not anatomical joint coordinates. |
| `hmap` | `(240, 320, 6)`, `float32` | Six generated sensor heatmap channels, following the sensor order below. Typical stored values range from approximately `exp(-5)` to 1; channels may contain NaNs for out-of-frame sensors. |
| `segmap` | `(240, 320)`, `uint8` | Hand segmentation mask. Original examples use 0/255 and transformed examples can use 0/1; use `segmap != 0`. |
| `handPos` | `(3, 1)`, `float32` | Detected/segmented hand centre in camera-space millimetres, used for centring and cropping. It is not identical to the measured palm sensor. |
| `bbox` | `(1, 4)`, `float32` | Image-space bounding rectangle `[x, y, width, height]` as used by the original MATLAB image routines. |
| `session` | MATLAB character data | Recording-session identifier. |
| `idx` | `(1, 1)`, observed `uint16` | Frame index within a recording session. |
| `gidx` | `(1, 1)`, observed `uint16` or `int32` | Global frame index; preserve this stored value when tracking chronology. |
| `angle` | `(1, 1)`, observed `float64` | Angle metadata present in transformed examples; degrees. Do not assume this field exists in original examples. |

## Sensor order

| Python index | MATLAB index | Sensor |
| ---: | ---: | --- |
| 0 | 1 | Thumb |
| 1 | 2 | Index fingertip |
| 2 | 3 | Middle fingertip |
| 3 | 4 | Ring fingertip |
| 4 | 5 | Little fingertip |
| 5 | 6 | Palm / back-of-hand sensor |

For example, `pos[:, 5]` and `rot[:, :, 5]` describe the measured palm sensor in Python. No intermediate knuckle positions are supplied by these arrays. Connecting fingertips to the palm is a schematic annotation display, not measured bone geometry.

The first five heatmap channels follow the fingertip ordering and the sixth follows the palm sensor. Direct inspection of original examples confirms the sixth channel's peak at the projected palm location. This stored palm heatmap is distinct from the non-fingertip supervision described for the paper's detector. Do not infer a complete anatomical label taxonomy from numeric label IDs alone; label 7 is left unnamed here.

## Camera coordinates and projection

The camera frame has +X to image right, +Y down and +Z away from the camera. Depth and `pos` use millimetres. For a stored image of width 320 and height 240, use **zero-based** pixel coordinates `u = column`, `v = row` for the original calibration:

```python
fx = 240.30773969018747
fy = 240.07488537862218
cx = 178.29264757987775
cy = 117.9581118815394

Z = depth[v, u]
X = (u - cx) * Z / fx
Y = (v - cy) * Z / fy

# Reproject a camera-space sensor:
u_sensor = fx * X_sensor / Z_sensor + cx
v_sensor = fy * Y_sensor / Z_sensor + cy
```

Discard zero depth before forming a cloud. A sensor's projection can lie outside the image or behind a visible surface; do not replace measured 3D coordinates with heatmap peaks. The separate [calibration.json](calibration.json) stores this matrix and its sources. No distortion coefficients are supplied in the original `Parameters.mat`; the viewer uses the matrix directly.

The historical bounding rectangle belongs to MATLAB image coordinates. Its origin should not be assumed to share the zero-based camera-ray convention. Check a crop against the displayed image when reproducing historical preprocessing.

## Masks, heatmaps and preprocessing

Keep the unchanged archive data as the source of truth. Convert masks with `segmap.astype(bool)` and account for `depth == 0`. For display, normalize finite heatmap values and map NaNs to zero. Preserve raw arrays if exporting annotations; normalization is a consumer transformation.

The historical HDF5 preparation script centres depth on `handPos[2]`, divides by 125 mm, clips to `[-1, 1]`, and sets missing/background pixels to +1. It produces a 96-by-96 crop and contrast-normalized scales of 96, 48 and 24 pixels, with 18-by-18 heatmap targets. These are processing choices, not the native archive image shape.

## Transformations and split identity

`DerotGT` means orientation normalization using measured ground-truth palm orientation. Perturbed variants apply uniformly sampled in-plane rotations between -90 and +90 degrees. The original rotation routine updates images and sensor poses together around the camera principal point and camera Z axis. A ground-truth transformation does not constitute a learned orientation estimate.

The examples were filtered and shuffled before release. `session`, `idx` and `gidx` carry ordering information. The original project also supplies `Indices.mat` in its repository; it is linked rather than repackaged in this dataset. Random frame splits are not participant-disjoint splits.

## Derived Parquet preview

`preview/samples.parquet` contains 96 visualization rows, not all 214,971 original frames. Its `depth`, `infrared` and `labels` columns are embedded display PNGs with Hugging Face `Image` metadata; they are not the native arrays above. Sensor positions are stored as `sensor_xyz_mm` with shape `(6, 3)`, transposed from the MATLAB `pos` convention. Each of the six `sensor_rotations_rowmajor` entries contains nine values that reshape to a 3-by-3 matrix in row-major order. `source_archive`, `source_member` and `source_mat_sha256` identify the native source. See [the preview schema](preview/samples.schema.json) for all fields.

## Sources

- [Original data viewer and camera-ray convention](https://github.com/twerdster/HandNet/blob/master/DisplaySession.m)
- [Camera matrix](https://github.com/twerdster/HandNet/blob/master/Parameters.mat)
- [Historical HDF5 preparation](https://github.com/twerdster/HandNet/blob/master/CreateH5Data.m)
- [Transformation routine](https://github.com/twerdster/HandNet/blob/master/rotateData.m)
- [DeROT angle computation](https://github.com/twerdster/HandNet/blob/master/derotate.m)
- [Paper](https://arxiv.org/abs/1507.05726)

These links preserve provenance. They do not change the historical source code's license.