Search
This homework is split into two weeks.
[N1 N2 N3] = p3p_distances( d12, d23, d31, c12, c23, c31 )
Create the function p3p_distances for computing distances of three spatial points from a calibrated camera centre. The function must return the distances η_i in N1, N2, N3 of the three points. Implement only the case 'A' of the computation. If there are more solutions, the returned variables are row vectors. If there is no solution by the case 'A', return empty matrices ([]]).
p3p_distances
N1
N2
N3
[]
The function should return only such solutions, that are consistent with input arguments, i.e., that pass verification using cosine law (see below). Use (relative) threshold 1e-4.
e = p3p_dverify( N1, N2, N3, d12, d23, d31, c12, c23, c31 )
Create the function p3p_dverify for verification of computed camera-to-point distances using the cosine law. Use this function in p3p_distances. The function returns vector of three errors, one for each equation. Each computed error should be distance (not squared), relative to particular <latex>d_{jk}</latex>, i.e.
p3p_dverify
<latex>e(1) = \frac{\sqrt{\eta_1^2 + \eta_2^2 - 2\eta_1\eta_2c_{12}} - d_{12}}{d_{12}}</latex>
See the skeletons of the functions in the Tools repository for description of arguments. For constructing the fourth order polynomial, there is the p3p_polynom function in the repository.
p3p_polynom
[R C] = p3p_RC( N, u, X, K )
Create the function p3p_RC for computing calibrated camera centre C and orientation R from three scene-to-image correspondences (X,u), using already computed distances N = [η_1 η_2 η_3].
p3p_RC
C
R
X
u
N
The function takes one configuration of η_i and returns a single R and C. Note that R must be orthonormal with determinant equal to +1.
See the skeletons of the function in the Tools repository for description of arguments.
04_distances.pdf
Note: The matrix Q obtained in HW-02 is not related to this task and is not used in any way.
P
point_sel
04_p3p.mat
save( '04_p3p.mat', 'R', 'C', 'point_sel', '-v6' )
daliborka_01
x
04_RC_projections_errors.pdf.
04_RC_maxerr.pdf
04_RC_pointerr.pdf
04_scene.pdf
Note: Use your p3p_distances.m and plot_csystem.m from previous HW.
p3p_distances.m
plot_csystem.m
Note: The matrix P obtained in HW02 is not related to this task and is not used in any way.
Upload two archives containing the following files.
The first part (04a):
p3p_dverify.m
hw04a.m
The second part (04b):
p3p_RC.m
04_RC_projections_errors.pdf
any other your files required by hw04b.m (including data and files from the repository).
Note: The required files must be in the root directory of the archive.