Sign in to follow this  
rezuan

Generating 3D image from 2D image file

Recommended Posts

rezuan    122
this is actually my final year project, I'm required to get the above application up and running using Visual C and OpenGL. Being a novice with at both, this will be a tough project for me. Fortunately this website with its toturials have been a great help for me. The application is suppose to be able to generate a 3D view of a 2D image file (like an ID card photo). Can someone gives me a hint or two on how to do this. Or suggest me topics that i should research on. Thanks.

Share this post


Link to post
Share on other sites
Metus    168
I tried to implement this.. "effect" in a game-project a couple of weeks ago, and the basics are really simple:
scan through every pixel of the image, and create a quad with the dimension of 1*1 for every corresponding pixel and it's color. Then traslate each of these quads 100's of units away from the camera an voila.

Share this post


Link to post
Share on other sites
stein    164
Doesn't that just give you a smaller - and still 2d - image?

I thought this would require edge-detection and the like, to extract a scene-perspective... And then detect objects in the picture, given this perspective. Or something like that, anyway :)

[Edited by - stein on November 8, 2004 3:14:09 AM]

Share this post


Link to post
Share on other sites
hoLogramm    170
I think he needs just a 3d view :-).

Making the content of an image 3d is not possible only with 1 image. Maybe fake 3d when you convert the image in grayscale and apply the method of displacement as with heightmapping or calculate surface normals on every pixel and use it for lighting calculations like relief texturing or bumpmapping does.

but i would recommend that you follow the tutorials from nehe.gamedev.net or www.gametutorials.com.
They have very good texturing tutorials.

Share this post


Link to post
Share on other sites
Enigma    1410
This is the well-known (and very difficult) Shape from Shading problem. Googling that term will give you some information on the issue, but probably not a great deal. I have the basics written down somewhere. I'll try and find them and post them for you later.

Enigma

Share this post


Link to post
Share on other sites
T2k    220
shape from shading wont work with only one picture, its based on a displaced lightsource (2 times), so that you have to use at least 3 images (each with a different position of the lightsource taken) and then do some math...

i would recommend 3d-stereo-triangulation method, you only need one camera that takes 2 pictures of the same scene at different positions, and its easier than shape from shading imho, you could also do some sort of light-line-scanner which needs special hardware and so on...

search for 'computer vision' and you should find enough information on this topic


T2k

Share this post


Link to post
Share on other sites
Enigma    1410
The classic Shape from Shading research is not based on displaced lightsources, but on recovering shape information from a single image by solving the Image Irradiance Equation, usually assuming known lightsources.

Enigma

Share this post


Link to post
Share on other sites
kiteflight    122
Extracting 3D info from 2D pics is a tough problem. I've worked on a related problem of generating interpolated camera views of a scene. I used edge detection and matching - it worked OK. You can see the results here (staring my big Lab). Generated 40 interpolated virtual cameras from 3 real ones.

http://www.flysim.com/data/cossmall.avi

-J.R.

Share this post


Link to post
Share on other sites
rezuan    122
thanks for all the tips you all. i'll do more research on them. i've checked JR's cossmall.avi.. its a great piece.

i'm still new so i'm going to ask this silly question :) i've seen many samples on 3D terrain creation, is it near to what i'm supposed to do ?

i advance my millions of thanks everybody. tq.

Share this post


Link to post
Share on other sites
What kind of quality do you need and how many angles of the same picture do you get?

If you only get one angle, and quality isn't extremely important, it would be easy enough to map a person's ID to a 3d head. As far as heads go, you can assume an average shape and size that you would just paste the image on. The nose would be kind of a lump, not really defined, and you'd stretch the edge of the picture so that it curves correctly around the face.

If you get multiple angles, like the front and sides, you can use the same "average" head but paste the seperate images onto portions of the head. Where the images meet, you'd use a little alpha blending or line matching to get things to look right. The good thing about multiple angles is that you could get the outline of the head just right using the side view. If you can find the outline of the nose, then you have a good idea of where the eyes are and the whole thing kinda falls together.

Share this post


Link to post
Share on other sites
rezuan    122
the requirement is for me to demonstrate the understanding of projecting 3D image from 2D image by showing it in the method that i choose in projecting the 3D image.

the quality of the image wud be a plus point for me :P

tq.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this