Take the 2-minute tour ×

I've got a project which involves 3D reconstruction if point clouds from a 3D scanner. Being relatively new to the computer vision field I'm in the dark. The objective of the project is to implement this 3D reconstruction in C/C++ without using Matlab so that it can be further integrated with the ROS (for robots).

Can anyone guide me with this issue so that I get enough idea regarding how to approach the problem?

share|improve this question
This isn't worth an answer, but there are examples of 3D point clouds rendering using CUDA and OpenGL in CUDA's SDK examples. –  kaoD Aug 16 '12 at 4:26
add comment

4 Answers

A point cloud is nothing but a bunch of x,y,z coordinates in 3D space. First figure out what is the representation of the points coming from the scanner. Is it cartesian or do you have to convert it to cartesian etc.?

After than all you have to do is 'read in the file' (using file I/O) in C/C++ and parse the file (which is probably line by line) and call the following code:

//structure or class to store the vertex coordinates
struct {
float x, y, z;
} Vertex;

for(int i=0; i<fileLength; i++)
   Vertex v = getNextVertex(); //custom define a function like this that loads a Vertex
   glVertex3f(v.x, v.y, v.z);

This is the highlevel workflow. You'll probably be using glOrtho or define your own projection using a perspective view (See this post for details). Once you load the file you should see the point cloud. You could always set a point size using glPointSize - I suggest reading up on OpenGL. What you ask is relatively straightforward IMHO assuming I am understanding your need correctly.

If the file is too large and memory is not a constraint it's okay to read the whole thing in memory but you may want to look at doing a buffered read by only reading in a few lines/bytes at a time if it's a problem.

Hope this helps.

share|improve this answer
add comment

First step is to get some goal of what you want to do with this data. (As in: What is your input and what is the output - not in vague terms like "reconstruction", but in someting deliverable, like "surface vectors every 10 px".

But you can start to set up a framework to read it, clean it up (3D-input devices often produce spikes,..) and visualize it in 3D. You would do well with using OpenGL for visualization, but for a quick hack I often just use Processing with the Peasycam library (like 20 lines of code or so, it's dead easy). Visual data really helps you to understand how your code affects the data.

Also, image processing is huge on sample data. You need to understand more about your problem to identify what could be representative (and you'll never find all the edge cases, trust me), but you could start a small collection of that.

Play around with http://pointclouds.org/, which is a really good lib for Point Clouds. They have a good set of tutorials here: http://pointclouds.org/documentation/tutorials/ - might save you some time.

share|improve this answer
add comment

3D reconstruction from point clouds is field of scientific research, and it is not a simple topic. It involves a lot more mathematics than a typical answer here on "programmers" can provide you with. To find research papers about that topic, google for "point cloud reverse engineering".

Said that, if you don't have any experts of that field in your organization, and if you don't want to invest weeks or months to become one by yourself, then IMHO the best option is trying to find some tools or libraries provided by third party vendors which suit your needs. I won't suggest any libs to you, but you will find some by googling for the same keywords I told you above.

share|improve this answer
add comment

You have a bunch of points. What do you want to do with them? Is the robot going to navigate a maze? Is it facial recognition? Is it an automated Where's-Waldo finder?

Does the input come in real-time like human vision? Must it be processed in real-time? Is it just a snap shot where you can sit back and let it churn through your idealized algorithm?

You may end up with dramatically different designs depending on what it is you expect to do with your points.

My advice would be to try the bottom-up design style. Write little modules that do something useful with the points. In effect you'll be creating a library. While you are creating these helper modules you'll gain a better understanding of the problem and can start to mix in a top-down design.

share|improve this answer
add comment

Your Answer


