pts1
and pts2
are divided
by max(image.shape)
to scale them for numerical stability.[x1' * x1, x1' * y1, x1', y1' * x1, y1' * y1, y1', x1, y1, 1]
, building the matrix
A
.
A
gives the fundamental
matrix F
from the last singular vector reshaped to 3x3.F
is refined using
F = TT @ F @ T
to account for scaling.
F
is refined using
T.T @ F @ T
and scaled by F[2][2]
.
E = K2.T @ F @ K1
E = E / E[2][2]
-0.41524274 -8.81748894 -2.15055808 -1.3803559 0.79067134 69.08265036 -3.58890876 -68.47438701 1.
2.5298064 -0.67056178 7.33094837 -6.62032749 -3.02768466 -28.29861665 -14.50071092 26.41824781 1.
pts1
and pts2
are divided by
M
to ensure numerical stability.
[x1' * x1, x1' * y1, x1', y1' * x1, y1' * y1, y1', x1, y1, 1]
, generating the matrix
A
.
A
are reshaped to obtain two matrices, F1
and F2
.
F = a * F1 + (1 - a) * F2
is constructed, and
the determinant is expanded to form a cubic polynomial in a
.F
.F
is refined using
T.T @ F @ T
and scaled by F[2][2]
.
pts1
and pts2
.F
using
the specified method (7-point or 8-point).pts1
, calculate the
epipolar line in the second
image using F.T
and find the distance from the corresponding point in
pts2
to this line and vice-versa.
F
using only these inliers.iterations = 2000
with a
threshold_tol = 1.5
.
(a, b)
,
the matrix A
is constructed using the projection matrices P1
and
P2
with the equation:
A = [a_y * P1_3 - P1_2, P1_1 - a_x * P1_3, b_y * P2_3 - P2_2, P2_1 - b_x * P2_3]
.
A
, and
the last singular vector is the homogeneous coordinates of X
. Scale X
to make the last element = 1.
X
is extracted and stored
in Points3D
.#!/bin/bash IMAGE_DIR="hand" DATABASE_PATH="hand/database.db" SPARSE_MODEL_PATH="hand/sparse" colmap feature_extractor --database_path $DATABASE_PATH --image_path $IMAGE_DIR # Perform exhaustive feature matching colmap exhaustive_matcher --database_path $DATABASE_PATH mkdir -p $SPARSE_MODEL_PATH # Perform sparse reconstruction colmap mapper --database_path $DATABASE_PATH --image_path $IMAGE_DIR --output_path $SPARSE_MODEL_PATH
------------------------------------------------------------------------------------