camera.camera — CV Camera Functions¶
The camera.camera module provides methods for working with
idealized cameras and look vector intersections.
New in version 0.1.0.
- autocnet.camera.camera.camera_from_f(F)[source]¶
Estimate a camera matrix using a fundamental matrix.
- Parameters
f (ndarray) – (3,3) fundamental matrix or autocnet Fundamental Matrix object
- Returns
p1 – Estimated camera matrix
- Return type
ndarray
- autocnet.camera.camera.compute_epipoles(f)[source]¶
Compute the epipole and epipolar prime
- Parameters
f (ndarray) – (3,3) fundamental matrix or autocnet Fundamental Matrix object
- Returns
e (ndarray) – (3,1) epipole
e1 (ndarray) – (3,3) epipolar prime matrix
- autocnet.camera.camera.idealized_camera()[source]¶
Create an idealized camera transformation matrix
- Returns
(3,4) with diagonal 1
- Return type
ndarray
- autocnet.camera.camera.projection_error(p1, p, pt, pt1)[source]¶
Based on Hartley and Zisserman p.285 this function triangulates image correspondences and computes the reprojection error by back-projecting the points into the image.
This is the classic cost function (minimization problem) into the gold standard method for fundamental matrix estimation.
- Parameters
p1 (ndarray) – (3,4) camera matrix
p (ndarray) – (3,4) idealized camera matrix in the form np.eye(3,4)
pt (dataframe or ndarray) – of homogeneous coordinates in the form (x_{i}, y_{i}, 1)
pt1 (dataframe or ndarray) – of homogeneous coordinates in the form (x_{i}, y_{i}, 1)
- Returns
reproj_error – (n, 1) vector of reprojection errors
- Return type
ndarray
- autocnet.camera.camera.triangulate(pt, pt1, p, p1)[source]¶
Given two sets of homogeneous coordinates and two camera matrices, triangulate the 3D coordinates. The image correspondences are assumed to be implicitly ordered.
References
- Parameters
pt (ndarray) – (n, 3) array of homogeneous correspondences
pt1 (ndarray) – (n, 3) array of homogeneous correspondences
p (ndarray) – (3, 4) camera matrix
p1 (ndarray) – (3, 4) camera matrix
- Returns
coords – (4, n) projection matrix
- Return type
ndarray