Coder Social home page Coder Social logo

sunfish2010 / project6-point-cloud-registration Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 2.0 4.58 MB

Point Cloud Registration with CUDA to Substitute Original Vulkan Project

CMake 27.09% C 55.92% C++ 12.54% Cuda 3.47% Objective-C 0.84% GLSL 0.15%

project6-point-cloud-registration's Introduction

University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project6-Point-Cloud-Registration Point Cloud Registration with CUDA to Substitute Original Vulkan Project

  • Yu Sun
  • LinkedIn
  • Tested on: Windows 10 , i7-6700HQ CPU @ 2.60GHz ร— 8 , GeForce GTX 960M/PCIe/SSE2, 7.7GB Memory (Personal Laptop)

Introduction

Below is a demo run of the registration of point cloud. The source point cloud was shifted certain distance and rotated certain angle away from the original point cloud. The algorithm was able to register these two point clouds together.

The main algorithm behind the registration is Iterative Closest Point (ICP), which is a commonly known algorithm used to reconstruct point clouds from different scans. It is widely used in localization and path planning. People also do point cloud registration based on feature descriptor matching and transformation (where you have more information like color). However, for this project, that is way too complicate for me to implement so I'll possibly leave that to the final project. There are also many variants of ICP, such as how you sample the points, what distance measurement you use, do you perform outlier rejection or do you use K Nearest Neighbor or Nearest Neighbor to estimate the surface, etc. Here I just followed the algorithm described in this link with the following idea:

  • We can know the correct correspondance by iterative approach
  • Substrct center of mass from every corresponding points in the set
  • Use SVD to find the rotation and translation matrix between the two datasets
  • Converges if the starting positions are close enough

With fixed algorithm, I compared the performance using three different methods to see how much speed up we can get by leveraging the use of GPU. I implemented an exhaustive search version with cpu, a version exhaustive search version with GPU, and a KDTree based search with GPU. The performance analysis can be seen below.

Performance Analysis (Number of Points)

Here are how these three approach perform for scenes with different number of pts. To show this more explicitly, the exact numbers are also shown.

Graph Exact Number

The performance gain of using GPU is huge since exhaustive search is an O(n^2) process, and the process can be parallized very easily. Also KDTree is much faster because the tree structure reduces the number of searches needed to be done. Building the tree takes O(nlogn) with mean. However, this is a one time process, and the tree built can be used in many iterations in the algorithm.

I also analysize the performance of this algorithm with and without display. The result are shown below:

This make senses since copying the pts color to VBO becomes a bottle neck and thus it takes around the same time even with different number of points in the scene.

Issue

I tried a long time debugging for KDTree since I originally thought that KDTree should always give the exact result as exhaustive search, but due to some reason, it seems like when there are competition between distance, the tree is not able to handle it properly (non optimal closet point) so the result is not ideal as the exhaustive search. I guess that's why people also use correspondence rejection or use K Nearest Neigbhor, but I don't have the time to implement such algorithm given I only had 4 days for this project.

Citation

I used some of the previous project's code for loading and displaying point clouds, don't have time to figure out the PCL yet. Leave it to the final project. I also used open source code for svd calculation. (https://github.com/ericjang/svd3)

project6-point-cloud-registration's People

Stargazers

 avatar

Watchers

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