UnresolvedCenterFinding

giant.relative_opnav.estimators.unresolved:

class giant.relative_opnav.estimators.unresolved.UnresolvedCenterFinding(scene, camera, image_processing, search_distance=15, apply_phase_correction=False, phase_correction_type=PhaseCorrectionType.SIMPLE, brdf=None)[source]

This class implements GIANT’s version of unresolved center finding for extracting bearing measurements to unresolved targets in an image.

The class provides an interface to perform unresolved center finding for each target body that is predicted to be in an image. It does this by looping through each target object contained in the Scene.target_objs attribute. For each of these targets the algorithm:

  1. Predicts the location of that target in the image using the a priori knowledge

  2. Searches the region around the predicted location defined by the search_distance attribute for bright spots

  3. If only one bright spot exists in the region then it finds the sub-pixel center of the bright spot or, if more than one or no bright spots exist in the region it raises a warning and moves on to the next object.

  4. If requested, the observed center-of-brightness is corrected to be closer to what the observed center of figure should be using the phase angle, the illumination direction, and the predicted apparent diameter of the target in pixels.

Steps 2 and 3 are both performed by the ImageProcessing.locate_subpixel_poi_in_roi() method, which is the same method used to extract potential star locations from an image in the stellar_opnav package. Therefore, all of the same settings are used to adjust the performance and the reader is directed to to the ImageProcessing.locate_subpixel_poi_in_roi() documentation for more information.

The search region is controlled by the search_distance attribute. This should be an integer which specifies half of the square region to search around the predicted center, such that a 2* search_distance by 2* search_distance pixels of the image will be searched. Whether the phase correction is applied or not is controlled by the boolean flag apply_phase_correction.

When all of the required data has been successfully loaded into an instance of this class, the estimate() method is used to extract the sub-pixel centers of the target bodies predicted to be in the requested image. The results are stored into the observed_bearings attribute. In addition, the predicted location for each target is stored in the computed_bearings attribute. Finally, the details about the fit are stored as a dictionary in the appropriate element in the details attribute. Specifically, these dictionaries will contain the following keys.

Key

Description

'PSF'

The fit PSF values. Only available if successful. Will be None if ImageProcessing.save_psf is False

'Phase Correction'

The phase correction vector used to convert from center of brightness to center of figure. This will only be available if the fit was successful. If apply_phase_correction is False then this will be an array of 0.

'SNR'

The peak signal to noise ratio of the detection. This will only be set if the fit was successful. If ImageProcessing.return_stats is False then this will be None.

'Max Intensity'

The intensity of the peak pixel used in the PSF fit. This will only be set if the fit was successful.

'Failed'

A message indicating why the fit failed. This will only be present if the fit failed (so you could do something like 'Failed' in unresolved.details[target_ind] to check if something failed. The message should be a human readable description of what called the failure

'Found Results'

The points of interest that were found in the search region. This is only present if the fit failed because there were more than 1 point of interest in the search region. The value to this key is the return from ImageProcessing.locate_subpixel_poi_in_roi()

Warning

Before calling the estimate() method be sure that the scene has been updated to correspond to the correct image time. This class does not update the scene automatically.

Parameters:
  • scene (Scene) – The Scene object containing the target, light, and obscuring objects.

  • camera (Camera) – The Camera object containing the camera model and images to be utilized

  • image_processing (ImageProcessing) – The ImageProcessing object to be used to process the images

  • search_distance (int) – The search radius to search around the predicted centers for the observed centers of the target objects

  • apply_phase_correction (bool) – A boolean flag specifying whether to apply the phase correction to the observed center of brightness to get closer to the center of figure based on the predicted apparent diameter of the object.

  • phase_correction_type (PhaseCorrectionType | str) – The type of phase correction to use. Should be one of the PhaseCorrectionType enum values

  • brdf (IlluminationModel | None) – The illumination model to use to compute the illumination values if the RASTERED phase correction type is used. If the RASTERED phase correction type is not used this is ignored. If this is left as None and the Rastered phase correction type is used, this will default to the McEwen Model, McEwenIllumination.

property camera: Camera

The camera instance that represents the camera used to take the images we are performing Relative OpNav on.

This is the source of the camera model, and may be used for other information about the camera as well. See the Camera property for details.

generates_templates: bool = False

A flag specifying whether this RelNav estimator generates and stores templates in the templates attribute.

relnav_handler: Callable | None = None

A custom handler for doing estimation/packaging the results into the RelativeOpNav instance.

Typically this should be None, unless the observable_type is set to RelNavObservablesType.CUSTOM, in which case this must be a function where the first and only positional argument is the RelativeOpNav instance that this technique was registered to and there are 2 key word arguments image_ind and include_targets which should be used to control which image/target is processed.

If observable_type is not RelNavObservablesType.CUSTOM then this is ignored whether it is None or not.

property scene: Scene

The scene which defines the a priori locations of all targets and light sources with respect to the camera.

You can assume that the scene has been updated for the appropriate image time inside of the class.

details: List[Dict[str, Any]]

Key

Description

'PSF'

The fit PSF values. Only available if successful. Will be None if ImageProcessing.save_psf is False

'Phase Correction'

The phase correction vector used to convert from center of brightness to center of figure. This will only be available if the fit was successful. If apply_phase_correction is False then this will be an array of 0.

'SNR'

The peak signal to noise ratio of the detection. This will only be set if the fit was successful. If ImageProcessing.return_stats is False then this will be None.

'Max Intensity'

The intensity of the peak pixel used in the PSF fit. This will only be set if the fit was successful.

'Failed'

A message indicating why the fit failed. This will only be present if the fit failed (so you could do something like 'Failed' in unresolved.details[target_ind] to check if something failed. The message should be a human readable description of what called the failure

'Found Results'

The points of interest that were found in the search region. This is only present if the fit failed because there were more than 1 point of interest in the search region. The value to this key is the return from ImageProcessing.locate_subpixel_poi_in_roi()

observed_bearings: List[NONEARRAY]

A list of the observed bearings in the image where each element corresponds to the same element in the Scene.target_objs list.

The list elements should be numpy arrays or None if the the target wasn’t considered for some reason. If numpy arrays they should contain the pixel locations as (x, y) or (col, row). This does not always need to be filled out.

This is were you should store results for CENTER-FINDING, LIMB, LANDMARK, CONSTRAINT techniques.

computed_bearings: List[NONEARRAY]

A list of the computed (predicted) bearings in the image where each element corresponds to the same element in the Scene.target_objs list.

The list elements should be numpy arrays or None if the the target wasn’t considered for some reason. If numpy arrays they should contain the pixel locations as (x, y) or (col, row). This does not always need to be filled out.

This is were you should store results for CENTER-FINDING, LIMB, LANDMARK, CONSTRAINT techniques.

phase_correction_type: PhaseCorrectionType

The type of phase correction to use, if requested.

See PhaseCorrectionType for details.

brdf: IlluminationModel

The illumination model used to convert geometry into expected illumination.

This is only used if the RASTERED phase correction type is chosen and is ignored otherwise.

technique: str = 'unresolved'

The name of the technique identifier in the RelativeOpNav class.

observable_type: List[RelNavObservablesType] = [<RelNavObservablesType.CENTER_FINDING: 'CENTER-FINDING'>]

The type of observables this technique generates.

Summary of Methods

compute_line_of_sight_sun_image

compute_phase_correction

The method computes the phase correction assuming a spherical target.

estimate

This method extracts the observed sub-pixel centers for each requested target object from the supplied image.

rastered_phase_correction

This method computes the phase correction by raster rendering the target to determine the offset from the center of illumination to the center of figure.

reset

This method resets the observed/computed attributes as well as the details attribute to have None for each target in scene.

simple_phase_correction

This method computes the simple phase correction assuming the target is a sphere.

target_generator

This method returns a generator which yields target_index, target pairs that are to be processed based on the input include_targets.