pysdic.optimize_transformation_input_points#

optimize_transformation_input_points(transformation, output_points, guess, *, kwargs=None, mode='rJ', loss=None, loss_scale=1.0, use_cache=False, **solve_kwargs)[source]#

Optimize the input points \(X\) of a transformation \(T\) such that \(T(X) \approx Y\), with pysolvegn.solve_batch (one independent problem per point).

It is a numerical inverse of the transformation, for example when invert is not implemented or to refine its result.

See also

Parameters:
Returns:

  • numpy.ndarray – The optimized input points with shape \((\dots, n_i)\).

  • pysolvegn.BatchSolveResult – The result of pysolvegn.solve_batch.

Return type:

Tuple[ndarray, BatchSolveResult]

Examples

normalized_points, result = optimize_transformation_input_points(
    distortion, distorted_points, guess=distorted_points, max_iteration=20, ptol=1e-12
)