UnresolvedCenterFinding¶
giant.relative_opnav.estimators.unresolved
:
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:Predicts the location of that target in the image using the a priori knowledge
Searches the region around the predicted location defined by the
search_distance
attribute for bright spotsIf 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.
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 thestellar_opnav
package. Therefore, all of the same settings are used to adjust the performance and the reader is directed to to theImageProcessing.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 flagapply_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 theobserved_bearings
attribute. In addition, the predicted location for each target is stored in thecomputed_bearings
attribute. Finally, the details about the fit are stored as a dictionary in the appropriate element in thedetails
attribute. Specifically, these dictionaries will contain the following keys.Key
Description
'PSF'
The fit PSF values. Only available if successful. Will be
None
ifImageProcessing.save_psf
isFalse
'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
isFalse
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
isFalse
then this will beNone
.'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 utilizedimage_processing (ImageProcessing) – The
ImageProcessing
object to be used to process the imagessearch_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 theRASTERED
phase correction type is not used this is ignored. If this is left asNone
and theRastered
phase correction type is used, this will default to the McEwen Model,McEwenIllumination
.
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.
A flag specifying whether this RelNav estimator generates and stores templates in the
templates
attribute.
A custom handler for doing estimation/packaging the results into the
RelativeOpNav
instance.Typically this should be
None
, unless theobservable_type
is set toRelNavObservablesType.CUSTOM
, in which case this must be a function where the first and only positional argument is theRelativeOpNav
instance that this technique was registered to and there are 2 key word argumentsimage_ind
andinclude_targets
which should be used to control which image/target is processed.If
observable_type
is notRelNavObservablesType.CUSTOM
then this is ignored whether it isNone
or not.
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.
Key
Description
'PSF'
The fit PSF values. Only available if successful. Will be
None
ifImageProcessing.save_psf
isFalse
'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
isFalse
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
isFalse
then this will beNone
.'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()
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.
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.
The type of phase correction to use, if requested.
See
PhaseCorrectionType
for details.
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.
The name of the technique identifier in the
RelativeOpNav
class.
The type of observables this technique generates.
Summary of Methods
The method computes the phase correction assuming a spherical target. |
|
This method extracts the observed sub-pixel centers for each requested target object from the supplied image. |
|
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. |
|
This method resets the observed/computed attributes as well as the details attribute to have |
|
This method computes the simple phase correction assuming the target is a sphere. |
|
This method returns a generator which yields target_index, target pairs that are to be processed based on the input |