Terrain Construction from 2D Image
Language: C++, Middleware: OpenGL, QT
Overview of the project
Motivation
- Generate 3D terrain using same process of children's Pop-up book. Terrain designers start from 2D concept arts when they create new terrain, but creating 3D terrain from 2D image can be time a consuming work. How can we optimize this process?
Motivation
- Generate 3D terrain using same process of children's Pop-up book. Terrain designers start from 2D concept arts when they create new terrain, but creating 3D terrain from 2D image can be time a consuming work. How can we optimize this process?
Problem which I had
- 2D image and 3D geometry are in completely different perspective space. The actual height of mountain near horizon and that near camera are different even thought the number of pixels in 2D image is same. We need to find unknown perspective matrix.
Which features are included in this project
- Finding unknown perspective projection matrix which can convert 2D to 3D
- Building 3D geometry after finding actual height of each mountain
How to solve the problem
- Used matrix solver. aM = b, where M is unknown matrix, and M can be computed using inverse 'a' (M = a^-1 * b).
- Generated 3D geometry using Poisson solver.
Limitation
- It can only generate large scale of terrain so that additional post-processing for the terrain is required.
- 2D image and 3D geometry are in completely different perspective space. The actual height of mountain near horizon and that near camera are different even thought the number of pixels in 2D image is same. We need to find unknown perspective matrix.
Which features are included in this project
- Finding unknown perspective projection matrix which can convert 2D to 3D
- Building 3D geometry after finding actual height of each mountain
How to solve the problem
- Used matrix solver. aM = b, where M is unknown matrix, and M can be computed using inverse 'a' (M = a^-1 * b).
- Generated 3D geometry using Poisson solver.
Limitation
- It can only generate large scale of terrain so that additional post-processing for the terrain is required.
Detail of the Project
1. Process of construction of 3D terrain from 2D image
In order to create 3D geometry of terrain, the system follows the process below.
(1) Load the photograph
(2) Setting horizon guide line.
(3) Setting perspective
- The real distance of one pixel between in the front and near horizon are different. So we need to consider perspective and vanishing point of the photo.
- The real distance of one pixel between in the front and near horizon are different. So we need to consider perspective and vanishing point of the photo.
(4) Extracting base line of the mountain
- We need to extract mountain base to decide actual location of mountain in 3D scene.
- We need to extract mountain base to decide actual location of mountain in 3D scene.
(5) Extracting ridge lines
- This process is used to determine approximated height of each mountain in the photograph.
- This process is used to determine approximated height of each mountain in the photograph.
(6) Creation of skeletons of mountains
- Based on these location and height information, skeletons are generated.
- Based on these location and height information, skeletons are generated.
(7) Generation of terrain
- Result
2. Specification
The crux of this project is to find unknown matrix 'M' which solves pM = p'.
The crux of this project is to find unknown matrix 'M' which solves pM = p'.
Since we know the position of four corner points both in orthographic and perspective projection, we can find the matrix 'M' using inverse calculation, M = p^-1 * p.
The actual height of mountains can be computed as below using perspective matrix 'M'.
Then the system can generate the skeleton of mountain. In order to generate the entire shape of mountain, I used Poisson solver in P. Perez's paper (Poisson Image Editing).
Then the system can generate the skeleton of mountain. In order to generate the entire shape of mountain, I used Poisson solver in P. Perez's paper (Poisson Image Editing).
-More result