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Dataset
|
| 7 |
+
|
| 8 |
+
This directory contains RGB image sequences, object pose annotations, camera intrinsics, object mesh models, and a utility script for visualizing object contours.
|
| 9 |
+
|
| 10 |
+
## Dataset Structure
|
| 11 |
+
|
| 12 |
+
```text
|
| 13 |
+
scene_1/
|
| 14 |
+
├── cam_K.txt
|
| 15 |
+
├── models/
|
| 16 |
+
│ ├── cheese_wafer_box_canonical.ply
|
| 17 |
+
│ ├── cheese_wafer_box_deform_mild.ply
|
| 18 |
+
│ └── ...
|
| 19 |
+
├── static/
|
| 20 |
+
│ ├── seq_1/
|
| 21 |
+
│ │ ├── pose.json
|
| 22 |
+
│ │ └── rgb/
|
| 23 |
+
│ │ ├── 000000.png
|
| 24 |
+
│ │ ├── 000002.png
|
| 25 |
+
│ │ └── ...
|
| 26 |
+
│ │ └── depth/
|
| 27 |
+
│ │ ├── 000000.png
|
| 28 |
+
│ │ ├── 000002.png
|
| 29 |
+
│ │ └── ...
|
| 30 |
+
│ │ └── masks/
|
| 31 |
+
│ │ ├── 000000
|
| 32 |
+
│ │ ├── 000002
|
| 33 |
+
│ │ └── ...
|
| 34 |
+
│ ├── seq_2/
|
| 35 |
+
│ │ ├── pose.json
|
| 36 |
+
│ │ └── rgb/
|
| 37 |
+
│ │ └── ...
|
| 38 |
+
│ └── ...
|
| 39 |
+
├── models_name.md
|
| 40 |
+
├── seq_img_obj.md
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
### Main Files and Directories
|
| 44 |
+
|
| 45 |
+
- `static/`: contains different sequence folders named as `seq_{seq id}`.
|
| 46 |
+
|
| 47 |
+
- `static/seq_{seq id}/rgb/`: contains RGB images for the sequence. Image filenames use 6-digit IDs such as `000000.png`.
|
| 48 |
+
|
| 49 |
+
- `static/seq_{seq id}/pose.json`: stores object poses for images in the sequence. Each pose entry contains an `obj_id`, `cam_R_m2c`, and `cam_t_m2c`.
|
| 50 |
+
|
| 51 |
+
- `models/`: contains object mesh models in PLY format. For example, `models/1.ply` corresponds to object ID `1`.
|
| 52 |
+
|
| 53 |
+
- `cam_K.txt`: stores the camera intrinsic matrix.
|
| 54 |
+
|
| 55 |
+
- `seq_img_obj.md`: lists which objects have valid poses in each image of each sequence.
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
## Data Index
|
| 60 |
+
|
| 61 |
+
Before running the visualization script, please check `seq_img_obj.md` and select the target entry from its table:
|
| 62 |
+
|
| 63 |
+
- `seq id`: the sequence ID, corresponding to `static/seq_{seq id}`
|
| 64 |
+
- `img id`: the image ID, corresponding to `static/seq_{seq id}/rgb/{img id}.png`
|
| 65 |
+
- `obj id`: the object ID with pose annotation in that image, corresponding to `models/{obj id}.ply`
|
| 66 |
+
|
| 67 |
+
Only the `seq id`, `img id`, and `obj id` combinations listed in `seq_img_obj.md` have valid poses and can be used for contour visualization.
|
| 68 |
+
|
| 69 |
+
## Object Contour Visualization
|
| 70 |
+
|
| 71 |
+
`visualize_object_contour.py` renders the contour of a specified object using:
|
| 72 |
+
|
| 73 |
+
1. the RGB image from `static/seq_{seq id}/rgb/{img id}.png`,
|
| 74 |
+
2. the object pose from `static/seq_{seq id}/pose.json`,
|
| 75 |
+
3. the object mesh from `models/{obj id}.ply`, and
|
| 76 |
+
4. the camera intrinsics from `cam_K.txt` or `cam_K.json`.
|
| 77 |
+
|
| 78 |
+
### Basic Usage
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
python visualize_object_contour.py --seq-id 1 --img-id 000000 --obj-id 1
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
You can also provide `img id` in numeric form:
|
| 85 |
+
|
| 86 |
+
```bash
|
| 87 |
+
python visualize_object_contour.py --seq-id 1 --img-id 0 --obj-id 1
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
The script automatically pads numeric image IDs to 6 digits. For example, `0` is parsed as `000000`.
|
| 91 |
+
|
| 92 |
+
### Specify Output Path
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
python visualize_object_contour.py \
|
| 96 |
+
--seq-id 1 \
|
| 97 |
+
--img-id 000000 \
|
| 98 |
+
--obj-id 1 \
|
| 99 |
+
--output outputs/seq1_img000000_obj1.png
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
If `--output` is not specified, the default output path is:
|
| 103 |
+
|
| 104 |
+
```text
|
| 105 |
+
edge_seq{seq_id}_img{img_id}_obj{obj_id}.png
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
### Common Options
|
| 109 |
+
|
| 110 |
+
```bash
|
| 111 |
+
python visualize_object_contour.py \
|
| 112 |
+
--seq-id 1 \
|
| 113 |
+
--img-id 000000 \
|
| 114 |
+
--obj-id 1 \
|
| 115 |
+
--edge-thickness 3 \
|
| 116 |
+
--color 255 0 0 \
|
| 117 |
+
--alpha 1.0
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
Option descriptions:
|
| 121 |
+
|
| 122 |
+
- `--seq-id`: sequence ID, required
|
| 123 |
+
- `--img-id`: image ID, required
|
| 124 |
+
- `--obj-id`: object ID, required
|
| 125 |
+
- `--output`: output image path, optional
|
| 126 |
+
- `--edge-thickness`: contour line width, default is `3`
|
| 127 |
+
- `--color R G B`: contour color, default is red `255 0 0`
|
| 128 |
+
- `--alpha`: contour overlay opacity in `[0, 1]`, default is `1.0`
|
| 129 |
+
- `--root`: dataset root directory, default is the current directory
|
| 130 |
+
- `--camera`: camera intrinsic file path; if not specified, the script uses `cam_K.json` first, otherwise `cam_K.txt`
|
| 131 |
+
- `--occurrence`: selects which instance to visualize when the same `obj id` appears multiple times in one image, default is `0`
|
| 132 |
+
|
| 133 |
+
### Example
|
| 134 |
+
|
| 135 |
+
Green semi-transparent contour:
|
| 136 |
+
|
| 137 |
+
```bash
|
| 138 |
+
python visualize_object_contour.py \
|
| 139 |
+
--seq-id 1 \
|
| 140 |
+
--img-id 000000 \
|
| 141 |
+
--obj-id 1 \
|
| 142 |
+
--color 0 255 0 \
|
| 143 |
+
--alpha 0.8
|
| 144 |
+
```
|