CentralCamera.project_quadric#

CentralCamera.project_quadric(Q: ndarray) ndarray[source]#

Project 3D quadric to image plane

Parameters:

Q (ndarray(4,4)) – quadric matrix

Returns:

image plane conic

Return type:

ndarray(3,3)

Quadrics, short for quadratic surfaces, are a rich family of 3-dimensional surfaces. There are 17 standard types including spheres, ellipsoids, hyper- boloids, paraboloids, cylinders and cones all described by points \(\vec{x} \in \mathbb{P}^3\) such that

\[\hvec{x}^{\top} \mat{Q} \hvec{x} = 0\]

The outline of the quadric is projected to a conic section on the image plane

\[c^* = \mat{C} \mat{Q}^* \mat{C}^{\top}\]

where \((\mat{X})^* = det(\mat{X}) \mat{X}^{-1}\) is the adjugate operator.

Example:

>>> from machinevisiontoolbox import CentralCamera
>>> from spatialmath import SE3
>>> T_cam = SE3.Trans(0.2, 0.1, -5) * SE3.Rx(0.2)
>>> Q = np.diag([1, 1, 1, -1])  # unit sphere at origin
>>> camera = CentralCamera.Default(f=0.015, pose=T_cam);
>>> camera.project_quadric(Q)
array([[ -2166031.6261,  -7965097.3688,    -10128.1232],
       [ -7965097.3688, -11963644.9528,    -18212.0607],
       [   -10128.1232,    -18212.0607,       -23.2084]])
References:
Seealso:

C project_point project_line