Photo-realistic model with texture maps
By Thomas Dvornik
Overview
The interest for this project started with a comment about creating a model
of a building at Cal Poly with a camera that is floating by a balloon. I did not
take pictures with a floating camera, but I did do a photo-realistic model of
the Computer Science building at Cal Poly. The comment was made after a
presentation on the paper "Modeling and
Rendering Architecture from Photographs: A hybrid geometry and image based
approach." by Paul Debevec, Camillo Tylor, and Jitendra Malik. This
project uses the ideas from this paper, in a simplistic way.
Goals, Implementation, and Results
- Camera Calibration:
The accuracy of the camera calibration is
important for the overall look and accuracy of the final image. To start,
I estimated all of the camera parameters. The goal was to get the
projected textures for the model working first, then get the camera
calibration more accurate to see the improvements. I never finished the
projection in order to change the parameters. The camera in the following
image is the red ball, and the blue vector is the direction of the camera.
The next image is a view from one of the cameras.
- Model:
A simple model of the front right side of the
computer science building was created. I wanted to create a full model
but figured it was more important to get the other parts working
first.
- Manually map textures to model:
To get a textured model first, I manual mapped U, V coordinates from 3
different photos. It looks relatively well, as can be seen from the
overview image above, but I ran into some weird "bending" issues with the
textures. The "bending" was a shift in angle when being mapped, usually
resulting in a diagonal line, as seen from the next few images.
- Projective Textures:
I found an example from David Yu of SGI that
projected an image on a box. I took that example and applied it to my
model. A preview of the projection can be seen below.
Unfortunately, I ran into a lot of problems with the matrix
transforms and frustums. I finally got it to work, kinda, but too late,
so I couldn't perfect it. It ended up stretching along a wall when, I
think, it shouldn't have. An example can be seen from below.
- Corresponding edges to model:
This was just a goal, and never implemented. Once the projection was
accomplished, I was going to correlate the edges of the image to the
edges of the model.
Source Code:
You can download my souce code here,
which includes both the model example and the projective texture example.
Photos:
The photos are included in the source, but for reference, here is the photos I
used for mapping.