**2. Textural Segmentation in OIA of Coke**

Metallurgical coke is one of the major components of the blast furnace load, and its qualities, such as strength, abrasion resistance and reactivity, which are strongly dependent on coke structure/texture, are critical for stable blast furnace operation. OIA enables an improved understanding of the relationships between coke quality, parent coal blend composition and coke structure/texture. This allows for the improvement and optimization of the processes involved in coke production, such as parent coal blending, sizing, coking, etc.

In this section we essentially discuss coke "structure", defining it as the spatial distribution of porosity and the coke matrix, which consists of different coked/reacted macerals. In many disciplines within mineral processing, the term "texture" means approximately the same as "structure". However, when applied to coke characterization, "texture" is understood to mean the spatial distribution of different isotropic and anisotropic carbon types within the coke, typically determined during optical imaging by differences in bi-reflectance [18,19].

During coking of parent coal blends, some macerals, such as different types of vitrinite, are significantly fluidized and thus subject to a stronger reaction. The parts of the coke matrix resulting from such reactions are called Reacted Maceral Derived Components (RMDC). The non-reacted or significantly less reacted types of macerals (inerts) form Inert Maceral Derived Components (IMDC). One of the major tasks during the characterization of coke structure is to determine the relative amounts of carbonaceous materials with different degrees of reaction. The relative abundance and corresponding size distributions of these coke phases show strong significant correlations with different coke strength indices and parent coal blend composition [18]. For example, a study by Donskoi et al. [18] confirmed the earlier findings of Kubota et al. [22] that 1.5 mm is the critical size for IMDC affecting coke strength.

Mineral4 segments and comprehensively characterizes three different phases in coke matrix: unreacted IMDC, partially reacted IMDC and RMDC. Figure 2a shows an image obtained using a narrow bandwidth (±5 nm) green filter (λ = 546 nm) of coke made from medium rank coal. In the image, the unreacted areas (unreacted IMDC), slightly reacted areas (partially reacted IMDC), and the very porous network connecting them together (RMDC) are clearly evident. The results of automated segmentation of these structural components are given in Figure 2b. It is clear that unreacted IMDC grains can have different structures; some are quite dense, showing almost no porosity, whereas others are quite porous. This complicates the task of properly identifying them by structure. Standard segmentation by thresholding is also of limited use here. While the coke matrix as a whole can be reliably thresholded to distinguish it from porosity, there is no critical difference in reflectivity between IMDC and RMDC.

Mineral4 Textural Identification uses three different methods to identify various areas of unreacted IMDC and then combines the results into one unreacted IMDC map. These three methods are bulk identification of IMDC, porous IMDC identification and identification of "washed out" IMDC. Similar methodology is used for identification of the partially reacted IMDC. The remainder of the coke matrix is then considered to be RMDC. It is important to highlight that the understanding of RMDC structure as the one consisting of thin walls and large pores is applied in some IMDC identification methods to exclude areas that are "not IMDC". Generally, for successful structural segmentation, a knowledge of the individual features of all phases is critical.

**Figure 2.** (**a**) Image of coke made from medium rank coal using a green filter (λ = 546 nm); *(***b**) the structural map corresponding to this image (magenta—unreacted IMDC, blue—partially reacted IMDC, green—RMDC, yellow—porosity).

### *2.1. Bulk IMDC Textural Identification*

"Bulk identification" of IMDC is based on the discrimination of a large nucleus of unreacted, non-porous IMDC surrounded by RMDC or partially reacted IMDC. The algorithm is presented in Figure 3. Initially a binary map of the coke matrix is obtained by thresholding (Figure 3a). Next, this map is dilated to remove the finest porosity (up to 5–7 μm) within different parts of the coke matrix (Figure 3b). In the next step, a strong erosion is applied with the purpose of removing all parts of the coke matrix where porosity is still present (Figure 3c). The majority of the removed matrix is supposed to be porous RMDC or partially reacted IMDC. However, IMDC areas with larger internal pores, as well as IMDC boundaries, may also be affected. Some dilation is applied to re-connect pieces of non-porous IMDC in the following step, in case they were broken apart by erosion because of large internal pores or cracks (Figure 3d). Further down objects smaller than a certain size, which are typically the remnants of coagulated RMDC, are scrapped, after which extra dilation is applied to fully compensate for the previous erosion, thus reconstructing the IMDC grain areas (Figure 3e). When the original coke matrix (Figure 3a) is masked with that map, the result is the full map of non-porous or very finely porous IMDC (Figure 3f). Comparison of IMDC identified in Figure 3f with the unreacted IMDC present in Figure 2b, however, shows that, for instance, the large piece of IMDC in the top-right corner is almost lost. The reason is that this IMDC grain is noticeably more porous compared to those identified by the "bulk identification" method. To identify such IMDC areas the porous IMDC identification method must be used.

(**a**) (**b**) (**c**)

**Figure 3.** The algorithm of "bulk identification" of unreacted IMDC: (**a**) coke matrix identified as a binary map; (**b**) moderate dilation applied; (**c**) strong erosion applied; (**d**) intermediate dilation; (**e**) scrapping of fine objects and final dilation; (**f**) map of non-porous and very finely porous IMDC.

### *2.2. Porous IMDC Textural Identification*

Even though the method is called "porous IMDC identification", the porosity of such IMDC is still smaller in size than typical porosity present in the reacted or partially reacted part of the coke matrix. To identify porous IMDC, a binary map of coke porosity, which is essentially the inverted map of the coke matrix (Figure 3a), is created (Figure 4a). Further, all fine porosity (less than 10 μm thickness) is scrapped (Figure 4b) and the resulting map is dilated (Figure 4c). In the next step, this map, representing areas where large pores are predominant, is inverted (Figure 4d) and subtracted from the original map of the whole porosity (Figure 4e). These operations allow clusters of fine porosity, which typically represent IMDC areas, to be identified. Such areas can be solidified by strong dilation (Figure 4f). However, this map also contains significant amounts of RMDC, which too can have fine porosity. Strong erosion is then applied to remove possible RMDC areas still associated with large pores (Figure 4g). After subsequent dilation, compensating for such erosion, filling holes and scrapping of small objects with size less than identifiable porous IMDC (Figure 4h) the resulting map is then used to mask the map of the coke matrix (Figure 3a) and obtain a map of porous IMDC (Figure 4i). After a last scrapping of small objects this map is considered final. It is evident that some non-porous IMDC areas are not included in this map, for example, parts of the IMDC grain in the lower central part of the image. It is also clear that porous IMDC identification is capable of segmenting IMDC areas much smaller in size than bulk IMDC identification, even when they are fully surrounded by RMDC (see Figure 2). Small non-porous pieces of IMDC cannot be reliably distinguished from RMDC by analyzing the coke matrix or simple thresholding, but for more precise studies, textural/bi-reflectance characterization can be used [19].

**Figure 4.** The algorithm of "Porous IMDC Identification" of not reacted IMDC: (**a**) the whole porosity identified as binary map; (**b**) fine porosity removed; (**c**) dilation applied; (**d**) map inverted; (**e**) clusters of fine porosity identified; (**f**) strong dilation (**g**) strong erosion; (**h**) compensating dilation; (**i**) map of porous IMDC.
