#
Position Estimation Using the Image Derivative^{ †}

^{1}

^{2}

^{3}

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

## 2. Concept

- The geometrical illumination conditions and the expected size of the observed body are first computed. These data allow one to determine whether the target is sufficiently illuminated and of sufficient size to perform the estimation process.
- The image differentiation is obtained with a fourth order Richardson extrapolation.
- The pixels of the gradient image are sorted in descending mode. Eventual outliers present in this set, due to noise or background stars, are then eliminated by two sequential filters.
- −
- The first filter validates an edge pixel based on eigenanalysis of a small gradient box around the pixel and by investigation of the same box in the original image.
- −
- The second filter is a modified version of the RANSAC algorithm.

- The edge points selected are then used to obtain the first estimate of center and radius. The Taubin best fitting algorithm [10] is used.
- The first estimate is refined via non-linear least-squares using a circular sigmoid function to describe the edge transition.

- Camera: This includes focal length (f) in mm and imager data (number and size of rows and columns).
- Image: This is the image (made of ${N}_{r}$ rows and ${N}_{c}$ columns) taken at the specified time.
- Time: This is the time instant at which the image is taken. This time is used to compute the Moon and Sun positions in J2000.
- Position: This input consists of a raw estimate of the spacecraft position, $E\left\{r\right\}$, and its accuracy, ${\sigma}_{r}$. These data are used to estimate the Moon’s radius on the imager and the expected illumination condition. This position estimate is very rough, having typical an accuracy of less than 10,000 km.
- Attitude: This input consists of the spacecraft attitude, $E\left\{q\right\}$, and attitude accuracy, ${\sigma}_{q}$. These data are used to compute the spacecraft-to-Moon vector in the J2000 reference frame.

## 3. Expected Radius and Illumination Parameter

#### 3.1. Full or New Moon

#### 3.2. Gibbous Moon

#### 3.3. Crescent Moon

#### 3.4. Special Case: Cropped Target

**Figure 6.**Processing of a cropped image. (

**a**) Cropped image of the Moon; (

**b**) Results of the cropped detection.

- Number of pixels in the gradient image to be analyzed (N): This number has to be proportional to the length of the visible Moon arc. However, at this stage, it is impossible to know the angular width of the target; moreover, the presence of the terminator introduces a number of high contrast pixels that are not part of the Moon edge. Ultimately, N is chosen to be proportional to ${p}_{r}$ and ${p}_{i}$, according to the following:$$N=k\phantom{\rule{0.166667em}{0ex}}\pi {p}_{r}$$$$k=2\left(1+{\displaystyle \frac{{p}_{i}-10}{2\phantom{\rule{0.166667em}{0ex}}{p}_{r}-10}}\right)$$
- The size of the box for box-based outliers removal (s): Because of the way the code works, the box has to be chosen small enough that the segment of the Moon edge within the box appears almost straight. Extensive testing has shown that the best choice is to take $s=\lceil 0.8{p}_{r}\rceil $, with a lower limit of $s=3$ and an upper limit of $s=21$.
- RANSAC maximum distance: This is chosen equal to ${d}_{max}=5\phantom{\rule{0.166667em}{0ex}}{p}_{r}/100$.
- Number of tests for RANSAC (${N}_{T}$): RANSAC randomly selects for testing a subset of all of the possible triplets of pixels remaining after the box-based outliers’ removal. Testing has shown that the best choice is to have:$$N}_{T}={\displaystyle \frac{1}{5}}\phantom{\rule{0.166667em}{0ex}}\left(\genfrac{}{}{0pt}{}{{N}_{1}}{3}\right)={\displaystyle \frac{{N}_{1}\phantom{\rule{0.166667em}{0ex}}({N}_{1}-1)({N}_{1}-2)}{30}$$
- Convergence tolerance for circular sigmoid function (CSF) least squares [9]: At the k-th iteration, the convergence check is performed on the solution variation $\text{\Delta}{X}_{k}=\sqrt{|\text{\Delta}{r}_{k}^{2}+\text{\Delta}{c}_{k}^{2}-\text{\Delta}{R}_{k}^{2}|}$. Assuming the requirement accuracy is 0.3 pixel (in the center and radius estimation), the CSF-LS converge criteria is assumed to be 1/50 smaller than that, $\text{\Delta}{X}_{min}=0.3/50$.
- The number of iterations for CSF least squares is ${N}_{iter}=50$.

- Check 1 (after internal parameter computation):
- The Moon is too small (apparent diameter less than a set number of pixels) or too big (the Moon is completely or almost completely filling the image).
- The Moon is new (or otherwise, its illuminated fraction is negligible) or out of frame altogether.

- Check 2 (after box-based outlier removal; see Section 4.2):
- −
- Too many outliers have been identified, leaving the pool of valid data below a set limit.

- Check 3 (after RANSAC-based outlier removal; see Section 4.3):
- −
- Too many outliers have been identified, leaving the pool of valid data below a set limit.
- −
- The estimated radii found by RANSAC are not consistent with the expected apparent radius previously found.

- Check 4 (after Taubin; see Section 5.1):
- −
- The radius found is not consistent with the expected value.
- −
- The computed center position of the Moon is out of the imager and too far away form the optical axis.

- Check 5 (inside and after CSF-LS):
- −
- The maximum number of iterations is exceeded.
- −
- The estimates of the radius and center are too different from the results of Taubin.

## 4. Gradient-Based Image Processing Algorithm

#### 4.1. Image Differentiation

#### 4.2. Box-Based Outlier Identification

- The ratio between the eigenvalues must be lower than a certain threshold, chosen experimentally at $0.3$. This indicates that the distribution of bright pixels has a preferential direction.
- The values of the gradient in the pixels furthest from the edge line should be small, as both should be far from areas of variable brightness. Moreover, their gray tones should differ noticeably, as one belongs to the target and the other to the night sky.
- For the pixels along the continuous line in Figure 7, the ratio of their gradient values should be close to one (${g}_{min}/{g}_{max}>0.6$), as they both supposedly belong to the edge.
- For the pixels marked by “D” in the same figure, the ratio of their gray tone values should be close to zero (${g}_{min}/{g}_{max}<0.3$), as one belongs to the night sky and the other to the target.

#### 4.3. RANSAC for Circle and Ellipse

- selects m data points at random;
- finds the curve passing through these m points, thus estimating the associated m parameters;
- counts how many data items are located at a distance greater than a minimum value ${d}_{min}$ from the curve; they are ${N}_{k}$;
- if ${N}_{k}<{N}_{min}$, then set ${N}_{min}={N}_{k}$.

## 5. Circle Best Fitting

- Geometric fit: Given a set of n data points, iteratively converge to the minimum of:$${L}_{g}=\sum _{i=1}^{n}\phantom{\rule{0.166667em}{0ex}}{d}_{i}^{2}\left(x\right)$$
- Algebraic fit: ${d}_{i}$ are replaced with some other function of the parameters ${f}_{i}$, and thus, a new cost function is defined:$${L}_{a}=\sum _{i=1}^{n}\phantom{\rule{0.166667em}{0ex}}{f}_{i}^{2}\left(x\right)$$

#### 5.1. Taubin Best Fitting

## 6. Numerical Tests

- Maximum number of highest derivatives selected: $N=1,500$;
- Box-based outlier elimination: box size = $21\times 21$;
- Box-based outlier elimination: derivative ratio $>0.6$;
- Box-based outlier elimination: corner ratio $<0.3$;
- Box-based outlier elimination: eigenvalue ratio $<0.3$;
- RANSAC: minimum distance ${d}_{min}=4$ pixels;
- RANSAC: number of tests = 100.

#### 6.1. Example 1: Real Image, Four-Times Cropped

**Figure 10.**Example 1: Image processing phases (data in pixel). (

**a**) 1490 highest derivatives; (

**b**) $21\times 21$ box approach removed 375 outliers; (

**c**) RANSAC removed 5 outliers using 100 tests and ${d}_{min}=4$; (

**d**) Body center inside image. Row center = 185.5991, Column center = 187.339, Radius = 218.0337 (worst residual = 2.9321).

**Figure 11.**Example 1: Circular Sigmoid Function (CSF)-LS final estimation. Center (white mark) inside the image. Row center: 186.169 pixel ($\text{\Delta}r=-0.71781$). Column center: 187.8695 pixel ($\text{\Delta}c=-0.53055$). Radius: 217.6452 pixel ($\text{\Delta}R=0.38853$).

#### 6.2. Example 2: Synthetic Image Cropped

**Figure 13.**Example 2: Image processing phases (data in pixel). (

**a**) 1500 highest derivatives; (

**b**) $21\times 21$ box approach removed 911 outliers; (

**c**) RANSAC removed 229 outliers using 100 tests and ${d}_{min}=4$; (

**d**) Body center inside image. Row center = 189.0829, Column center = 437.5094, Radius = 89.0182 (worst residual = 4.9575).

**Figure 14.**Example 2: Circular Sigmoid Function (CSF)-LS final estimation (data in pixel). Center (white mark) inside the image. Row center: 189.2105 ($\text{\Delta}r=-0.12759$). Column center: 437.1483 ($\text{\Delta}c=0.3611$). Radius: 89.0247 ($\text{\Delta}R=-0.0064852$).

#### 6.3. Example 3: Real Image with Center Far Outside the Imager

**Figure 16.**Example 3: Image processing phases (data in pixel). (

**a**) 1500 highest derivatives; (

**b**) $21\times 21$ box approach removed 35 outliers; (

**c**) RANSAC removed 0 outliers using 100 tests and ${d}_{min}=4$; (

**d**) Body center outside image. Row center = 551.8926, Column center = −393.0706, Radius = 612.8029 (worst residual = 2.995).

**Figure 17.**Example 3: CSF-LS final estimation (data in pixel). Center outside the image. Row center: 556.0114 ($\text{\Delta}r=-4.1188$). Column center: −386.4042 ($\text{\Delta}c=-6.6663$). Radius: 605.5698 ($\text{\Delta}R=7.233$).

## 7. Error Analysis

- Estimated position error: This analysis quantifies how the error in the measured Moon radius (in pixel) affects the spacecraft-to-Moon distance computation (in km).
- Estimated attitude error: This analysis quantifies how the error in the camera attitude knowledge affects the spacecraft-to-Moon direction (unit-vector).
- Image processing errors: This Monte Carlo analysis shows the distribution of the Moon radius and center estimated by the image processing software when the image is perturbed by Gaussian noise. This is done in the three cases of crescent, gibbous and full Moon illumination.

#### 7.1. Position and Attitude Uncertainty Propagation

#### 7.2. Image Processing Error

## 8. Conclusions

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## References

- Chorym, M.A.; Hoffman, D.P.; Major, C.S.; Spector, V.A. Autonomous navigation-where we are in 1984. In Guidance and Control; AIAA, Inc.: Keyston, CO, USA, 1984; pp. 27–37. [Google Scholar]
- Owen, W.; Duxbury, T.; Action, C.; Synnott, S.; Riedel, J.; Bhaskaran, S. A brief history of optical navigation at JPL. In Proceedings of the 31st AAS Rocky Mountain Guidance and Control Conference, Breckenridge, CO, USA, 1–6 February 2008.
- Synnott, S.; Donegan, A.; Riedel, J.; Stuve, J. Interplanetary optical navigation: Voyager uranus encounter. In Proceedings of the AIAA Astrodynamics Conference, Williamsburg, VA, USA, 18–20 August 1986.
- Riedel, J.E.; Owen, W.M., Jr.; Stuve, J.A.; Synnott, A.P.; Vaughan, R.A.M. Optical navigation during the voyager neptune encounter. In Proceedings of the AIAA/AAS Astrodynamics Conference, Portland, OR, 20–22 August 1990.
- Gillam, S.D.; Owen, W.M., Jr.; Vaughan, A.T.; Wang, T.-C.M.; Costello, J.D.; Jacobson, R.A.; Bluhm, D.; Pojman, J.L.; Ionasescu, R. Optical navigation for the Cassini/Huygens mission. In Proceedings of the AIAA/AAS Astrodynamics Specialist Conference, Mackinac Island, MI, USA, 19–23 August 2007.
- Li, S.; Lu, R.; Zhang, L.; Peng, Y. Image processing algorithms for deep-space autonomous optical navigation. J. Navig.
**2013**, 66, 605–623. [Google Scholar] [CrossRef] - Christian, J.A.; Lightsey, E.G. Onboard image-processing algorithm for a spacecraft optical navigation sensor system. J. Spacecr. Rockets
**2012**, 49, 337–352. [Google Scholar] - Christian, J.A. Optical navigation using planet’s centroid and apparent diameter in image. J. Guid. Control Dyn.
**2015**, 38, 192–204. [Google Scholar] [CrossRef] - Mortari, D.; de Dilectis, F.; Zanetti, R. Position estimation using image derivative. In Proceedings of the AAS/AIAA Space Flight Mechanics Meeting Conference, Williamsburg, VA, USA, 12–15 January 2015.
- Taubin, G. Estimation of planar curves, surfaces and nonplanar space curves defined by implicit equations, with applications to edge and range image segmentation. IEEE Trans. PAMI
**1991**, 13, 1115–1138. [Google Scholar] [CrossRef] - Fischler, M.A.; Bolles, R.C. Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography. Comm. ACM
**1981**, 24, 381–395. [Google Scholar] [CrossRef] - Mortari, D.; Samaan, M.A.; Bruccoleri, C.; Junkins, J.L. The pyramid star pattern recognition algorithm, ION. Navigation
**2004**, 51, 171–183. [Google Scholar] [CrossRef] - Chernov, N. Circular and linear regression. Fitting circles and lines by least squares. In Monographs on Statistics and Applied Probability; CRC Press: Boca Raton, FL, USA, 2011; Volume 117. [Google Scholar]

© 2015 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Mortari, D.; De Dilectis, F.; Zanetti, R.
Position Estimation Using the Image Derivative. *Aerospace* **2015**, *2*, 435-460.
https://doi.org/10.3390/aerospace2030435

**AMA Style**

Mortari D, De Dilectis F, Zanetti R.
Position Estimation Using the Image Derivative. *Aerospace*. 2015; 2(3):435-460.
https://doi.org/10.3390/aerospace2030435

**Chicago/Turabian Style**

Mortari, Daniele, Francesco De Dilectis, and Renato Zanetti.
2015. "Position Estimation Using the Image Derivative" *Aerospace* 2, no. 3: 435-460.
https://doi.org/10.3390/aerospace2030435