# Dynamic Granularity Matrix Space Based Adaptive Edge Detection Method for Structured Light Stripes

Authors: Changzhi Yu; Fang Ji; Xingjiu Jing; Mi Liu
Journal: Mathematical Problems in Engineering
 (2019)

---

## 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.


---

## Body

## 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: Section2 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.
LetA be a fuzzy subset on domain Ω. For ∀x∈Ω, a specified number μAx∈0,1 is called membership of x with respect to A. Mapping μA:Ω→0,1, x→μAx is called a membership function of A.Definition 2.
LetT represent the set of all fuzzy subsets on Ω. Assume that function R∈TΩ×Ω and satisfies(i)
reflexivity,∀x∈Ω,Rx,x=1;(ii)
symmetry,∀x,y∈Ω,Rx,y=Ry,x;(iii)
∀x,y,z∈Ω,Rx,z≥supyRx,y,Ry,z.
R is called a fuzzy equivalence relation on Ω.Proposition 3.
Assume that R is a fuzzy equivalence relation onΩ. Let Rλ=x,y∣Rx,y≥λ and λ∈0,1; Rλ is a crisp equivalence relation on Ω and is called a cut relation of R.Proposition 4.
LetΩλ be a quotient space corresponding to equivalence relation Rλ. From Definition 2, it can be seen that 0≤λ2≤λ1≤1⇔Rλ1>Rλ2⇔Ωλ2is a quotient space of Ωλ1. A family Ωλ1∣Rx,y≥λ,λ∈0,1, of quotient spaces forms an order-chain based on the inclusion relation of quotient sets. A set Ωλ∣λ∈0,1 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Ωλ∣λ∈0,1 is a hierarchical structure on Ω; there is a fuzzy equivalence relation R on Ω, whose cut relation is Rλ. Quotient space corresponding to equivalence relation Rλ is Ωλ,λ∈0,1.


### 2.2. Dynamic Granularity Matrix Space

Definition 7.
Using five tuplesX,A,V,I,E,M,R~λ represents dynamic granular matrix space (DGS) model.In Definition7,Xis 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., ∃∀a∈A,fa∈V;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; andR is fuzzy dynamic granularity, i.e., the state characteristics of granules under fuzzy equivalence relation, reflecting the dynamics of granules.Theorem 8.
LetR~ be a fuzzy relation on the domain U. If and only if, ∀λ∈0,1, the cut-off matrix Rλ of R~ is an equivalent relation on U, the fuzzy relation R~ is a fuzzy equivalent relation.Definition 9.
LetR~ be a fuzzy equivalent relation on U. The cut matrix Rλ of fuzzy equivalence relation corresponds to a Boolean matrix, rijλ=R~xi,xj=1,rij≥λ;0,rij〈λ, R~xi,xj indicates the similarity between xi and xj.Theorem 10.
LetR~ be a fuzzy equivalent relation on U and corresponds to a dynamic granular matrix space X,A,V,I,E,M,R~λ. The structure can be represented by fuzzy equivalent granules Y~1,Y~2,⋯,Y~i,⋯,Y~m, where Y~i represents a fuzzy subgranular. ∀Y~i,Y~j,dY~i,Y~j=1-R~a,b,∀a∈Y~i,b∈Y~j, d•,• is a distance function in X,A,V,I,E,M,R~.According to Theorem10, 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 matrixRλ1 corresponds to a granularity matrix space X,A,V,I,E,M,Rλ1 and Rλ2 corresponds to a granularity matrix space X,A,V,I,E,M,Rλ2, if 0≤λ1≤λ2≤1, Rλ2≤Rλ1, X,A,V,I,E,M,Rλ2 is the quotient set of X,A,V,I,E,M,Rλ1.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 onU corresponding to a hierarchical structure onU.Theorem 12.
LetUλλ∈0,1 be a hierarchical structure on U; given a fuzzy equivalent relation R~ on U, its cut-off matrix is Rλ and corresponds to a granularity matrix space Uλ,λ∈0,1.Theorem 13.
X , A , V , I , E , M , R ~ λ, the following conclusion is equivalent:(i)
given a fuzzy equivalence relation;(ii)
given a hierarchical structure;(iii)
given a distanced•,•.


### 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 Definition7, the original image can be described by the five tuples X,A,V,I,E,M,R~λ.X denotes the granular set formed by all pixels of the image. A=α,β 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., ∃∀αi,βj∈A,fαi,βj∈V. All pixels can be divided into several fuzzy equivalent clusters according toA, 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.UsingI,E,MR~=∪i=1nIi,Ei,Mi describes the image, whereI 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.Figure 1
A hierarchical structure.When a granularity matrix space model is established for an image, given the pixel attributeA, all pixels can be divided into several fuzzy equivalent clusters D1,D2,⋯,Dn, in which each equivalent cluster Di represents a basic region of image Ii,Ei,Mi.The union of all granules ∪i=1nIi,Ei,Mi is used to represent the image segmented. According to the requirements of different segmentation accuracy, givenA, 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 distanced=absfxi,yi-fxj,yj+gxi,yi-gxj,yj/2, wheref represents the pixel gray value and g represents the neighborhood mean gray value of the pixel. Given that the distanced 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 Hλi is defined as(1)Hλi=∑t=1kNtK×infoNt,where Nt represents thetth information granule in granularity layer;k is the number of information granules in granularity layer; Nt denotes the number of pixels in the information granule;K is the total number of pixels of the image; and infoNt is the amount of information needed to completely distinguish all information granules, which can be written as(2)infoNt=-log1Nt.Hence, combining (1) with (2), the formula for measuring the information granularity layer can be rewritten as(3)Hλi=-∑t=1kNtK×log1Nt.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 λi to the finer granularity layer λi+1, shown as(4)GainHλi+1=Hλi+1-Hλi+1.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.


## 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.
LetA be a fuzzy subset on domain Ω. For ∀x∈Ω, a specified number μAx∈0,1 is called membership of x with respect to A. Mapping μA:Ω→0,1, x→μAx is called a membership function of A.Definition 2.
LetT represent the set of all fuzzy subsets on Ω. Assume that function R∈TΩ×Ω and satisfies(i)
reflexivity,∀x∈Ω,Rx,x=1;(ii)
symmetry,∀x,y∈Ω,Rx,y=Ry,x;(iii)
∀x,y,z∈Ω,Rx,z≥supyRx,y,Ry,z.
R is called a fuzzy equivalence relation on Ω.Proposition 3.
Assume that R is a fuzzy equivalence relation onΩ. Let Rλ=x,y∣Rx,y≥λ and λ∈0,1; Rλ is a crisp equivalence relation on Ω and is called a cut relation of R.Proposition 4.
LetΩλ be a quotient space corresponding to equivalence relation Rλ. From Definition 2, it can be seen that 0≤λ2≤λ1≤1⇔Rλ1>Rλ2⇔Ωλ2is a quotient space of Ωλ1. A family Ωλ1∣Rx,y≥λ,λ∈0,1, of quotient spaces forms an order-chain based on the inclusion relation of quotient sets. A set Ωλ∣λ∈0,1 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Ωλ∣λ∈0,1 is a hierarchical structure on Ω; there is a fuzzy equivalence relation R on Ω, whose cut relation is Rλ. Quotient space corresponding to equivalence relation Rλ is Ωλ,λ∈0,1.


## 2.2. Dynamic Granularity Matrix Space

Definition 7.
Using five tuplesX,A,V,I,E,M,R~λ represents dynamic granular matrix space (DGS) model.In Definition7,Xis 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., ∃∀a∈A,fa∈V;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; andR is fuzzy dynamic granularity, i.e., the state characteristics of granules under fuzzy equivalence relation, reflecting the dynamics of granules.Theorem 8.
LetR~ be a fuzzy relation on the domain U. If and only if, ∀λ∈0,1, the cut-off matrix Rλ of R~ is an equivalent relation on U, the fuzzy relation R~ is a fuzzy equivalent relation.Definition 9.
LetR~ be a fuzzy equivalent relation on U. The cut matrix Rλ of fuzzy equivalence relation corresponds to a Boolean matrix, rijλ=R~xi,xj=1,rij≥λ;0,rij〈λ, R~xi,xj indicates the similarity between xi and xj.Theorem 10.
LetR~ be a fuzzy equivalent relation on U and corresponds to a dynamic granular matrix space X,A,V,I,E,M,R~λ. The structure can be represented by fuzzy equivalent granules Y~1,Y~2,⋯,Y~i,⋯,Y~m, where Y~i represents a fuzzy subgranular. ∀Y~i,Y~j,dY~i,Y~j=1-R~a,b,∀a∈Y~i,b∈Y~j, d•,• is a distance function in X,A,V,I,E,M,R~.According to Theorem10, 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 matrixRλ1 corresponds to a granularity matrix space X,A,V,I,E,M,Rλ1 and Rλ2 corresponds to a granularity matrix space X,A,V,I,E,M,Rλ2, if 0≤λ1≤λ2≤1, Rλ2≤Rλ1, X,A,V,I,E,M,Rλ2 is the quotient set of X,A,V,I,E,M,Rλ1.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 onU corresponding to a hierarchical structure onU.Theorem 12.
LetUλλ∈0,1 be a hierarchical structure on U; given a fuzzy equivalent relation R~ on U, its cut-off matrix is Rλ and corresponds to a granularity matrix space Uλ,λ∈0,1.Theorem 13.
X , A , V , I , E , M , R ~ λ, the following conclusion is equivalent:(i)
given a fuzzy equivalence relation;(ii)
given a hierarchical structure;(iii)
given a distanced•,•.


## 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 Definition7, the original image can be described by the five tuples X,A,V,I,E,M,R~λ.X denotes the granular set formed by all pixels of the image. A=α,β 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., ∃∀αi,βj∈A,fαi,βj∈V. All pixels can be divided into several fuzzy equivalent clusters according toA, 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.UsingI,E,MR~=∪i=1nIi,Ei,Mi describes the image, whereI 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.Figure 1
A hierarchical structure.When a granularity matrix space model is established for an image, given the pixel attributeA, all pixels can be divided into several fuzzy equivalent clusters D1,D2,⋯,Dn, in which each equivalent cluster Di represents a basic region of image Ii,Ei,Mi.The union of all granules ∪i=1nIi,Ei,Mi is used to represent the image segmented. According to the requirements of different segmentation accuracy, givenA, 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 distanced=absfxi,yi-fxj,yj+gxi,yi-gxj,yj/2, wheref represents the pixel gray value and g represents the neighborhood mean gray value of the pixel. Given that the distanced 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 Hλi is defined as(1)Hλi=∑t=1kNtK×infoNt,where Nt represents thetth information granule in granularity layer;k is the number of information granules in granularity layer; Nt denotes the number of pixels in the information granule;K is the total number of pixels of the image; and infoNt is the amount of information needed to completely distinguish all information granules, which can be written as(2)infoNt=-log1Nt.Hence, combining (1) with (2), the formula for measuring the information granularity layer can be rewritten as(3)Hλi=-∑t=1kNtK×log1Nt.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 λi to the finer granularity layer λi+1, shown as(4)GainHλi+1=Hλi+1-Hλi+1.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.Figure 2
The framework of QGH algorithm.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 selectGgroups andM members for each group, the total number of group members is G∗M. For example, GRPgit=Memg1it,Memg2it,⋯,Memgmit,⋯,MemgMit, g=1,2,⋯,G, m=1,2,⋯,M, where, GRPgit represents gth group initth iteration and Memgmit representsmth member of gth group initth 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 is0~L-1; then the neighborhood mean gray value is also 0~L-1. Let gx,y be the gray value of pixel in coordinates x,y, and the neighborhood mean gray value of the pixel be defined as (5)hx,y=1d∗d∑i=-d-1/2d-1/2∑j=-d-1/2d-1/2gx+i,y+j,wheredis the width of the pixel square neighborhood window and generally takes odd numbers [29–31].
Two tuplesi,j composed of gx,y and hx,y are used to represent the image. If the frequency of i,j is ci,j, the joint probability density pi,j for the image with size of M∗N is (6)pi,j=ci,jM∗N,∑i=0L-1∑j=0L-1pi,j=1.
Using two-dimensional vectors,t as the threshold, the two-dimensional histogram of an image can be divided into four regions (as shown in Figure 3). AreaA represents the target, areaB is the background, andC andD 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 as(7)ω0s,t=∑i=0s∑j=0tpij,ω1s,t=∑i=s+1L-1∑j=t+1L-1pij.
Define a discrete measure matrix between target and background as(8)σB=ω0u0-uzu0-uzΤ+ω1u1-uzu1-uzΤ.
The tracetrσB of σB is used as the distance measure function between the target and the background,(9)Fs,t=trσBs,t=ω0u0i-uzi2+u0j-uzj2+ω1u1i-uzi2+u1j-uzj2=ω0s,tuzi-uis,t2+ω0s,tuzj-ujs,t2ω0s,t1-ω0s,t.
Supposes∗,t∗ represent the 2D optimal segmentation threshold, and the fitness function can be expressed as(10)s∗,t∗=argmax⁡Fs,t.Figure 3
2D histogram of image.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 biti of memberm randomly, and then transfer the bit in the same location of leader’s to memberm at a certain probability. (ii) Transfer theith bit of leader to theith bit of memberm. (iii) Rotate memberm directed to leader. The rotation strategy is adopted from [33]: (11)Δθxm=0,θxl=θxmθ0∗θxl-θxmθxl-θxm,θxl≠θxmwhere x=1,2,…,N,  m=1,2,…,M, and θ0 is a very small positive real number, usually 0<θ0<1. θxm is thexth bit of memberm. θxl is thexth bit of leader. Then,(12)θxm′=θxm+Δθxm,x=1,2,…,N,and θxm is updated by (13)θxm′′=-θxm′,θxm′<0,2-θxm′,θxm′>1,θxm′,0≤θxm′≤1,x=1,2,…,Nwhere θxm′′ is the new number in thexth bit of member new_m.
(iv) Calculatenew_m’s evaluation function. If it is better than the old one, replace m by new_m. Otherwise, keep m 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ηi∈0,1. If ηi<αi2, thus theith 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 is1≤σ≤1/2∗∑i=1mμi+1, 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.Figure 4
One-way crossover operations.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 (14)αmi′=4∗αmi∗1-αmi
whereαmi is theith Q-bit of member Memgmit, αmi′ is the updated value, g=1,2,…,G,m=1,2,…,M, i=1,2,…,N. When the optimal fitness is greater than the algebraic variation, we use formula (14) to update the populations and individuals.Step 6.
Repeat Steps3–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 thresholds∗,t∗ is achieved.


### 3.2. Adaptive Canny Edge Detection Method

From Section3.1, the segmentation threshold s∗,t∗ of original image was obtained. According to [35, 36], take T∗=s∗+t∗/2, Tupper=kT∗ as the upper threshold, Tlower=Tupper/4 as the lower threshold. We use the adaptive threshold Tupper,Tlower to improve the Canny operator. The proposed iterative algorithm is described in Algorithm 1.Algorithm 1:Adaptive edge detection iterative algorithm.
Input:Input image F, max iteration t=200, populations size G=8, member size Ms=10. Output: Segmented image F^; Begin Step1. Based on of DGS model, obtain the hierarchical structure of the image; Step2. Compute the optimal granularity layer; Step3. Calculate the 2D segmentation threshold; for  it=1  to  tdo Use QGH algorithm to solve image segmentation threshold; if maximum iterationst is researched, stop. End Step4. The segmentation threshold s∗,t∗ of the image is obtained through the above steps. Step5. Taken Tupper,Tlower as the adaptive threshold for Canny operator, and get the segmented image, F^. endBased 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.


## 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.Figure 2
The framework of QGH algorithm.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 selectGgroups andM members for each group, the total number of group members is G∗M. For example, GRPgit=Memg1it,Memg2it,⋯,Memgmit,⋯,MemgMit, g=1,2,⋯,G, m=1,2,⋯,M, where, GRPgit represents gth group initth iteration and Memgmit representsmth member of gth group initth 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 is0~L-1; then the neighborhood mean gray value is also 0~L-1. Let gx,y be the gray value of pixel in coordinates x,y, and the neighborhood mean gray value of the pixel be defined as (5)hx,y=1d∗d∑i=-d-1/2d-1/2∑j=-d-1/2d-1/2gx+i,y+j,wheredis the width of the pixel square neighborhood window and generally takes odd numbers [29–31].
Two tuplesi,j composed of gx,y and hx,y are used to represent the image. If the frequency of i,j is ci,j, the joint probability density pi,j for the image with size of M∗N is (6)pi,j=ci,jM∗N,∑i=0L-1∑j=0L-1pi,j=1.
Using two-dimensional vectors,t as the threshold, the two-dimensional histogram of an image can be divided into four regions (as shown in Figure 3). AreaA represents the target, areaB is the background, andC andD 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 as(7)ω0s,t=∑i=0s∑j=0tpij,ω1s,t=∑i=s+1L-1∑j=t+1L-1pij.
Define a discrete measure matrix between target and background as(8)σB=ω0u0-uzu0-uzΤ+ω1u1-uzu1-uzΤ.
The tracetrσB of σB is used as the distance measure function between the target and the background,(9)Fs,t=trσBs,t=ω0u0i-uzi2+u0j-uzj2+ω1u1i-uzi2+u1j-uzj2=ω0s,tuzi-uis,t2+ω0s,tuzj-ujs,t2ω0s,t1-ω0s,t.
Supposes∗,t∗ represent the 2D optimal segmentation threshold, and the fitness function can be expressed as(10)s∗,t∗=argmax⁡Fs,t.Figure 3
2D histogram of image.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 biti of memberm randomly, and then transfer the bit in the same location of leader’s to memberm at a certain probability. (ii) Transfer theith bit of leader to theith bit of memberm. (iii) Rotate memberm directed to leader. The rotation strategy is adopted from [33]: (11)Δθxm=0,θxl=θxmθ0∗θxl-θxmθxl-θxm,θxl≠θxmwhere x=1,2,…,N,  m=1,2,…,M, and θ0 is a very small positive real number, usually 0<θ0<1. θxm is thexth bit of memberm. θxl is thexth bit of leader. Then,(12)θxm′=θxm+Δθxm,x=1,2,…,N,and θxm is updated by (13)θxm′′=-θxm′,θxm′<0,2-θxm′,θxm′>1,θxm′,0≤θxm′≤1,x=1,2,…,Nwhere θxm′′ is the new number in thexth bit of member new_m.
(iv) Calculatenew_m’s evaluation function. If it is better than the old one, replace m by new_m. Otherwise, keep m 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ηi∈0,1. If ηi<αi2, thus theith 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 is1≤σ≤1/2∗∑i=1mμi+1, 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.Figure 4
One-way crossover operations.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 (14)αmi′=4∗αmi∗1-αmi
whereαmi is theith Q-bit of member Memgmit, αmi′ is the updated value, g=1,2,…,G,m=1,2,…,M, i=1,2,…,N. When the optimal fitness is greater than the algebraic variation, we use formula (14) to update the populations and individuals.Step 6.
Repeat Steps3–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 thresholds∗,t∗ is achieved.


## 3.2. Adaptive Canny Edge Detection Method

From Section3.1, the segmentation threshold s∗,t∗ of original image was obtained. According to [35, 36], take T∗=s∗+t∗/2, Tupper=kT∗ as the upper threshold, Tlower=Tupper/4 as the lower threshold. We use the adaptive threshold Tupper,Tlower to improve the Canny operator. The proposed iterative algorithm is described in Algorithm 1.Algorithm 1:Adaptive edge detection iterative algorithm.
Input:Input image F, max iteration t=200, populations size G=8, member size Ms=10. Output: Segmented image F^; Begin Step1. Based on of DGS model, obtain the hierarchical structure of the image; Step2. Compute the optimal granularity layer; Step3. Calculate the 2D segmentation threshold; for  it=1  to  tdo Use QGH algorithm to solve image segmentation threshold; if maximum iterationst is researched, stop. End Step4. The segmentation threshold s∗,t∗ of the image is obtained through the above steps. Step5. Taken Tupper,Tlower as the adaptive threshold for Canny operator, and get the segmented image, F^. endBased 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.Figure 5
Original structured light stripes images.
(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 Figures6, 7, and 8.Figure 6
Segmentation results for the structured light stripes in Figure5(a).
(a) (b) (c) (d) (e) (f)Figure 7
Segmentation results for the structured light stripes in Figure5(b).
(a) (b) (c) (d) (e) (f)Figure 8
Segmentation results for the structured light stripes in Figure5(c).
(a) (b) (c) (d) (e) (f)Figures6–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 pointsA, the number of 4-connected componentsB, and the number of 8-connected componentsC as the objective evaluation criteria [37] to objectively evaluate the performance of different segmentation methods. The ratio ofC/A is used to indicate the edge continuity of the image detected. The smaller theC/A ratio is, the better the edge continuity is. TheC/B ratio is used to represent the edge width. The smaller theC/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 ofC/A andC/B mean better edge continuity, fewer discontinuities, more edges with single pixel, and better edges quality.The evaluation criteria of the images in Figures6–8 are listed, respectively, in Table 1. For more intuitive observation of effects, the contents of Table 1 are illustrated in Figure 9.Table 1
Evaluation criteria.
Images Methods A B C C/A C/B Time/ms Figure5(a) Robert operator 877 103 47 0.1174 0.0536 53 Sobel operator 861 270 31 0.3136 0.0360 55 Prewitt operator 859 261 30 0.3038 0.0349 59 Canny operator 3785 568 96 0.1501 0.0254 72 Proposed method 1312 166 13 0.1265 0.0099 599 Figure5(b) Robert operator 6490 428 343 0.0659 0.0529 56 Sobel operator 6934 895 248 0.1291 0.0358 73 Prewitt operator 6932 841 236 0.1213 0.0340 64 Canny operator 14123 1366 210 0.0967 0.0149 209 Proposed method 14033 1348 200 0.0961 0.0143 2870 Figure5(c) Robert operator 5318 384 265 0.0722 0.0498 62 Sobel operator 5063 801 126 0.1582 0.0249 67 Prewitt operator 5072 794 127 0.1565 0.0250 56 Canny operator 10509 1074 330 0.1022 0.0314 116 Proposed method 7657 701 165 0.0916 0.0215 2950Figure 9
Evaluation criteria for light stripes images.
(a) (b) (c)From Table1 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, theC/A values of Robert operator are smaller, while theC/B values are relatively bigger, which means that the edge continuity is well and the single pixel edges are less. The differences ofC/A values andC/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 theC/A andC/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 Figure5(b) as example, convergence curves of proposed QGH are compared with the ones of genetic algorithm (GA) and GLOA, as shown in Figure 10.Figure 10
Convergence curves of different algorithms.
(a) (b)From Figure10, 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.



---

*Source: 1959671-2019-03-12.xml*