StarID.ransac

giant.stellar_opnav.star_identification:

StarID.ransac(image_locs, catalogue_dirs, temperature, image_number)[source]

This method performs RANSAC on the image poi-catalogue location pairs.

The RANSAC algorithm is described below

  1. The pairs are randomly sampled for 4 star pairs

  2. The sample is used to estimate a new attitude for the image using the DavenportQMethod routines.

  3. The new solved for attitude is used to re-rotate and project the catalogue stars onto the image.

  4. The new projections are compared with their matched image points and the number of inlier pairs (pairs whose distance is less than some ransac threshold) are counted.

  5. The number of inliers is compared to the maximum number of inliers found by any sample to this point (set to 0 if this is the first sample) and:

    • if there are more inliers

      • the maximum number of inliers is set to the number of inliers generated for this sample

      • the inliers for this sample are stored as correctly identified stars

      • the sum of the squares of the distances between the inlier pairs for this sample is stored

    • if there are an equivalent number of inliers to the previous maximum number of inliers then the sum of the squares of the distance between the pairs of inliers is compared to the sum of the squares of the previous inliers and if the new sum of squares is less than the old sum of squares

      • the maximum number of inliers is set to the number of inliers generated for this sample

      • the inliers are stored as correctly identified stars

      • the sum of the squares of the distances between the inlier pairs is stored

  6. Steps 1-5 are repeated for a number of iterations, and the final set of stars stored as correctly identified stars become the identified stars for the image.

In order to use this method, the image_locs input and the catalogue_dirs input should represent the initial pairings between the image points found using image processing and the predicted catalogue star unit vectors in the inertial frame. The columns in these 2 arrays should represent the matched pairs (that is column 10 of image_locs should correspond to column 10 in catalogue_dirs).

This method returns the paired image locations and catalogue directions from the best RANSAC iteration and the boolean index into the input arrays that extract these values.

In general this method is not used directly by the user and instead is called as part of the id_stars() method.

Parameters:
  • image_locs (ndarray) – The image points of interest that met the initial matching criteria as a 2xn array

  • catalogue_dirs (ndarray) – The catalogue inertial unit vectors that met the initial matching criteria in the same order as the image_locs input as a 3xn array.

  • temperature (Real) – The temperature of the camera at the time of the image being processed

  • image_number (int) – The number of the image being processed

Returns:

The matched image points of interest, the matched catalogue unit vectors, and the boolean index that represents these arrays

Return type:

Tuple[ndarray, ndarray, ndarray]