I want my application to understand the diagrams drawn on a paper of 3d objects like cubes, cylinders, pyramids by using image processing(openCV) and render corresponding 3d models in opengl. The following figure shows simple sketch and its corresponding 3d model. How can i recognize the objects drawn on paper as the shapes like cube,pyramid etc.. and build 3d models.Can any one explain how can i approach to solve this. is there any readily available source code or library for it.
4 Answers
No code (you'll see why), but you might be interested to read the 1963 PhD thesis of Lawrence G Roberts, titled Machine perception of three-dimensional solids, where he tackles this very problem. You can view the pdf in the first link.

- 31,741
- 15
- 75
- 115
What you're trying to do is a very, very difficult task. At least if you want this to work with arbitrary shapes.
This is for a simple reason: A computer does not work like a human's brain. Let's for example take a look at that top right picture. What do you see? A Box? Or is it some flat rectangular shape with two parallelograms attached on top and the left?
Our brain sees a 3 dimensional shape, because we live in a 3 dimensional world and the majority of things we see are 3 dimensional and our evolution led to the formation of neural structures which easily lean perception of such.
But there's an even more fundamental problem at hand: Image segmentation. You need to separate the parts of the picture into contigous regions to work on. In our brain object shape recognition, reconstruction and segmentation are interconnected and it happens in a iterative process. You've probably experienced it a number of times: You saw some shape, but at first couldn't tell what it is. And your mind was racing with a huge amount of objects and shapes that may be what you see. And then after a few moments you clearly see the shape. But not because you finally figured it out from just the picture, but because the brain augmented the sensory input with its preexisting knowledge of the world.
The task you're asking for touches not only computer vision, but also machine learning and pattern recognition.

- 159,371
- 13
- 185
- 298
I think what you want to do is this. You can write them an e-mail to get access to the source code. Good luck!

- 1,507
- 2
- 16
- 23
That is a very complex task and involves several image processing techniques to achieve the result you are looking for.
I suggest you take a look at this work first: Creating 3D models with a simple webcam

- 92,053
- 36
- 243
- 426