LimbScanner

giant.relative_opnav.estimators.ellipse_matching:

class giant.relative_opnav.estimators.ellipse_matching.LimbScanner(scene, camera, psf, number_of_scan_lines=51, scan_range=2.356194490192345, number_of_sample_points=501, brdf=None, peak_finder=<function parabolic_peak_finder_1d>)[source]

This class is used to extract limbs from an image and pair them to surface points on the target.

This is done by first determining the surface points on the limb based on the shape model, the scan center vector, and the sun direction vector. Once these surface points have been identified (using :meth:.Shape.find_limbs`) they are projected onto the image to generate the predicted limb locations in the image. Then the image is sampled along the scan line through each predicted limb location and the scan center location in the image using the image_interpolator input to get the observed intensity line. In addition, the scan line is rendered using ray tracing to generate the predicted intensity line. The predicted intensity lines and the extracted intensity lines are then compared using cross correlation to find the shift that best aligns them. This shift is then applied to the predicted limb locations in the image along the scan line to get the extracted limb location in the image. This is all handled by the extract_limbs() method.

There are a few tuning options for this class. The first collection affects the scan lines that are used to extract the limb locations from the image. The number_of_scan_lines sets the number of generated scan lines and directly corresponds to the number of limb points that will be extracted from the image. In addition, the scan_range attribute sets the angular extent about the sun direction vector that these scan lines will be evenly distributed. Finally, the number_of_sample_points specifies how many samples to take along the scan lines for both the extracted and predicted intensity lines and corresponds somewhat to how accurate the resulting limb location will be. (Generally a higher number will lead to a higher accuracy though this is also limited by the resolution of the image and the shape model itself. A higher number also will make things take longer.)

In addition to the control over the scan lines, you can adjust the brdf which is used to generate the predicted intensity lines (although this will generally not make much difference) and you can change what peak finder is used to find the subpixel peaks of the correlation lines.

This technique requires decent a priori knowledge of the relative state between the target and the camera for it to work. At minimum it requires that the scan center be located through both the observed target location in the image and the target shape model placed at the current relative position in the scene. If this isn’t guaranteed by your knowledge then you can use something like the moment_algorithm to correct the gross errors in your a priori knowledge as is done by LimbMatching.

Generally you will not use this class directly as it is used by the LimbMatching class. If you want to use it for some other purpose however, simply provide the required initialization parameters, then use extract_limbs() to extract the limbs from the image.

Parameters:
  • scene (Scene) – The scene containing the target(s) and the light source

  • camera (Camera) – The camera containing the camera model

  • psf (PointSpreadFunction) – The point spread function to apply to the predicted intensity lines. This should have a apply_1d()

  • number_of_scan_lines (int) – The number of scan lines to generate (number of extracted limb points)

  • scan_range (Real) – The angular extent about the sun direction vector to distribute the scan lines through. This Should be in units of radians and should generally be less than \(\pi\).

  • number_of_sample_points (int) – The number of points to sample along each scan line

  • brdf (IlluminationModel | None) – The illumination model to use to render the predicted scan intensity lines

  • peak_finder (Callable) – The peak finder to find the peak of each correlation line. This should assume that each row of the input array is a correlation line that the peak needs to be found for.

Summary of Methods

extract_limbs

This method extracts limb points in an image and pairs them to surface points that likely generated them.

predict_limbs

Predict the limb locations for a given target in the camera frame.