pysdic.Camera.get_camera_normalized_points#

Camera.get_camera_normalized_points(mask=None, *, distortion_kwargs=None)[source]#

Get the normalized_points of the pixels of the camera, by inverting the intrinsic and distortion transformations (see pysdic.undistort_points()).

The normalized points are cached: each pixel is computed only once, at the first call that requests it. The cache is automatically reset when the parameters of the intrinsic or distortion transformations, or distortion_kwargs, change (they are compared exactly with a saved copy at each call).

Note

Pixels for which the inversion fails (NaN) are cached as NaN and not computed again until the cache is reset.

Parameters:
  • mask (Optional[ArrayLike], optional (default: None)) – A boolean mask to filter the normalized points, with shape \((H \times W,)\) or \((H, W)\) where \(H\) and \(W\) are the height and width of the camera sensor. If None, all normalized points are returned.

  • distortion_kwargs (Optional[Dict[str, Any]], optional (default: None)) – Additional keyword arguments passed to the invert method of the distortion transformation (e.g. the options of the iterative inversion).

Returns:

An array of shape \((N_p, 2)\) representing the normalized points (a copy of the cache).

Return type:

numpy.ndarray

Raises:

ValueError – If the parameters of the intrinsic or distortion transformations are not set.