[orcid = 0000-0002-6980-1813] [1] Software, Writing of the manuscript

[orcid = 0000-0002-9661-5709] Software, Writing of the manuscript

[orcid = 0000-0002-2321-9334] Discussion, Writing of the manuscript

[orcid = 0000-0002-3477-2282] Conceptualization of this study, Methodology,
Writing of the manuscript

# Morphological Study of Granular-Granular Impact Craters through Time-of-
Flight Cameras: from Concept to Automation in Python

F. Corrales-Machín<EMAIL_ADDRESS>G. Viera-López  R. Bartali  Y.
Nahmad-Molinari  Universidad Autónoma de San Luis Potosí, Instituto de Física,
Av. Parque Chapultepec 1570, San Luis Potosí 78295, México  Gran Sasso Science
Institute, Viale Francesco Crispi, 7, L’Aquila 67100, Italy  Universidad
Autónoma de San Luis Potosí, Facultad de Ciencias, Av. Parque Chapultepec
1570, San Luis Potosí, 78295, México

###### Abstract

Laboratory made granular-granular impact craters have been used as model
analogues of planetary impact craters. These kind of craters have been
observed and studied using profilometry techniques that allow to retrieve
important morphologic features from the impacted surface. In this work, we
propose to use a Time-of-Flight camera (Microsoft Kinect One) for the
acquisition of depth data. We show comparisons between the typically used
technique and the analysis derived from the Time-of-Flight data. We also
release _craterslab_ , a Python library developed to automate most of the
tasks from the process of studying impact craters produced by granular
projectiles hitting on the surface of granular targets. The library is able to
acquire, identify, and measure morphological features of impacted surfaces
through the reconstruction of 3D topographic maps. Our results show that using
a Time-of-Flight camera and automating the data processing with a software
library for the systematic study of impact craters can produce very accurate
results while reducing the time spent on different stages of the process.

###### keywords:

Depth sensor Kinect Crater morphology Python library

Introduces a robust technique based on ToF sensors for studying experimental
man-made craters morphology.

Compares the results obtained with ToF sensors against the established
technique.

Proposes a software library for the automation of impact craters morphology
and morphometric measurements.

##  1 Introduction

Determining unknown distances to objects or their spatial dimensions by
measuring the angles they form from known points of observation is an ancient
technique known as triangulation, which is still used in modern instruments.
In the sixth century BC, Thales of Miletus measured the height of pyramids by
comparing the ratio of their shadow length to height with his own shadow
length to height ratio at the same time, using the Thales theorem of
corresponding proportions. Shortly after, Eratosthenes measured the radius of
the Earth, while Aristarchus of Samos calculated the sizes of the Sun and
Moon, as well as their distances from the Earth in Earth radii, based on the
same geometric principles. This led to the development of a heliocentric model
of our solar system, utilizing a simple yet powerful set of geometric
theorems, thousands of years ago (James, 1953).

After Galileo invented the astronomical telescope in $1609$ and discovered
craters on the Moon’s surface, various hypotheses were proposed regarding the
origin of these geological structures, including coraline reefs, volcanic
activity, and the later rejected idea of impact origin proposed by Hooke. It
was not until the twentieth century that the impact origin theory was revived
by Grove Gilbert for explaining lunar craters, and found to align well with
Laplace’s protoplanetary cloud theory of solar system formation (Gilbert,
1979).

The importance of meteorite impacts for Earth and life on Earth evolution was
recognized in $1980$, when the Chicxulub crater in the Yucatán peninsula was
recognized as the scar of a colossal impact that caused the mass extinction
event at the Cretaceous - Paleogene (K-Pg) boundary $65$ Ma ago (Alvarez et
al., 1980, 1995). Initially, projected shadow length was used to determine the
depth of craters and the height of their rims in early studies of lunar
geophysical features (Chappelow, 2013). Subsequently, satellite radar
altimetry using real-time of flight techniques (Davis, 1992) was employed to
explore topographic features and create elevation maps. Eventually, phase-
change Time-of-Flight techniques, such as LiDAR, were introduced for
atmospheric, terrestrial, and planetary science prospecting.

Currently, there exists a well-established understanding of the processes
involved in impact crater formation, which has been derived from geophysical
exploration of terrestrial impact craters, computer simulations, and
hypervelocity experiments. These processes can be categorized into three main
stages: contact and compression, excavation of a transient crater, and
modification through avalanching and deposition of debris (Melosh, 1989;
Osinski and Pierazzo, 2013). However, due to their rare occurrence and the
immense energy involved, impacts that form planetary craters are infrequent
events that are difficult to observe directly. Consequently, it is challenging
to gather experimental or observational evidence to directly compare and
validate the theoretical understanding of impact crater formation.

Again, using proportionality laws or scaled systems, the Scottish geologist
and geographer Henry Cadell played a pivotal role in advancing the field of
analog model studies through sandbox experiments. His work focused on
investigating the formation of thrust and fold systems in the Scottish
Highlands. Subsequently, scaled analogue modeling has become a commonly
employed technique for studying the geometric, kinematic, and dynamic
evolution of various geological structures. This powerful tool allows for a
comprehensive understanding of the geometric and kinematic development of
extensional, inverted fault systems, as well as strike-slip fault systems.

The remarkable resemblance between the scaled models and the natural
geological examples described in the literature highlights the effectiveness
of this method in accurately replicating real-world geological structures
(McClay, 1996). However, this technique has been, just very recently,
incorporated for understanding Impact craters as geologic processes (Bartali
et al., 2015) by considering equal adimensional numbers (v.g. Reynolds and
comminution numbers), regardless of the fact that man made laboratory craters
and observed planetary craters are produced by events differing in six or more
orders of magnitude (González-Gutiérrez et al., 2014; Pacheco-Vázquez and
Ruiz-Suárez, 2011).

In order to investigate the influence of impact collision energy on the final
shape of craters, various techniques have been employed for the
characterization of morphological features of craters such as laser
profilometry or direct measurements (De Vet and de Bruyn, 2007). These
techniques provide valuable insights into the characteristics and behavior of
impact craters, aiding in the understanding of the relationship between the
energy involved in the event and the resulting crater morphology and
sedimentologic features.

In 2010, Microsoft released a structured light-based range detection camera,
Kinect, which provides depth images (RGB-D) along with an RGB color camera.
Although the Kinect sensor was originally intended for natural user
interaction in body-based video games, the release of its source code by
Microsoft has led to the development of numerous applications in robotics (El-
laithy et al., 2012), 3D reconstruction (Keller et al., 2013; Newcombe et al.,
2011; Nießner et al., 2013), medicine (Mousavi Hondori and Khademi, 2014),
augmented reality and interaction (Vera et al., 2011), geophysics (Rincón et
al., 2022; Tortini et al., 2014), among others.

In 2013, Microsoft announced an update to Kinect based on the Time-of-Flight
(ToF) principle. This new version includes additional improvements compared to
its predecessor.

In the study of craters, the Kinect system has been employed to automatically
measure grain size distribution across a range from pebbles to blocks in
outcrops within the Joya Honda crater in Mexico (Chávez et al., 2014).
However, the increasing utilization and affordability of LiDAR and Time-of-
Flight instruments for rapid surface topography measurement have prompted us
to develop a versatile methodology specifically designed for acquiring and
processing topographic data in the study of impact crater formation.

As part of this work, we release a Python library we develop to automate our
methodology and determine the morphological characteristics of excavated
craters in laboratory settings. We expect that both our library and our
approach on using Time-of-Flight cameras may enable novel studies on granular-
granular impact craters serving as model analogues for observed planetary
craters.

##  2 Mapping of surfaces

Three-dimensional measurement and reconstruction of surfaces is a significant
topic in various fields of research, with diverse applications such as range
scanning (Zhang and Yau, 2009), industrial inspection of manufactured parts
(Graebling et al., 2002), reverse engineering (digitization of complex, free-
form surfaces) (Lu and Wang, 2015; Carbone et al., 2001), object recognition
and 3D mapping (Stein et al., 1992; Rogers et al., 2011). Currently, several
techniques are implemented for these measurements, benefiting from significant
technological advancements that enable high resolutions and software with
multiple domain-specific features. However, access to these software often
comes with a high financial cost.

In the context of mapping granular-type impact craters, the scientific
community primarily relies on profilometry as the preferred technique for
obtaining morphological characteristics. However, the idea of implementing
depth measurement techniques based on range sensors, such as LiDAR, in this
field of research is highly appealing. In this section, we will explain the
operating principle of both techniques and their general limitations, with a
deeper focus on their application for the study of craters morphology.

###  2.1 Profilometry-based Methods

With the current technological advances in acquiring three-dimensional surface
maps, different profilometry techniques have been refined to obtain more
reliable results in shorter time (Van der Jeught and Dirckx, 2016; Salvi et
al., 2010; Su and Chen, 2001). Despite these advancements, most of these
techniques are challenging to implement and have limitations such as complex
image analysis.

As mentioned earlier, laser profilometry is commonly used to obtain
morphological characteristics of craters. This method is based on the
principle of triangulation, where a laser projects a beam of light onto the
surface of interest, and a sensor records the position and angle of the
reflected beam. With this information, the distance between the sensor and the
surface can be calculated, allowing for the reconstruction of a three-
dimensional profile.

In addition to laser profilometry, another technique used for measuring depths
on crater surfaces is structured light profilometry (Geng, 2011). In this
method, a pattern of structured light, such as stripes or lines, is projected
onto the surface, and an image of the illuminated surface is captured.
Analyzing the deformations of the light pattern in the image allows for the
calculation of local depths of the surface. Structured light profilometry is
based on the principle of interferometry, where variations in the surface
shape cause changes in the phase and intensity of the reflected light. These
changes are captured by a camera and processed to obtain a depth map of the
crater’s surface.

While laser profilometry and structured light profilometry are widely used
techniques for obtaining data for the morphological characterization of
granular impact surfaces, they also have certain limitations that are
important to consider. The following are some of these limitations:

Both laser profilometry and structured light profilometry methods have
limitations in resolution due to factors such as sensor-to-surface distance,
pixel size, and laser precision. These limitations can impede capturing fine
surface details, especially in areas with small features. Additionally,
accurately measuring transparent or translucent surfaces can be challenging as
light may pass through or be absorbed instead of being reflected, resulting in
inconsistent measurements. Reflective surfaces can also pose difficulties, as
intense reflections can interfere with measurements and generate inaccurate
data. Shadows and obstructed areas on the surface can hinder data capture by
causing variations in reflected light intensity or blocking the light pattern
projection. Furthermore, measurements obtained through these methods are
susceptible to noise and artifacts, which can introduce errors or distortions
in the data. These artifacts can arise from fluctuations in light intensity,
environmental interference, or device calibration issues. Finally, data
acquisition time can be a limitation, particularly when high resolution or
sampling large areas efficiently is required, impacting situations that demand
fast response times.

In summary, laser profilometry and structured light profilometry are valuable
techniques for measuring depths and obtaining three-dimensional surface
information. While they have seen improvements in recent years, they still
have limitations in terms of implementation complexity and specific challenges
related to image analysis. These techniques, nevertheless, offer valuable
insights into the morphology of granular impact craters and contribute to the
understanding of physical phenomena.

###  2.2 Methods based on LiDAR Sensors

In the last decade, new affordable range detection devices have been
developed. Light Detection and Ranging (LiDAR), since the 1960s with the
advent of lasers, has emerged as a pioneer in this field, empowering multiple
applications (Dong and Chen, 2017; Pittman et al., 2013). LiDAR technology is
based on the Time-of-Flight principle. It measures the time it takes for light
emitted by a device to travel to the surface of an object and return to the
sensor of the unit. The precise measurement of the time it takes for light to
travel and return to the sensor array of a measuring device is determined by
the switching velocity of the sensor’s microelectronics. Time-of-Flight
cameras employ a continuous wave intensity modulation approach, where the
surface of interest is illuminated with near-infrared intensity-modulated
periodic light. Considering the finite speed of light ($c$) and the distance
between the camera and the surface (assuming the sensor and illumination are
in the same location), an optical signal experiences a temporal shift
$\phi[d]$, which corresponds to a phase shift in the periodic signal. The
phase shift is calculated by considering the charge accumulated in the sensor
due to the reflected light when the synchronous shutter turns off the light
sampling. By transforming the temporal shift into the sensor-object distance,
we obtain the equation $d=4c\phi\pi$. It is important to note that
intermittent illumination of the scene at several gigahertz and rapid
switching speeds are crucial for achieving high depth resolution.

Among the various LiDAR devices based on the Time-of-Flight principle, the
second generation of Microsoft Kinect (KinectToF) stands out. It offers
several improvements over its predecessor, which utilizes structured light
(SL) method for depth information acquisition. In the first generation of
Kinect, the structured light method involves projecting a sequence of known
patterns onto an object, which deform based on the object’s shape. The
deformed patterns are then captured by a camera, and by analyzing the
distortion using triangulation, depth information is derived.

Both SL and ToF principles for range detection are susceptible to various
sources of error. Several studies have compared these methods and explored
different calibration techniques for the Kinect camera. These studies include
(Sarbolandi et al., 2015; Wasenmüller and Stricker, 2017; Pagliari and Pinto,
2015; Yang et al., 2015; Lachat et al., 2015; Essmaeel et al., 2012; Zhang,
2000). Considering the benefits and limitations of the two different Kinect
principles of operation, it has been determined that the second generation,
utilizing ToF technology, is superior (Kadambi et al., 2014). To our
knowledge, ToF sensors have not yet been used for the study of morphological
signatures of experimental impact craters in laboratory.

##  3 Materials and Methods

An experimental system was designed to recreate the formation of impact
craters by using, for the first time, a KinectToF sensor for the data
acquisition. Considering that laser profilometry is the typically used
technique for this purpose, we added it to the experimental setup in order to
validate the results obtained by our approach.

We constructed a square-based sandbox with dimensions of $45$ cm per side and
$15$ cm in height as the surface or granular bed in which the crater forms
after the impact of a sand lump projectile. Sand grains with a diameter of
$d\leq 1.0$ mm were deposited inside the box as the granular medium. The
granular bed is loose packed or compacted in order to observe how the
morphologies of the craters vary for different impact energies.

Impacts were carried out by releasing a granular projectile from heights
ranging from $0.1$ m to $20$ m, respectively. The granular projectiles were
composed of $250$ g of the same granular material as the impact surface, using
$50$ ml of water, and $5.0$ g of hydraulic Portland cement as an adhesive. The
mixture was compacted into a spherical mold and left to dry at room
temperature, forming weakly consolidated granular spheres with a diameter of
$7.0$ cm and packing fractions ranging from $\eta=0.40$ to $\eta=0.62$.

For retrieving depth maps from the granular surface, we attached a Microsoft
Kinect One to a mobile system placed over the sandbox, allowing the sensor to
move along one horizontal (the $Y$ axis) above the sand free surface during
experiments. Depth data was acquired at a height of $102.7$ cm, perpendicular
and stationary to the impact surface. Two depth maps are acquired using
Kinect, the first one containing all projectile fragments that may be present
on the surface, and for the second one, the interfering projectile fragments
are removed to facilitate the morphological analysis of the impacted surface.
Once the depth data is acquired using the Kinect sensor, a custom software was
used in order to process the data and retrieve valuable information from the
surface.

The laser profilometry technique is performed as well in order to compare and
discuss the results of both methods. It is conducted without a sensor for
automated data acquisition. Instead, a laser beam is used to project five
lines onto the granular bed at a $45$-degree angle. Scanning is performed at
different points on the surface, and images are captured for each position.
Subsequently, these images are processed using _ImageJ_ software (Bartali et
al., 2013), employing the principle of triangulation to obtain depth and
diameter measurements of the crater under study. The procedure of using laser
profilometry to obtain morphological characteristics is well-known and
established in the field.

Next, we will address some definitions related to morphological observables
from impact craters.

##  4 Main Crater Observables

Craters can be classified into two groups: simple and complex craters.
Examples from both types can be inspected in Figure 1(a) and Figure 1(b)
respectively.

Simple craters are bowl-shaped depressions with raised rims and approximately
parabolic interior profiles. A straightforward structure that presents a
circular or elliptical rim with the rim-to-floor depths of a large sample of
simple craters on the moon are roughly $1:5$ of the rim-to-rim diameter.

Complex craters possess a variety of features and a more complicated structure
than simple craters. They often exhibit a central structure in their interior
(central peak or dome) which may protrude above the crater rim. Images from
Lunar Reconnaissance Orbiter Camera (LROC) shows craters with single or
multiple central peaks, concentric rims and flat inner floors. The depths of
complex craters increase with increasing diameter, but they increase much more
slowly than the depths of simple craters (Melosh and Ivanov, 1999).

(a)

(b)

Figure 1: Crater classification. (a) Simple crater Steinheil (b) Complex
crater Tycho. Images taken from (Lunar QuickMap, 2023d, b)

In both cases, we will establish the original ground surface as the zero
reference for heights and depths (Osinski and Pierazzo, 2013). From this
reference point, we will consider the positive $Z$ axis as an increase in
height above the surface, and the negative axis as a decrease in surface
level.

For both morphologies depicted in Figure 2 there may be deposits of granular
material in the interior of the crater, which are remnants of the impacting
granular projectile. Therefore, the maximum observable depth $d_{max}$ may be
smaller than the actual crater depth $d_{t}$. Both measurements of depth are
typically below the original ground surface.

(a)

(b)

Figure 2: Definition of some craters observables. (a) For Simple Craters. (b)
For Complex Craters.

The height of the central peak $H_{cp}$ can be defined as the difference
between its maximum depth value $d_{cp}$ and the maximum observable depth
$d_{max}$.

From Figure 1 we can notice that craters generally have an elliptical
geometry, where a circular approximation of their surface is a special case of
an ellipse. To determine the type of geometric approximation that best fits
their surface, Equation (1) can be fitted on samples from the distribution of
maximum height values around the crater rim $h_{rim}$.

Once this ellipse is obtained, the values of $a$ and $b$ are fixed, which
represent the major and minor radii of the ellipse, respectively. In the case
of a circular fit, these values will be equal. Additionally, $x_{c}$ and
$y_{c}$ represent the $x$ and $y$ coordinates of the center of the ellipse.
Finally, Equation 1 fitted over the rim provides the variables $\theta$ and
$\varepsilon=\dfrac{\sqrt{a^{2}-b^{2}}}{a}$, which are the rotation angle and
eccentricity of the ellipse that represents how circular or elliptical the
surface of the crater is in function of it diameters.

$\displaystyle\frac{[(x-x_{c})\cos\theta+(y-y_{c})\sin\theta]^{2}}{a^{2}}+$
(1)
$\displaystyle\frac{[(x-x_{c})\sin\theta-(y-y_{c})\cos\theta]^{2}}{b^{2}}=1$

The diameter $D=2a$ of both simple and complex craters is defined as the
distance equal to the major axis of the best fitting ellipse to the rim.
Having an elliptical approximation for a crater simplifies the computation of
several observables. For example, the crater diameter $D$ can be conveniently
expressed as $D=2a$. Furthermore, by transforming Equation (1) into an
inequality, it is possible to quickly determine whether an arbitrary
coordinate $x,y$ corresponds to the interior of the crater or not. This can be
used to speed up some costly computations, such as finding the maximum
observable depth $d_{max}$ or computing the crater concavity’s volume
$V_{in}$.

The concavity’s volume $V_{in}$ is the volume contained inside the crater
limited to the average value of $h_{rim}$. This volume is equivalent to the
amount of water that can be contained within the crater’s concavity if it
could be filled up to the average rim’s height without being spilled out,
considering the rim’s height to be uniform all around the fitting ellipse.

The excavated volume $V_{ex}$ is the volume of the hollow under the surface
reference ground level within the crater rims. This excavated volume only
accounts for the amount of material of the target that has been removed or
compressed, but not substituted by the projectile material. As the impact
energy increases, larger is the excavated volume, and less material from the
projectile remains within the crater.

For complex craters with uplifted central structures, such as central peaks or
domes, the crater’s depression forms an annular trough. The lowest points of
this annular depression delineate a ring-shaped valley, marking the beginning
of the uplifted central structure. The volume of the central peak ($V_{cp}$)
corresponds to the space enclosed within the inner ring-shaped valley and is
determined based on the average depth of this valley.

On the other hand, we define the deposit excess volume $V_{exc}$ as the volume
found above the ground surface. This variable is related to the amount of
material ejected and expanded (Reynolds dilatancy (Andreotti et al., 2013)) or
displaced by the shock wave during the impact and includes all material
deposited on the surface, including that of the crater rim. It is important to
note that in the case of complex craters, the formation of central peaks may
protrude above the ground surface zero reference, and that fraction of the
volume of the central peak $V_{cp}$ is considered in the calculation of
$V_{exc}$.

Now, let’s delve into a particular case of morphologies observed for impacts
with very low energies, where no penetration occurs in the original and
compacted ground surface (See Figure 3).

(a)

(b)

Figure 3: Impacts at very low energies with no penetration of original ground
surface. (a) Perpendicular view respect to the original ground surface (b)
Oblique view.

These particular morphologies do not meet the definitions of craters, since no
depression is formed, and will be considered as sand mounds formed by the
remnants of the projectile on the impact surface. These mounds may or may not
approximate central peaks. For these cases, only the variables of deposit
excess volume $V_{exc}$ and maximum mound height $H_{m}$ for $z>0$ values are
taken into account.

##  5 Craterslab Software

The study of planetary geology and impact craters encouraged the development
of various software tools that aid in the analysis of planetary craters. These
software tools provide valuable insights into the formation and evolution of
celestial bodies, helping us to better understand the history and structure of
our solar system.

Some of the most recent software tools for analyzing planetary craters include
craterstats (Michael, Greg and Annex, Andrew and Aye, Michael, ), CSFD Tools
(Riedel et al., 2018), mvtk (McDonald and Montgomery, 2015) and PyNAPLE
(Sheward et al., 2022). These software offer a range of features, from 3D
visualization and topographic mapping to data analysis and modeling tools.
They are widely used by planetary scientists and researchers to study the
morphology and history of craters on various celestial bodies.

However, most of the craters-related software have been crafted with a strong
focus on planetary craters. While man-made craters have been shown to be
useful models for studying the rare events occurred during impact crater
formation, specific software tools are required to help process data from
these experiments. To address this need, we have developed _craterslab_ , a
software library that is able to automate data acquisition from Time-of-Flight
sensors and process the data to retrieve the main crater morphologic features.
The library is open source and packaged for distribution via pypi (Viera-
López, Gustavo and Corrales-Machín, Frank, ).

The software is designed to simplify the data acquisition and analysis
process, allowing researchers to focus on the interpretation of results rather
than spending time on data processing. It offers a range of features,
including automatic data acquisition, real-time data processing, and the
ability to visualize and analyze data in a variety of ways. Sample plots
produced with _craterslabs_ can be seen in Figure 4.

(a)

(b)

Figure 4: Visualization of the impacted surfaces using _craterslab_. (a) 2D
view of the impact surface in the $X,Y$ plane. The fitted ellipse is observed
over the distribution of maximum height values around the crater rim. The
diameter, which coincides with the major axis of the fitted ellipse, is also
represented. (b) 3D visualization of the cavity volume, which can be
interpreted as the amount of water that can be contained within the crater.
This provides a visual interpretation of the numerical value of $V_{in}$.

The workflow of the software can be summarized in: (1) fetching surface
mapping data directly from sensors or locally stored files; (2) Classifying
the surface based on the observed formation: simple crater, complex crater or
sand mound; (3) computing the shape of the crater by fitting an ellipse to the
crater rim; (4) determining morphological crater features and (5) visualizing
the results. However, the software is built with flexibility, allowing for
independent usage of some of its functionalities.

The different crater’s observables computed by the software, described in
Section 4, allows for various analyses of experimental crater morphology.
Variables such as diameter and depth can be more accurately correlated with
each other. Others, like cavity volume, can now be determined precisely with
numerical integration rather than geometric approximations. For example, it is
now possible to calculate the volume of the cavity in the craters represented
in Figure 5(d) and Figure 5(e).

The software is also able to compute the interior slopes of the craters, which
allows to determine the incoming direction of the projectile in oblique
impacts; the excavated and excess volume, which are related to the amount of
material deposited inside the crater, compression and expansion of the
terrain, and the ejecta deposited outside the crater after impact.

In the following section, we will illustrate the usage of the software by
processing the data obtained following the procedure described in Section 3.

##  6 Results and Discussion

In order to validate both, the methodology for studying craters morphologies
through ToF sensor and our software library for automating the process, we
conducted a set of experiments at different launching heights on a compacted
or loose packed sand bed as described in section 3, producing a wide range of
impact craters types or sand mounds. Figure 5 shows the outcomes of three
different type of morphologies produced experimentally.

Figure 5(a) shows the resulting data gathered and visualized using our
software for the case of a simple crater, similarly, Figure 5(b) and Figure
5(c) resemble the data from a complex crater and a sand mound respectively.
For all three cases, we included an image of the surface taken after the
impact. Those images can be seen in Figures 5(d), 5(e) and 5(f) respectively.
When comparing the images in the first and second rows of Figure 5, the
remarkable similarities between the experimental craters and their three-
dimensional visualizations by _craterslab_ are evident.

The images in the third row (Figures 5(g), 5(h), 5(i)) depict natural craters
on the Moon, Mercury, and Mars, respectively (Lunar QuickMap, 2023c; Mercury
QuickMap, 2023; Mars QuickMap, 2023). They were included to highlight the
similarities found between our experimental craters and those in our solar
system. The insets of these images represent the cross-sectional profiles
obtained from the platforms provided by Applied Coherent Technology (ACT)
Corporation. Upon comparing the profiles of the images in the second row,
obtained by _craterslab_ , with those in the third row of Figure 5, the
striking similarity between granular analog craters and natural craters is
remarkable.

In order to expand the evaluation, we proceeded to use our software for
analyzing the depth map of the King crater, a well known lunar crater. The
results are presented in Figure 6, where a three-dimensional visualization of
the crater surface with the fitted ellipse on the crater rims (Figure 6(b)) is
displayed. In addition to reproducing natural craters in three dimensions and
enabling visual analysis, _craterslab_ is also capable of extracting the main
observables that allow for the analysis of their morphological
characteristics.

For the King crater (Figure 6(a)) (Lunar QuickMap, 2023a), our software
provides results that can be directly compared with those from the LROC
platform, such as cross-sectional profile and interior slopes. However,
_craterslab_ can obtain and analyze additional observables from natural
craters, for example the cavity volume ($V_{in}$).

(a)

(b)

(c)

(d)

(e)

(f)

(g)

(h)

(i)

Figure 5: Three-dimensional visualization of the morphological surface of
granular impact craters using _craterslab_ with Kinect depth data.
Experimental and natural crater images are shown for comparison. (a) A simple
crater obtained at a height of $7.0$ m above a loose packed granular bed with
$V_{in}=442966.88$ mm3. (b) A complex crater obtained at a height of $9$ m
above a loose packed granular bed with $V_{in}=550837.34$ mm3. The morphology
inside the crater changes compared to (a) due to a slight variation in
potential energy. (c) Sand mound formed by the remnants of the projectile on
the compacted impact surface at a height of $2$ m with $V_{exc}=191267.39$
mm3. The experimental images (d), (e), and (f) correspond to the reconstructed
three-dimensional models and serve as a visual comparison, showcasing the
similarities and differences between the experimental craters and their
reconstructions using ToF sensors. The insets correspond to the cross-
sectional profile obtained by _craterslab_. Similarly, images (g), (h), and
(i) display natural craters alongside the insets of their cross-sectional
profiles. (g) Simple crater Bernoullie C on the Moon, inset extracted from the
LROC platform using LOLA (Lunar Orbiter Laser Altimeter). (h) Complex crater
Debussy on Mercury, inset obtained from the USGS DEM (United States Geological
Survey Digital Elevation Model). (i) Mound formation on Mars without
nomenclature, coordinates: Latitude: $-45.47963$, Longitude: $55.10807$, inset
extracted from the MOLA DEM (Mars Orbiter Laser Altimeter Digital Elevation
Model).

Additionally, a comparison is shown between the profile view of the crater
over the ellipse’s largest radii obtained by _craterslab_ and the profile view
by LROC, Figure 6(c). The profile for the King crater obtained by the software
is similar to the one obtained by the LROC tool. The slight differences can be
attributed to the manual selection of the profile with the LROC tool, which
does not allow for obtaining the largest profile from the crater
automatically.

Once the 3D data from the experimental or natural craters is obtained, the
software can compute the main observables automatically, eliminating the need
for manual calculations or laborious image analysis procedures. This
automation not only saves time but also ensures a more reliable and consistent
analysis, leading to a deeper understanding of the crater morphology and how
is correlated with its associated launching parameters.

(a)

(b)

(c)

Figure 6: Depth map analysis of the King crater using _craterslab_. (a) King
Crater, with a diameter of $77$ km and a depth of $5$ km, is one of the
youngest craters on the far side of the Moon and serves as an excellent
example of a Copernican-aged complex impact crater. (b) Three-dimensional
projection of King Crater. The volume of its cavity is $V_{in}=5392.65$ km3.
(c) Comparison of cross-sectional profiles of King Crater obtained from the
LROC platform using LOLA (Lunar Orbiter Laser Altimeter) and _craterslab_

Next, we obtain and characterize the morphological variations of the impact
surface using our library and a KinectToF as the depth sensor. All craters
produced by the collision events were characterized by both techniques:
profilometry and software-aided depth map analysis. The morphological
characteristics of craters were measured manually from upper view pictures for
profilometry, but both manually and automatically from the depth maps provided
by the Kinect sensor, for comparison purposes.

For the Kinect measurements in the plane $X,Y$, we first determined the
craters diameter manually, mimicking the processing conducted with the
profilometry, and then we automatically fitted a rotated ellipse using our
software in order to compare both methods for measuring the diameter of the
crater. Results are shown in Figure 7(b) and Figure 7(c) respectively. It is
notorious that both methods are equivalent for diameter purposes, at least for
the eccentricity values of these normal incidence impact craters.

(a)

(b)

(c)

Figure 7: Diameter vs. Potential Energy for Impacts on a Loose Packed Granular
Bed. The insets display logarithmic scale plots accompanied by linear fits.
All linear fits cases exhibit a slope of $0.23$. This preliminary result is
close to the exponent found in the relationship $D\propto E^{1/4}$ for natural
craters in our solar system. (a) Diameters obtained using the profilometry
method. (b) Diameters estimated manually using Kinect data. (c) Diameters
computed automatically using _craterslab_.

Comparing the results from the profilometry technique (see Figure 7(a)) with
the manual processing of the depth map (see Figure 7(b)), a standard deviation
of $0.028$ mm is obtained for distance values. This indicates that, under our
working conditions, the resolution of the Kinect camera is equivalent to the
profilometry method in the $X,Y$ plane.

Consequently, the differences in diameter size obtained from the software,
manual estimation from the depth map, and profilometry are nearly
indistinguishable, as depicted in Figure 7.

In morphological characterizations involving the $Z$ plane, both techniques
are equivalent for obtaining depth data but profilometry exhibits a higher
margin of error compared to KinectToF. The increased errors in profilometry
occur within the interior of the fitted ellipse. This is attributed to the
granular nature of the surface and the lighting conditions on the impact
surface, which cause the thickness of the laser lines to increase within the
crater. This introduces greater uncertainty in the measurement of depth
values, as depicted in Figure 8. The average thickness in error of the laser
lines within the crater is $5.09$ mm.

In contrast, Kinect depth data exhibits an offset of $\pm 1$ mm in our
measurements. This offset represents the correction applied to align the depth
measurements with the true surface positions, compensating for any systematic
errors introduced by the sensor or experimental setup.

As a result, Kinect provides higher precision in the three-dimensional
reconstruction of granular impact surfaces.

##  7 Conclusions

We propose a methodology for studying impact craters based on Time-of-Flight
sensors. We validate our approach by comparing it with the established
technique which relies on profilometry. Surface topographic data are gathered
using a KinectToF camera for different impacting energies and compaction of
the target terrain, producing a variety of crater shapes whose main
morphological features are recognized and automatically measured, including;
shape, depth, local slope, excess and excavated volumes as well as central
peak volume and height. KinectToF exhibits high precision for the task,
outperforming laser profilometry.

A software for automating the process is released as part of this work. It is
designed for data acquisition and analysis of granular impact craters and
natural craters. Time spent on both acquisition and analysis of data is
considerably minimized when compared with previous methods due to the usage of
this software.

LiDAR sensors, specifically the second generation of Microsoft Kinect, when
combined with our software, are able to provide very accurate results from
craters morphology. As a consequence, previously used geometric
approximations, such as cavity’s volume, can now be calculated numerically
with greater precision. The automatic computation of other observables
performed by the software, such as excess volume, excavated volume and inner
slope of the crater, may be pivotal for advancing various research topics in
field. For instance, determining projectile’s penetration angle in craters
formed by oblique impacts and analyzing the amount of material remaining as a
deposit or ejected matter after impacts.

(a)

(b)

Figure 8: Lines of the laser light beam inside the crater depending on the
lighting conditions. (a) thickness $6.96$ mm. (b) thickness $3.36$ mm.

Code availability section

Name of the library: craterslab

Contact<EMAIL_ADDRESS>
Hardware requirements: Any system compatible with Windows, Linux or MacOS

Program language: Python 3.10+

Software required: Python

Program size: Scripts size – 34.2 kB, pretrained model – 26.3 MB

The source code is available for downloading at the link:
https://github.com/gvieralopez/craterslab

Data availability

The data used for this work is available for downloading at the link:
https://github.com/gvieralopez/craters-data

## References

  * Alvarez et al. (1980) Alvarez, L.W., Alvarez, W., Asaro, F., Michel, H.V., 1980.  Extraterrestrial cause for the cretaceous-tertiary extinction.  Science 208, 1095–1108.
  * Alvarez et al. (1995) Alvarez, W., Claeys, P., Kieffer, S.W., 1995.  Emplacement of cretaceous-tertiary boundary shocked quartz from chicxulub crater.  Science 269, 930–935.
  * Andreotti et al. (2013) Andreotti, B., Forterre, Y., Pouliquen, O., 2013.  Granular media: between fluid and solid.  Cambridge University Press.
  * Bartali et al. (2015) Bartali, R., Nahmad-Molinari, Y., Rodríguez-Liñán, G.M., 2015.  Low speed granular–granular impact crater opening mechanism in 2d experiments.  Earth, Moon, and Planets 116, 115–138.
  * Bartali et al. (2013) Bartali, R., Rodríguez-Liñán, G.M., Nahmad-Molinari, Y., Sarocchi, D., Ruiz-Suárez, J.C., 2013.  Role of the granular nature of meteoritic projectiles in impact crater morphogenesis.  arXiv:1302.0259.
  * Carbone et al. (2001) Carbone, V., Carocci, M., Savio, E., Sansoni, G., De Chiffre, L., 2001.  Combination of a vision system and a coordinate measuring machine for the reverse engineering of freeform surfaces.  The International Journal of Advanced Manufacturing Technology 17, 263--271.
  * Chappelow (2013) Chappelow, J., 2013.  Simple impact crater shape determination from shadows.  Meteoritics & Planetary Science 48, 1863--1872.
  * Chávez et al. (2014) Chávez, G.M., Sarocchi, D., Santana, E.A., Borselli, L., Rodríguez-Sedano, L., 2014.  Using kinect to analyze pebble to block-sized clasts in sedimentology.  Computers & Geosciences 72, 18--32.
  * Davis (1992) Davis, C.H., 1992.  Satellite radar altimetry.  IEEE transactions on microwave theory and techniques 40, 1070--1076.
  * De Vet and de Bruyn (2007) De Vet, S.J., de Bruyn, J.R., 2007.  Shape of impact craters in granular media.  Physical Review E 76, 041306.
  * Dong and Chen (2017) Dong, P., Chen, Q., 2017.  LiDAR remote sensing and applications.  CRC Press.
  * El-laithy et al. (2012) El-laithy, R.A., Huang, J., Yeh, M., 2012.  Study on the use of microsoft kinect for robotics applications, in: Proceedings of the 2012 IEEE/ION Position, Location and Navigation Symposium, IEEE. pp. 1280--1288.
  * Essmaeel et al. (2012) Essmaeel, K., Gallo, L., Damiani, E., De Pietro, G., Dipanda, A., 2012.  Temporal denoising of kinect depth data, in: 2012 Eighth International Conference on Signal Image Technology and Internet Based Systems, IEEE. pp. 47--52.
  * Geng (2011) Geng, J., 2011.  Structured-light 3d surface imaging: a tutorial.  Advances in Optics and Photonics 3, 128--160.
  * Gilbert (1979) Gilbert, G.K., 1979.  The moon’s face: A study of the origin of its features, in: A Source Book in Astronomy and Astrophysics, 1900--1975. Harvard University Press, pp. 80--87.
  * González-Gutiérrez et al. (2014) González-Gutiérrez, J., Carrillo-Estrada, J., Ruiz-Suarez, J., 2014.  Penetration of granular projectiles into a water target.  Scientific reports 4, 1--5.
  * Graebling et al. (2002) Graebling, P., Lallement, A., Zhou, D.Y., Hirsch, E., 2002.  Optical high-precision three-dimensional vision-based quality control of manufactured parts by use of synthetic images and knowledge for image-data evaluation and interpretation.  Applied Optics 41, 2627--2643.
  * James (1953) James, 1953.  Historia de la física: hasta mediados del siglo xx.  Technical Report.
  * Van der Jeught and Dirckx (2016) Van der Jeught, S., Dirckx, J.J., 2016.  Real-time structured light profilometry: a review.  Optics and Lasers in Engineering 87, 18--31.
  * Kadambi et al. (2014) Kadambi, A., Bhandari, A., Raskar, R., 2014.  3d depth cameras in vision: Benefits and limitations of the hardware: With an emphasis on the first-and second-generation kinect models.  Computer vision and machine learning with RGB-D sensors , 3--26.
  * Keller et al. (2013) Keller, M., Lefloch, D., Lambers, M., Izadi, S., Weyrich, T., Kolb, A., 2013.  Real-time 3d reconstruction in dynamic scenes using point-based fusion, in: 2013 International Conference on 3D Vision-3DV 2013, IEEE. pp. 1--8.
  * Lachat et al. (2015) Lachat, E., Macher, H., Mittet, M.A., Landes, T., Grussenmeyer, P., 2015.  First experiences with kinect v2 sensor for close range 3d modelling.  International Archives of the Photogrammetry, Remote Sensing & Spatial Information Sciences .
  * Lu and Wang (2015) Lu, K., Wang, W., 2015.  A multi-sensor approach for rapid and precise digitization of free-form surface in reverse engineering.  The International Journal of Advanced Manufacturing Technology 79, 1983--1994.
  * Lunar QuickMap (2023a) Lunar QuickMap, 2023a.  Complex crater king.  URL: https://bit.ly/45cpIGL. we acknowledge the use of imagery from Lunar QuickMap(https://quickmap.lroc.asu.edu), a collaboration between NASA, Arizona State University & Applied Coherent Technology Corp.
  * Lunar QuickMap (2023b) Lunar QuickMap, 2023b.  Complex crater tycho.  URL: https://bit.ly/3pYhjYh. we acknowledge the use of imagery from Lunar QuickMap(https://quickmap.lroc.asu.edu), a collaboration between NASA, Arizona State University & Applied Coherent Technology Corp.
  * Lunar QuickMap (2023c) Lunar QuickMap, 2023c.  Simple crater bernoullie c.  URL: https://bit.ly/43AL2nK. we acknowledge the use of imagery from Lunar QuickMap(https://quickmap.lroc.asu.edu), a collaboration between NASA, Arizona State University & Applied Coherent Technology Corp.
  * Lunar QuickMap (2023d) Lunar QuickMap, 2023d.  Simple crater steinheil.  URL: https://bit.ly/471E5z5. we acknowledge the use of imagery from Lunar QuickMap(https://quickmap.lroc.asu.edu), a collaboration between NASA, Arizona State University & Applied Coherent Technology Corp.
  * Mars QuickMap (2023) Mars QuickMap, 2023.  Mound formation on mars without nomenclature.  URL: https://bit.ly/3Dlg4ph.
  * McClay (1996) McClay, K., 1996.  Recent advances in analogue modelling: uses in section interpretation and validation.  Geological Society, London, Special Publications 99, 201--225.
  * McDonald and Montgomery (2015) McDonald, J., Montgomery, J., 2015.  Real-time crater profile analysis: Visualizing high-resolution laser altimetry data sets on the gpu.  SPECIAL PAPER OF THE GEOLOGICAL SOCIETY OF AMERICA 518, 213--227.
  * Melosh and Ivanov (1999) Melosh, H., Ivanov, B., 1999.  Impact crater collapse.  Annual Review of Earth and Planetary Sciences 27, 385--415.
  * Melosh (1989) Melosh, H.J., 1989.  Impact cratering: A geologic process.  New York: Oxford University Press; Oxford: Clarendon Press .
  * Mercury QuickMap (2023) Mercury QuickMap, 2023.  Complex crater debussy.  URL: https://bit.ly/3Do9IW7. we acknowledge the use of imagery from Mercury QuickMap(https://messenger.quickmap.io), a collaboration between NASA, JHU/APL & Applied Coherent Technology Corp.
  * (34) Michael, Greg and Annex, Andrew and Aye, Michael, .  Craterstats.  URL: https://github.com/ggmichael/craterstats.
  * Mousavi Hondori and Khademi (2014) Mousavi Hondori, H., Khademi, M., 2014.  A review on technical and clinical impact of microsoft kinect on physical therapy and rehabilitation.  Journal of medical engineering 2014.
  * Newcombe et al. (2011) Newcombe, R.A., Izadi, S., Hilliges, O., Molyneaux, D., Kim, D., Davison, A.J., Kohi, P., Shotton, J., Hodges, S., Fitzgibbon, A., 2011.  Kinectfusion: Real-time dense surface mapping and tracking, in: 2011 10th IEEE international symposium on mixed and augmented reality, Ieee. pp. 127--136.
  * Nießner et al. (2013) Nießner, M., Zollhöfer, M., Izadi, S., Stamminger, M., 2013.  Real-time 3d reconstruction at scale using voxel hashing.  ACM Transactions on Graphics (ToG) 32, 1--11.
  * Osinski and Pierazzo (2013) Osinski, G.R., Pierazzo, E., 2013.  Impact cratering: Processes and products.  Impact Cratering , 1--20.
  * Pacheco-Vázquez and Ruiz-Suárez (2011) Pacheco-Vázquez, F., Ruiz-Suárez, J., 2011.  Impact craters in granular media: grains against grains.  Physical review letters 107, 218001.
  * Pagliari and Pinto (2015) Pagliari, D., Pinto, L., 2015.  Calibration of kinect for xbox one and comparison between the two generations of microsoft sensors.  Sensors 15, 27569--27589.
  * Pittman et al. (2013) Pittman, S.J., Costa, B., Wedding, L.M., 2013.  Lidar applications.  Coral reef remote sensing: A guide for mapping, monitoring and management , 145--174.
  * Riedel et al. (2018) Riedel, C., Michael, G., Kneissl, T., Orgel, C., Hiesinger, H., van der Bogert, C.H., 2018.  A new tool to account for crater obliteration effects in crater size-frequency distribution measurements.  Earth and Space Science 5, 258--267.
  * Rincón et al. (2022) Rincón, M., Márquez, A., Herrera, R., Galland, O., Sánchez-Oro, J., Concha, D., Montemayor, A., 2022.  Monitoring volcanic and tectonic sandbox analogue models using the kinect v2 sensor.  Earth and Space Science 9, e2020EA001368.
  * Rogers et al. (2011) Rogers, J.G., Trevor, A.J., Nieto-Granda, C., Christensen, H.I., 2011.  Simultaneous localization and mapping with learned object recognition and semantic data association, in: 2011 IEEE/RSJ International Conference on Intelligent Robots and Systems, IEEE. pp. 1264--1270.
  * Salvi et al. (2010) Salvi, J., Fernandez, S., Pribanic, T., Llado, X., 2010.  A state of the art in structured light patterns for surface profilometry.  Pattern recognition 43, 2666--2680.
  * Sarbolandi et al. (2015) Sarbolandi, H., Lefloch, D., Kolb, A., 2015.  Kinect range sensing: Structured-light versus time-of-flight kinect.  Computer vision and image understanding 139, 1--20.
  * Sheward et al. (2022) Sheward, D., Avdellidou, C., Cook, A., Sefton-Nash, E., Delbo, M., Cantarella, B., Zanatta, L., 2022.  Pynaple: Lunar surface impact crater detection.  Monthly Notices of the Royal Astronomical Society 514, 4320--4328.
  * Stein et al. (1992) Stein, F., Medioni, G., et al., 1992.  Structural indexing: Efficient 3-d object recognition.  IEEE Transactions on Pattern Analysis and Machine Intelligence 14, 125--145.
  * Su and Chen (2001) Su, X., Chen, W., 2001.  Fourier transform profilometry:: a review.  Optics and lasers in Engineering 35, 263--284.
  * Tortini et al. (2014) Tortini, R., Bonali, F.L., Corazzato, C., Carn, S.A., Tibaldi, A., 2014.  An innovative application of the kinect in earth sciences: quantifying deformation in analogue modelling of volcanoes.  Terra Nova 26, 273--281.
  * Vera et al. (2011) Vera, L., Gimeno, J., Coma, I., Fernández, M., 2011.  Augmented mirror: interactive augmented reality system based on kinect, in: 13th International Conference on Human-Computer Interaction (INTERACT), Springer. pp. 483--486.
  * (52) Viera-López, Gustavo and Corrales-Machín, Frank, .  Craterslab.  URL: https://github.com/gvieralopez/craterslab.
  * Wasenmüller and Stricker (2017) Wasenmüller, O., Stricker, D., 2017.  Comparison of kinect v1 and v2 depth images in terms of accuracy and precision, in: Computer Vision--ACCV 2016 Workshops: ACCV 2016 International Workshops, Taipei, Taiwan, November 20-24, 2016, Revised Selected Papers, Part II 13, Springer. pp. 34--45.
  * Yang et al. (2015) Yang, L., Zhang, L., Dong, H., Alelaiwi, A., El Saddik, A., 2015.  Evaluating and improving the depth accuracy of kinect for windows v2.  IEEE Sensors Journal 15, 4275--4285.
  * Zhang and Yau (2009) Zhang, S., Yau, S.T., 2009.  High dynamic range scanning technique.  Optical Engineering 48, 033604--033604.
  * Zhang (2000) Zhang, Z., 2000.  A flexible new technique for camera calibration.  IEEE Transactions on pattern analysis and machine intelligence 22, 1330--1334.