View Full Version : Creating mesh from point cloud

07-15-2014, 07:18 AM
Hi all,

I've got a project which involves 3D reconstruction of point clouds from a 3D scanner. Being relatively new to computer vision i am in the dark. I need to implement this 3D reconstruction in c++. I plotted the coordiated i recieved from the 3D scanner and i got a point cloud, a picture of which is attached.

Agent D
07-15-2014, 10:30 AM
First of all, I don't see how this is related to OpenGL(R) at all, and I have no knowledege of the subject, here are some suggestions how I would approach the task:

a) Search for it online (https://www.google.at/search?q=point+cloud+triangulation)

b) Here's an intuitive aproach I though up on the train ride home (i.e. I don't guarantee for this to actually work):

Compute the AABB from the point samples
Generate an octree from the point samples

if there are no points left, stop octree subdivision
if the octree node edge length reaches a certain threshold, stop octree subdvision and average the remaining points inside the node (that way you could some how controll the resolution of the mesh)

At this point, you have an octree where each leave contains either zero points or exactely one point
For each node:

If it is a leave node and it contains a point, label it filled, otherwise label it empty
If it is a non leave node and contains at least one filled child, label it filled, otherwise label it empty

For each non empty leave node:

Generate a triangle fan from the point sample as first vertex and all surounding non-empty leave nodes
Store node pointers instead of vertex positions as integers are easier to compare for equality than float touples
Append every triangle of the fan individually to a triangle list

For each triangle in the list

For each vertex

If the vertex has not been encountered before, append it's coordinates to the final vertex buffer and append the index of the top of the vertex list to the final index buffer
If a vertex has been encountered before, only append the index of the existing vetex position to the index buffer