Giter Club home page Giter Club logo

Comments (2)

fwilliams avatar fwilliams commented on September 15, 2024

Hi @raphaelsulzer unfortunately, the surface reconstruction benchmark only comes with dense point clouds for ground truth. See the ground_truth/ directory in the zip for this paper.

It would be pretty reasonable to simply mesh the very dense ground truth data and use that as a proxy for the real ground truth data. You can do that as follows with Point Cloud Utils

  1. Convert the dense ground truth files from .xyz to .ply so they're easier to manage (See code below which does this)
  2. Estimate normals for the dense point cloud. (See code below)
  3. Generate a mesh with e.g. Screened Poisson Surface Reconstruction

Estimating normals with point cloud utils:

import point_cloud_utils as pcu
import numpy as np

path_to_ply = "put your path here"
num_neighbors = 20  # Number of nearest neighbors to use for normal estimation. Tune this to control smoothness of normals
v, _, _, _ = pcu.read_ply(path_to_ply, dtype=np.float64)
n = pcu.estimate_normals(v, k=num_neighbors)
pcu.write_ply(path_to_ply[:-len(".ply")] + "-normals.ply, v, np.zeros([0, 3], dtype=np.int32), n.astype(v), np.zeros([0, 3], dtype=v.dtype))

Converting .xyz to .ply

import argparse
import numpy as np
import point_cloud_utils as pcu

def main():
    argparser = argparse.ArgumentParser()
    argparser.add_argument("xyz_path", type=str)
    args = argparser.parse_args()

    if not args.xyz_path.endswith(".xyz"):
        raise ValueError("Input file must end in .xyz")

    pts = []
    with open(args.xyz_path) as f:
        for line in f:
            pts.append([float(c) for c in line.strip().split()])

    pts = np.array(pts)
    out_path = args.xyz_path[:-len("xyz")] + "ply"
    print(out_path)
    pcu.write_ply(out_path, pts, np.zeros([0, 3], dtype=np.int32),
                  np.zeros([0, 3], dtype=pts.dtype), np.zeros([0, 3], dtype=pts.dtype))


if __name__ == "__main__":
    main()

from deep-geometric-prior.

raphaelsulzer avatar raphaelsulzer commented on September 15, 2024

Ok, I see. Thanks a lot for the explanation and the code! Great help!

from deep-geometric-prior.

Related Issues (10)

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.