Code Monkey home page Code Monkey logo

depthtonormal's Introduction

Depth To Normal

Python code used to transform depth map to normal map using point cloud as intermediate representation

Compilation

This repo uses the code from "Fast and robust normal estimation for point clouds with sharp features" by Alexandre Boulch and Renaud Marlet to estimate the normal map from point clouds.

python wrapper

Using the library with Python requires building the wrapper. This works fine with g++ 5.4.0 on Ubuntu 16.04 with Anaconda.

cd python
python setup.py install --home="."

python test

python example.py

The script creates a point cloud on a cube and estimate the normals. It produces a .xyz containing both points and normals, it can be displayed using Meshlab.

Usage

Our usage is based on the dataset providing accurate RGB-D image pairs such as iBims-1

First, use depth_to_pointcloud.py to generate point clouds from depth maps.

  • the default format for depth map is in uint16

  • some pixels in depth map is labeled as 0 as a result of invalid depth estimation

  • the generated point cloud is of format [x, y, z] in meters

Then, use pointcloud_to_normal.py to generate normal maps from point clouds.

  • here we provide also a function to generate point to point depth map from plane to plane depth map

  • the normal_xyz output saves the point cloud with normal map in .xyz file of format [x, y, z, n_x, n_y, n_z]

  • the normal_img output saves the normal map in .png file with RGB values corresponding to normal vectors

License

See here for the original license.

depthtonormal's People

Contributors

youngxiao13 avatar

Watchers

 avatar

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.