RGB |
Depth |
Camera Path (green line) |
This repository provides an interface for generating simulation image data of the gastrointestinal tract based on the simulation environment VR-Caps for capsule endoscopy. It implements a method to add the following two steps to VR-Caps for generating images. The dataset used in the paper View Synthesis of Endoscope Images by Monocular Depth Prediction and Gaussian Splatting, presented at EMBC2024, can be downloaded here.
- Creating custom camera path using Unity GUI
- Generating RGB and Depth Images along camera path
- Unity version: 2019.3.3f1
- Unity Hub
- Anaconda
- Python 3.10
https://github.com/rsagawa/EndoscopicSimDataset.gitRun VR-Caps-Unity / Assets / Scenes / Record_scene.unity.
-
Select Hierarchy Window > Capsule > Camera.
-
Check the box for Inspector Window > Camera Mover.
-
Check the box for Inspector Window > Camera Path Save.
-
Specify the file path for the CSV in Inspector Window > Camera Path Save > Save Path.
-
Click the play button (triangle icon) to enable camera movement using the mouse and keyboard:
W : Move forward
S : Move backward
A : Move left
D : Move right
Q : Move up
E : Move down
Mouse Drag : Rotate the camera freely -
Press the space key to start recording the camera path.
-
Press the space key again to stop recording the camera path.
-> The csv file will be generated at the specified save location.
-
Select Hierarchy Window > Capsule > Camera.
-
Specify the path of the CSV file in Inspector Window > Depth Save > Load Camera Pose Path.
-
Specify the path of the CSV file in Inspector Window > RGB Save > Load Camera Pose Path.
- Place multiple CSV files in VR-Caps-Unity / Assets / Resources.
- Select Hierarchy Window > Capsule > Camera.
- Set Inspector Window > Depth Save > Load Camera Pose Path to empty (leave it blank).
- Set Inspector Window > RGB Save > Load Camera Pose Path to empty (leave it blank).
-
Select Hierarchy Window > Capsule > Camera.
-
Enable the checkbox for Inspector Window > RGB Save.
-
Specify the save folder path in Inspector Window > RGB Save > Save Folder Path.

-
Press the Play button to automatically start capturing images along the camera path.
-> RGB images (.png) will be generated in the specified folder.
-
Go to Edit Tab > Project Settings > HDRP Default Settings > After Post Process and select DepthExample.
-
Select Hierarchy Window > Capsule > Camera.
-
Enable the checkbox for Inspector Window > Depth Save.
-
Specify the save folder path in Inspector Window > Depth Save > Save Folder Path.
-
Press the Play button to automatically start capturing images along the camera path.
-> Depth image data (.exr) will be generated in the specified folder.
- Install the following modules.
- numpy
- openEXR
- matplotlib
conda install numpy
conda install -c conda-forge openexr-python
pip install matplotlib-
Copy the path of the exr file.
-
Specify the copied path in the filename variable within VR-Caps-Unity/Assets/test_exr.py.
-
Run test_exr.py in the command prompt.
-> The depth shape like the one below will be displayed.

The data generated can be downloaded from the link below.
https://data.airc.aist.go.jp/cvrt/endoscopic_simulation_dataset.zip
@inproceedings{masuda2024view,
title={View Synthesis of Endoscope Images by Monocular Depth Prediction and Gaussian Splatting},
author={Masuda, Takeshi and Sagawa, Ryusuke and Furukawa, Ryo and Kawasaki, Hiroshi},
booktitle={2024 46th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC)},
pages={1--6},
year={2024},
organization={IEEE}
}










