PhaseCorrector¶
giant.relative_opnav.estimators.unresolved:
This class adds phase correction capabilities to RelNavEstimator.
Phase correction is the process by which we attempt to move an observed center of brightness (the centroid of a bright patch in this case) to more closely resemble the location where the center of figure would be observed in the image. This is done by correcting for the fact that the phase angle between the camera, the target, and the sun, can cause the observed center of brightness to be biased towards one side of the shape because only part of the target appears illuminated.
Specifically, this class adds 2 new key word argument inputs and attributes
phase_correction_type, andbrdfwhich specify what phase correction method to use to compute the phase correction, as well as the BRDF that is used to generate the illumination information for each facet when theRASTEREDphase correction method is used. In addition, it provides the methodcompute_phase_correction()which will return the phase correction based as a size 2 numpy array from the center of brightness to the center of figure in pixels using the current scene settings and the selectedphase_correction_type. It also defines 3 helper methods which are included for documentation purposes but are rarely interfaced with directly:compute_line_of_sight_sun_image(),simple_phase_correction(), andrastered_phase_correction().Generally this class is not used by the user and is instead used internally by the RelNav techniques that the user interacts with. If you are trying to implement a new relnav technique that needs phase correction capabilities, then you can subclass this class (no need to also subclass
RelNavEstimator) and then use thecompute_phase_correction()method when you need it. For more information on defining a new RelNav technique, refer to therelative_opnav.estimatorsdocumentation.- Parameters:
scene (Scene) – The
Sceneobject containing the target, light, and obscuring objects.camera (Camera) – The
Cameraobject containing the camera model and images to be utilizedoptions (PhaseCorrectorOptions | None) – The options configuring the phase corrections enum values
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
Cameraproperty for details.
A flag specifying whether this RelNav estimator generates and stores templates in the
templatesattribute.
The types of observables that are generated by this technique.
This should be a list of
RelNavObservablesTypeenum values that specify what type(s) of observables this technique generates. It can also beNonein which case the default type ofRelNavObservablesType.CENTER_FINDINGwill be assumed, or it can be a single string orRelNavObservablevalue if only one type is assumed.If this is
RelNavObservablesType.CUSTOM, then that can be the only type, and you must also define a class attributerelnav_handlerwhich is a function where the first and only positional argument is theRelativeOpNavinstance that this technique was registered to and there are 2 key word argumentsimage_indandinclude_targetswhich should be used to control which image/target is processed.
A custom handler for doing estimation/packaging the results into the
RelativeOpNavinstance.Typically this should be
None, unless theobservable_typeis set toRelNavObservablesType.CUSTOM, in which case this must be a function where the first and only positional argument is theRelativeOpNavinstance that this technique was registered to and there are 2 key word argumentsimage_indandinclude_targetswhich should be used to control which image/target is processed.If
observable_typeis notRelNavObservablesType.CUSTOMthen this is ignored whether it isNoneor 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.
The name for the technique for registering with
RelativeOpNav.If None then the name will default to the name of the module where the class is defined.
This should typically be all lowercase and should not include any spaces or special characters except for
_as it will be used to make attribute/method names. (That isMyEstimator.technique.isidentifier()should evaluateTrue).
Summary of Methods
The method computes the phase correction assuming a spherical target. |
|
This method should apply the technique to a specified image for all targets specified in |
|
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 |