Input:
```python
import numpy as np
r4 = lambda a: (np.round(np.asarray(a, dtype=float), 4) + 0.0).tolist()
def rot(ax, ay, az):
cx, sx, cy, sy, cz, sz = np.cos(ax), np.sin(ax), np.cos(ay), np.sin(ay), np.cos(az), np.sin(az)
Rx = np.array([[1, 0, 0], [0, cx, -sx], [0, sx, cx]])
Ry = np.array([[cy, 0, sy], [0, 1, 0], [-sy, 0, cy]])
Rz = np.array([[cz, -sz, 0], [sz, cz, 0], [0, 0, 1]])
return Rz @ Ry @ Rx
K = np.array([[700.0, 0.0, 320.0], [0.0, 700.0, 240.0], [0.0, 0.0, 1.0]])
P1 = K @ np.hstack([np.eye(3), np.zeros((3, 1))])
R2 = rot(0.05, -0.2, 0.03)
P2 = K @ np.hstack([R2, np.array([[-1.0], [0.1], [0.2]])])
def proj(P, X):
q = np.hstack([X, np.ones((len(X), 1))]) @ P.T
return q[:, :2] / q[:, 2:]
rng = np.random.default_rng(0)
Xt = np.column_stack([rng.uniform(-2, 2, 12), rng.uniform(-1.5, 1.5, 12), rng.uniform(4, 9, 12)])
x1, x2 = proj(P1, Xt), proj(P2, Xt)
F = fundamental_8point(x1, x2)
print([r4(F * 1000.0), r4(epipolar_distances(F, x1, x2)), r4(np.linalg.svd(F, compute_uv=False))])
```Output:
[[[0.0002, -0.0028, 1.7076], [0.0057, 0.0006, 7.5091], [-2.7117, -9.2632, 999.9238]], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [1.0, 0.0001, 0.0]]