Coder Social home page Coder Social logo

njnf66 / 3d-point-cloud-curve-extraction-and-optimization Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maggielovedd/3d-point-cloud-curve-extraction-and-optimization

1.0 0.0 0.0 15.78 MB

Point cloud optimization

Home Page: https://youtu.be/tMISwyArxd0

License: MIT License

Python 100.00%

3d-point-cloud-curve-extraction-and-optimization's Introduction

3D Point Cloud Curve Extraction and Optimization

3D Point Cloud Curve Extraction and Optimization is designed to derive a representative curve or center line from a noisy 3D point cloud, specifically for point clouds with discernible geometric patterns.

Description

Given a noisy point cloud with an inherent structure or shape, this tool identifies and traces a continuous curve that encapsulates the essence of the shape. It synthesizes 3D point clouds based on predefined shapes, simulates noise to mimic real-world scenarios, thins out the point cloud to emphasize its core structure, ensures the curve's continuity, and uses Bayesian optimization to find the best parameters for curve extraction.

  • blue: sample 3d point cloud
  • orange: thinned points
  • green: sorted points

Key Features

  • Synthetic Point Cloud Generation: Generate 3D point clouds based on various predefined shapes.
  • Noise Simulation: Introduce synthetic noise to the generated points.
  • Curve Thinning: Thin out the point cloud to capture the central line.
  • Curve Sorting: Maintain a logical and continuous order in the extracted curve.
  • Parameter Optimization: Utilize Bayesian optimization to determine optimal parameters.
  • Visualization: Provide real-time and post-process visualization of the point clouds and extracted curves.

Key Parameters

The curve extraction process heavily relies on the optimization of three crucial parameters. Their appropriate setting can significantly influence the accuracy and quality of the extracted curve from the noisy point cloud.

Parameter Description Effect when Value Increases Effect when Value Decreases
point_cloud_thickness Defines the radius around each point to identify its local neighborhood, determining the thickness of the cloud under consideration. Considers more neighboring points. Might lead to capturing more noise and affecting the accuracy of the localized regression line. Focuses on a narrower set of points. Could potentially miss crucial data if set too low, but will be more resistant to noise.
sorted_point_distance Anticipated distance between subsequent points in the extracted curve. Results in a curve with larger gaps between its points, potentially missing finer details. Produces a denser curve with closely spaced points, capturing more details but can be influenced more by noise.
search_ratio Modulates the search distance for neighboring points, specified as a ratio of the sorted_point_distance. Expands the search area for neighbors, potentially incorporating unrelated or noisy points into the curve. Restricts the search area, focusing more on immediate neighbors but might miss essential curve structures.

These parameters are intricately fine-tuned through Bayesian optimization to generate an extracted curve that is both faithful to the intrinsic shape in the point cloud and resilient against the inherent noise and anomalies.

Optimization

Objective Function

The objective function evaluates the quality of the processed point cloud based on several criteria. It calculates the objective value based on:

  1. Total length of the sorted points.
  2. Penalty for discontinuities in the sorted points.
  3. Reward based on the number of points in the sorted set.
Component Description Calculation
Total Length Sum of distances between consecutive sorted points. sum(distance.euclidean(sorted_points[i], sorted_points[i+1]) for i in range(len(sorted_points)-1))
Penalty Penalizes discontinuities between consecutive sorted points. penalty_factor * sum(abs(distance.euclidean(sorted_points[i], sorted_points[i+1]) - avg_distance) for i in range(len(sorted_points)-1))
Reward Rewards based on the number of sorted points. len(sorted_points) * reward_factor

The final objective value is a combination of the total length, penalty, and reward:
objective_value = -total_length + penalty - reward

Limitation

This code is primarily designed for open geometric patterns. It is not optimized for closed-loop or partially closed-loop geometries such as circles and mobius. Sorted point sometimes didn't order properly at where the sample points are thick and some part of the geometry close to others.

Getting Started

Prerequisites

To run the script, ensure you have the following libraries installed:

  • numpy
  • matplotlib
  • mpl_toolkits
  • scipy
  • sklearn
  • vg
  • skopt
  • signal

Installation

git clone https://github.com/maggielovedd/3D-Point-Cloud-Curve-Extraction-and-Optimization.git

Contributing

Contributions are welcome!

License

This project is licensed under the MIT License. See LICENSE for more details.

Acknowledgements

The method is developed based on 3D Point Cloud Curve Extraction.

3d-point-cloud-curve-extraction-and-optimization's People

Contributors

maggielovedd avatar

Stargazers

 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.