3d construction from 2d plane

asked 2020-08-11 04:11:16 -0600

qb gravatar image

updated 2020-08-12 03:49:53 -0600

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 image description

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.

edit retag flag offensive close merge delete

Comments

I'm looking for the ways to extrapolate this 2d plane into a 3d model.

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

also please put your image here, not on some dropbox

berak gravatar imageberak ( 2020-08-11 04:20:51 -0600 )edit

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 length and breadth, and a fixed z coordinate represent height.

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

qb gravatar imageqb ( 2020-08-11 05:20:11 -0600 )edit

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

shouldn't you rather ask the openGL folks ?

I put the image on my question.

can't see it. try again ?

berak gravatar imageberak ( 2020-08-11 05:36:51 -0600 )edit
1

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.

can't see it. try again ?

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

qb gravatar imageqb ( 2020-08-12 02:22:41 -0600 )edit
1

^^ yep.

I need to construct a 3d model based on the 2d plane

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 ?

  • do you already have a 3d model for your object ? (--> ICP registration)
  • can you use several images from varying angles ? (--> structure from motion)
  • can you use stereo cameras ? ( --> disparity / point clouds)
  • densedepth cnn (--> depth image / point cloud)
berak gravatar imageberak ( 2020-08-12 02:48:50 -0600 )edit

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

qb gravatar imageqb ( 2020-08-12 03:59:26 -0600 )edit

I think this, perhaps, is a suitable question for the openCV community.

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 ?

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.

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

berak gravatar imageberak ( 2020-08-12 05:25:44 -0600 )edit

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.

berak gravatar imageberak ( 2020-08-12 05:49:53 -0600 )edit
1

thanks @berak,

As I said, I'm new to this domain and 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.

qb gravatar imageqb ( 2020-08-13 12:43:37 -0600 )edit