# 3d construction from 2d plane

Hey all,

I need your advice on the work I'm doing now. I need to construct a 3d model based on the 2d plane. Over the plane, I have identified reasonable numbers of (x,y) coordinates of each corner the 2d plane has. Let say, if I have a fixed number for my z coordinate that makes all (x,y) coordinates have the same z coordinate, I'm looking for the ways to extrapolate this 2d plane into a 3d model.

My first approach is to first figure out how each (x,y) coordinates are connected to each other to represent the border of the 3d model. However, I'm not sure how to do it yet. After that, expand/extrapolate the z coordinate and connect all the coordinates to represent the 3d model.

Or is there a feature that allows me to build it instantly? The sample of my 2d plane with (x,y) coordinates can be seen in

I'm quite new with OpenCV and I write my code with python. So please forgive me if the question is trivial for some of you.

Thanks a lot for your advice.

what do you mean, exactly here ? please explain ! would delauny triangulation help ?

also please put your image here, not on some dropbox

Thanks @berak. I put the image on my question.

By extrapolating, I mean I want to expand the 2d plane into a 3d space model. I would imagine that my x and y coordinates represent

lengthandbreadth, and a fixed z coordinate representheight.As you can see I have all the (x,y) coordinates by using goodFeaturesToTrack(). But I lost the information of which (x,y) coordinates connected to which (x,y) coordinates; hence I can't create a border that represent my 2d original plane before I expand the 3d space model with the z coordinates.

Finally, I'm looking at the visualization of the 3d space model if I know all the (x,y,z) coordinates and how they are connected to each other.

I hope I explain this clearer and looking forward for any advice.

Thanks

im wondering, why you want to do this with opencv, a mostly 2d computer-vision library

shouldn't you rather ask the openGL folks ?

can't see it. try again ?

Thanks @berak,

The 2D plane initially from an object in an image, which I've managed to extract its outer contours and corners. I was thinking perhaps there are techniques that I can use from OpencV library to allow me further with constructing the 3D space model of the object in my 2D plane.

It's strange, I thought I have edited my post by uploading the picture. I try it again, and hopefully, you can see it now.

Thanks a lot @berak

^^ yep.

super-hard problem, if not impossible, from a single image, unfortunately. and you'll need to do a lot of research before trying to code anything

can you show us the original image ?

Thanks @berak,

I was thinking (maybe too simple) that may be just replicate all 7 coordinates I have on the 2D plane and put a fixed z coordinate (e.g. 10) for them. For instance, A' will be (xa,ya,10), B' will be (xb,yb,10), etc. Then I will connect A to A' with an edge, B to B' with an edge, etc. Then visualize them (perhaps with OpenGL if OpenCV library doesn't have instance function to allow me to do it).

I think my problem now is how can I connect A to B to C, etc that represents the purple shape I have on that image. I think this, perhaps, is a suitable question for the openCV community.

Thanks

it's a question for YOU in the 1st place. and you MUST do research, but haven't and instead try to hack it and then ask around. and btw, there exist 3d meshing algorithms like "marching cubes", and voronoi how comes you don't know ?

yea, so you still get a 2d model with 3d coords (just connecting abcdefg would be a valid polygon. but that's useless, no ?)

getting a good estimation for z is the hard part here, and you need "larger cannons" for this

your problem also suffers from occlusion. not all object corner points are visible, and like it is now you'll never know which vertices you see exactly.

thanks @berak,

As I said, I'm new to this domainand was asking for the advice that lead to my research of particular scope that will address my problem. I'll look at some advice that you mentioned, which obviously I didn't know before you mentioned them.