Optimize parameters of transformations#

For each optimization process, the following functions are available:

  • gn: Gauss-Newton optimization solving directly \(\mathbf{J}^T \mathbf{J} \Delta = -\mathbf{J}^T \mathbf{r}\) without damping, scaling or boundary constraints.

  • trf: Trust Region Reflective optimization using scipy.optimize.least_squares with scaling and boundary constraints.

  • lm: Levenberg-Marquardt optimization using scipy.optimize.least_squares without scaling and boundary constraints.

Optimize the parameters of a unique transformation#

Lets consider a pycvcam.Transform object and a set of input and output points. The following functions optimize the parameters of the transformation to minimize the reprojection error between the input and output points.

optimize_parameters_gn(transform, ...[, ...])

Optimize the parameters of a Transform object such that the transformed input points match the output points using a Gauss-Newton optimization method.

optimize_parameters_trf(transform, ...[, ...])

Optimize the parameters of a Transform object such that the transformed input points match the output points using the scipy.optimize.least_squares method.

optimize_parameters_lm(transform, ...[, ...])

Optimize the parameters of a Transform object such that the transformed input points match the output points using the scipy.optimize.least_squares method.

Optimize the parameters of a camera transformation#

Lets consider a pycvcam.Intrinsic object, a pycvcam.Distortion object, a pycvcam.Extrinsic object and a set of input and output points. The following functions optimize the parameters of the camera transformation to minimize the reprojection error between the input and output points.

optimize_camera_gn(intrinsic, distortion, ...)

Optimize the parameters of the intrinsic, distortion, and extrinsic transformations of a camera model such that the projection of the world points matches the image points using a Gauss-Newton optimization method.

optimize_camera_trf(intrinsic, distortion, ...)

Optimize the parameters of the intrinsic, distortion, and extrinsic transformations of a camera model such that the projection of the world points matches the image points using the scipy.optimize.least_squares method.

optimize_camera_lm(intrinsic, distortion, ...)

Optimize the parameters of the intrinsic, distortion, and extrinsic transformations of a camera model such that the projection of the world points matches the image points using the scipy.optimize.least_squares method.

Optimize the parameters of chains of transformations#

Lets \((T_0, T_1, ..., T_{N_T-1})\) be a tuple of \(N_T\) Transform objects, and \((C_0, C_1, ..., C_{N_C-1})\) be a tuple of \(N_C\) chains of transformations.

A chain \(C_i\) is defined as a tuple of indices corresponding to thetransformations in the chain. For example:

C_0 = (1, 4, 8) -----> C_0(X) = T_8 ∘ T_4 ∘ T_1(X)

The objective is to optimize the parameters of the transformations to minimize the reprojection error between the input and output points of all the chains.

optimize_chains_gn(seq_transforms, ...[, ...])

Optimize several Transform objects according multiple chains of transformations using the least squares method with the Gauss-Newton algorithm.

optimize_chains_trf(seq_transforms, ...[, ...])

Optimize several Transform objects according multiple chains of transformations using the scipy.optimize.least_squares method.

optimize_chains_lm(seq_transforms, ...[, ...])

Optimize several Transform objects according multiple chains of transformations using the scipy.optimize.least_squares method.