ConstraintMatching¶
giant.relative_opnav.estimators.constraint_matching:
This class implements constraint matching in GIANT.
See the module documentation or the attribute and method documentation for more details.
Warning
While this technique is functional, it has undergone less development and testing than other GIANT techniques and there could therefore be some undiscovered bugs. Additionally, the documentation needs a little more massaging. PRs are welcome…
- Parameters:
scene (Scene) – The scene describing the a priori locations of the targets and the light source.
camera (Camera) – The
Cameraobject containing the camera model and images to be analyzedoptions (ConstraintMatchingOptions | None) – A dataclass specifying the options to set for this instance.
This technique generates CONSTRAINT bearing observables
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.
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.
A flag specifying that this RelNav estimator generates and stores templates in the
templatesattribute.
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.
A flag to match keypoints between the image and a rendered template.
A flag to match keypoints across multiple images.
Minimum number of matched constraints in order for the constraint matching to be considered successful.
The illumination model that transforms the geometric ray tracing results (see
ILLUM_DTYPE) into an intensity values. Typically this is one of the options from theilluminationmodule).
The rays to use when rendering the template. If
Nonethen the rays required to render the template will be automatically computed. Optionally, a list ofRaysobjects where each element corresponds to the rays to use for the corresponding template in theScene.target_objslist. Typically this should be left asNone.
The subsampling to use per pixel when rendering the template. This should be the number of sub-pixels per side of a pixel (that is if grid_size=3 then subsampling will be in an equally spaced 3x3 grid -> 9 sub-pixels per pixel). If
raysis not None then this is ignored
The number of pixels to render in the template that overflow outside of the camera field of view. Set to a number less than 0 to accept all overflow pixels in the template. Set to a number greater than or equal to 0 to limit the number of overflow pixels.
Maximum time difference between image observation dates for keypoints to be matched between images. Set to a datetime.timedelta type. If None, then a maximum time difference will not be applied.
The feature matcher instance to use
This attribute should provide details from applying the technique to each target in the scene.
The list should be the same length at the
Scene.target_objs. Typically, if the technique was not applied for some of the targets then the details for the corresponding element should beNone. Beyond each element of the details should typically contain a dictionary providing information about the results that is not strictly needed for understanding what happened, however, this is not required and you can use whatever structure you want to convey the information. Whatever you do, however, you should clearly document it for each technique so that the user can know what to expect.
Trace from the camera to the target to estimate roughly the location that corresponds to each constraint on the target model.
- Parameters:
image (OpNavImage) – The image to locate the targets in
include_targets (list[bool] | None) – A list specifying whether to process the corresponding target in
Scene.target_objsorNone. IfNonethen all targets are processed.
Summary of Methods
This method computes the required rays to render a given target based on the location of the target in the image. |
|
This method returns the computed illumination values for the given target and the (sub)pixels that each illumination value corresponds to. |
|
This method resets the observed/computed attributes as well as the details attribute to have |
|
This method returns a generator which yields target_index, target pairs that are to be processed based on the input |
|
Matches keypoints between an image and a rendered template. |
|
Matches keypoints across different images. |
|
Trace from the camera to the target to estimate roughly the location that corresponds to each constraint on the target model. |
|
Do the estimation according to the current settings |