The aim of this project was to convert set of object (mostly building) photos to 3D model. This photos should be marked by user.
Program implements algorithms of so called multiple view geometry. It is computer science discipline dealing with relation between object views on multiple photos. MVG methods allow to restore real-world coordinates of some point by it’s position on two (or,better, more) photos.
Most of material is taken from the MVG bible “Multiple View Geometry in Computer Vision, Second Edition” by Richard Hartley and Andrew Zisserman.
The only invention I did myself is camera matrix parametrization by vanishing point scales. It is based on fact that if three VPs of pairwice orthogonal directions are given, then camera matrix can be found as
To obtain multipliers Ai, we use another fact: is skew-symmetric. Then, if we have fundamental matrices between three images, its enough to find Ai for these matrices.
- Find initial view triple
- Using point correspondence and VPs, estimate camera matrices and world points
- Adjust parameters of matrices and world points
- while new view with 8 pts exists
- Estimate camera matrix parameters from already found points and VPs
- Adjust all found points and cameras
- Adjust all points and cameras
First, we choose three images i1,i2,i3 with the largest number of common points.
Then, camera matrices are obtained as
P1 = (VP1 0)
P2 = (VP2diag(p2) e12)
P3 = (VP3diag(p3) e13)
where p2 and p3