OpenCVModel.pixels_to_unit¶
giant.camera_models.opencv_model
:
- OpenCVModel.pixels_to_unit(pixels, image=0, temperature=0, allow_interp=True)¶
This method converts pixel image locations to unit vectors expressed in the camera frame.
The pixel locations should be expressed as a shape (2,) or (2, n) array. They are converted to unit vectors by first going through the inverse distortion model (see
pixels_to_gnomic()
) and then being converted to unit vectors in the camera frame according to the definitions of the current model (also including any misalignment terms). Once the gnomic locations are retrieved usingpixels_to_gnomic()
, the unit vectors are formed according towhere
is the inverse rotation matrix for the misalignment for the image.- Parameters:
pixels (Sequence | ndarray) – The image points to be converted to unit vectors in the camera frame as a shape (2,) or (2, n) array
temperature (Real) – The temperature to use for the undistortion
image (int) – The image index that the pixel belong to (only important if there are multiple misalignments)
allow_interp (bool) – Allow the approximate conversion using interpolation for speed
- Returns:
The unit vectors corresponding to the image locations expressed in the camera frame as a shape (3,) or (3, n) array.
- Return type:
ndarray