Abstract
Structured light has been widely applied to 3D shape measurement with the capabilities of rapidness, high-accuracy, and noncontact. Because of uneven illumination and noise, it is difficult to distinguish the light stripes and background of the image, which reduces the measurement accuracy. In this paper, an adaptive Canny edge detection method with two phases is proposed for structured light stripes. Firstly, the idea of dynamic granularity is introduced and the dynamic granularity matrix space is established, in which image segmentation problems are described as the transformations and jumping of image at different granularity layers. The hierarchical structure and optimal granularity layer of image are obtained as the basis of adaptive edge detection. Secondly, a quantum-inspired group leader hybrid algorithm is adopted to calculate the optimal threshold from the optimal granularity layer, which is taken as the adaptive threshold for Canny operator. Finally, experimental tests and comparisons have been conducted to verify the effectiveness of the adaptive method proposed. The experiments show that the proposed method achieves high segmentation accuracy, improves the segmentation efficiency, and has strong robustness to noise.
1. Introduction
With recent advancements on computer science, due to the flexibility and versatility of structured light measurement, high-accuracy 3D shape measurement using structured light methods has been a vibrant field with increased interest in various industries [1–3], such as manufacturing and entertainment. In particular, high-accuracy 3D shape measurement techniques become more and more important with new applications found almost every day. Generally, structured light measurement system is composed of one CCD camera and one projection device or line laser device [3–6]. Fringe projection technology has been widely used in the field of structured light 3D measurement. By projecting fringe patterns onto the measured object and capturing the fringe images modulated by the object surface, the depth information is encoded into the phase of the fringe images [1, 2]. For shiny surface measurements, binary fringe, such as gray code pattern, is much more reliable than sinusoidal phase-shifting fringe patterns, because only two gray levels need to be identified instead of the absolute gray level, which are coded as 0 and 1. Furthermore, the binary fringe is more robust against noise. According to many research conclusions [7–11], binary fringe patterns can reduce the impact of the nonlinear gamma effect of projection, thereby reducing the system error and improving the measurement accuracy. In addition, the structured light measurement method based on line laser is also widely used in engineering field [5]. For binary fringe patterns and line laser stripes, a key step is to distinguish and extract the binary black-and-white stripes from the ambiguous zone [5, 9–11], in which image segmentation is the precondition for accurate analysis of stripe phase information. In real applications, the surfaces of objects are textured, and the radiation intensity of the scene is relatively high, leading to reduced contrast and distorted image. Due to the complex textures, high illumination, and noise, it is difficult to distinguish between structured light stripes and background of the image, which limits the measurement accuracy and efficiency.
Image segmentation is a classical problem in the fields of computer vision and image processing. Image segmentation is the basis of image analysis and understanding and is an important prerequisite for image feature extraction and target recognition. The main problem of image segmentation is that it is difficult for human vision to distinguish the blurriness of the gray level of the image from black to white. The complexity and variability of natural images makes the problem of determining which pixels belong to which region uncertain. Currently, the segmentation methods for structured light stripes mainly include threshold segmentation, fuzzy clustering, and edge detection method. The threshold method [12, 13] sets a boundary threshold to obtain two borders in the transverse section of the light stripe, and the centers of the light stripe are regarded as centers of the two borders. This method is affected by the noise and the image contrast conditions. Fuzzy C-means clustering method is an unsupervised technique that segregates the objects into several populations based on their qualities; the choice of initial cluster centers is done in a random fashion and this heavily influences the solution [14–16]. Due to this random selection, there is a possibility of delay in convergence rate or there will be a chance of getting stuck in local optimal solution [15], which leads to the increase of computing time. How to choose the appropriate initial cluster centers is still a difficult problem. Moreover, the above conditions need to be judged by artificial experience, and the clustering results obtained by different people may be also different. Because of the advantages of precise location, clear edge, and high efficiency, edge detection operator is widely used in structured light stripe segmentation. The need of edge detection for structured light stripes is to find the discontinuities in depth, discontinuities in surface orientation, and variations in scene illumination. The Robert operator calculates the difference between the orthogonal pixels, which is better for detecting vertical edges than hypotenuse ones, but it suffers significantly from image noise. The Prewitt operator simply considers the pixels with the differences larger than a given threshold as the edges, so that it can generate some misjudged edges. The Sobel operator convolves the original image with a matrix to suppress edge blur, but is not efficient when being applied to the structured stripes with backgrounds [17]. The Canny operator can both smooth the image and identify the light stripe edges; it uses a couple of fixed thresholds to detect the stripe edges, where the upper threshold detects the edges in the image and the lower one mends the breakpoints [18–21]. When the upper threshold is low, the detected pseudoedges will increase, and with the increase of the upper threshold, it is easy to lose important edge feature information. If the lower threshold is low, the retained edge feature information will increase, and the ability to suppress noise will decrease. With the increase of the lower threshold, the feature information of target edge decreases continuously, which easily leads to the discontinuity of image edges. However, fixed thresholds are not suitable for extracting light stripes under varying illumination conditions [11]. Some scholars have introduced many methods to improve the Canny operator through selecting the thresholds adaptively. Hu et al. introduced the Otsu method to modify the Canny operator, and the threshold obtained by Otsu method was used as the upper threshold for Canny algorithm [11], which only considered the gray level property of the image, causing the noise robustness to be low. In short, a single segmentation method above has many limitations and cannot meet the requirements of high-precision for image segmentation of structured light stripes. How to absorb the advantages of different methods for structured light stripes segmentation is a difficult problem at present.
According to the cognitive characteristic, Zhang et al. proposed a theory of fuzzy quotient space based on fuzzy equivalence relation by introducing fuzzy set theory into classical quotient space theory [22]. By partitioning complex problems into granules, fuzzy quotient space can transform them into some relatively simple problems, which is helpful to analyze and solve the complex problems [22–26]. Based on the existing knowledge, the individuals in the problem space are grouped into different classes, called granule, and all the granules form a granularity layer. When solving problems, people can analyze and observe the same problem from different granularity worlds and it is easy to move from one granularity world to another [26]. Granularity refers to the division of complex problems into granules with different sizes. Large-scale objects are called coarse-granule and vice versa, and then the conversion between coarse-granule and fine-granule was further studied. Zhang et al., based on the granularity principle of quotient space, established the theoretical framework of image segmentation [27]. He et al. proposed a granular lattice matrix space model and established an improved FCM algorithm, which gives weight to each cell granularity layer and achieves image segmentation by granularity synthesis. However, it still needs to set the initial number of clusters, relying on artificial experience [24].
Addressing the problems of high-accuracy stripe segmentation under the conditions of uneven illumination and noise and the shortcomings of the above image segmentation method, this paper proposes an adaptive edge detection method with two phases. Firstly, based on fuzzy quotient space theory, dynamic granularity matrix space model in the form of five tuples is constructed, and the image segmentation framework based on this model is established. The problems of image segmentation are transformed into the processes of transformation and jumping from coarse granularity to fine granularity. The hierarchical structure and optimal granularity layer of the image are determined through changing the granularity. Secondly, the quantum-inspired group leader hybrid algorithm is proposed to calculate the optimal segmentation threshold, which is applied to Canny operator to get the segmented image. Considering the gray attribute and neighborhood spatial attribute of pixels, 2D Otsu method is taken as evaluation function. The proposed method can be used not only for binary black-and-white fringe segmentation, but also for line laser stripes segmentation.
The work is organized as follows: Section 2 explains the dynamic granularity matrix space. Section 3 introduces the adaptive edge detection method based on quantum-inspired group leader hybrid algorithm and Canny operator. Section 4 experiments on structured light images. Conclusion is presented in the last section.
2. Dynamic Granularity Matrix Space
This section briefly explains the theory of fuzzy quotient space and proposes the dynamic granularity matrix space model. The hierarchical structure and optimal granularity layer are obtained based on this model.
2.1. Theory of Fuzzy Quotient Space
Zhang et al. proposed a theory of fuzzy quotient space based on fuzzy equivalence relation and proved that the whole fuzzy quotient spaces with different granularities compose a complete semi-order lattice [22]. Fuzzy quotient space has become one of the most important theoretical models of granular computing. The core course of the theory is how to build a kind of reasonable hierarchical structure from multiple quotient spaces with extremely different granularities. Some basic notions and properties of fuzzy quotient space theory are given as follows [22].
Definition 1. Let be a fuzzy subset on domain . For , a specified number is called membership of with respect to . Mapping , is called a membership function of .
Definition 2. Let represent the set of all fuzzy subsets on . Assume that function and satisfies(i)reflexivity, ;(ii)symmetry, ;(iii) is called a fuzzy equivalence relation on .
Proposition 3. Assume that R is a fuzzy equivalence relation on . Let and ; is a crisp equivalence relation on and is called a cut relation of .
Proposition 4. Let be a quotient space corresponding to equivalence relation . From Definition 2, it can be seen that is a quotient space of . A family , of quotient spaces forms an order-chain based on the inclusion relation of quotient sets. A set of spaces is called a hierarchical structure on .
Proposition 5. Given a fuzzy equivalence relation R on , we have a corresponding hierarchical structure on .
Theorem 6. Assume that is a hierarchical structure on ; there is a fuzzy equivalence relation R on , whose cut relation is . Quotient space corresponding to equivalence relation is .
2.2. Dynamic Granularity Matrix Space
Definition 7. Using five tuples represents dynamic granular matrix space (DGS) model.
In Definition 7, X is the set of the granules studied, representing the domain of the studied object; A represents the set of all the properties of granules, such as gray value, texture, and connectivity; V represents the set of attribute values of granules, i.e., ; I is the connotation of the granule embodied by the granularity matrix, which reflects the internal attributes of the interaction between the granules within a granularity; E is the extension embodied by the granularity matrix, which reflects the external attributes of the interaction between the granule and other granules; M performs the functions of the connotation extension operator and the extension connotation operator in the form of the granularity matrix; i.e., the transformation between connotation and extension is realized; and R is fuzzy dynamic granularity, i.e., the state characteristics of granules under fuzzy equivalence relation, reflecting the dynamics of granules.
Theorem 8. Let be a fuzzy relation on the domain U. If and only if, , the cut-off matrix of is an equivalent relation on U, the fuzzy relation is a fuzzy equivalent relation.
Definition 9. Let be a fuzzy equivalent relation on . The cut matrix of fuzzy equivalence relation corresponds to a Boolean matrix, , indicates the similarity between and .
Theorem 10. Let be a fuzzy equivalent relation on and corresponds to a dynamic granular matrix space . The structure can be represented by fuzzy equivalent granules , where represents a fuzzy subgranular. , is a distance function in .
According to Theorem 10, a fuzzy equivalence relation in space corresponds to a distance. If a distance is given, a fuzzy equivalence relation is also given. Therefore, the relationship between the two fuzzy equivalent granules can be also described by the distance function in space.
Theorem 11. Cut-off matrix corresponds to a granularity matrix space and corresponds to a granularity matrix space , if , , is the quotient set of .
Therefore, according to the inclusion relation of quotient sets, the cluster of quotient spaces forms an ordered chain, that is, a hierarchical structure, giving a fuzzy equivalence relation on U corresponding to a hierarchical structure on U.
Theorem 12. Let be a hierarchical structure on U; given a fuzzy equivalent relation on U, its cut-off matrix is and corresponds to a granularity matrix space .
Theorem 13. , the following conclusion is equivalent:(i)given a fuzzy equivalence relation;(ii)given a hierarchical structure;(iii)given a distance .
2.3. Image Segmentation Presentation
From the analysis of image segmentation theory and various algorithms, the problem of image segmentation is consistent with the model of dynamic granularity matrix space [22, 24]. Therefore, this model can be used to describe the image segmentation problem, and the theoretical framework of image segmentation is established from the point of dynamic granularity.
(i) Image segmentation problems. According to Definition 7, the original image can be described by the five tuples . X denotes the granular set formed by all pixels of the image. denotes the attributes of each pixel on the domain, including gray value attribute and neighborhood mean gray value attribute in this paper. V denotes the set of attribute values, i.e., . All pixels can be divided into several fuzzy equivalent clusters according to A, in which each fuzzy equivalent cluster constitutes a subregion of image, represented by a granule. Then the union of all granules can represent the image, and each of which can represent a region of the image.
Using describes the image, where I denotes the connotation of image subregion, that is, after segmentation, the consistent properties of the region pixels that make up a certain granule, such as gray value; E denotes a set of regions with obvious characteristics formed by the consistent pixels, such as the image region represented by the granule. M denotes the relationship between pixels and partitioned regions. When the whole image is regarded as a granule and all the pixels in it are regarded as the universe, the corresponding granularity is the finest. While the image is segmented, the corresponding granularity becomes coarse. Therefore, image segmentation problem can be regarded as the changing process from fine granularity to coarse granularity.
(ii) Hierarchical structure. The same problem space will produce different granularity layers at different granularity levels; that is, granularity can be simply understood as the process of obtaining a granularity layer under a given criterion. Through changing granularity, we can get the structure between different layers and within the same layer of the problem space. Multiple granularity layers can be obtained under the same granularity or different granularity, forming a multilevel network structure. At the same granularity layer or at different granularity layers, the problems can be transformed or reasoned through granular computing, so that the more detailed characteristics within the granule or the relationships between granules can be better understood.
According to the above theory, the granularity layers with different segmentation precision are constructed. The whole image information expressed on single layer and single granularity is transformed into some attribute information expressed on multilevel and multigranularity. It can be seen that the model transforms the problems of image segmentation on single level and single granularity into the problems at multilevel and multigranularity and realizes the dynamic segmentation of image by jumping and transforming at different granularity layers. Through changing the granularity, when the precision requirement is low, the similar granules are often gathered together to form a coarse granularity layer. When the precision requirement is high, it is necessary to further refine the granules and describe them in a fine granularity layer. A hierarchical structure is constructed by using nested fuzzy equivalence relation clusters; that is, an ordered quotient space is obtained [22], shown in Figure 1. Each small circle represents a granule.

When a granularity matrix space model is established for an image, given the pixel attribute A, all pixels can be divided into several fuzzy equivalent clusters , in which each equivalent cluster represents a basic region of image .The union of all granules is used to represent the image segmented. According to the requirements of different segmentation accuracy, given A, we can further refine or coarsen the pixel granules, forming different granularity layers and the nested relationship between pixel granules.
Considering the neighborhood property of pixels, we define the distance between pixels by normalized distance , where f represents the pixel gray value and represents the neighborhood mean gray value of the pixel. Given that the distance d is equivalent to its hierarchical structure corresponding to the fuzzy equivalence relation, thus, according to the fuzzy equivalence relation, hierarchical structure can be uniquely determined.
(iii) Optimal granularity layer. According to the theory of mathematical analysis, if the initial value of any iteration is close to the final convergence result, the convergence speed will be greatly improved and the number of iterations will be greatly reduced. At the same time, due to near optimal results, the possibility of falling into local optimum is also reduced. Theoretically, for each granularity layer, the corresponding image segmentation can be achieved. Hierarchical structure has some different granularity layers. However, not all of the granularity layers are meaningful. Thus, the optimal granularity layer is discussed in this subsection.
The effective granularity layer can reflect the clustering effect well, which can be measured by Shannon information entropy [25]. Information entropy is used to describe the average amount of information needed to completely distinguish all granules in each granularity layer [25]. Thus, the image information entropy is defined aswhere represents the tth information granule in granularity layer; k is the number of information granules in granularity layer; denotes the number of pixels in the information granule; K is the total number of pixels of the image; and is the amount of information needed to completely distinguish all information granules, which can be written as
Hence, combining (1) with (2), the formula for measuring the information granularity layer can be rewritten as
From (2), it can be found that the thickness of granularity space is proportional to information entropy; that is, the coarser of granularity space is, the greater the image information entropy is, and vice versa. The difference of information entropy between two adjacent granularity layers can be expressed by information gain, which refers to the amount of information provided by granulation from the coarser granularity layer to the finer granularity layer , shown as
The greater information gain shows that the granularity layer is more meaningful because it can give more information. Hence, the optimal granularity layer is selected out from the hierarchical structure.
3. Adaptive Edge Detection Method
Last section describes the dynamic granularity matrix space model and obtains the optimal granularity layer. This section discusses the adaptive edge detection method including two-steps: (i) calculating the optimal segmentation threshold from the optimal granularity layer, (ii) applying the threshold as an adaptive threshold to Canny operator and obtaining the segmented image.
3.1. Quantum-Inspired Group Leader Hybrid Algorithm
Inspired by the leaders’ social characteristics, Anmer and Sabre [28] proposed a new global optimization evolutionary algorithm, Group leader optimization algorithm (GLOA). Leaders in social groups command members to complete task, and members’ characteristics and performance are impacted by leaders’ qualities [26]. When a member’s leadership is trained to be better than the old leader, the new one is substituted for the old one. Therefore, GLOA allows the populations to converge upon global optimum fast. More details about GLOA are available in [26, 28]. On the basis of GLOA, quantum-inspired group leader hybrid (QGH) algorithm is adopted in this paper, which effectively combines quantum evolution algorithm, group leadership optimization algorithm, and chaotic mapping method. Different from the literature [26], the chaotic mapping method proposed in this paper is used to avoid the algorithm falling into local optimum. Because the initial populations come from the optimal granularity layer in Section 2.3, the diversity and clustering of populations are maintained. The framework of QGH is shown in Figure 2. The framework consists of two parts. The first part is to calculate initial solutions. The second is to improve the members toward the group leaders by running evolution operators in order to get better solution.

The steps of QGH are briefly introduced as follows:
Step 1 (populations initialization). Populations initialization is crucial in evolutionary algorithms, because it can affect the convergence speed and the quality of the final solution. In order to maintain population diversity, we choose the initial populations randomly selected from the optimal granularity layer. Assuming that we select G groups and M members for each group, the total number of group members is . For example, , , , where, represents th group in itth iteration and represents mth member of th group in itth iteration. Each group member contains two attribute values: gray attribute value and neighborhood mean value. Binary coding is adopted for each member, where the length is 16 bits, and the first 8 bits and the last 8 bits represent pixel gray value and pixel neighborhood mean value, respectively.
Step 2 (individual evaluation). Individual evaluation is closely related to the optimization criteria. Evaluation function specifies the members of the maximum fitness value in each group as group leaders. The fitness function value is the criterion to evaluate the ability of group members. Each group has a group leader, which has the max fitness value in the group. Group leader leads the group members to search for the optimal solution. Each group member can be considered as a solution.
In this paper, the objective is to maximize the evaluation function. Suppose the gray level of the image is ; then the neighborhood mean gray value is also . Let be the gray value of pixel in coordinates , and the neighborhood mean gray value of the pixel be defined as where d is the width of the pixel square neighborhood window and generally takes odd numbers [29–31].
Two tuples composed of and are used to represent the image. If the frequency of is , the joint probability density for the image with size of is Using two-dimensional vector as the threshold, the two-dimensional histogram of an image can be divided into four regions (as shown in Figure 3). Area A represents the target, area B is the background, and C and D away from the diagonal are possible edges and noise. According to the homomorphism, the gray value of pixels is close to the average gray value of the field at the target and background, and the difference between the gray value of pixels and the average gray value of the field at the boundary of the target and background is large. Therefore, pixels in the target and background will appear around the diagonal [29–32].
The probability of background and target can be, respectively, described asDefine a discrete measure matrix between target and background as The trace of is used as the distance measure function between the target and the background,Suppose represent the 2D optimal segmentation threshold, and the fitness function can be expressed as

Step 3 (mutation and converting). In order to increase population diversity, Q-gate rotation strategy is introduced to mutation operation. All the members except the leaders travel by sequential traversal method. (i) Choose a bit i of member m randomly, and then transfer the bit in the same location of leader’s to member m at a certain probability. (ii) Transfer the ith bit of leader to the ith bit of member m. (iii) Rotate member m directed to leader. The rotation strategy is adopted from [33]: where , , and is a very small positive real number, usually . is the xth bit of member m. is the xth bit of leader. Then,and is updated by where is the new number in the xth bit of member .
(iv) Calculate new_m’s evaluation function. If it is better than the old one, replace by . Otherwise, keep in the group. Q-gate rotation strategy is beneficial not only for accelerating the convergence speed but also for simplifying the algorithm process.
(v) Randomly generate each bit of a quantum individual . If , thus the ith bit converts to 0; otherwise, it converts to 1.
Step 4 (one-way crossover operations [26, 28]). One group crossover operation is conducted for each group and the group leader is evolved. One-way crossover operations are designed to escape local optimum. In this step, the crossover times of each group are very important. If the crossover times are too many, the algorithm converges too fast and all the populations become similar quickly. The number of crossover is , and only one bit is crossed at a time. One-way crossover operation is shown in Figure 4. If the fitness value of the new member is better than that of the crossed member, the old member is replaced by the new member; otherwise, the old member is retained.

Step 5 (quantum collapse). Chaotic maps are used as quantum collapse operators to make the algorithm escape from local optimum. When the number of iterations reaches a certain threshold, the quantum collapse operation is performed on each group to avoid falling into local optimum. In order to avoid premature convergence, the logical mapping [26, 34] is introduced as a quantum drastic operator, such as where is the ith Q-bit of member , is the updated value, , . When the optimal fitness is greater than the algebraic variation, we use formula (14) to update the populations and individuals.
Step 6. Repeat Steps 3–5 according to a given number of iterations, and finally choose the group leader with the best fitness as the solution. If the number of iterations reaches the maximum generations, the algorithm stops.
According to the steps above, the 2D optimal segmentation threshold is achieved.
3.2. Adaptive Canny Edge Detection Method
From Section 3.1, the segmentation threshold of original image was obtained. According to [35, 36], take , as the upper threshold, as the lower threshold. We use the adaptive threshold to improve the Canny operator. The proposed iterative algorithm is described in Algorithm 1.
|
Based on the characteristics of quantum evolutionary algorithm, and group leadership algorithm, chaotic mapping, this section proposes a quantum-inspired group leader hybrid algorithm which combines the advantages of the three algorithms. Chaos theory improves population diversity. The quantum rotation gate and group leader optimization algorithm systematically improve the search ability of the method proposed. The initial populations are selected randomly from the optimal granularity layer. The 2D segmentation threshold solved by QGH algorithm is taken as the adaptive threshold for Canny operator.
4. Experiments
In this section, we try to further evaluate the image segmentation performance based on the method proposed. In order to compare the effectiveness of different segmentation methods, we choose the structured light image as example. All simulations listed here are implemented in Matlab R2014a on a laptop equipped with 2.50 GHz CPU and 4G RAM memory.
In practical applications, structured light measurement is affected by ambient illumination and surface texture of objects, resulting in low contrast and uneven illumination [7, 11], shown in Figure 5, which contains the original structured light stripes projected onto three different metal surfaces. Figure 5(a) is a line laser stripe pattern, and Figures 5(b)-5(c) are binary fringe patterns. Figure 5(b) is strongly affected by reflections due to the projection of structured light stripes on the metal surface, resulting in a low contrast.

(a)

(b)

(c)
In order to evaluate the performance of the adaptive method proposed, the Otsu method, Robert operator, Sobel operator, Prewitt operator, and Canny operator have been compared respectively, as shown in Figures 6, 7, and 8.

(a)

(b)

(c)

(d)

(e)

(f)

(a)

(b)

(c)

(d)

(e)

(f)

(a)

(b)

(c)

(d)

(e)

(f)
Figures 6–8 display, respectively, the segmentation results for light stripes image Figures 5(a)–5(c), using, respectively, the Otsu method, Robert operator, Sobel operator, Prewitt operator, Canny operator, and the adaptive method proposed. From Figures 6–8, it is obvious that the Otsu method is very sensitive to image contrast. It can produce good segmentation results only for gray-scale images with a single peak. When the gray level of object and background are similar, one obtains multiple peaks of the image of the former and the fuzzy boundaries of the latter. Then it is difficult to determine the boundaries of the stripes using the Otsu method. The segmentation quality using Robert, Sobel, and Prewitt is low, and there are many unrecognized regions, and there are some broken edges, discontinuous edges, and pseudoedges. From Figures 7(e)-7(f), the result using Canny operator is very close to the adaptive method proposed in this paper. From Figures 6(e), 6(f), 8(e), and 8(f), Canny operator retains more edge feature information, including more outliers, pseudoedges, and discontinuous edges, which interfere with the extraction of stripe regions. This is due to the fixed threshold selection problem. Although the segmentation quality of Figure 7(e) is successful, the segmentation results of Figures 6(e) and 8(e) are not satisfactory. Although the Canny excels at processing scattered-light images, it is not good at correcting the images by uneven illumination and it cannot improve the contrast. As can be seen from Figures 6(e), 6(f), 7(e), 7(f), 8(e), and 8(f), the standard Canny operator requires artificial threshold setting. The adaptive method proposed combines the dynamic granularity matrix space method, the quantum group leadership algorithm, and the 2D Otsu method; the dynamic clustering of pixels can be realized based on the consideration of the gray and spatial characteristics of the image pixels; and the segmentation threshold can be calculated adaptively according to the different stripes images. And it is used as the upper and lower thresholds of Canny operator to get better edge detection results. From Figures 6–8, through the adaptive method proposed, we obtain the segmented results with exact localization, unabridged edges, and less redundancy information. Through adaptive threshold selection, the method proposed has strong self-adaptability. It can automatically select threshold according to different image quality and reduce the influence of noise to achieve high-quality stripe segmentation. The adaptive method proposed can handle efficiently the segmentation problems caused by uneven illumination and noise and improve the contrast between the light stripes and background.
There are two kinds of evaluation criteria for image edge detection: subjective standard and objective standard. The subjective standard is mainly based on the relationship between objects and is distinguished by the human eye. Above, we have analyzed the segmented images by subjective criteria. To better evaluate the edge detection methods, this paper selects the total number of edge points A, the number of 4-connected components B, and the number of 8-connected components C as the objective evaluation criteria [37] to objectively evaluate the performance of different segmentation methods. The ratio of C/A is used to indicate the edge continuity of the image detected. The smaller the C/A ratio is, the better the edge continuity is. The C/B ratio is used to represent the edge width. The smaller the C/B ratio is, the larger the proportion of the single pixel edges response to the total number of edges is. That is to say, the smaller ratios of C/A and C/B mean better edge continuity, fewer discontinuities, more edges with single pixel, and better edges quality.
The evaluation criteria of the images in Figures 6–8 are listed, respectively, in Table 1. For more intuitive observation of effects, the contents of Table 1 are illustrated in Figure 9.

(a)

(b)

(c)
From Table 1 and Figure 9, we can see that the numbers of edges detected by Robert, Sobel, and Prewitt operators are almost the same. Compared with Sobel and Prewitt operators, the C/A values of Robert operator are smaller, while the C/B values are relatively bigger, which means that the edge continuity is well and the single pixel edges are less. The differences of C/A values and C/B values between Sobel operator and Prewitt operator are separately unobvious. It can be seen from Figures 6–8 that the segmentation results are close to each other. The Canny operator detects the most number of edge points, which means that the Canny operator produces more pseudoedges under the lower threshold, due to the problem of fixed threshold, as shown in Figure 6(e). The number of edge points detected by the adaptive method proposed is only inferior to that of Canny operator, but the C/A and C/B ratio values are the smallest. It shows that the adaptive method proposed inherits the advantages of the Canny operator well. Moreover, the proposed method has better performances such as better edge continuity, finer edge, and more accurate edge location. Consequently, the experiments demonstrate that the adaptive method proposed can perform better than the other ones in edge detection for structured light stripes. As can be seen from Table 1, the running times of Robert, Sobel, and Prewitt operators are relatively close. Compared with Robert, Sobel, and Prewitt operators, Canny operator is slightly higher. The adaptive method proposed takes the most running time, because it combines artificial intelligence algorithms such as dynamic granularity matrix space, quantum-inspired group leader hybrid algorithm, and 2D Otsu method, which increases the time complexity but achieves better segmentation results.
Taking Figure 5(b) as example, convergence curves of proposed QGH are compared with the ones of genetic algorithm (GA) and GLOA, as shown in Figure 10.

(a)

(b)
From Figure 10, we can see that the three algorithms all achieved the global optimal threshold through several iterations. However, the convergence rate is different. Compared with the other two algorithms, the convergence speed of GA is the slowest. That is because the initial populations are generated randomly, which makes individuals far from the optimal value. The convergence speed of GLOA is faster than GA. That is due to the evolution of group members to group leader, and the diversity of populations is improved by one-way crossover and mutation operation. Furthermore, the QGH proposed in this paper converges to the global optimum faster than GLOA, because of the diversity and classification of initial populations which are obtained by dynamic granularity matrix space. In addition, quantum gate strategy is used to improve the diversity of populations in evolution process, and quantum collapse strategy is used to avoid falling into local optimum.
As can be seen from the above, the adaptive method proposed achieves higher segmentation accuracy and efficiency. It is superior to the traditional edge detection operator in noise suppression and edge joint, and it can also preserve the details more effectively and reduce the false edge phenomenon.
5. Conclusion
In this work, addressing the edge detection problem of structured light stripes under the conditions of high illumination, we introduced a novel adaptive edge detection method with two phases. Firstly, based on the unification of image segmentation and granularity partition, the dynamic granularity matrix space model is constructed. Based on this model, hierarchical structure and optimal granularity layer are obtained by changing the granularity. Secondly, a quantum-inspired group leadership hybrid algorithm is proposed to calculate the optimal segmentation threshold from the optimal granularity layer, which is applied to the Canny operator for adaptive threshold selection. The experiments have demonstrated that the adaptive method proposed is suitable for real-time industrial measurements, especially for the influences of excessive environmental illumination. The experiments have demonstrated that the proposed method can be used not only for binary black-and-white fringe segmentation, but also for line laser stripes segmentation. It can be seen from the experiments that the running time of this algorithm is longer due to the introduction of artificial intelligence algorithms. It is difficult to meet the requirements of real-time segmentation and real-time detection. In the future, we will be devoted to improving the speed of algorithm operation and reducing the running time.
The contributions of our approach are as follows: (i) The dynamic granularity matrix space model is constructed, and based on this model the image segmentation problems are transformed into the transformation and jumping of the image at different granularity layers. (ii) Hierarchical structure and optimal granularity layer are obtained to extract valuable spatial-temporal information from the image. (iii) Adaptive Canny operator based on QGH algorithm is implemented to enhance the segmentation accuracy and efficiency.
Data Availability
The original image data of this study are derived from reference papers. We have quoted quotations and cited reference papers.
Conflicts of Interest
The authors declare that there are no conflicts of interest regarding the publication of this paper.
Acknowledgments
This study was sponsored by the National Natural Science Foundation of China under grant number 51705485 and China Academy of Engineering Physics under grant number TB23.