pysdic.ImageProjectionResult#
The pysdic.ImageProjectionResult stores the result of pysdic.View.image_project(): the image values
gray_levels (or x) with a channel axis, the projected image_points, and the Jacobians with views on the
blocks of the extrinsic, distortion and intrinsic parameters.
See also
pysdic.ProjectionResult: the result of the geometric projection ofpysdic.Camera.project().
- class ImageProjectionResult(x, jacobian_dx=None, jacobian_dp=None, image_points=None, n_extrinsic=0, n_distortion=0, n_intrinsic=0)[source]#
Bases:
TransformationResultA class to represent the result of the projection of world points to the values (gray levels or colors) of an image.
It extends
pysdic.TransformationResultwith the projected image points and the number of parameters of each step of the projection, to give access to the blocks of the Jacobian with respect to the parameters of the extrinsic, distortion and intrinsic transformations (aspysdic.ProjectionResult).The values always have a channel axis \(C\) (\(C = 1\) for a grayscale image).
The Jacobians are obtained with the chain rule:
\[\nabla_{\gamma}[I \circ P](\vec{X}) = \nabla_{x}[I](P(\vec{X})) \cdot \nabla_{\gamma}[P](\vec{X})\]See also
Method
pysdic.View.image_project()that produces apysdic.ImageProjectionResultobject.
- Parameters:
x (numpy.ndarray) – The image values at the projected points. Shape \((\dots, C)\).
jacobian_dx (Optional[numpy.ndarray]) – The Jacobian of the values with respect to the world points, or None if not computed. Shape \((\dots, C, E)\).
jacobian_dp (Optional[numpy.ndarray]) – The Jacobian of the values with respect to the parameters of the projection, or None if not computed. Shape \((\dots, C, N_e + N_d + N_i)\). The blocks that were not requested are filled with NaN.
image_points (numpy.ndarray) – The projected image points \((x, y)\). Shape \((\dots, 2)\).
n_extrinsic (int) – The number of parameters \(N_e\) of the extrinsic transformation.
n_distortion (int) – The number of parameters \(N_d\) of the distortion transformation.
n_intrinsic (int) – The number of parameters \(N_i\) of the intrinsic transformation.
- property gray_levels: ndarray#
[Get] the image values at the projected points (alias of
x). Shape \((\dots, C)\).- Returns:
The image values.
- Return type:
- property jacobian_ddistortion: ndarray | None#
[Get] the Jacobian of the values with respect to the distortion parameters, as a view of
jacobian_dp[..., N_e:N_e + N_d]. Shape \((\dots, C, N_d)\).- Returns:
The Jacobian with respect to the distortion parameters, or None if not computed.
- Return type:
Optional[numpy.ndarray]
- property jacobian_dextrinsic: ndarray | None#
[Get] the Jacobian of the values with respect to the extrinsic parameters, as a view of
jacobian_dp[..., :N_e]. Shape \((\dots, C, N_e)\).- Returns:
The Jacobian with respect to the extrinsic parameters, or None if not computed.
- Return type:
Optional[numpy.ndarray]
- property jacobian_dintrinsic: ndarray | None#
[Get] the Jacobian of the values with respect to the intrinsic parameters, as a view of
jacobian_dp[..., N_e + N_d:]. Shape \((\dots, C, N_i)\).- Returns:
The Jacobian with respect to the intrinsic parameters, or None if not computed.
- Return type:
Optional[numpy.ndarray]