Commit d2590333 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev


parent 5b866020
# Description
Generate RGB-D format image pairs from *.obj models with textures using Blender.
# Description
\ No newline at end of file
# Quickstart
~$ python3
~$ python3
# Requirements
* Blender 2.80 (need to test 2.82 - didn't work for some models)
* Python3: **numpy, matplotlib, Pillow, open3d, OpenEXR**
* Tested in Kubuntu 16.04
# Setup
## Blender
* Get Blender 2.80 (need to test 2.82 - didn't work for some models)
* Add Blender's path to your ~/.bashrc:
export PATH="/home/$USER/Downloads/blender-2.80-linux-glibc217-x86_64:$PATH"
## Python 3
* numpy, matplotlib, pillow and open3d are trivially installed
* OpenEXR
pip install openexr
If it fails this [link]( helped.
# Details
```~$ python3 [input_folder [depth_map_resolution]]```:
*input_folder* - folder with subfolders with *.obj files, default value - **input**
*depth_map_resolution* - units in the depth 16-bit *.png file, default value - **0.1**, which is 10cm allowing for **0-6553.5 m** range
What it does:
1. Makes a list of all *.obj models found in a given input folder's subfolders
2. Runs Blender feeding it with the ** and the list
3. Blender script saves results into **output/** (auto created). A single result is a rendered image of a model and the depth buffer saved into 32-bit float *.exr format
4. After Blender is done for all models ** then generates 16-bit *.png depth images with a given resolution from *.exr files. Results are also in the **output/**
~$ python3 input 0.1
```~$ python3 [path-to-image-file [path-to-depth-file]]```:
*path-to-image-file* - jpeg, defaults to **output/test_cube-image.jpeg**
*path-to-depth-file* - 16-bit png, defaults to **output/test_cube-depth-10cm.png**
What is does:
1. Opens RGB-D pair using Open3D python library. First it displays side-to-side, upon closing the first plot - it display a 3D view. 3D view is BW, didn't check if it can do in color.
~$ python3 output/test_cube-image.jpeg output/test_cube-depth-10cm.png
Can be run standalone:
```blender -b -P -- path1/model1.obj,path2/model2.obj```
# Notes
* Can have multiple models in the same subfolder
* Model names need to be unique as the output files are dumped in a single **output/** folder
* *.obj filename must match with the name inside it. See example model in **input/**
* ** running ```blender -b -P -- filelist``` - Blender runs ** using its bundled python (Python 3.7 in Blender 2.80). Could have a single script for everything but it's too much effort to install openexr to that bundled python.
# More models
Loading everything can takes some time. Once loaded there's a download button in the top-right menu.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment