Splitting ore from X-ray image based on improved robust concave-point algorithm

View article
PeerJ Computer Science

Introduction

In the process of ore production, separation is an indispensable procedure, the effect of ore separation directly determines whether the raw ore can be fully utilized. At present, the main beneficiation methods are hand separation, gravity separation, floating separation, and so on (Qin et al., 2017). Among them, hand selection is based on the difference in color, luster and shape between target minerals and gangue in raw ore. Although laborious, this method can often obtain a higher grade concentrate. Gravity separation makes use of the density difference of ore and gangue. Floating separation is the main method for mineral extraction, but it is not suitable for all minerals. Taking antimony ore as an example, while antimony sulfide is a floating minera, antimony oxide belongs to refractory ore. Above methods have very significant problems, such as low identification accuracy, requiring of large space and higher investment costs, etc.

With the development of computer science and image processing technology, machine vision has been applied in the field of mineral separation (Jung & Choi, 2021) in recent years. Separation method based on dual-energy X-ray has attracted more and more attention. Scholars have carried out a lot of research on mineral separation. While most of the research focuses on how to conduct the separation according to the physical characteristics of ore itself (Von Ketelhodt & Bergmann, 2010), there are few researches on the separation of adherent ores.

The traditional image segmentation process mainly uses the methods based on threshold, edge, region and clustering. The essence of image segmentation method based on threshold (Otsu, 1979) is to classify image gray histogram by setting different gray threshold values (Huang, Zheng & Liang, 2020). Edge detection (Rosenfeld, 1981) consists of serial edge detection and parallel edge detection (Khan, Bhuiyan & Adhami, 2011). The serial edge detection method first detects the starting point of the edge, from which the adjacent edge points are searched and connected by the similarity criterion to complete the image edge detection; The parallel edge detection method is segmented by using the spatial calculus algorithm and convolving its template with the image in parallel. In practice, the parallel edge detection method can complete the segmentation by convolution directly with differential operators such as Robers (Rosenfeld, 1981), Sober (Gao et al., 2010) and Canny (Er-sen et al., 2009). The region based image segmentation method uses the spatial information of the image for classification, and there are many methods (Pham, Xu & Prince, 2000), among which the region growing algorithms, spliting and merging algorithm (Tremeau & Borel, 1997) and watershed algorithm (Chandra, Supraja & Bhavana, 2017) are the most commonly used methods. The region growing algorithms collects pixels with similar properties to form independent regions to get segmentation results. The essence of the spliting and merging algorithm is to get each sub-region of the image by constantly splitting and merging. The watershed algorithm (Liu, 2019; Chien, Huang & Chen, 2003) treats the image it operates as a topographic map, in which the brightness value of each pixel represents its height. The image segmentation method based on clustering (Huang, Zheng & Liang, 2020, Rosenfeld, 1981) gathers pixels with similar features into the same area, iterates and converges the clustering results repeatedly, and finally divides all pixels into several different categories to get the segmentation results.

With the development of deep learning, convolutional neural network has been introduced into the field of image segmentation as an important means of image processing. It can make full use of the semantic information of the image to realize the segmentation of the image. A series of image semantic segmentation methods based on deep learning, such as FCN (Long, Shelhamer & Darrell, 2015), PSPNet (Zhao et al., 2017), DeepLab (Chen et al., 2016, 2017) and Mask R-CNN (He et al., 2017), have been proposed. However, although the deep learning method has strong adaptability, it still has some shortcomings, such as requiring a large number of datasets for training and hard to obtain real-time segmentation results.

For specific segmentation scenarios, some of the algorithms can achieve good segmentation result. However, the result of ore adhesion is varied, thus the method mentioned cannot be directly applied to ore segmentation. The method based on concave point detection is a very effective method to segment circular adhesion objects. It can be observed that there must be multiple concave points existing in the outline when circular objects adhere to each other, and we can use this priori knowledge to segment such adhesive objects. For example, Yao et al. (2017) uses the concave point detection algorithm to segment rice, and Song, Zhao & Liu (2014) proposes a method combining the concave point detection and watershed algorithm to segment the adhesion cells. The segmentation method based on concave point detection is not only fast enough to meet the needs of tasks requiring high real-time performance, but also can achieve good results for objects with smooth surface such as cells. However, although the ore is also a kind of circular object, its physical characteristics determine that there are many small interference concave points on its surface. If the conventional concave point detection method is used directly, these interference concave points will not be filtered out, which will inevitably lead to a large amount of over-segmentation phenomena.

To solve the above problems, inspired by the traditional concave point detection algorithm, a new concave point matching algorithm is proposed in this article to filter the small concave points on the edge caused by the ore’s own characteristics, and the proposed method can greatly improve the accuracy of concave point matching. The proposed algorithm includes three parts: contour extraction module using adaptive threshold segmentation and image binarization and Suzuki’s contour extration algorithm (Suzuki & Abe, 1985), concave point detection module based on vector angle and concave point matching module based on concave point auxiliary line. In order to validate the proposed method, industrial experiment have been carried out on the antimony ore dataset and compared with other methods. The experiment show that the proposed concave matching method based on the auxiliary line of the concave point can well remove the small interference concave points, and meet the requirements of ore X-ray image segmentation.

Image segmentation of ore

Industrial background

The typical structure of ore sorting device based on X-ray is shown in Fig. 1. The sorting process is as follows: first, raw ore is crushed into small stones of uniform size, which are sent to the pseudo-dual-energy X-ray identification equipment through the belt conveyor. Then, the industrial computer needs to determine the grade of ore from the high and low energy images obtained from the X-ray device and pass the coordinate of ore to the valve controller, which uses the coordinates to adjust the direction of the air flow to blow the ore into the correct separator box. In this process, the image segmentation algorithm must be able to get the correct position of the ore from the X-ray image, otherwise the subsequent valve controller will not work correctly.

Ore sorting device.

Figure 1: Ore sorting device.

The pseudo-dual-energy X-ray processing subsystem used in the system is shown in Fig. 2. It contains an X-ray source and a pseudo-dual-energy X-ray detector. The X-ray source emits X-ray beam with a continuous spectrum, and the dual-energy detector is a two-layer structure, the upper layer collects low-energy signals, the middle layer uses a copper sheet to filter out the low-energy part of the ray, and the lower layer collects high-energy signals. The pseudo-dual-energy X-ray system is widely used in industrial inspection due to its simple structure, high precision and cost performance.

X-ray processing subsystem.

Figure 2: X-ray processing subsystem.

At present, the mainstream sorting method based on pseudo-dual-energy X-ray relies on the fact that different grades of ore have different physical characteristics and thus have different absorption ability for X-ray, so that the gray level of the picture obtained from the X-ray detector is different (one example is shown in Fig. 3). When the ore is separated from the original image, through these gray features, combined with the classification algorithm, different grades of ore and gangue can be separated.

Gray image obtained from X-ray detector.

Figure 3: Gray image obtained from X-ray detector.

The difficulty of ore image segmentation based on x-ray

Real time performance

Industrial computers must segment, classify ore from image and send ore locations and categories to subsequent controller in limited time. If the algorithm takes too long time, the antimony will not be blown into the corresponding box by the air valve in time, which will lead to the failure of sorting.

Accuracy

The classification algorithm uses each pixel of the segmented ore to classify the mineral. If over-segmentation occurs, the number of pixels available for ore classification will be reduced, resulting in errors in classification results. Accordingly, if undersegmentation occurs, the classification results will be inaccurate because the samples to be tested are mixed with different kinds of ores.

Robustness

In the actual production process, there will be a lot of small stones and other debris on the belt, and eventually these debris will appear on the X-ray gray image in the form of noise. If these noises are not processed, over-segmentation will occur and the accuracy of recognition will be reduced.

Robust ore image segmentation algorithm

The ore image segmentation algorithm proposed in this article is implemented on the system shown in Fig. 1. It consists of three modules: contour extraction module, concave point detection module and concave point matching module. The contour extraction module consists of image cutting, image binarization, noise processing and contour extraction. The concave point detection module determines whether the point on the contour is concave by calculating the angle between three consecutive points. As the main contribution of this article, the concave point matching module filters out the interference concave points on the boundary by drawing parallel lines of connecting lines of concave points and judging the relative position of parallel lines and ore contours, so as to reduce the probability of over-segmentation.

Image cutting

As shown in Fig. 4, the output image of the X-ray processing subsystem consists of two parts: high-energy part and low-energy part, so it needs to be cut apart through the slicing operation of the matrix. The image obtained after cutting is shown in Fig. 5.

Original image.

Figure 4: Original image.

(A–B) Two parts of X-ray image.

Figure 5: (A–B) Two parts of X-ray image.

Image binarization

In order to find the ore contour using Suzuki’s method (Suzuki & Abe, 1985), the image obtained in the Image cutting section needs to be binarized. Fixed threshold segmentation, Otsu threshold segmentation, and adaptive threshold segmentation are the most commonly used methods. It is found in practice that for the samples obtained from actual production process, fixed threshold and Otsu threshold segmentation, as a global threshold segmentation method, cannot effectively binarize ore image under the condition of dark background, much noise and interference caused by stone powder, while as a method using local threshold, adaptive threshold segmentation can better adapt to complex situations in different scenes. Therefore, this article adopts adaptive threshold segmentation algorithm to segment non-adhesive images, and carries out preliminary segmentation of adhesive images.

By selecting the low energy image or high energy image in Fig. 5, the binary image can be obtained after being processed with the adaptive threshold segmentation algorithm, and the result is shown in Fig. 6.

The binary image obtained by adaptive threshold segmentation.

Figure 6: The binary image obtained by adaptive threshold segmentation.

Noise filtering

In the actual production process, the binary image of ore has a lot of noise. If the noise is not filtered, the program will treat the noise as tiny ores, which not only increases the computing load of the computer, but also interferes with the process of recognizing normal ores.

We use morphological operation (Comer & Delp, 1999) to remove noise from the image. Firstly, the noise inside the stones were removed by dilation operation, as shown in Fig. 7. Similarly, in order to remove noise outside the ore, erosion operation is used, and the effect is shown in Fig. 8.

Dilation operation.

Figure 7: Dilation operation.

(A) Before dilation operation; (B) after dilation operation.
Erosion operation.

Figure 8: Erosion operation.

(A) Before erosion operation; (B) after erosion operation.

Contour extraction

In this article, the method proposed by Suzuki (Ren, Zhang & Zhang, 2019, Suzuki & Abe, 1985) is used to extract contour from binary image, and the extracted contour is shown in Fig. 9.

Extract the contour from the binary image.

Figure 9: Extract the contour from the binary image.

(A) Binary image; (B) after drawing contour.

Concave point detection

It can be observed that the concave point is a class of points with the maximum local curvature on the contour formed by two or more circular objects stacked. For a single smooth elliptic object, the contour curve will not have a large curvature mutation, nor will it form a concave region caused by overlapping of different objects. On the contrary, there must be points whose curvature change suddenly on the contour of the cohesive ores, which is the basis for determining concave points.

As shown in Fig. 10, two vectors named u and v are formed by three consecutive points on the contour (the length of the u and v are greater than the hyperparameter d), then the angle between the two vectors is calculated to obtain the concavity corresponding to the point.

Concave point detection.

Figure 10: Concave point detection.

For points on the contour [p1,p2,...,pk,...,pn], in order to find the concavity corresponding to point pk on the contour, by using Eq. (1), m=i and m=j can be solved separately (in Eq. (1), i>k,j<k, and in this article, d is set to 6).

argminm|km|s.t. |pkpm|>d

By substituting the values of i and j into Eqs. (2) and (3), we can derive the values of the vectors u and v, and their corresponding coordinates ux, uy, vx and vy.

u=(ux,uy)=pipk

v=(vx,vy)=pjpk

To calculate the angle between the vectors u and v, the function θ(x,y) defined in Eq. (4) is used to calculate the angle between the x-axis and the vector u, and the same is true for v, so that we can obtain the values of θ(ux,uy) and θ(vx,vy). Let θ1 be the difference between θ(ux,uy) and θ(vx,vy). Note that θ(x,y) in Eq. (4) is 0 in the positive direction of the x-axis, and gradually increases in the counterclockwise direction, with a max value of 2π.

θ(x,y)={arctan(yx)x>0,y0arctan(yx)+πx<0arctan(yx)+2πy<0,x>0π2x=0,y>03π2x=0,y<0

θ1=θ(ux,uy)θ(vx,vy)

As θ1[2π,2π], the result obtained in the previous step need to be processed by using Eq. (6) to obtain the angle α.

α={θ1+2πθ1(2π,π)θ1θ1(π,π)θ12πθ1(π,2π)

We can obviously judge the convexity and angle of the local contour from the value of α, that is, if α[0,π], it is concave, otherwise it is convex. In practical use, in order to reduce interference, relatively flat local contours will be excluded, that is, point on the contour can be regarded as a concave point only if α[0,θt], where θt<π. After repeated experiments, it is found that selecting θt=3π4 as threshold in this article can achieve better detection effect. By using the concave detection algorithm described above, the concave points can be detected in the extracted contour (b) in Fig. 9, and these concave points are annotated in red in Fig. 11 (the contour drawn in the Contour extraction section is hidden to highlight the concave points).

Concave points detected on the contour.

Figure 11: Concave points detected on the contour.

Concave point matching

The physical characteristics of the ore often lead to the existence of a large number of concave points on its edge in the absence of adhesion with other ores. For example, because some antimonite exists in the form of crystal, many concave points will be detected when the concave detection algorithm is performed. For this kind of ore, it will lead to over-segmentation if the concave line is used as the dividing line directly. This problem can be solved perfectly by using three-line method proposed in this article. The schematic diagram of this method is shown in Fig. 12.

Three-line method.

Figure 12: Three-line method.

As can be seen from the Fig. 12, due to the characteristics of the ore itself, concave points can be detected even from the outline of a single ore. Obviously, in such case, the connecting line of the concave points cannot be directly used as the dividing line (marked in green). In order to eliminate the false segmentation caused by such points, auxiliary lines are drawn in the figure (marked in black). The connecting line of its concave points can be used as a dividing line if the auxiliary lines are all inside the contour. The detailed steps of the method are as follows:

Finding the auxiliary line

As shown in the Fig. 12, the auxiliary line is actually the parallel line of the connecting line of the two concave points, and it has the same length as the connecting line of the concave points. Therefore, the auxiliary line can be obtained by combining the slope k of the connecting line between the concave points and the given distance d.

Let E0=(r0,c0) and E1=(r1,c1) be the endpoints of the connecting line. First, calculate its slope k by using Eq. (7).

k=c1c0r1r0

The distance difference ( Δx and Δy) between the concave point and the end point of the auxiliary line is obtained by using slope k and distance d.

Δx=kd1+k2

Δy=Δxk

The endpoints of the concave points (r0,c0) and (r1,c1) are translated by distance Δx and Δy in the horizontal and vertical directions to obtain the endpoints of the auxiliary line: P0, P1, N0 and N1.

P0=(r0+Δx,c0+Δy)

P1=(r1+Δx,c1+Δy)

N0=(r0Δx,c0Δy)

N1=(r1Δx,c1Δy)

Wire P0 and P1 to get the auxiliary line LP. Similarly, the auxiliary line LN can be obtained by connecting N0 and N1.

Judging the position relation between auxiliary line and contour

In order to judge the position relationship between the auxiliary line and the contour, it is necessary to judge the position relationship between each point of the auxiliary line and the contour. In this article, the PNPoly algorithm (Haines, 1994; Zhang & Zhou, 2022) proposed by W. Randolph Franklin is used to solve the position relationship between the point and the contour (the point to be measured can be on the contour, inside the contour or outside the contour). The idea of the algorithm is shown in Fig. 13.

Find the position relation between any point and the contour.
Figure 13: Find the position relation between any point and the contour.

As can be seen from the figure, the position relationship between the point and the contour can be judged by drawing the horizontal line and finding the number of times that the line crosses the contour.

Finding the true dividing line

As shown in Algorithm 1, by repeatedly applying the method described in the Concave point detection section and the Concave point matching section for each candidate concave point splitting line, the true splitting line of the adhered ore can be found.

Algorithm 1:
Finding the true dividing line
Input: C: Concave point set
Output: Llist: Candidate dividing lines set
1: For concave point set C={p1,p2,...,pn}, after performing the permutation and combination operation, we get {p1,p2}, {p1,p3}, {pi,pj},…, {pn1,pn}
2: Calculate the distance d between its elements: D={d1,2,d1,3,di,j,dn1,n}, di,j=|pipj|
3: Find the minimum value dk,q in set D
4: Add the connecting line L between pk and pq into Llist
5: Remove pk,t and pt,q from set D,where t=1,2,...,n
6: Repeat steps 3–5 until the number of elements in C is less than 2
7: for all line L in the Llist
8:    Let distance be d, draw auxiliary line Lsiblings
9:    if Lsiblings are all on the contour then
10:     Append L into Llist
11:    end if
12: end for
13: return Llist
DOI: 10.7717/peerj-cs.1263/table-3

Complete segmentation process

The overall segmentation process is shown in the Algorithm 2, one of the segmentation examples is shown in Fig. 14.

Algorithm 2::
Overall segmentation process
Input: Pseudo-dual-energy X-ray grayscale image
Output: Contour of ore
1: Image cutting
2: Image binarization
3: Noise filtering
4: Contour extraction
5: Concave point detection
6: Using concave point mathing algorithm proposed in this article to
get the splitting line if the number of concave points is bigger than 2
7: The dividing line is combined with the contour in step 4, and the
result is used as the new segmentation contour
8: return The segmented contour
DOI: 10.7717/peerj-cs.1263/table-4
Segmentation example.

Figure 14: Segmentation example.

Experiments

LNPC12-80, a pseudo-dual-energy X-ray sorting device produced by Longi company, was selected for the experiment, the equipment shown in Fig. 15.

LNPC12-80.

Figure 15: LNPC12-80.

In order to verify the performance of the proposed algorithm, the antimony ore dataset made by ourselves is selected for the experiment. The relevant parameters of the sample are shown in Table 1.

Table 1:
Sample distribution
Types of antimony ore Weight Grade
High grade ore 1.91 kg 26.83%
Medium grade ore 1 1.7 kg 4.74%
Medium grade ore 2 4.8 kg 0.556%
Tailings 17.9 kg 0.024%
DOI: 10.7717/peerj-cs.1263/table-1

In this experiment, the memory of the host used in the experiment is 16G, the CPU model is 28375CX2, and the windows 10 operating system is used. C++ and Opencv library are used to implement the proposed algorithm, and 134 single-channel 512×5,632 gray scale images are tested.

Analysis of results

In order to better demonstrate the superiority of the algorithm in this article, the algorithm proposed in this article is compared with simple concave point matching algorithm and the watershed algorithm based on distance transform using exactly the same dataset. Several typical images are selected from the results of experiment to illustrate the performance of each algorithm. As shown in Fig. 16, if the overlapping area of two ores is large, they cannot be separated by the watershed algorithm (as shown in the first row). Even if the watershed algorithm can be used to divide the cohesive ore, the dividing line in the segmentation result is not very accurate (as shown in the second row). Due to the physical characteristics of the ore, even a single ore may have a large number of concave points on its contour, in this case, the use of simple concave matching will inevitably lead to over-segmentation (as shown in the third row). In the above cases, the algorithm proposed in this article can work well.

Comparison of different algorithms.

Figure 16: Comparison of different algorithms.

In this article, Pu (under-segmentation rate), Po (over-segmentation rate) and Pa (accuracy rate) are used as performance indicator to reflect the performance of algorithms when applied in practical industrial applications and they are defined as:

Pu=NuM×100%

Po=NoM×100%

Pa=NaM×100%

In this formula, Nu is the number of under-segmentation ore, No is the number of over-segmentation ore, Na is the number of ores correctly divided and M is the total number of ores tested ( M=134).

As can be seen from the Table 2, compared with other algorithms, the proposed algorithm can significantly reduce the probability of under-segmentation and over-segmentation and improve the accuracy of segmentation.

Table 2:
The accuracy rate of different algorithms
Method Pu% Po% Pr%
Simple concave point matching 3.73 7.46 88.81
Watershed algorithm 5.22 2.24 92.54
Algorithm of this article 3.73 0 96.27
DOI: 10.7717/peerj-cs.1263/table-2

Conclusion

This article presents a strategy of ore segmentation based on concave point detection. This strategy contains two main innovation. Firstly, an ore segmentation framework for pseudo-dual-energy X-ray images is proposed, which is mainly composed of contour extraction module, concave point detection module and concave point matching module. Secondly, in order to reduce the influence of the concave points caused by the physical characteristics of ore on segmentation process, this article proposes a concave point matching algorithm which uses the position relationship between the auxiliary line and the contour to judge whether the candidate segmentation scheme is available. By comparing the result of experiment, it is found that the proposed algorithm can obtain a satisfactory segmentation effect, and it can be applied to the actual industrial ore separation process, and also pave the way for the ore classification.

1 Citation   Views   Downloads