CUBESAT ONBOARD ALGORITHM FOR SPACE DEBRIS MOTION DETERMINATION BY PROCESSING STEREO IMAGES

The study addresses the problem of space debris motion determination using a nanosatellite with video equipment that allows making stereo images. An original algorithm to determine a spatial orientation of the space debris is proposed. The algorithm is based on a pair of simultaneous stereo images and uses random samples of triangulated points to match the sequentially conducted stereo images. The Monte Carlo method is used to estimate the probability of the proposed algorithm effectiveness. The study offers the results of solving the model problem of a nanosatellite approach to the space debris and proposes recommendations on adjusting an algorithm and choosing the measurement program. * Corresponding author


INTRODUCTION
Nowadays excessive space debris poses a real threat to the access to outer space Therefore, a problem of cleaning space from these fragments, especially large-format ones, is urgent. Such missions imply a spacecraft-inspector approach to the space debris, which consists of uncooperative objects. A preliminary study of the fragment motion parameters is required to maneuver the space debris. In this case, both methods of optical image processing with the use of a single optical camera (Mansour et al., 2019) and methods of stereo photogrammetry are the most promising ones as they involve obtaining object characteristics by processing stereo images from a pair of cameras.
One such example is the reference (Tweddle, 2011), which contains a description of the method of relative navigation of the inspector device, with regard to the object of observation. The motion parameters are found by processing a sequence of stereo images, which is performed in two stages. A feature of this work is also the use of dynamics models to predict the parameters of motion, in cases where receipt of new measurements is absent.
The authors (Aghili, 2012) consider the use of the iterative method of nearest points for finding the parameters of the motion of the inspector device relative to the object of observation based on the results of stereo image processing in this work.
However, the major disadvantages of these methods are their computational complexity and impossibility to link two measurements conducted at sequential moments of time.
At this moment, there is an increasing interest in studying possibilities of using CubeSat nanosatellites in similar missions. These nanosatellites are cheap due to a high level of unification and standardization of their onboard systems and can be developed within a short time frame. Nevertheless, the small size of such devices imposes significant restrictions on the observation equipment and on the computational complexity of the algorithms since the task should be solved onboard.
This study presents a solution to the problem of the space debris motion determination using a nanosatellite with video equipment that allows making stereo images. An original algorithm that uses stereo images is proposed. The algorithm is based on the principles of triangulation and uses a pair of sequentially conducted simultaneous stereo images to determine a spatial orientation.

Coordinate Systems
The following coordinate systems are used in this study: 1. Body-fixed coordinate system (FCS) с O XYZ of the nanosatellite with the datum point in the center of nanosatellite mass. An с OX axis is directed along the longitudinal axis of the nanosatellite. An с OY axis is located in the plane of symmetry, coinciding with the plane of the trajectory, and is directed upwards, away from the center of mass. An с OZ axis complements the coordinate system to the right coordinate system.

Instrumental coordinate system (ICS)
Oxyz of the nanosatellite optical camera with datum point in the camera optical center. An Ox axis is directed along the optical axis of the camera.
Oy and Oz axes form an Oyz projection plane. In a process of triangulation for the left camera of stereo pair this coordinate system has the form 1 1 1 Ox y z and for the right camera of stereo pair it has 2 2 2 Ox y z . Usage of modified Rodrigues parameters allow reducing the computational complexity of the issue to determine the space debris motion.
To determine the spatial coordinates of the landmark from the stereo image, it is intended to use the direct photogrammetric serif method.
Suppose, that at time t we have to images 1 P and 2 P , which constitute stereo image and point i on the surface of space debris. Using the model of the projective camera (Szeliski, 2010) we can write equations for the three-dimensional coordinates of a point in the coordinate system associated with the left camera of the stereo pair: where Hscale factor; x y z coordinates of a point in the auxiliary coordinate system for images 1 P and 2 P , defined by the index j and can be described as: where Сa matrix that determines the angular position of the image relative to the ICS and is parameterized by the elements of the external orientation of the image (Bezmenov, 2009); fcamera focal length.
The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLIII-B1-2021 XXIV ISPRS Congress (2021 edition) The matrix that determines the angular position of the image relative to the selected coordinate system can be found as (Bezmenov, 2009 where the longitudinal inclination angle of the image relative to ICS, deg.; the transverse inclination angle of the image relative to ICS, deg.; the angle of rotation of the image relative to ICS, deg.; The scale factor H can be found using Figure 1 by writing an equation for collinear vectors for images 1 P and 2 P . Substituting (4) into (5) and considering that  i R R B , we will get an equation: To find the scalar H from (6) we will submit cross equations in the form of determinants: i j k -unit vectors of axis Ox , Oy , Oz of ICS.
The resulting vectors of these products are coplanar and differ only by the constant H .
Decompose products according to the determinants of the first lines: Together expressions (2) and (7) allow us to determine the three-dimensional coordinates of a point from its image on a pair of frames and constitute a direct photogrammetric serif.
For the current work, according to the limitations and assumptions, which are described earlier, the angles of mutual orientation are known in advance and constitute 0 , 90 , 0 The base between the cameras of the stereo pair in this case will be 0, , 0 In view of these values, the matrix С is written as: Thus, product (7) will take following form: where ptransverse parallax.
Substituting (8) into (2) we will get equations for the threedimensional coordinates of the landmark i in ICS: It should be noted that the stage of triangulation of stereo images into three-dimensional coordinates in the work is implemented with using the methods of the OpenCV (Beyeler, 2015).
The present study uses a measurement model classical for optical sensors (Gunnam et al, 2002), which is used for linking the landmarks of two sequentially made stereo images. Transformation of the coordinates into unit vectors components, which is also used in this study, is considered in reference (Lee, Pernicka, 2011).
On the other hand, this measurement can be presented through the t moment of time as: where i r is a vector, which has the following form: x y z is an offset between t and 1 t  states, m; ij A denote matrix components of the ICS rotation between the t and 1 t  states. The matrix representing the ICS rotation between the t and 1 t  states is defined as (Schaub et al., 2009)

ALGORITHM OF SPACE DEBRIS MOTION DETERMINATION BY PROCESSING STEREO IMAGES
To link two sequentially conducted stereo images, it was proposed to use an approach based on random sample consensus algorithm (RANSAC) and perform the following steps: 1. To detect reference points on the surface of the space debris for each pair of stereo images using OpenCV.
2. Triangulate each pair and determine 3D coordinates of points 3. For each pair of 3D coordinates at adjacent times: a. to form subsamples of the points for the two sequential moments of time, t and 1 t  .
c. to find estimates of the increments of the motion parameters that are optimal in terms of the minimum mean square error using the differential evolution method, which ensures regular convergence under conditions of a significant degree of uncertainty: d. to check the found estimates by comparing to points not included in the subsample 4. To add the found increments of the motion parameters to those calculated at the previous step of the algorithm: The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLIII-B1-2021 XXIV ISPRS Congress (2021 edition) Figure 3. Data processing with using stereo images.

NUMERICAL MODELLING
To evaluate results of the numerical experiments, Monte Carlo method is used. The problem of a nanosatellite-inspector rendezvousing with the space debris has been solved a given number of times with the developed algorithm for a fixed number of points on the surface of an uncooperated object.
To simulate the motion of the space debris relative to the center of the mass, a model (Popov, 1986) is used. To simulate the motion of a nanosatellite relative to the space debris, a model of relative motion (Apazov et al., 1987) is used. The initial distance for approach to the space debris is chosen from considerations of reaching a close inspection trajectory (Apazov et al., 1987 andScherbakov, 2019).  To estimate the adjusting parameters of the method of random point subsamples, the following expression denoting the probability of a correct modeling is used: where n is a number of points selected for building a compatibility model; I is a number of inliers (matching points); T is a total number of points found for the current moment of time.
The study also uses a / w I T  parameter to characterize a qualitative ratio of the sample.
A probability that in k iterations the algorithm will never select n corresponding points is (1 ) k q  and this situation will mean that it is impossible to build a correct model.
The study estimates the probability of an algorithm error on data for different qualitative ratios of a sample w = 25, 50, 75 %; for different numbers of selectable model points n = 2, 5, 10, 20; for different iterations numbers k = 10, 100, 1000.

RESULTS AND RECOMMENDATIONS
According to the simulation results, errors in determining the parameters of linear and angular motion decrease with a reduction in the distance between the nanosatellite and space debris. The maximum error values are 1.2 m and 0.2 degrees and correspond to the initial distance between nanosatellites and space debris of 80 m.
There are some recommendations, which are formed to adjust the method of random subsampling of points and the measurement program and based on the results of the simulation.
1. The number of iterations k of the method has little effect on the construction of an erroneous compatibility model.
2. The number of points n selected for construction has an influence on the construction of an erroneous compatibility model. The best option is the one that selects a small number of points ( 5 n  ).
3. Estimation errors can be reduced by choosing the value of the time interval between neighboring measurements.