SceneObject.get_bounding_pixels

giant.ray_tracer.scene:

SceneObject.get_bounding_pixels(model, image=0, temperature=0.0)[source]

Computes the bounding pixels for the given camera model and the current location.

The bounding pixels are the pixel bounds which the scene predicts the target should be completely contained in. They are computed either by using the circumscribing_sphere bounding sphere of the object if it is not None, by make a circumscribing sphere if the object is an ellipsoid, or by projecting the bounding box vertices onto the image. These are typically used to determine which pixels to trace for rendering the object

This method assumes that the object has already been placed in the camera frame (the frame centered at the focus of the camera) with the z axis pointing perpendicular to the image plane. If any of the assumptions are not met this method will return nonsense.

Parameters:
  • model (CameraModel) – The camera model that relates points in the 3d world to points on the image plane

  • image (int) – the index of the image that is being projected onto. Can normally be ignored

  • temperature (Real) – The temperature of the camera at the time we are trying to get the apparent diameter

Returns:

The minimum (upper left) and maximum (lower right) pixel bounds that should contain the object based off of the scene as a tuple of length 2 numpy arrays (min, max). Note that these are inclusive bounds

Return type:

Tuple[ndarray, ndarray]