From 2D to 3D.Depth detection algorithm?

Started by
6 comments, last by e-u-l-o-g-y 18 years, 8 months ago
Say that I have a 2D picture(the content is irrelevant) and I want to trasnfer its content to 3D space. Is there a known algorithm that can decide whether a pixel on an image is "higher" than one other? Any help whould be appreciated :).
-----------------------------Dev.Enviroment:VS 2005 Language:C#GfxLib:DirectX(preferably),OpenGL.Ability:Damn Noob!
Advertisement
If you mean making the picture a 3D surface with depth as well as width and height, there isn't just one simple algorithm that solves your problem. If you could post an example picture (I know you said the content is irrelevant, but for a problem like this it isn't) and an idea of what you'd like it to do perhaps someone could give you a little bit more guidance.
First of all thanks for the reply.

The content should be irrelevant but I will become more specific.
I want to depict human faces from pictures to 3D space.

I've googled a little and found that the name of the problem I'm addressing is
"Stereo Vision".

Here is a link with what I'd like to do.
http://axon.physik.uni-bremen.de/research/stereo/vrml/index.html

The problem is that this algorithm requires 2 pictures, each from one eye perception (left eye,right eye). I need to do this with one and only picture.

The truth is that I dont need an exact estimation. A rough one should fit me fine because I want to use it as an initial.
The rest of the process is to be interactive and the user will finish the refinement.
-----------------------------Dev.Enviroment:VS 2005 Language:C#GfxLib:DirectX(preferably),OpenGL.Ability:Damn Noob!
With a single picture, you basicly have nothing to go on. There is lighting, but it's pretty much imposible to discern change in lighting from change in material. If you had a front view and a side view you might have a chance, but even then it takes some pretty clever algorithms.
___________________________________________________David OlsenIf I've helped you, please vote for PigeonGrape!
With only one picture and no user interaction this will be quite difficult. All algorithms I've seen, work either with 2+ images and/or need some kind of user interaction (to mark outlines etc.).
my-eulogy - A blog about coding and gfxsdgi - Semi-Daily Game IdeaChunkyHacker - Viewer for Relic chunky formats (used in DOW)
if you need per pixel depth values, then you have no chance to get what you want from just one picture, there are methods based on stereo, focus, additional lightsources, moire effects, etc. for that, but they all need 2+ pictures.
In some cases you can get Hardware cameras that do it for you (i dont know how these cameras work but they give you depthvalues).
Additionally to this pure optical methods you can get laser scanners, radars, MRIs etc. which use echo-time-measurements (if you know how a radar works, you know how a laser scanner works, the difference is that a radar/MRI can look through objects). Dunno about MRI exactly, but it could work a bit different like SAR or something like that...

In case of faces you can use a different approach. That is you have already a face model and you try to get it mapped onto the face in the image. That can be done by finding some relevant points like eye,nose,mouth,ear positions on the 2d image and then mapping your 3d model onto these points so that they 'fit best'/have a minimal energy. The idea behind that is to 'render' your 3d model into 2d and compare the point positions, then minimize the distance between them, by modifiyng the rotation/translation/scale of the 3d face, and render again until you are satisfied with the result (automatically that means minimum is less than a specified value or hasnt changed since the last iteration). This algorithm can cause some problems depending on your minimizing mechanism. For example you could try to find the next best minimum and it can happen that this 'local' minimum is suboptimal...
finding eyes and other parts of the face could be a bit tricky, but ive seen it working, not only in movies where people like to think of computers as the answer to everything, and randomly clicking on the keyboard makes impossible things possible :)


T2k
T2K

Such a method requires advanced Maths(Least Squares,linear systems with more solutions than unknowns etc) and I also encountered problems with rotation parameters, during the projection transformation.
I've read a paper about it and tried to follow it in vain.

No.
What I build, is an Interactive program to create a face from a "plane" of points which correspond directly to an image.
I just wanted to have some initial estimation (however rough) and not start from a flat set of points.

Anyway, I've heard what I wanted to hear.
I thank you all :)
-----------------------------Dev.Enviroment:VS 2005 Language:C#GfxLib:DirectX(preferably),OpenGL.Ability:Damn Noob!
For anyone interested, I've just found this:
http://www.cs.cmu.edu/~dhoiem/projects/popup/

It's about as close as one gets with only one image
my-eulogy - A blog about coding and gfxsdgi - Semi-Daily Game IdeaChunkyHacker - Viewer for Relic chunky formats (used in DOW)

This topic is closed to new replies.

Advertisement