Grain Size Characterization of Ceramic Matrix Composites

In the field of materials science, the mesoscopic geometry of materials is of great significance for the research and development of materials and materials. This paper mainly focuses on the image data of existing ceramic matrix composites, and studies the characterization method of grain image of ceramic matrix, which realizes the accurate characterization of grain size. It has important practical research on the mesostructure of ceramic matrix composites. Value. Taking the SEM grain image of 5μm resolution of self-toughening silicon nitride (Si3N4) ceramic as an example, the grain image is segmented by median filtering, image binarization and watershed algorithm, and then used to directional bounding box (Oriented). The Bounding Boxes, OBB) algorithm finds the rectangular outline bounding box of the grain, enabling accurate measurement and statistics of the grain size.


I. INTRODUCTION
In the field of materials science, big data, data mining and data representation complement each other and are closely related [1]. As shown in Fig. 1, they are three mutually supportive technologies in material science. Big data refers to data on various aspects of materials obtained from material research experiments. Data mining needs to extract the required patterns and information from these data, and data representation is the link among them. Because the material data is characterized by diversity and heterogeneity, it needs to be correctly characterized to further carry out data mining and related work such as building a material database. Therefore, the characterization of material data has important research significance.
The ceramic matrix composite is a composite material obtained by compounding a ceramic matrix and a reinforcing fiber. The ceramic matrix is mostly a high-temperature structural ceramic such as silicon nitride (SiN), silicon carbide (SiC) or boron nitride (BN), in order to improve the ceramic ductile fiber [2]. The reinforcement is composited to obtain a ceramic matrix composite. There are many kinds of Manuscript received July 25, 2019; revised Novermber 1, 2020. This work was supported in part by the National Key R&D Program of China (2016YFB0700500) and the Science and Technology Project of Shaanxi Province (2018GY-048).
Gao ceramic matrix composites. The chemical Vapor Infiltration (CVI) is used in the laboratory for scientific research. The main process is to increase the fibers according to the demand (2D, 2.5D or 3D). The braided body is placed into a reaction space under certain conditions, and an interface layer and a ceramic matrix layer are deposited on the surface of the fiber through a chemical reaction to obtain a ceramic matrix composite material [3]. In order to improve their oxidation resistance, most of them also need to deposit other compound coatings on the surface to prevent oxidation. Schematic diagram of the mesostructure of the ceramic matrix composite is shown in Fig. 2. It can be seen that the outermost layer of the macrostructure is a protective coating. The mesoscopic fiber surface is the interface and the deposited ceramic matrix.  The ceramic matrix composite consists of a fiber-woven preform, a deposited interface and a ceramic matrix, and a protective coating on the outermost layer. Among them, the ceramic matrix is the main part of the material. Composite with fibers is to enhance its toughness and improve the brittleness of ceramics, so as to improve its performance in harsh environment [4]. The ceramic matrix, whether oxide or non-oxide, exhibits a grain structure in the microstructure. The size of the grain is very important for the strength of the formed material as well as the brittleness, tensile bending and fracture toughness. Influence, the effect of the size effect of the grain on the electrical, mechanical and thermal properties of the ceramic matrix has also received increasing attention [5]. At present, the characterization of grain size mostly stays at the stage of human eye judgment or rough estimation measurement. When studying the influence of grain size on the properties of ceramic matrix composites, the accurate measurement and characterization method of grain size is neglected. The research has caused errors in accuracy to some extent. In this paper, self-toughened silicon nitride (Si3N4) ceramics with 5 μm resolution SEM grain image is taken as an example. The digital image processing technology is used to segment the grain image to achieve accurate measurement and statistics of grain size.

A. Binarization
Image binarization is the most basic image processing technology. It sets the gray level of pixels on the image to 0 or 255, which means that the entire image shows a clear black-and-white effect. The binarization operation converts 256 gray levels of gray images into binarized images that can still reflect the overall and local characteristics of the image through appropriate threshold selection. In digital image processing, binary images occupy a very important position. To process and analyze the binary image, we must first binarize the grayscale image to obtain a binary image. When the image is further processed, the set property of binary image is only related to the position of pixel points, not to the multi-level value of pixel, which can reduce the difficulty of image processing [6]. We first convert the SEM grain image of the self-toughening silicon nitride ceramic into a gray image and then perform median filtering to eliminate the salt and pepper noise and protect the edge information of the grain without being blurred. Median filtering is a non-linear smoothing technique. Its basic principle is to replace the pixel value of each pixel with the median value of the filter operator, thereby eliminating isolated noise points in the image [6].
Due to the non-uniformity of the grains, the contrast and texture of different regions in the grain image are very different. If the fixed threshold binarization is used, the ideal segmentation effect cannot be achieved. Therefore, the adaptive thresholding function Threshold function in OpenCV is used to binarize it. The adaptive thresholding is to determine the binarization threshold of the pixel point according to the pixel value distribution of the neighborhood block around the pixel point, so that the entire image has different binarization thresholds. The binarization threshold of each pixel position is determined by the pixel values of the surrounding pixels. The threshold for regions with high brightness is correspondingly high, and the threshold for regions with low brightness becomes lower, thereby well separating the target region from the background region. There are two commonly used types of adaptive thresholds. One is to use the average value of the pixels in the local neighborhood block as the threshold value of the pixel, and the other is to calculate the Gauss weighted sum of the distance between the pixel point and the center point in the local neighborhood block as the threshold value of the pixel point according to the Gauss function [7]. In this paper, the first method is used. The average value method is used to adaptively binarize the grain images. The SEM grain image of self-toughened silicon nitride ceramic and the image after median filtering and binarization are shown in Fig. 3.

B. Watershed Segmentation
Although the grain image after binarization has obvious contours under the observation of human eyes, the computer cannot recognize the contours between the interconnected grains. Therefore, the watershed algorithm is used to segment the grains in the image. Watershed algorithm is a mathematical morphological segmentation method based on topological theory. Its basic principle is to treat the image to be segmented as a topographic map. The gray value size of each pixel in the image corresponds to the altitude of the corresponding area. The place with high gray value has high altitude, and the place with low gray value has low altitude. Each local minimum and its surrounding area correspond to an image area with a lower gray value. This area corresponds to a basin in the topographic map and a corresponding watershed at the boundary of each basin [8].
The process of segmenting the image through the "watershed" is the process of calculating the watershed, which is an iterative labeling of the input image. The classic calculation method of watershed was proposed by L. Vincent. In this algorithm, the watershed calculation is divided into two steps, one is the sorting process, and the other is the flooding process [9]. First of all, the gray level of each pixel is sorted from low to high. Then it gradually floods from low to high, that is, it starts to merge nearby neighborhoods from the local minimum of the gray level. This is equivalent to injecting water from the lowest point of the basin part, and the water in different basins gradually floods until it reaches the boundary between the two basins, which is the watershed to be calculated.
The watershed segmentation algorithm is an excellent and widely used image segmentation method. In essence, it belongs to a segmentation method based on regional growth. The boundary of the target obtained by the watershed segmentation algorithm is a continuous, closed boundary. In many fields, this segmentation technique has been widely used. However, watershed segmentation has a weakness, which is that it is very sensitive to noise and fine textures. Because there may be many noise points or other interference factors in the image, too many "basins" may be generated during the watershed calculation process, resulting in excessive segmentation of the image, and the required targets cannot be separated [10]. Therefore, in response to this problem, many people have proposed a variety of improved watershed segmentation algorithms. Generally speaking, the improvement methods of the watershed algorithm are roughly divided into three categories. First, segmentation pre-processing is used. Before applying watershed segmentation, some preprocessing is performed on the image, such as image denoising, gradient image seeking, morphological reconstruction, labeling foreground and background, and so on [11]. Its purpose is to reduce small "basins", thereby reducing the number of over-segmented areas. Second, segmentation post-processing is used. After applying watershed segmentation, the resulting images are merged. If the initial segmentation produces too many small regions, the merge process will have a large amount of calculation. So the time complexity of this method is often high. In addition, the determination of merger criteria is also a relatively difficult matter. There are usually combining criteria based on the average gray level information and boundary intensity information of adjacent regions. Different merge criteria will result in different segmentation results [11]. Third, pre-processing and post-processing are used. According to the requirements of specific application fields, if you can't get satisfactory results through pre-processing or post-processing, then use them all.
In this study, we preprocess the image with gradient labels before segmentation with the watershed algorithm. The gradient of the image is equivalent to the grayscale difference between two adjacent pixels, and the gradient of the target contour in the image to be segmented can be enhanced by the gradient marker. Images that have been gradient-marked filter out the noise points that cause interference, and specify the starting point of the segmentation region, which is equivalent to using prior knowledge to guide the watershed algorithm. In order to facilitate the observation of the segmentation result, the spectral color is used to fill the marker and the segmentation result. The results of gradient marking and watershed algorithm segmentation of the grain image are shown in Fig. 4.

C. Morphological Transformations
The basic idea of mathematical morphology is to use the structural elements with certain morphology to measure and extract the corresponding shapes in the image to achieve the purpose of image analysis and recognition [12]. Morphological transformation in digital image processing refers to using mathematical morphology as a tool to extract image components from the image that are useful for expressing and depicting the shape of the area, such as boundaries, skeletons, and convex hulls [13]. It also includes morphological filtering, refinement and trimming for pre-processing or post-processing. Morphological transformation is a simple shape-based transformation. Its processing object is usually a binary image. The morphological transformation requires two parameters, one is the original image, and the second is called a structured element or kernel, which is used to determine the nature of the operation. The two basic morphological operations are erosion and dilation. Their variants consist of open operations, closed operations, and morphological gradients [13].
Erosion is like soil erosion. This operation will erode the boundaries of foreground objects. The convolution kernel slides along the image. If all the pixel values of the original image corresponding to the convolution kernel are 1, the center element keeps the original pixel value, otherwise it becomes 0. All pixels close to the foreground will be eroded according to the size of the convolution kernel, so the foreground objects will become smaller and the white area of the entire image will be reduced. This is useful for removing white noise from an image, and can also be used to disconnect two connected objects [14]. Dilation is the opposite of corrosion. As long as one of the pixel values of the original image corresponding to the convolution kernel is 1, the pixel value of the center element is 1. So this operation will increase the white area (foreground) in the image. Generally, erosion is used first and then dilation is used when removing noise. Because erosion removes white noise, it also makes foreground objects smaller. Then the dilation operation is used. At this point the noise has been removed, but the foreground is still increasing. Dilation can also be used to connect two separate objects.
The open operation is realized by eroding the image and then dilating it. Erosion can remove the small dots outside the image, and then the main image can be restored by dilation. The open operation can eliminate small clumps of objects, eliminate isolated points higher than neighboring points, achieve denoising, smooth the contours of objects, and break narrow necks [14]. The closed operation is realized by dilating the image first and then eroding it. Dilation can remove the small dots in the image, and then restore the main image through erosion. Small black holes (black areas) can be eliminated. And isolated points lower than adjacent points can be eliminated to achieve denoising. The utility model can smooth the contour of an object, bridge narrow discontinuities and long and thin gullies, eliminate small holes, and fill in the fractures in the contour line.
The segmentation result of the watershed algorithm still has some interference noise [8]. In order to avoid errors in the following aspect ratio statistics, we perform morphological transformations on the segmentation results. We perform erosion, dilation, and closing operations on the resulting image in the following order. Finally, the small holes and cracks at the edges and inside of the grain are eliminated. As shown in Fig. 5, a relatively complete grain marker and a general outline are finally obtained.

D. Oriented Bounding Boxes (OBB)
In the field of computer graphics and computational geometry, the bounding box is an algorithm that solves the optimal bounding space of a set of discrete points. The basic idea is to use a slightly larger and simpler geometry to approximately replace complex geometric objects [15]. The bounding box is a simple geometric space containing complex shaped objects. Encapsulating complex objects in simple bounding boxes can improve the efficiency of geometric operations. It is usually easier to detect the overlap between simple objects. Bounding boxes are often used to speed up certain inspection processes. In ray tracing, bounding boxes are used for ray intersection inspection. In many rendering algorithms, it is also used for the inspection of the view volume. In collision detection, if the two bounding boxes do not intersect, the contained objects will not collide. The preliminary collision detection using this algorithm has been widely used in the fields of virtual reality, computer-aided design, games and robots [16]. And it has even become a key technology.
The selection of the bounding box type is affected by different factors. The more common bounding boxes are Axis-Aligned Bounding Boxes (AABB), Spheres, Oriented Bounding Boxes (OBB) [17]. AABB is the earliest applied bounding box. It is defined as the smallest hexahedron that contains the object and whose sides are parallel to the coordinate axis. The bounding sphere is defined as the smallest sphere that contains the object. AABB and spheres are suitable for shapes that are relatively evenly distributed on each coordinate axis. They are simple in construction and small in storage space, but have a large redundant space and poor tightness for irregular shapes. OBB has a wider range of applications. It is the smallest cuboid that contains the object and is arbitrary with respect to the direction of the coordinate axis. OBB's biggest advantage is its arbitrariness of direction, which makes it possible to surround the object as closely as possible according to the shape characteristics of the object being surrounded. It can be applied to objects in any direction, such as translation, rotation, and scaling. OBB approaches objects more closely than AABB and spheres, which can significantly reduce the number of bounding volumes, thereby avoiding the detection of intersections between a large number of bounding volumes. But the detection of intersections between OBB is more time-consuming than the detection of intersections between AABB or spheres [18]. Because the grains overlap and intersect each other, the direction is arbitrary, in order to accurately measure the aspect ratio of the grains. This study uses Oriented Bounding Boxes algorithm to generate rectangular bounding boxs of the grains by inputting the contour image of the grains.
The generation method of Oriented Bounding Boxes is mainly based on the Principle of Principal Components Analysis (PCA) [19]. Principal Components Analysis is used to reduce the dimensionality of the two-dimensional data in the grain image to find the major axis in the grain contour. Then the rectangular bounding boxs of the grains is obtained by further calculation. Principal component analysis is a common method of data analysis. Principal Components Analysis is a commonly used data analysis method. It uses linear transformation to transform a set of linear data with linear correlation into a set of linearly independent data representations of each dimension, so as to extract variables that can contain the main information of the original data [20]. It can reduce the number of unnecessary variables and simplify data analysis. It is usually used for dimensionality reduction of high-dimensional data [21]. The principle of PCA dimensionality reduction from two-dimensional data to one-dimensional data can be represented in Fig. 6. Fig. 6. Data in a two-dimensional coordinate system is reduced to one-dimensional data.
As shown in Fig. 6, if you want to reduce the five scattered points in the two-dimensional coordinate system to a one-dimensional coordinate system, you must select a straight line in the two-dimensional coordinate system and project the five scattered data to the straight line, the five scattered data are represented by their projection values. If they are projected to the X-axis or Y-axis, there will be different points repeated, resulting in only three of the five data messages remaining, resulting in information loss. Therefore, it is necessary to find a straight line so that the projected scatter data is as scattered as possible, that is, linearly uncorrelated [22]. Expressed mathematically, the direction of the straight line to be projected is the direction with the largest variance between the points after the projection. The variance is a special case of covariance in one-dimensional space, and the projection transformation in the coordinate system can be transformed into the matrix transformation of the sample data matrix and the orthogonal basis. Therefore, the PCA dimensionality reduction problem can be transformed into the covariance matrix of the original data [23]. Then the eigenvalues and eigenvectors corresponding to the covariance matrix are obtained, and the eigenvalues are sorted from large to small. The eigenvector corresponding to the largest feature value is selected as the projection direction, which is the required linear direction [23]. Corresponding to Oriented Bounding Boxes algorithm, the two-dimensional image data contour of the grain is obtained by principal component analysis to obtain the principal axis direction of the grain. Then the center point and the horizontal axis of the grain are calculated by the distance between the grain profile and the main axis [21]. Further, the length and width of the rectangular bounding box are obtained, and finally the oriented bounding boxes image of grains is as shown in Fig. 7.

III. RESULT
After statistically obtained grain length, width and aspect ratio data, a total of 164 data were obtained. And the statistical results were sorted in order of aspect ratio, and 30 of them were selected as shown in Table I. The average aspect ratio is 2.6415. Through the processing of the SEM image of the grain and the statistical calculation of the grain profile by Oriented Bounding Boxes algorithm, the automatic measurement of the grain size in grain images can be realized. This study is of great significance for the characterization of mesostructure and performance analysis of the ceramic matrix composites [24].

IV. CONCLUSION
This paper mainly studies the grain size characterization methods of the matrix of ceramic matrix composites. The grain size characterization in the ceramic matrix goes through the following steps. Firstly, the SEM images of grains are processed by digital image processing technology, including binarization, watershed segmentation, morphological transformation and so on. Then, the rectangle bounding boxs of the grains are obtained by using the Oriented Bounding Boxes algorithm. The length, width and aspect ratio data of the grains are obtained through statistical calculation.
The mesostructure characterization method of ceramic matrix composites studied in this paper realizes the parametric characterization of the mesostructure of ceramic matrix composites. It has important reference value for the construction of RVE model, performance analysis and material preparation of ceramic matrix composites.