## 3 Image Processing Workflow
### Mineral Correction
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Type** & **Characteristics** & **Method** & **Representative Minerals** \\  & & & **and Components** \\ \hline I & Obvious grayscale features & MAPS image threshold & \\  & & segmentation + particle & Organic matter, pores, pyrite \\  & & & expansion & \\ \hline II & \begin{tabular}{c} Relatively dispersed particles; \\ good particle profile \\ morphology; minimal overlap \\ with other minerals during \\ thresholding \\ \end{tabular} & \begin{tabular}{c} MAPS image threshold \\ segmentation + morphology + \\ particle expansion \\ \end{tabular} & \begin{tabular}{c} Apatite, rutile, siderite \\ apatite, rutile, siderite \\ \end{tabular} \\  & & & \\ \hline III & \begin{tabular}{c} High component content; \\ good profile morphology; \\ uniform grayscale texture; \\ easy overlap with other \\ minerals during thresholding \\ \end{tabular} & \begin{tabular}{c} Variance and other texture \\ feature extraction + \\ morphology + particle \\ expansion \\ \end{tabular} & \begin{tabular}{c} Quartz; feldspar \\ quartz \\ feldspar \\ expansion \\ \end{tabular} \\ \hline IV & \begin{tabular}{c} Wide grayscale range; no solid \\ morphology; wide \\ distribution; high \\ component/mineral content \\ \end{tabular} & \begin{tabular}{c} 1. QEMSCAN image \\ outlier filtering \\ 2. Multiple thresholds + \\ morphology \\ \end{tabular} & \begin{tabular}{c} Illite, kaolinite \\ \end{tabular} \\ \hline V & \begin{tabular}{c} Low mineral content; wide \\ grayscale range or high \\ grayscale ratio; good particle \\ morphology \\ \end{tabular} & \
\begin{tabular}{c} 1. QEMSCAN image \\ outlier filtering \\ 2. Particle expansion \\ \end{tabular} &
\begin{tabular}{c} Dolomite, calcite \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of the mineral types and correction methods. mineral, such as in regions b and d. For the case of S1, the morphology may be a ringing signal (as seen in region c of Figure 3A). This mainly occurs when threshold segmentation occurring in a selected grayscale range is situated near some particle boundaries causing a grayscale gradient region. For this type of situation, image morphology relationships (e.g., aspect ratio and area/perimeter2) can be used for screening. Type III: This type relates to minerals with relatively high contents, better particle morphology, more uniform grayscale textures, and easily overlapping minerals through thresholding methods. This includes minerals such as quartz and feldspar. For this type, a certain filter can be built, using the grayscale texture characteristics of the mineral surface to conduct correction. Because the quartz and feldspar mineral components are relatively determinable, the features generally displayed on the grayscale surface of MAPS imagery are more uniform and less noisy. Therefore, extraction can be facilitated by building the simplest variance filters. Through variance filters, uniform grayscale regions and acute changes in grayscale along edges can be effectively extracted. By integrating extracted regions with QEMSCAN images, the determination method can be applied (Figure 3), and this type of mineral can be corrected. Type IV: A wide grayscale range, relatively no solid morphology, extensive distribution, and comparatively high mineral content, such as clay minerals (e.g., illite, kaolinite), that mainly present as large distributions of patches and more feature outliers on the QEMSCAN images. Due to insufficient resolution, when scanned using QEMSCAN, this type of mineral can be misidentified. For instance, sections with nanoscale porosity or clay pores may be identified as clay minerals, thereby resulting in overestimations of mineral content. Correction of this type of mineral requires first removing the outliers, and then, after correction of the other minerals or components (porosity and organic matter), multiple thresholds and morphological determination methods are needed to restore the real distribution of the minerals.