SceneObject.get_apparent_diameter

giant.ray_tracer.scene:

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

Computes the apparent diameter for the given camera model and the current location.

The apparent diameter is the be guess at how large the object should appear in the image based on the current scene and assuming a spherical approximation for the target. It is computed either by making a reference sphere by taking the mean of the principal axes of the Surface.reference_ellipsoid best fit ellipsoid of the object if it is not None, by making a reference sphere by taking the mean of the principal axes if the object is an ellipsoid, or by maxing a reference sphere using the average radius of the bounding box vertices of the target.

This method assumes that the object has already be 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 approximate apparent diameter of the object in pixels. Note that if the contained object is a Point this will always return 0.

Return type:

float