This python implementation of Sparse bundle adjustment is based on the sparse Levenberg-Marquardt algorithm with Ground Control Points (GCPs). A bundle adjustment problem arises in 3-D reconstruction, and it can be formulated as follows (taken from https://en.wikipedia.org/wiki/Bundle_adjustment):
To derive accurate 3D geospatial information from imagery, it is necessary to establish the camera's interior and exterior orientation parameters. Interior orientation parameters (IOPs), which contain internal sensor elements such as principal distance, principal point coordinates, and lens distortions, are specified through a camera calibration procedure. EOPs, which define the position and orientation of the camera at the point of exposure in a mapping frame, can be established using either Ground Control Points (GCPs) or through an Aerial triangulation (AT) process. AT is one of the most critical steps in aerial photogrammetry to estimate the Tie points Object coordinates (OC), EOPs, and IOP, which is performed with the bundle Adjustment (BA).
The basic photogrammetric principal geometry consists of three geometric entities: object space points (3D points), corresponding image points (2D points), and perspective centers. Such a geometry can be formalized with collinearity equations.
The additional parameters related to lens distortions, coordinates of the principal point (i.e., the point closest to the projection center), and sensor distortions can, in practice, be used to recover the theoretical collinearity condition between image points, camera position, and object point.
To estimate the 6 EOPs, the image coordinates are first rectifed using the calculated IOPs of the digital camera, consisting of the principal point
Finally, the camera parameters and coordinates of Tie points and are updated. In this research, the Sparse Bundle Adjustment (SBA) method was used Reduced Camera System, and Schur Complement. Because the number of equations of observations and the number of unknowns is high. As a result, the dimensions of matrix A are so large that they cannot be solved in the usual way. It can prove that the schur complement of a symmetric positive definite matrix is symmetric positive definite, thus can be solved by Cholesky decomposition. (taken from https://en.wikipedia.org/wiki/Schur_complement)
Requires Python and the installation of following packages
- numpy
- pandas
- scipy
- matplotlib
- ismember
- xmltodict
If using pip as your package manager, you only need to type the following...
pip install -r requirements
- Func : inclode Objective function, Jacobians and functions that read initial IOPs, EOPs and etc.
- SBA : inclode main code that implementation BA
It is not a package, but it is easy to use; update the data folder and run SBA.py.
-
Iteration of Algorithm (Up), Iteration of image and object coordinate residuals and the posteriori sigma zero (Phi) (down)
-
Show Rsiduals of first iteration (Up), Normal and t-student distribution on histogram of all residuals (down)
-
Show Rsiduals of Last iteration (Up), Normal and t-student distribution on histogram of all residuals (down)