Coder Social home page Coder Social logo

agent-inf / mergepositionnormals Goto Github PK

View Code? Open in Web Editor NEW

This project forked from waps101/mergepositionnormals

0.0 0.0 0.0 15 KB

Matlab implementation of Nehab et al. 2005 "Efficiently combining positions and normals for precise 3D geometry"

License: Apache License 2.0

MATLAB 100.00%

mergepositionnormals's Introduction

MergePositionNormals

In 2005, Nehab et al. proposed a very efficient method for combining either a depth map or mesh with target surface normals:

Nehab, D., Rusinkiewicz, S., Davis, J. and Ramamoorthi, R., 2005. Efficiently combining positions and normals for precise 3D geometry. ACM transactions on graphics (TOG), 24(3), pp. 536-543.

The original paper came with a C implementation but this has become more difficult to compile over the years due to required dependencies. In this repository, we provide an efficient re-implementation of the Nehab method in Matlab.

mergeDepthNormals.m

This merges a perspective depth map and surface normal map.

Inputs:

  1. Z - H x W perspective depth map
  2. NM - H x W x 3 normal map in cameras coordinates
  3. cx,cy,f - camera parameters
  4. lambda - regularisation weight, larger means Z_merged is closer to Z
  5. mask - H x W binary foreground mask (logical)

Outputs:

  1. Z_merged - H x W refined depth map
  2. mask - H x W mask (mask may need to be modified to compute finite differences)

mergeMeshNormals.m

This merges a mesh and per-vertex surface normals.

Inputs:

  1. V - nverts x 3 matrix of vertex positions
  2. F - nfaces x 3 matrix of triangle vertex indices
  3. N - nverts x 3 matrix of per-vertex surface normals
  4. lambda - regularisation weight, larger means Vnew is closer to V

Outputs:

  1. Vnew - nverts x 3 refined vertex positions

Citation

This implementation was developed for the following paper:

Ye Yu and William A. P. Smith. Depth estimation meets inverse rendering for single image novel view synthesis. In Proc. CVMP, 2019.

in which we show how to write the depth/normal merging in terms of finite difference matrices and also include the centre of projection. If you use our implementation, you may also like to cite our paper.

mergepositionnormals's People

Contributors

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