Marble Slabs Classification System Based on Image Processing (Ark Marble Mine in Birjand)

Marble is one of the semi-precious stones that has been used in decorating building façade and making decorative things. This stone is present in the nature in the form of rock or layered stone. Examining the kind of stone, extent of impurity and different streaks in white marble is a widely confronted subject by those who are involved in this industry. Obtaining the extent of impurity of white marble using methods of detecting and analyzing material is expensive and timeconsuming. In this research carried out on while marbles of Arc Mine in Birjand, it has been attempted to present very fast method using Image Processing Techniques so that while preserving identity and appearance of stone and without any damage to it, we compute the impurity level and different streaks on white marble surface. The proposed method includes two stages; in the first stage applying image processing functions, it is attempted to segment the present impurities and streaks on marble surface from the stone background and in the second stage, the area of these impurities and streaks is computed. Results obtained in this paper (97.8%) in comparison with other researches and experimental methods indicate acceptability of this algorithm.


Introduction
Stone is one of the most primary building materials that human being has used it for making tools, shelters and meeting his own needs. Ornamental stones are chosen based on beauty, price, persistence, resistance and popularity. Stone colors can be categorized from totally dark to so light and warm to cool. Stone textures also vary from gross grain to granule and dense. Marble is a kind of limestone (calcium carbonate, CaCo3) found in different colors. White marble has been historically used in construction. Egyptians and Greek used this stone for building their own shrines. Iranian people also used marble in building their holy places. Another unique properties of this stone is its energy therapy features, the marble absorbs negative energy of the environment and diffuses positive energy, on the basis of this property, marble is used in rest and massage halls. This stone is stable against heat, coldness and rain. When limestone is under high pressure and heat in long term beneath the earth, is transformed and turned into the marble. The main constituent of marble is calcium carbonate. Other kinds of marble have 99 percent calcium carbonate. Presence of Aluminum and magnesium salts in marble cause variety of color in it. The pure marble is quietly white. Crystal textures of marble gives its color a special brightness as the light travels a short distance in the depth of the stone and is reflected by underlying crystals. This feature can be defined as internal reflection which is an appropriate distinction criterion for categorizing marble and limestone. For preparing marble, at first, marble rocks are divided into 108 large pieces by special machinery. Then these pieces are transferred to special workshops of stone cutting and they are cut in suitable and ideal sizes. After cutting, marble is varnished by special machinery to have even and flat surface. Therefore, marble is ready to use. In comparison with Travertine, marble is used more frequently in floor and stairs because of having high stiffness and less porosity. Extraction and usage of building stones in Iran has a long history. Usage of these stones in primary Millenniums of civilization formation in Iran had been widespread whether as building stones or decorative stones inside buildings. Iran is among the five countries in the world in terms of producing ornamental stones [1]. High quality ornamental stones in the market are generally distinguished from other types due to their attractive features, beautiful appearances obtained from color, texture, easy to polish and dimension of the grains [2]. Iran has about 68 mineral materials (non-oil), 37 billion tons of discovered deposits and 57 billion tons of potential deposits among 15 mineral powers of the world and is considered as one of the rich countries in terms of mineral assets. Different mines are present all over Iran in diffused manner ( Figure 1). Although Iran has a suitable position among other stone producing countries and variety of ornamental stone resources, the share of Iran from global stone export is one percent while about 11.5 percent of global stone production is dedicated to Iran [3]. There are so many ornamental stone deposits in Iran. Distribution state of travertine, granite and marble in Iran has been spread all over this country ( Figure 2).

Figure 2. The map of geographical dispersion of ornamental stone resources in Iran
South Khorasan county is one the counties of Iran. This county is located in the East of Iran and its center is city of Birjand. The area of this county is 151193 square kilometers that is third county of Iran. This county has high potential in mine department. Presence of ornamental and granite stones are among the other extant potentials in this county. Considering ornamental stones and stone carving has been traditionally popular in this county, and one of the oldest of stone charts of this county is Kal Jangal Parthian Fresco. South Khorasan county has a very various condition in geological terms and three main geological arenas are found in this county i.e. sediment constituents, igneous and transformed. In south parts of the county located in geological arenas of sediment constituents, igneous and transformed, great deposits of building stones, copper, Chromites, Magnesium and so many elements, minerals and economically valued stones are placed ( Figure 3) for example we can refer to Ghale Zare Mine in Birjand as the biggest copper underground mine in Iran. Marble mines are extant all over Iran and one of the most popular marble mines of Iran is Arc Marble Mine in Birjand, located in South Khorasan County, this stone has bright background which is mostly popular in the market of Iran and the world. Arc Marble stone in Birjand is very compact and because of this stone has high grind level. Arc Marble stone in Birjand has relatively high grind level, this stone has either less water absorption (Table 1) and has high level of quality. Ark marble stone in Birjand is suitable for using in internal floor of buildings and also staircase walls and parking's. Generally, the Block dimensions of Ark Marble Stone of Birjand are 200 in 290 centimeters that can be cut into other dimensions using cut machine. The price of Ark Marble Stone in Birjand depends on the way of production and material used in manufacturing and producing. From this perspective, there are different prices of this stone in the market. Stones extracted from Ark Marble Stone in Birjand have differences both in terms of appearance and constituent material and stones are conventionally categorized into different groups in this mine. Based on a sent sample of Ark Marble Stone of Birjand to the technical and soil mechanics laboratory of South Khorasan, the chemical tests' results of this stone ( Table 2) indicate its desirability.   Ore Block is kind of stone containing valuable and important metals and elements extracted from mine and during a process; the needed elements are obtained from it and used. Emergence form of an Ore Block affects directly on related costs of ore extraction. Studies related to optimization of primary dimensions of ore extracted from outdoor mines have been carried out by different researchers [7], among the first researches in this respect, we can refer to performed examinations for preparing three dimensional models by Canadian scholars [8]. The subject of their studies was detecting economic dimensions of ornamental stone blocks in order to maximize productivity and minimize losses. In the following researches, other scholars presented and developed a simple linear index for qualitative classification of ornamental stone resources using multi variant models based on databank prepared from ornamental stone mines in operation [9]. Their method allowed that each block of an ornamental stone can be classified in different qualitative categories based on extent of ore obtainable from it. Their method resulted in a strategy that in its implementation process, users of ornamental stone deposits can gain the maximum extraction retrieval. In Caranassios et al [10] a recursive process for modeling geology, detecting reservoir and extraction design for ornamental stone resources was proposed. This innovative method with success in 8 ornamental stone mines in Brazil having different extraction Block dimensions, the conditions of selling markets, production costs and extraction limits, was used. Minimizing production costs for manufacturing ornamental stones is very important. In Xu & Wu [11] a computer modeling method and designing production planning for ornamental stone based on minimizing production costs was proposed. In 2004, by presenting the first algorithm of designing, production planning and extracting from ornamental stone resources, a great change arose in optimization of extraction process from ornamental stone resources [12]. Based on the suggested algorithm, in that year, modeling decorative stone resources includes two steps of preparing block models and economic models. For detecting extent of obtainable decorative stone from mine mass and before process, new extraction methodology was introduced [13]. In this methodology, qualitative properties were considered the most important variable and decision making index.
Marble is a kind of metamorphosed rock produced from metamorphosis of limestone. Its main mineral content is calcite. This stone were used extensively in the past for sculpture. Marble is usually observed in colors of white, green, yellow, lemon and other colors. Property variation and present streaks in marble in many kinds of colored marble is usually related to different impurities of minerals like clay, silt, sand and gravel and iron oxides which in fact due to limestone layers. White and pure marble is symbol of purity. Marble has streaks and fossils which give special beauty to this stone but in many cases these impurities reduce economic value of this stone. There are many methods of analysis and detecting material that we can name surface analysis methods (AES (Auger Electron Spectroscopy), XPS (X-ray photoelectron spectroscopy), SIMS (Secondary ion mass spectrometry)), element analysis methods (XRF (Xray Fluorescence Spectroscopy), FES (Flame Emission Spectrometer), AAS (Atomic Absorption Spectroscopy)), Phase analysis methods (XRD (X-ray Diffraction)), microstructure analysis methods (TEM (Transmission Electron Microscope), SEM (Scanning Electron Microscopy), OM (Optical Microscope)) and thermal analysis methods (TGA (Thermogravimetry Analysis), TD (Dilatometery), DTA (Differential Thermal Analysis)) [14,15].
Methods of detection and analysis of material for obtaining rate of available impurities in white marble is commonly costly and time-consuming. Obtaining impurity percentage or content of different streaks in white marble has significant importance (especially in economic terms) as many marble ores extracted from quarries which are in big rocks, have some totally streakless parts without impurities that can be classified and separated after cutting the stone. By categorizing cut stones, we can grade them and sell them with different prices that this issue can have many economic benefits for manufacturers of ornamental stones and building facades. Nowadays the numbers of mines having first grade marbles (quite bright and without streak) are limited and marble mines have lower qualities more find in the nature. Using image processing techniques and artificial intelligence we can automatically grade and categorize cuts of white marbles. Nowadays, separating white marbles and sorting them are carried out manually by ordinary people and a person examines rate of impurities and streaks on stone surfaces and sorts them by hand which is a difficult and time-consuming process and the possibility of human error in it is so high. Light source in examining white marbles for obtaining impurity levels and available impurities on stone surface, this glowing of light to people's eyes brings about fatigue and causes error in examining the rate of impurities and streaks on marble surface. So, designing automatic method for the purpose of examining the extent of impurity and present streaks on the surface of the marble, help greatly to the people involving in this industry. Automatic examination of rate of impurities and available impurities on white marble surface is an approach based on machine learning algorithms; As, one of the main objectives of examining images by automatic methods is accurate and correct separation of impurity level and available streaks on stone surface. This process has a special importance and the rate of accuracy of automatic processes like detecting ores [16], size and formation of ores [17] and detection of kinds and names of stones [18] depend greatly on the extent of accuracy of results of ore separations on stone surface. In Sanchez Delgado et al. [19] it has been considered the effect of texture and study of ore and also cracks in granite stones in stone cut outputs. In Latham et al. [20] software has been proposed for analyzing and practicing the obtained results from geological and economic modeling for planning the production of ornamental stone resources. By increasing the efficiency of computer modeling and using these models in the realm of building stones [21], a smart algorithm was formulated and presented for planning producing ornamental stone resources. In Goodchild et al. [17], an algorithm was designed based on image processing method, Gaussian smoothing, color change calculations, the extent of threshold and using image sketching methods. In another study, using Lazy Grain Boundary (LGB), an algorithm was designed for detecting ore contours [23]. An algorithm was designed based on mineral color properties by Zhou et al. [24] for the purpose of finding mineral contours in thin sections that region growing algorithm has been used as the main tool for detecting contours. Also, using transfer of colorful systems and applying colored space of RGB, CIELab, YIQ and YUV is a method that has been proposed by Obara [25]. This method proposes the final model of separation using watershed separation algorithm. In another research, a computer program called TSecSoft was designed by Yesiloglu-Gultekin et al. [18]. This program separates the minerals in sections using the least color interfere and implementing image processing algorithms and finally, the final model of mineral separation is prepared by regulation and correction of program user. The authors in [33] used ultrasonic method for measuring crack depths in marble statues. This technique examined a case study named Michelangelo's David statue. The results indicated the capability of detecting erosions in surfaces and disperse cracks. In [34], a metric was introduced termed Block Quality Designation (BQD) for examining rock mass in the marble industry. A design system was presented in [35] in order to create images of patterns of marbling textile. In research [36] using 3 complimentary features, the kind of marble classes is detected. In this research a new method has been proposed on marble stones for segmenting background and foreground. The results of this research indicated that the best segmentation of marble images is using Local OTSU and mean saliency binary maps. In research [27] also the role of Hadoop (Hadoop is an Open Source Application used for dividing and distribution of intensive files) in image processing has been studied. Using Hadoop can improve speed and productivity in image processing projects. Based on research work in [28] used on manuscripts and published texts for converting texts to blocks and using them for building CAPTCHA, we can also use a similar method for separating and blocking available impurities on white marble surface. In this method by blocking impurities on marble surface we can obtain a percent of this impurity rate.

The Proposed Method
In the suggested algorithm, automatic separation of impurities and present streaks on the surface of the white marbles was carried out using digital image processing methods and clustering. The proposed algorithm flowchart has been illustrated in Figure 4 that in the following subsections, its details will be explained.

Figure 4. Applied method with separation of steps
Clustering is one of the important problems in computer science [29] and its purpose is detecting groups having similar patterns, identifying meaningful and applied structure in database [30]. The automatic separation of impurities and streaks on the white marble surfaces is based on clustering along with colored properties. So, pixels with similar rate higher than α are placed in a cluster and after that pixels with similar rate of α and β were placed in another category, then pixels with similarity rate lower than β are placed in another group and this clustering can be carried out based on different scales and proposed based on impurities and separated streaks in the format of black and white (gray) images. Also the similarity rate in a cluster is measured with Equation 1, which the variation d is the Euclidian distance between input pixels and the center of each cluster.
At first, before image input, the pre-processing operations are carried out for the purpose of preparing input images and harmonizing them with the proposed algorithm. In the debate of preparing the input image, performing preprocessing operations will cause that algorithm have better resulted than a case that pre-processing operations has not been carried out. After image input, first we should convert the colored image to gray image (this is done by rgb2gray function in MATLAB software) and then we harmonize image background using morphology functions. At first we approximate the image background using morphology functions and then reduce it from the main image. Now although the background of the image has been harmonized, but the image doesn't have appropriate light intensity. Hence (using imadjust function) we improve the image light intensity. By using this function we can change the lightening variation range of an image, and then we convert the image of the marble surface to the binary. For converting image to binary we need to define a level so that (im2bw Function) we can convert the light intensity higher than the level to white and the light intensity lower than the level to black. So detecting the threshold level is decisive role in the result of conversion. For detecting general threshold level, (there is function named graythresh in MATLAB) using Otsu's Method, we determine a global threshold for the image. Then, by using this threshold level, we convert the image to binary that has been illustrated in Figure 5c. Then we use an average filter. An average filter is a linear place one that has been widely used in processing and analyzing images. This filter makes the image smooth that causes the process and analysis of the image easier [31]. Now note that some of the small binary objects has been caused by noise and on the other hand there is blank space inside streaks and present impurities on the stone surface that we should fill in them (using bwareaopen order in MATLAB) so that streaks and impurities become smooth (according to Figure 6). By calculating obtained area from streaks and impurities on marble surface and dividing it by total area of the stone surface, the extent of impurity percentage on stone surface can be obtained. Getting this area is very important in stone classifications and each cut out white marble can be classified into grades one, two, three, four and consider different economic value for each of them.  For more resolution of streaks and impurities on marble surface after dealing with binary image for more clarity of present streaks and impurities on marble surface, we have converted the image to colored one (RGB) (Figure 8).

Materials: The Stone Repository Ark Birjand
For the reason of lack of available acceptable and professional database of images for white marble Ark Birjand surfaces used in building façade throughout Iran and even all over the world, this study, at first prepares acceptable and professional database of common and at hand while marbles. For this purpose, during a sampling operation, 100 digital images from cut out white marbles in colored space of RGB with suffix of JPEG and standard resolution of 96 dpi were prepared that the size of the image is 300×250. These images were prepared from the stone repository Ark Birjand extracted from the mine Ark in South Khorasan County. All of the obtained images in this research were taken by Sony digital camera (14.1 Mega Pixels optical Steadyshot DSC-W380) from distance of 30 cm from the stone surface with similar optical conditions in perpendicular state. The lighting was carried out using 100 watt incandescent lamp, fixed in one meter over the piece. For smoothing light, a radiation was used from an A4 page in 7 cm from light resource (lamp) fixed in stable position. Also for changing the light intensity a power supply of feeding direct current to lamp has been used.

Results and Discussions
In study [22] an automatic industrial method using protractor strip and image processing system have been used for clustering white marbles (four image groups (G1, G2, G3, G4)) that correct classification rate(CCR) and K-means clustering using SDH, Wavelet and morphological features individually and altogether are as following (Table 3). In this research, also correct classification rate (CCR) of K-means clustering using different two-and-three-level hierarchical clustering strategies (L: level) has been as following (Table 4).  [32] marble classification has been examined using image processing techniques. The proposed method in this research includes two phases, training and classification. In training phase, k-means clusters unsupervised learning method has been used for categorizing so many kinds of marble samples (three categories of A, B, C). K-means clustering technique is applied with threshold values that these values are used in classification process. Also in this method Sobel edge detector has been used and has the accuracy rate of above 96 percent. The proposed algorithm in this paper has been successful by correct rate of 97.8 percent on obtained images from Ark marble quarry in Birjand. This software has been tested at least on 100 obtained images from white marble surfaces that its obtained results has had conformity with the cursory examination of the operator. The results of this research indicated that we can use image processing technology for grading white marbles based on impurity levels on their surfaces in quality clusters according to size and color with acceptable precision. This software greatly increases efficiency in extracted stones form stone resources as many of large ores extracted from mines has higher different percentages of streaks and impurities and this issue affects considerably their price and economic value, the sale of these large ores without cutting them out won't have so much economic interests but on the other hand cutting out the white marble stones and classifying them into different groups with different economic values can have its own special buyers and be very lucrative. Obtained results in this research indicate that this method with high accuracy rate can act so well and have many economic interests. Obtained results with software have been compared visually with marble surface and one of the cases that software has considered impurity by mistake is break or stroke in marble surface that should be separated from impurity and we hope that in future research, researchers of this industry deal with them.

Conclusion
Machine Vision is an important engineering tool in digital appliances and it is used for controlling other industrial instruments like handling robot arms or removing the defected equipment in computer networks. Like human force reviewing the goods in the production line for quality detection and their structure type with unaided eyes, Machine Vision uses digital and smart cameras such as image processing applications for this purpose. This research examines and analyzes an industrial problem in the ornamental stone industry. In this paper a simple and efficient method has been proposed for white marble classification. The proposed method includes two stages, in the first stage by using image processing functions it is attempted to segment the present impurities and streaks on marble surface from the stone background and in the second stage, the area of these impurities and streaks is calculated. As it was mentioned, this algorithm at least has been tested on 100 marble samples obtained from Ark Quarry in Birjand and its result (above 97 percent accuracy) is acceptably proportional with the obtained result from human eye examinations. Also, the tentative results indicate that the proposed method is comparable or even more efficient than similar methods in this industry.