In this activity, we explore how stereometry works. We try to reconstruct a 3D object using 2 images of taken by the same camera at the same distance z from the object but with a different x position (assuming x is the parallel axis between the camera and the object).
The camera used was first calibrated to get its internal parameter f (focal length). From the a's calculated using Activity 11 – Camera Calibration, matrix A is formed by recasting the a's. We then get the values of matrix A(1:3,1:3) and factorize this using RQ factorization, to get upper diagonal matrix K. (Note: Ensure that the factorized A(3,3) element is 1 by dividing the matrix by K(3,3)). The K-matrix obtained is shown below.
Knowing that K is just
and
we now have a value for focal length f (let kx=1);
We then get z values (using the equation 1) for different points on the object (purple dots).
Reconstruction was done using Matlab's griddata instead of SciLab's splin2d because of the latter's initial requirement of increasing values for both x and y image coordinates. Matlab's griddata function, however, works well for random values of x and y image coordinates.
Reconstruction of the rubik's cube is shown below.
we now have a value for focal length f (let kx=1);
We then get z values (using the equation 1) for different points on the object (purple dots).
Reconstruction was done using Matlab's griddata instead of SciLab's splin2d because of the latter's initial requirement of increasing values for both x and y image coordinates. Matlab's griddata function, however, works well for random values of x and y image coordinates.
Reconstruction of the rubik's cube is shown below.
It may not seem obvious but the reconstruction obtained the general height difference of the points selected. The edges are not defined but it somehow approximates the shape of the rubik's cube.
---
Thanks Cole for helping me with the images and JC for the discussions with regards to reconstruction.
---
Rating 6/10 since
1. reconstruction is not that good
2. I used Matlab in reconstruction rather than SciLab
3. I posted this blog very late.
---
Thanks Cole for helping me with the images and JC for the discussions with regards to reconstruction.
---
Rating 6/10 since
1. reconstruction is not that good
2. I used Matlab in reconstruction rather than SciLab
3. I posted this blog very late.
No comments:
Post a Comment