File size: 4,252 Bytes
5c1feaf
 
e7216ce
5c1feaf
e7216ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
pretty_name: desope_lite
---

# Introduction to the DeSOPE Dataset

This directory contains RGB image sequences, object pose annotations, camera intrinsics, object mesh models, and a utility script for visualizing object contours.

## Dataset Structure

```text
scene_1/
├── cam_K.txt
├── models/
│   ├── cheese_wafer_box_canonical.ply
│   ├── cheese_wafer_box_deform_mild.ply
│   └── ...
├── static/
│   ├── seq_1/
│   │   ├── pose.json
│   │   └── rgb/
│   │       ├── 000000.png
│   │       ├── 000002.png
│   │       └── ...
│   │   └── depth/
│   │       ├── 000000.png
│   │       ├── 000002.png
│   │       └── ...
│   │   └── masks/
│   │       ├── 000000
│   │       ├── 000002
│   │       └── ...
│   ├── seq_2/
│   │   ├── pose.json
│   │   └── rgb/
│   │       └── ...
│   └── ...
├── models_name.md
├── seq_img_obj.md
```

### Main Files and Directories

- `static/`: contains different sequence folders named as `seq_{seq id}`.

- `static/seq_{seq id}/rgb/`: contains RGB images for the sequence. Image filenames use 6-digit IDs such as `000000.png`.

- `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`.

- `models/`: contains object mesh models in PLY format. For example, `models/1.ply` corresponds to object ID `1`.

- `cam_K.txt`: stores the camera intrinsic matrix.

- `seq_img_obj.md`: lists which objects have valid poses in each image of each sequence.

  

## Data Index

Before running the visualization script, please check `seq_img_obj.md` and select the target entry from its table:

- `seq id`: the sequence ID, corresponding to `static/seq_{seq id}`
- `img id`: the image ID, corresponding to `static/seq_{seq id}/rgb/{img id}.png`
- `obj id`: the object ID with pose annotation in that image, corresponding to `models/{obj id}.ply`

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.

## Object Contour Visualization

`visualize_object_contour.py` renders the contour of a specified object using:

1. the RGB image from `static/seq_{seq id}/rgb/{img id}.png`,
2. the object pose from `static/seq_{seq id}/pose.json`,
3. the object mesh from `models/{obj id}.ply`, and
4. the camera intrinsics from `cam_K.txt` or `cam_K.json`.

### Basic Usage

```bash
python visualize_object_contour.py --seq-id 1 --img-id 000000 --obj-id 1
```

You can also provide `img id` in numeric form:

```bash
python visualize_object_contour.py --seq-id 1 --img-id 0 --obj-id 1
```

The script automatically pads numeric image IDs to 6 digits. For example, `0` is parsed as `000000`.

### Specify Output Path

```bash
python visualize_object_contour.py \
  --seq-id 1 \
  --img-id 000000 \
  --obj-id 1 \
  --output outputs/seq1_img000000_obj1.png
```

If `--output` is not specified, the default output path is:

```text
edge_seq{seq_id}_img{img_id}_obj{obj_id}.png
```

### Common Options

```bash
python visualize_object_contour.py \
  --seq-id 1 \
  --img-id 000000 \
  --obj-id 1 \
  --edge-thickness 3 \
  --color 255 0 0 \
  --alpha 1.0
```

Option descriptions:

- `--seq-id`: sequence ID, required
- `--img-id`: image ID, required
- `--obj-id`: object ID, required
- `--output`: output image path, optional
- `--edge-thickness`: contour line width, default is `3`
- `--color R G B`: contour color, default is red `255 0 0`
- `--alpha`: contour overlay opacity in `[0, 1]`, default is `1.0`
- `--root`: dataset root directory, default is the current directory
- `--camera`: camera intrinsic file path; if not specified, the script uses `cam_K.json` first, otherwise `cam_K.txt`
- `--occurrence`: selects which instance to visualize when the same `obj id` appears multiple times in one image, default is `0`

### Example

Green semi-transparent contour:

```bash
python visualize_object_contour.py \
  --seq-id 1 \
  --img-id 000000 \
  --obj-id 1 \
  --color 0 255 0 \
  --alpha 0.8
```