COMP5421 / Project 3 / Single View Modeling

Overview

In this project we create 3D texture-mapped models from a single image using the single view modeling method discussed in class.
We build 3D models from both painting and real world image, with each model contains at least 10 text features. view3dscene is utilized to visualize the VRML model.

The whole program mainly consists of the following steps.

  1. Load Image.
  2. Choose parallel lines and calculate vanishing points.
  3. Choose reference points to calculate transformation matrix.
  4. Compute textures and 3D positions.
  5. Create VRML model.

Calculate Vanishing Point

Bob collins' algorithm is used to compute vanishing points.
For example, to compute the vanishing point x, we first select a group of lines that are all parallel to the x axis and compute the following "second moment" matrix M

Finally, apply singular value decomposition to M, and the eigenvector associated with the smallest eigenvalue is the vanishing point vector V.

Select Reference Point

After choosing the origin point, it is essential to choose the proper reference points and set the scalar, which will directly affect the computation of transformation matrix.
By default, we choose three reference points respectively from x, y and z axis that are pre-defined by the user, and input appropriate scalars.
If the real scalar(dimension) is not accessible, a oil painting, for example. We can simply treat all axis as unit dimension.

Measuring Height

To calculate the height of a certain object in the image, we utilize the following equation.

The most important part is to obtain the position of b, where line br is perpendicular to the Hxy plane. Here we project b to both x and y axis to find its coordinate in the 3d scene.

Image Warping

After getting all desird transformation matrix, it is time to do the image tranformation. imwarp is used to do so.

Hxy Hyz Hxz
Then we can use the intelligent scissor from project1 to cut the region of interest and get corresponding texture.

Artifact: Painting

We have implemented our algorithm to a Second Pompeian Style Roman wall painting, where 10 textures are obtained and displayed in below.
Front wall, left wall, right wall, floor, desk frontface, desk topface, chair frontface, chair topface and two arch-like ceilings.

Artifact Source Image

However, the scales of the object is misinterpreted due to lack of measurement in the real scene.

Artifact: Office

We have tested the program on a photo shot in a laboratory, where 10 textures are obtained and displayed in below.
Three cases and one barrier on the right, front door and wall, two left curtains and ceiling.

Artifact Source Image

Since we have roughly measured the dimensions of the objects in the real world scene, this artifact is more vivid.

The END