cross_correlation¶
This module provides the capability to locate the center-of-figure of a target in an image using 2D cross-correlation.
Description of the Technique¶
Center-finding is the process by which the bearing to the center-of-figure of a target is identified in an image. The most popular way of performing center finding for OpNav is through a process known as 2D cross-correlation. In cross-correlation, a template is correlated with the image to locate where the template and image match the most. The template typically represents what we expect the object to look like and the correlation is performed for every possible alignment between the image and the template. The location where the correlation score is highest is then said to be the location of the template in the image.
Cross-correlation based center finding is extremely accurate when the shape model of the target is well known, the range
to the target is pretty well known, and the orientation between the target and the camera is pretty well known. The
results degrade and can even become biased when any of these conditions are not met, particularly the range to the
target. If you expect that your knowledge will not be sufficient in one of these areas it may be better to attempt
to use a different technique such as sfn
or limb_matching
. Alternatively, you can use this method
to get initial results, then refine your knowledge with OD and shape modelling, and then reprocess the images to get
more accurate results.
In GIANT, the cross correlation algorithm is implemented as follows.
Render the template based on the a priori relative state between the camera and the target using a single bounce ray trace and the routines from
ray_tracer
.Perform 2D normalized cross correlation for every possible alignment between the center of the template and the image.
Locate the peak of the correlation surface (optionally locate the subpixel peak by fitting a 2D quadric to the correlation surface)
Correct the located peak based on the location of the center-of-figure of the target in the template to get the observed center-of-figure in the image.
Tuning¶
There aren’t too many parameters that need to be tuned for successful cross correlation as long as you have a decent shape model and decent a priori state information. Beyond that, parameters you can tune are
Parameter |
Description |
---|---|
The bidirectional reflectance distribution function used to compute the expected illumination of a ray based on the geometry of the scene. |
|
The size of the grid to use for subpixel sampling when rendering the template |
|
The function to use to detect the peak of the correlation surface. |
|
A flag specifying whether to blur the correlation surface to decrease high frequency noise before identifying the peak. |
|
An optional search region in pixels to restrict the area the peak of the correlation surface is search for around the a priori predicted center |
|
The minimum correlation score to accept as a successful identification. Correlation scores range from -1 to 1, with 1 indicating perfect correlation. |
Of these options, most only make small changes to the results. The 2 that can occasionally make large changes are
search_region
and blur
. In general
search_region
should be left at None
which searches the whole image. However, if your
object is nearly unresolved (<10 pixels across or so) and your a priori knowledge is pretty good, then it may be
beneficial to set this to a smallish number to ensure that you don’t mistakenly correlate with a noise spike or bright
star. The blur
attribute can also be used to help avoid correlating with a star but in
general should be left as False
unless the object is small (<7-10 pixels). Finally, the
min_corr_score
can generally be left at the default, though if you have a poor a priori
knowledge of either the shape model or the relative position of the object then you may need to decrease this some.
Use¶
The class provided in this module is usually not used by the user directly, instead it is usually interfaced with
through the RelativeOpNav
class using the identifier cross_correlation
. For more
details on using the RelativeOpNav
interface, please refer to the relnav_class
documentation. For
more details on using the technique class directly, as well as a description of the details
dictionaries produced
by this technique, refer to the following class documentation.
Classes
This class implements normalized cross correlation center finding for GIANT. |