Semi-automated Image Segmenting Software for Martian Soil Granulometry
Authors: Shi Yutong , Zhao Siyuan , Karunatillake Suniti , Xiao Long 
Published: March 2021

&lt;p&gt;Photoanalytical segmentation of individual soil grains and granulometry in high-resolution surface images are key in understanding sedimentation processes of planetary bodies before samples return to Earth. Here we present a Mathematica-based semi-automated image segmenting software tool that allows fast segmentation and granulometry analysis of Martian (soil) images based on the algorithm of Karunatillake et al. (2013, 2014), with a graphical user interface (GUI) to increase the software accessibility.&lt;/p&gt;&lt;p&gt;Our software has been adapted to Martian in-situ observation images including the Mars Hand Lens Imager (MAHLI) and Microscopic Imager (MI), providing segmenting and granulometry measurement through steps below: (1) Image imported: all common raster images are supported, as well as the IMG formatted MAHLI and MI images. While the MI image possesses a constant pixel size of 31 &amp;#956;m/pixel, for MAHLI images with various focal lengths, a focus motor count is required to calculate pixel size. The imported images are processed with gamma correction, contrast adjustment, background sharpen, and are visually decided whether there is a distinct foreground before going to the second step: (2) Image segmented: two independent modules are designed for segmenting the foreground and background with separate parameters, the coarser-grained foreground was masked before the finer-grained background is segmented. The GUI allows dynamic visualization of how the segmenting result changes with each parameter, facilitating the setting of parameters. (3) Granulometry: the grain size is calculated from the focal length and Wentworth classification of detected grains is established, highlighting the dominant class of grain size. The probability density and cumulative distribution of grain size can also be plotted. The granulometry results and parameters used are supported to export.&lt;/p&gt;&lt;p&gt;To check the performance of our software, we qualitatively tested our software with 57 MAHLI and MI images with or without foreground, with comparison to region based segmentation method such as BASEGRAIN, edge detection based method such as ENVI Classification tools and Feature Extraction tools, and supervised segmentation methods such as ENVI supervised classification tools and ImageJ Trainable Weka Segmentation tool. Our software shows better results in generating grains with closed boundaries and distinguishing adjacent grains with similar colors, with the fastest speed and less workload. Factors that may influence the accuracy of segmenting include image resolution, camera angle, inter-grain brightness/color contrast and shadow coverage.&lt;/p&gt;&lt;p&gt;In future work, a particle morphometry measuring function will be added so that statistics of grain roundness, sphericity, and angularity could be obtained. High-resolution images from the Moon and the asteroids will also be used in software testing to expand the range of its applicability to other planetary bodies. We will also consider its application on terrestrial cases, such as images of terrestrial sediments or petrological thin sections, which will need further improvement of the software concerning the increased compositional and optical complexity of terrestrial grains.&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;