Git Product home page Git Product logo

blender_kitti's Introduction

blender-kitti

License: MIT

KITTI Point Cloud KITTI Point Cloud
KITTI Point Cloud KITTI Point Cloud
KITTI Scene Flow KITTI Scene Flow

About

This repository contains some code to create large particle collections (voxel grids, point clouds) together with color information in Blender. blender-kitti has two goals in mind:

  • The created objects are exact, meaning that all particles are created at their defined location and all colors have the exact RGB-value as specified. All particles can be colored individually.
  • Performance of the scrips is acceptable. It should not take much longer than a second to create a 100k point cloud.

Together, these qualities enable blender-kitti to render large scale data from the KITTI dataset (hence the name) or related datasets.

When it comes to visualization, everyone has a different usecase. So this is not a one-fits-all solution but rather a collection of techniques that can be adapted to individual usecases.

There is example code that renders the demo images above. Use this to verify that your installation works and as a starting point for your modifications.

Installation into Blender's bundled python

# Wherever your Blender installation is located. E.g. cd /opt/blender-2.90.1-linux64/2.90/python
$ cd <blender_directory>/<blender_version>/python

# make pip available
$ ./bin/python3.Xm lib/python3.X/ensurepip

# install
$ ./bin/pip3 install -e <path_to_blender_kitti>

Render demo images

Render the bundled KITTI point cloud with semantic coloring from two different camera perspectives. This writes two image files to the /tmp folder.

$ blender --background --python-console

>>> import blender_kitti_examples
>>> blender_kitti_examples.render_kitti_point_cloud()

Render the bundled Semantic KITTI voxel grid as top view and close-up image. This writes two image files to the /tmp folder.

$ blender --background --python-console

>>> import blender_kitti_examples
>>> blender_kitti_examples.render_kitti_voxels()

Render the bundled KITTI point cloud with pseudo odometry for hsv colored scene flow from two different camera perspectives. This writes two image files to the /tmp folder.

$ blender --background --python-console

>>> import blender_kitti_examples
>>> blender_kitti_examples.render_kitti_scene_flow()

Work on a scene in Blender

You can import and use blender-kitti in the python console window in the Blender-GUI itself to work on a given scene.

# Create a random [Nx3] numpy array and add as point cloud to a scene in blender.
import bpy
import numpy as np
from blender_kitti import add_point_cloud

# create some points
points = np.random.normal(loc=0.0, scale=2.0, size=(100, 3))

# get current scene
scene = bpy.context.scene

# create point cloud object and link to scene
add_point_cloud(points=points, scene=scene, particle_radius=0.2)

Result:

KITTI Point Cloud

Ideas for future development

  • Track all created objects/meshes/images and be able to completely remove them later
  • Handle name clashes or overwrite existing objects
  • Define the rotation/scale of individual particles
  • Create a useful, small API
  • Finally be able to build Blender-bpy as module (Dockerfile)

blender_kitti's People

Contributors

baurst avatar risteon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blender_kitti's Issues

TypeError: missing a required argument: 'bpy'

Hi,
blender_kitti_examples.render_kitti_point_cloud() throws the error TypeError: missing a required argument: 'bpy'
Using exactly the same blender version (2.90.1). Something seems to wrong in the setup_scene().
Any idea how to resolve this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.