OwenModel.project_onto_image

giant.camera_models.owen_model:

OwenModel.project_onto_image(points_in_camera_frame, image=0, temperature=0)[source]

This method transforms 3D points or directions expressed in the camera frame into the corresponding 2D image locations.

The points input should be either 1 or 2 dimensional, with the first axis being length 3 (each point (direction) in the camera frame is specified as a column).

The optional image key word argument specifies the index of the image you are projecting onto (this only applies if you have a separate misalignment for each image)

The optional temperature input specifies the temperature to perform the projection at. This is only import when your focal length is dependent on temperature and you have entered or calibrated for the temperature dependency coefficients.

You can specify the directions to be input as either a shape (3,) or shape (3, n) array::
>>> from giant.camera_models import PinholeModel
>>> model = OwenModel(kx=300, ky=400, px=500, py=500, focal_length=10, a1=1e-5, a2=1e-6, radial2=1e5,
>>>                   misalignment=[[1e-12, -2e-14, 3e-10], [2e-15, 1e-13, 3e-10]],
>>>                   estimation_parameters=['multiple misalignments'])
>>> model.project_onto_image([1, 2, 12000])
array([500.33680555, 500.89814814])
>>> model.project_onto_image([[1, 2, 3, 4], [2, 5, 6, 7], [12000, 13000, 9000, 5000]], image=1)
array([[500.33680556, 501.25352754, 506.55555555, 564.79999998],
       [500.89814815, 504.17842513, 517.48148149, 651.20000003]])
>>> model.project_onto_image([[1, 2, 3, 4], [2, 5, 6, 7], [12000, 13000, 9000, 5000]], temperature=-1)
array([[500.33680252, 501.25351625, 506.55549654, 564.7994167 ],
       [500.89814006, 504.1783875 , 517.48132409, 651.19863896]])
Parameters:
  • points_in_camera_frame (Sequence | ndarray) – a shape (3,) or shape (3, n) array of points to project

  • image (int) – The index of the image being projected onto (only applicable with multiple misalignments)

  • temperature (Real) – The temperature to project the points at

Returns:

A shape (2,) or shape (2, n) numpy array of image points (with units of pixels)

Return type:

ndarray