# Segmentation and Classification of Zn-Al-Mg-Sn SEM BSE Microstructure
## 2 Materials and Methods
\begin{table}
\begin{tabular}{l l} \hline Substance & Metal alloy Zn-Al-Mg-Sn: \\  & Zn bal. wt.\% (weight), 1.6 wt.\% Al, 1.6 wt.\% Mg, 0–3 wt.\% Sn \\ Sn content & 0, 1, 2, 3 wt.\% \\ Task & Segmentation and classification: \\  & level thresholding + morphology, histogram thresholding \\ Number of classes & 3 or 4 (depending on Sn content) \\ Microscope & JEOL JSM 7600F \\ Electron source & Schottky field emission gun \\ Detector & BSE—SM-74280 RBEI in composition mode \\ Image exposure time & 6600 ms \\ Working distance & 15 mm \\  & Grinding 280—4000 grid emery paper \\ Sample treatment & Polishing 3—0.25 \(\upmu\)m ethanol-based diamond paste \\  & Cooling and lubrication with ethanol \\ Software & Matlab 9.11.0.1769968 (R2021b) \\ OS + Hardware & Win10 Pro 21H2 64 bit, i7–7820 HQ, SSD, 64 GB RAM \\ Image information & 960 \(\times\) 1280, 8 bit grayscale \\ Noise removal & NonLocal Mean (NLM) filter \\ Zoom & 1000, 2000, 4000 \\ \hline \end{tabular}
\end{table} 
Table 3: Summary description of the task. The individual microstructural components were characterised through a local EDX analysis. Figure 2a shows a BSE image of an area with all key microstructure components present. The base matrix is formed by \(\eta\)(Zn) represented by the Zn map in Figure 2b. The Al map (Figure 2c) clearly indicates the presence of the \(\eta\)(Zn) + \(\alpha\)(Al) eutectoid mixture particles, while the areas containing both Zn and Mg (Figure 2d)) indicate the presence of the Mg\({}_{2}\)Zn\({}_{11}\) phase particles. Finally, the presence of Mg and Sn (Figure 2e) indicate the location of the Mg\({}_{2}\)Sn phase particles. In this paper, two designations with the same meaning are used interchangeably based on the context of the current section: particle (materials science point of view) and shape (IP point of view). Figure 3 shows a section from an original unfiltered microscopic image (3% Sn, Zoom4000) with the dimensions of 300 \(\times\) 500 pixels--throughout the paper, the notation [rows \(\times\) columns] is used as in Matlab. The BG background, the BW eutectoid and the L and D shapes are observed. The image shows a typical white rim at the interface of the BG background and D shapes. A similar rim can also be observed on the interfaces of the BG and L shapes as well as the BG background and BW eutectoid, but only to a lesser extent. This is characterised by the visible elevations in the line segment figures (see Figure 6--the edges of the span approx. 250 to 480). As another detail, BG contains the precipitates of \(\alpha\)(Al) solid solution visible as the small dark spots. These are observed in the \(\eta\)(Zn) solid solution BG, as well as on the BG/L and BG/D interfaces. These particles were ignored due to their small size (approx. 50 to 100 nm) and negligible influence on the total phase composition. In the centre of the image, a BW shape is present at the bottom, which gradually increases in intensity values upwards. The given particle is therefore not cut perpendicularly but at an angle of less than 90 degrees. It gradually begins to shine through from the background. The D shapes can also appear with a high-intensity interior--see Figure 14 for more details. Microscopic image and accompanying information--The acquired microscopic images had dimensions of 1024 \(\times\) 1280 pixels. They consisted of two parts: the image information itself in the upper part 1:960 \(\times\) 1280 (grayscale in 8-bit depth) and a black information bar 961:1024 \(\times\) 1280. The following information was extracted using optical character recognition: zoom, date and time of the image taking, and scale bar. The third source