Micro-Scale Spherical and Cylindrical Surface Modeling via Metaheuristic Algorithms and Micro Laser Line Projection

: With the increasing micro-scale manufacturing industry, the micro-scale spherical and cylindrical surface modeling has become an important factor in the manufacturing process. Thus, the micro-scale manufacturing processes require efﬁcient micro-scale spherical and cylindrical models to achieve accurate assembly. Therefore, it is necessary to implement models to represent micro-scale spherical and cylindrical surfaces. This study addresses metaheuristic algorithms based on micro laser line projection to perform micro-scale spherical and cylindrical surface modeling. In this technique, the micro-scale surface is recovered by an optical microscope system, which computes the surface coordinates via micro laser line projection. From the surface coordinates, a genetic algorithm determines the parameters of the mathematical models to represent the spherical and cylindrical surfaces. The genetic algorithm performs exploration and exploitation in the search space to optimize the models’ mathematical parameters. The search space is constructed via surface data to provide the optimal parameters, which determine the spherical and cylindrical surface models. The proposed technique improves the ﬁtting accuracy of the micro-scale spherical and cylindrical surface modeling performed via optical microscope systems. This contribution is elucidated by a discussion about the model ﬁtting between the genetic algorithms based on micro laser line projection and the optical microscope systems.


Introduction
Nowadays, the micro-scale spherical and cylindrical surface modeling plays an important role in inspecting micro-scale sphericity and cylindricity [1,2]. In the micro-scale manufacturing industry, object machining, surface roughness, drilling, and object measurements are determined via spherical and cylindrical surface models and robotic vision systems [3][4][5]. To achieve these manufacturing processes, mathematical models have been implemented to represent micro-scale spherical and cylindrical surfaces. For instance, the spherical surface modeling has been implemented in geomatics to determine rock surface sphericity [6,7], in optics to estimate lens sphericity [8,9], in object machining to determine surface sphericity [10,11], in pharmaceutics to determine proppants sphericity [12,13], in object prototyping to determine assemble sphericity [14,15], and so on. Moreover, the cylindrical surface modeling has been implemented in surface machining to inspect cylindrical surface [16,17], in surface milling to estimate milling cylindricity [18], and so on. Based on these statements, surface models have been constructed via surface data and mathematical equations for representing micro-scale spherical and cylindrical surfaces [19,20]. Currently, micro-scale spherical and cylindrical surface models are carried out via surface information, which is retrieved by means of optical microscope imaging systems [21,22]. These microscope systems construct the surface models by employing surface data obtained via gray-level image processing and the least squares method [23,24]. In addition, the least squares optimization is employed by the vision systems' models to determine surface algorithms due to the missing of a reference equation to optimize the model parameters. Moreover, these algorithms begin the optimization with a random solution, which leads to computing a huge iterations number. Furthermore, the objective function is deduced by an equation, which includes additional parameters to the surface model. Furthermore, the spherical and cylindrical surfaces can be represented by having a specific equation. In this way, a genetic algorithm provides a suitable structure to optimize the spherical and cylindrical surface models. For instance, the genetic algorithm is allowed to define an objective function by means of the equations that represent the spherical and cylindrical surface. Therefore, additional parameters are not required. In addition, it is possible to begin the optimization by employing the best candidates, which provides a solution near the optimal solution. The best candidates are deduced from the search space via spherical and cylindrical equations and known surface data. Moreover, exploration and exploitation are carried out to find the optimal solution inside or outside of the best candidates. Thus, all research space can be analyzed. Based on these statements, the metaheuristic genetic algorithm is chosen to construct the spherical and cylindrical surface models. The genetic algorithm viability to construct micro-scale spherical and cylindrical surface models is elucidated via quality gap, solution quality, suitable structure, and experimental results. Thus, the genetic algorithm determines the spherical and cylindrical modeling by employing surface coordinates, which are computed via micro laser line projection. To do so, the metaheuristic algorithm determines the search space from the surface topography to compute the surface model parameters. In this procedure, the genetic algorithm determines the best candidates for the initial population via analytic equations and surface data. Then, the algorithm performs an optimization via exploration and exploitation to find the optimal surface model parameters. The genetic algorithm based on micro laser line projection performs micro-scale spherical and cylindrical surface modeling for rectangular surfaces. This micro-scale surface modeling is carried out by means of an optical microscope vision system on which a CCD camera and a 42 µm laser line are attached. In this way, the micro laser line is projected on the surface and the CCD camera captures the micro laser line, whose reflection depicts the surface topography. The surface dimension is computed via perspective model and the laser line coordinates. Thus, the micro-scale spherical and cylindrical surface modeling is performed via surface topography, which is not employed by the traditional optical microscope imaging systems. Therefore, the micro-scale surface modeling via genetic algorithms based on micro laser line projection improves the fitting accuracy of the micro-scale spherical and cylindrical surface modeling performed via optical microscope systems. This statement is corroborated by a discussion based on model fitting of the micro-scale spherical and cylindrical surface modeling. Thus, the contribution of the proposed technique is elucidated via micro-scale surface modeling accuracy. The accuracy is determined via the error between the surface model provided by the genetic algorithm and the surface data. The paper is organized as follows: the algorithm to perform the micro-scale spherical surface modeling is described in Section 2.1, the algorithm to perform the micro-scale cylindrical surface modeling is described in Section 2.2, the micro-scale surface recovering via microscope vision system based on micro laser line projection is described in Section 2.3, the results of the micro-scale spherical and cylindrical surface modeling are pointed out in Section 3, and a discussion about the model fitting is described in Section 4.

Micro-Scale Spherical Surface Modeling via Genetic Algorithm
The micro-scale spherical surface modeling is carried out by a genetic algorithm via surface coordinates, which are retrieved via micro laser line projection from a rectangular spherical surface. Typically, a metaheuristic algorithm provides an optimization in a moderated time [43]. Additionally, the metaheuristic algorithm performs an exploration and exploitation to find the optimal solution [44]. Based on these statements, the micro-scale spherical surface modeling is performed by a genetic algorithm by means of the surface coordinates provided by a micro laser line image. To do so, a spherical surface model is constructed by means of surface coordinates, which are retrieved from a rectangular spherical surface. The surface coordinates are shown in Figure 1. These surface coordinates are represented by (x i,j , y i,j , z i,j ), where the sub-indices (i, j) are defined in the x-axis and y-axis, respectively. Thus, the rectangular spherical surface provides the surface points (z 0,0 , z 1,0 , . . . , z n,0 , z n,1 , . . . , z n,m ) in the z-axis, where, the sub-indices (n, m) depict the number of surface points in the x-axis and y-axis, respectively. spherical surface. Typically, a metaheuristic algorithm provides an optimizat moderated time [43]. Additionally, the metaheuristic algorithm performs an exp and exploitation to find the optimal solution [44]. Based on these statements, cro-scale spherical surface modeling is performed by a genetic algorithm by mea surface coordinates provided by a micro laser line image. To do so, a spherica model is constructed by means of surface coordinates, which are retrieved fro tangular spherical surface. The surface coordinates are shown in Figure 1. These coordinates are represented by (xi,j, yi,j, zi,j), where the sub-indices (i, j) are define x-axis and y-axis, respectively. Thus, the rectangular spherical surface provides face points (z0,0, z1,0,…, zn,0, zn,1,…, zn,m) in the z-axis, where, the sub-indices (n, m the number of surface points in the x-axis and y-axis, respectively. The spherical origin coordinates are represented by (h, k, l) and the ratio sented by R. Furthermore, the spherical surface provides the ratio ri in the x-axis ratio R j in the y-axis. The coordinates (k, l) and (h, l) represent the origin coordinat ratios ri and Rj, respectively. Based on these coordinates, the spherical surface defined via ratio R by means of the next expression Additionally, the circumference equation is defined via ratio ri and Rj by lowing expressions From these equations, the spherical surface model is deduced by compu origin coordinates (h, k, l) and the ratio R via genetic algorithm. To do so, a gene rithm is implemented via Equations (1)-(3) and the surface data (xi,j, yi,j, zi,j). T genetic algorithm determines the spherical parameters in five steps, which are d as follows.
The first step is to determine the initial population. Typically, the metaheu gorithms determine the initial population in random form. In addition, the initi lation can be determined by means of the best candidates. This leads to a speed o convergence [45]. The best candidates can be obtained via random methods or pling the surface model. Therefore, the genetic algorithm determines the initial tion by sampling the surface model to obtain the best candidates. The sampling i out by solving Equations (2) and (3) to obtain the best candidates. Based on the ments, Equations (2) and (3) are solved by employing the surface coordinates (xi (xi+δ,j, yi+δ,j, zi+δ,j), (xi,j+Δ, yi,j+Δ, zi,j+Δ), and (xi+δ,j+Δ, yi+δ,j+Δ, zi+δ,j+Δ). In this case, the sub-ind The spherical origin coordinates are represented by (h, k, l) and the ratio is represented by R. Furthermore, the spherical surface provides the ratio r i in the x-axis and the ratio R j in the y-axis. The coordinates (k, l) and (h, l) represent the origin coordinates of the ratios r i and R j , respectively. Based on these coordinates, the spherical surface model is defined via ratio R by means of the next expression Additionally, the circumference equation is defined via ratio r i and R j by the following expressions From these equations, the spherical surface model is deduced by computing the origin coordinates (h, k, l) and the ratio R via genetic algorithm. To do so, a genetic algorithm is implemented via Equations (1)-(3) and the surface data (x i,j , y i,j , z i,j ). Thus, the genetic algorithm determines the spherical parameters in five steps, which are described as follows.
The first step is to determine the initial population. Typically, the metaheuristic algorithms determine the initial population in random form. In addition, the initial population can be determined by means of the best candidates. This leads to a speed out of the convergence [45]. The best candidates can be obtained via random methods or by sampling the surface model. Therefore, the genetic algorithm determines the initial population by sampling the surface model to obtain the best candidates. The sampling is carried out by solving Equations (2) and (3) to obtain the best candidates. Based on these statements, Equations (2) and (3) are solved by employing the surface coordinates (x i,j , y i,j , z i,j ), (x i+δ,j , y i+δ,j , z i+δ,j ), (x i,j+∆ , y i,j+∆ , z i,j+∆ ), and (x i+δ,j+∆ , y i+δ,j+∆ , z i+δ,j+∆ ). In this case, the sub-index ∆ indicates an increment such as ∆ = m/2 and the sub-index δ indicates an increment such as δ = n/2. Thus, the initial parameters (h, k, l) are determined by means of the next expressions where, By computing Equations (4)-(6), four parents (P 1,t , P 2,t , P 3,t , P 4,t ) are determined for each parameter, where, the sub − index t indicates the generation number. In this way, the parent P 1,1 is determined by computing Equations (4)-(6) via sub-indices (i = 0, j = 0, δ = n/2, ∆ = m/2). The parent P 2,1 is determined by computing Equations (4)-(6) via sub-indices (i = 0, j = m/2, δ = n/2, ∆ = m/2). The parent P 3,1 is determined by computing Equations (4)-(6) via sub-indices (i = n/2, j = 0, δ = n/2, ∆ = m/2). The parent P 4,1 is determined by computing Equations (4)-(6) via sub-indices (i = n/2, j = m/2, δ = n/2, ∆ = m/2). Thus, four coordinates (h, k, l) are obtained, and they are defined as the initial population. Additionally, the ratioŘ is determined by the average distance between the origin coordinates and the surface points. Then, the genetic algorithm determines the search space based on the maximum and minimum value of each parameter. In this way, the minimum and maximum of the parameter h are defined as x 0 , 0 and x n,m , respectively. The minimum and maximum of the parameter k are defined as y 0 , 0 and y n,m , respectively. The minimum and maximum of the parameter l are defined as (l +Ř/2) and (l −Ř/2), respectively. Thus, the initial population is completed. The second step is to perform the crossover to create the current children. This procedure is carried out via exploration and exploitation [46]. In this procedure, two children are created inside parents and two children are created outside parents. Thus, the children (C 1+4*q,t , C 2+4*q,t , C 3+4*q,t ,C 4+4*q,t ) are created via parents (P 1+2*q,t , P 2+2*q,t ) for q = 0 and q = 1. These children are computed by means of the next equations C 1+4 * q,t = P 1+2 * q,t − 0.5β P 1+2 * q,t − minimum , if P 1+2 * q,t < P 2+2 * q,t P 2+2 * q,t − 0.5β P 2+2 * q,t − minimum , if P 2+2 * q,t < P 1+2 * q,t C 2+4 * q,t = 0.5 P 1+2 * q,t + P 2+2 * q,t − β P 1+2 * q,t − P 2+2 * q,t C 3+4 * q,t = 0.5 P 1+2 * q,t + P 2+2 * q,t + β P 1+2 * q,t − P 2+2 * q,t C 4+4 * q,t = P 2+2 * q,t + 0.5β maximum − P 2+2 * q,t , if P 1+2 * q,t < P 2+2 * q,t P 1+2 * q,t + 0.5β maximum − P 1+2 * q,t , if P 2+2 * q,t < P 1+2 * q,t For these equations, the probability distribution β is accomplished via spread factor α, which is randomly generated in the interval between 0 and 1. Thus, the probability distribution is computed by the expression β = (2α) 1/2 if α > 0.5, otherwise, β = [2(1 − α)] 1/2 . In this way, Equations (8) and (9) compute the children inside parents, and Equations (7) and (10) compute the children outside parents. By replacing the parents (P 1,t , P 2,t ) and q = 0 in Equations (7)-(10), the children (C 1,t , C 2,t , C 3,t , C 4,t ) are determined. In addition, by replacing the parents (P 3,t , P 4,t ) and q = 1 in Equations (7)-(10), the children (C 5,t , C 6,t , C 7,t , C 8,t ) are determined. The third step is to evaluate the fitness. To do so, an objective function is constructed based on the surface coordinates (x i,j , y i,j , z i,j ) and the current origin coordinates (h, k, l). The objective function is defined by means of the next expression The fourth step is the selection procedure, which determines the parents of the next generation. To do so, the best current parents and children are selected via fitness. In this way, the parents P 1,t+1 and P 3,t+1 are selected from the pairs (P 1,t , P 2,t ) and (P 3,t , P 4,t ), respectively. Then, the parents P 2,t+1 and P 4,t+1 are selected from the children (C 1,t , C 2,t , C 3,t , C 4,t ) and (C 5,t , C 6,t , C 7,t , C 8,t ), respectively.
The fifth step is to perform the mutation procedure to avoid trapping in a local minimum. To do so, the worst parent is selected by computing the fitness via Equation (11). Then, a new parent is randomly generated from the search space and the fitness is computed via Equation (11). If the new parent improves the fitness, the worst parent is replaced by the new parent. On the other hand, the worst parent is not mutated. Additionally, a parent is randomly selected to mutate one parameter, which is selected in random form. To do so, a new parameter is randomly generated from the search space. Then, the new parameter is replaced in the selected parent and the fitness is computed via Equation (11). If the parent fitness is improved, the new parameter is replaced, if not, the parameter is not mutated. Thus, the current parents' mutation is completed and the (t + 1) generation parents are determined. Then, the crossover is performed to create the (t + 1) generation children via Equations (7)- (10). In addition, the fitness of these children is computed via Equation (11). Thus, the population of the (t + 1) generation is completed. The procedure to compute the (t + 1) generation is repeated until the optimal parameters (h, k, l) that minimize the objective function FO are obtained. In this way, the spherical surface modeling is completed.
To elucidate the surface modeling via genetic algorithm, a spherical surface model is constructed from the spherical surface shown in Figure 2a. The flowchart of the genetic algorithm to construct the spherical surface modeling is shown in Figure 2b. From this structure, the genetic algorithm performs the first step to determine the initial population. To do so, Equations (4)- (6) are computed by employing m = 10, n = 10, ∆ = 5, and δ = 5. Thus, the parent P 1,1 is obtained by computing Equations (4)-(6) via surface coordinates whose sub-indexes are (i = 0, j = 0, δ = 5, ∆ = 5), the parent P 2,1 is determined via sub-indexes (i = 0, j = 5, δ = 5, ∆ = 5), the parent P 3,1 is deduced via sub-indexes (i = 5, j = 0, δ = 5, ∆ = 5), and the parent P 4,1 is determined via sub-indexes (i = 5, j = 5, δ = 5, ∆ = 5). In this way, four origin coordinates (h, k, l) are obtained, and they are defined as the initial population. The initial population data are shown in Table 1, where the first column represents the origin coordinates, the second column represents the generation number, and the parents (P 1,1 , P 2,1 , P 3,1 P 4,1 ) are pointed out in the third to sixth column.
Then, the genetic algorithm performs the second step via crossover to compute the current children. To do so, the children (C 1,t , C 2,t , C 3,t ,C 4,t ) are computed by substituting the parents (P 1+2*q,t , P 2+2*q,t ) and q = 0 in Equations (7)- (10). Additionally, the children (C 5,t , C 6,t , C 7,t ,C 8,t ) are computed by substituting the parents (P 1+2*q,t , P 2+2*q,t ) and q = 1 in Equations (7)- (10). The data of the children are pointed out in the seventh to fourteenth column of Table 1.
Then, the algorithm performs the third step to evaluate the fitness of the current generation. To do so, the coordinates (h, k, l) of each parent and son are replaced in Equation (11) to compute the objective function. The current generation fitness is pointed out in the fourth row of Table 1. Thus, the first generation is completed. In this case, the algorithm provides a low error from the initial population. Therefore, it is corroborated that the initial population provides the best candidates to speed out the convergence.  Table 1. Thus, the first generation is completed. In this case, the algorithm provides a low error from the initial population. Therefore, it is corroborated that the initial population provides the best candidates to speed out the convergence. Then, the algorithm performs the fourth step to select the next generation parents. To do so, the best current parents and children are selected via fitness. In this way, the parents P1,t+1 and P3,t+1 are selected from the pairs (P1,t, P2,t) and (P3,t, P4,t), respectively. In addition, the parents P2,t+1 and P4,t+1 are selected from the children (C1,t, C2,t, C3,t, C4,t), (C5,t, C6,t, C7,t, C8,t), respectively. In this case, P1,2 = P2,1, P3,3 = P4,1, P2,2 = C2,1, and P4,2 = C7,1.
Then, the algorithm performs the fifth step to mutate the parent P2,2, which is determined as the worst parent via fitness. To perform the mutation, a new parent is ran- Then, the algorithm performs the fourth step to select the next generation parents. To do so, the best current parents and children are selected via fitness. In this way, the parents P 1,t+1 and P 3,t+1 are selected from the pairs (P 1,t , P 2,t ) and (P 3,t , P 4,t ), respectively. In addition, the parents P 2,t+1 and P 4,t+1 are selected from the children (C 1,t , C 2,t , C 3,t , C 4,t ), (C 5,t , C 6,t , C 7,t , C 8,t ), respectively. In this case, P 1,2 = P 2,1 , P 3,3 = P 4,1 , P 2,2 = C 2,1 , and P 4,2 = C 7,1 . Then, the algorithm performs the fifth step to mutate the parent P 2,2 , which is determined as the worst parent via fitness. To perform the mutation, a new parent is randomly generated from the search space and the fitness is computed via Equation (11). In this case, the new parent does not improve the fitness and the parent is not mutated. Next, the parent P 2,3 is randomly selected to mutate the parameter h, which is selected in random form. Thus, a new parameter h is randomly generated from the search space and the fitness of the parent P 2,3 is computed via Equation (11). In this case, the fitness is improved by the new parameter. Therefore, the parameter h is mutated. Then, the algorithm performs the second step to create the children of the (t + 1) generation via Equations (7)- (10). Additionally, the fitness of these children is computed via Equation (11). Thus, the population of the second generation is completed. The second-generation population is pointed out in the fifth to eighth row of Table 1. In this way, the procedure to compute the (t + 1) generation is repeated until obtaining the optimal parameters (h, k, l), which minimize the objective function Equation (11). The optimal origin coordinates are h = 30.1214, k = 40.0256, l = 29.9715, and R =Ř = 20.2304. These coordinates are substituted in Equation (1) to obtain the spheri- which produces the spherical surface shown in Figure 2c. Thus, the spherical surface modeling is performed via the metaheuristic algorithm. The cylindrical surface modeling is described in the next section. Table 1. Spherical model parameters generated via genetic algorithm for first and second generation.

Micro-Scale Cylindrical Surface Modeling via Genetic Algorithm
The micro-scale cylindrical surface modeling is performed by a genetic algorithm via surface coordinates, which are retrieved via micro laser line projection. To carry it out, a cylindrical surface model is constructed by means of surface coordinates, which are retrieved from a rectangular cylindrical surface. The surface coordinates are shown in Figure 3, where, the surface coordinates are represented by (x i,j , y i,j , z i,j ), and the subindices (I, j) are defined in the x-axis and y-axis, respectively. Thus, the rectangular surface provides the surface points (z 0,0 , z 1,0 , . . . , z n,0 , z n,1 , . . . , z n,m ) in the z-axis, where, the sub-indices (n, m) depict the number of surface points in the x-axis and y-axis, respectively. The origin coordinates are represented by (x 0,j , k 0 , l 0 ), the direction coordinates are depicted by (x n,j , k n , l n ), and the ratio is defined by r. In this way, the cylindrical surface model is defined based on the circumference equation via ratio r by means of the next expression For this equation, the coordinates (k i , l i ) are determined based on the surface geometry shown in Figure 3 by means of the next expressions Algorithms 2022, 15, 145 9 of 24 These equations are computed via origin and direction coordinates. In this way, the cylindrical surface model is performed by determining the coordinates (k 0 , l 0 ), (k n , l n ) and the ratio r via genetic algorithm.  (14) These equations are computed via origin and direction coordinates. In this way, the cylindrical surface model is performed by determining the coordinates (k0, l0), (kn, ln) and the ratio r via genetic algorithm. To do so, the genetic algorithm determines the origin and direction coordinates via Equation (12), and surface coordinates (xi,j, yi,j, zi,j). This procedure is carried out in five steps, which are described as follows: The first step is to determine the initial population via surface data. To do so, the genetic algorithm computes the initial population of the parameters (k0, l0, kn, ln) by means of the next expressions 0 ) ) ) ) ) ) ) ) ] ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) For these equations, the sub-index δ represents an increment in the x-axis, and the parameters (ki, li) are determined via surface data by means of the next expressions  To do so, the genetic algorithm determines the origin and direction coordinates via Equation (12), and surface coordinates (x i,j , y i,j , z i,j ). This procedure is carried out in five steps, which are described as follows: The first step is to determine the initial population via surface data. To do so, the genetic algorithm computes the initial population of the parameters (k 0 , l 0 , k n , l n ) by means of the next expressions For these equations, the sub-index δ represents an increment in the x-axis, and the parameters (k i , l i ) are determined via surface data by means of the next expressions where, In this case, the sub-indices ∆ and κ represent an increment in the y-axis. By computing Equations (15)-(18), four parents (P 1,t , P 2,t , P 3,t , P 4,t ) are determined for each parameter.
Additionally, the ratioř is defined as the average distance between the coordinates (k i , l i ) and the surface coordinates (x i,j , y i,j , z i,j ). Then, the genetic algorithm determines the search space based on the maximum and minimum of each parameter. For the parameter k 0 , the minimum and maximum are defined as y 0,0 and y 0,m , respectively. For k n , the minimum and maximum are defined as y n,0 and y 0,m , respectively. For l 0 , the minimum and maximum are defined as (l 0 +ř/2) and (l 0 −ř), respectively, where, l 0 is computed via Equation (16). For l n , the minimum and maximum are defined as (l n +ř/2) and (l n −ř), respectively, where, l n is computed via Equation (18). Thus, the initial population is completed. The second step is to create the current children via crossover. To do so, two children are created inside parents and two children are created outside parents. Thus, the children (C 1+4*q,t , C 2+4*q,t , C 3+4*q,t ,C 4+4*q,t ) are created via parents (P 1+2*q,t , P 2+2*q,t ) for q = 0 and q = 1. By replacing the parents (P 1,t , P 2,t ) and q = 0 in Equations (7)-(10), the children (C 1,t , C 2,t , C 3,t , C 4,t ) are determined. In addition, the parents (P 3,t , P 4,t ) and q = 1 are replaced in Equations (7)-(10) to compute the children (C 5,t , C 6,t , C 7,t , C 8,t ).
The third step is to evaluate the fitness. To do so, an objective function is constructed via the surface data. The objective function is defined by means of the next expression For these equations, k i and l i are computed via Equations (13) and (14), respectively. Thus, the fitness of parents and children is computed.
The fourth step is to select the parents of the next generation. To do so, the best current parents and children are selected via fitness. Thus, the parents P 1,t+1 and P 3,t+1 are selected from the pairs (P 1,t , P 2,t ) and (P 3,t , P 4,t ), respectively. The parents P 2,t+1 and P 4,t+1 are selected from the children (C 1,t , C 2,t , C 3,t , C 4,t ) and (C 5,t , C 6,t , C 7,t , C 8,t ), respectively.
The fifth step is to perform the mutation to avoid trapping in a local minimum. To do so, the worst parent is selected by computing the fitness via Equation (21). Then, a new parent is randomly generated from the search space and the fitness is computed via Equation (19). If the new parent improves the fitness, the worst parent is replaced by the new parent, if not, the worst parent is not mutated.
Additionally, a parent is randomly selected to mutate one parameter, which is selected in random form. To carry it out, a new parameter is randomly generated from the search space. Then, the new parameter is replaced in the selected parent and the fitness is computed via Equation (21). If the parent fitness is improved, the parameter is replaced by the new coordinate, if not, the parameter is not mutated. Thus, the mutation of the current parents is completed and the parents of the (t + 1) generation are determined. Then, the crossover is carried out to create the children of the (t + 1) generation via Equations (7)- (10). Additionally, the fitness of these children is computed via Equation (19). Thus, the population of the (t + 1) generation is completed. The procedure to compute the (t + 1) generation is repeated until the parameters (k 0 , l 0 , k n , l n ) that minimize the objective function in Equation (21) are obtained. From these parameters, the cylindrical surface model is defined by the expression z i,j = l i + [ř 2 − (y i,j − k i ) 2 ] 1/2 . Thus, the cylindrical surface model is determined by the metaheuristic algorithm.

Micro-Scale Surface Contouring via Micro-Laser Line Projection
The micro-scale surface is retrieved by the microscope vision system shown in Figure 4a. This setup consists of an optical microscope, a laser diode, a CCD camera, a slider device, and a computer. The surface plane is located on the x-axis and y-axis, and the surface topography is parallel to the z-axis. The lateral configuration of the microscope vision system in the x-axis is depicted by the geometry shown in Figure 4b, where a 42 µm laser line is projected perpendicularly on the target surface and the optical microscope is aligned at an angle. The symbol θ indicates the angle between the laser line and the optical axis. The distance between the objective lens and the surface is represented by d. The objective focal length is depicted by f 1 and the objective focus is represented by F 1 . The distance between the intermediate image plane and the ocular lens is depicted by L. The ocular focal length is indicated by f 2 and the ocular focus is represented by F 2 . The lateral configuration of the microscope vision system in the y-axis is described by means of the geometry shown in Figure 4c. The laser line coordinates in the CCD array are denoted by (x i,j , y i,j ) in the x-axis and y-axis, respectively. slider device, and a computer. The surface plane is located on the x-axis and y-axis, and the surface topography is parallel to the z-axis. The lateral configuration of the microscope vision system in the x-axis is depicted by the geometry shown in Figure 4b, where a 42 μm laser line is projected perpendicularly on the target surface and the optical microscope is aligned at an angle. The symbol θ indicates the angle between the laser line and the optical axis. The distance between the objective lens and the surface is represented by d. The objective focal length is depicted by f1 and the objective focus is represented by F1.
The distance between the intermediate image plane and the ocular lens is depicted by L.
The ocular focal length is indicated by f2 and the ocular focus is represented by F2. The lateral configuration of the microscope vision system in the y-axis is described by means of the geometry shown in Figure 4c. The laser line coordinates in the CCD array are denoted by (xi,j, yi,j) in the x-axis and y-axis, respectively. The surface coordinates yi,j and zi,j are defined via geometry shown in Figure 4b,c by means of the expressions The surface coordinate xi,j is defined by the position where the laser line is projected in the x-axis. This coordinate is provided by the slider device. In this way, the surface topography is computed based on the vision parameters (xc, yc, η, θ, f1, F1, f2, F2). These parameters are determined via genetic algorithm by means of Equations (22) and (23), and surface data. The genetic algorithm determines the vision parameters in five steps, which are described as follows.
The first step is to determine the initial population. To do so, the search space is deduced via the maximum and minimum of each parameter. The maximum and minimum of the parameters (xc, yc, η) are deduced via image size. The maximum and minimum of the parameters (θ, f1, F1, f2, F2) are defined via microscope geometry. The minimum F2 is defined by a distance more than half of the ocular lens diameter, and the maximum F2 is two times the minimum F2. The minimum f2 is defined as the minimum F2 and the maximum f2 is four times the minimum F2. In the same way, the minimum F1 is The surface coordinates y i,j and z i,j are defined via geometry shown in Figure 4b,c by means of the expressions The surface coordinate x i,j is defined by the position where the laser line is projected in the x-axis. This coordinate is provided by the slider device. In this way, the surface topography is computed based on the vision parameters (x c , y c , η, θ, f 1 , F 1 , f 2 , F 2 ). These parameters are determined via genetic algorithm by means of Equations (22) and (23), and surface data. The genetic algorithm determines the vision parameters in five steps, which are described as follows.
The first step is to determine the initial population. To do so, the search space is deduced via the maximum and minimum of each parameter. The maximum and minimum of the parameters (x c , y c , η) are deduced via image size. The maximum and minimum of the parameters (θ, f 1 , F 1 , f 2 , F 2 ) are defined via microscope geometry. The minimum F 2 is defined by a distance more than half of the ocular lens diameter, and the maximum F 2 is two times the minimum F 2 . The minimum f 2 is defined as the minimum F 2 and the maximum f 2 is four times the minimum F 2 . In the same way, the minimum F 1 is defined by a distance more than half of the objective lens diameter, and the maximum F 1 is two times the minimum F 2 . The minimum f 1 is determined as the minimum F 1 and the maximum f 1 is four times the minimum F 1 . The minimum θ is defined as an angle more than 10 • and the maximum θ is defined as an angle less than 45 • . Thus, the search space is determined. Then, four parents (P 1,t , P 2,t , P 3,t , P 4,t ) are created in random form from the search space. In this way, four values of the vision parameters (x c , y c , η, θ, f 1 , F 1 , f 2 , F 2 ) are obtained and they are defined as the initial population.
The third step is to evaluate the fitness. To do so, an objective function is constructed based on the known surface data and the vision parameters. The objective function is defined by means of the next expressions From these equations, the fitness is computed by the expression FO = (FO 1 + FO 2 )/2. In this case, the surface topography (z i,j -z i,m ) and the surface width (y i,j − y i,1 ) are known.
The fourth step is to select the parents of the next generation. To do so, the best current parents and children are selected via fitness. Thus, the parents P 1,t+1 and P 3,t+1 are selected from the pairs (P 1,t , P 2,t ) and (P 3,t , P 4,t ), respectively. Then, the parents P 2,t+1 and P 4,t+1 are selected from the children (C 1,t , C 2,t , C 3,t , C 4,t ) and (C 5,t , C 6,t , C 7,t , C 8,t ), respectively.
The fifth step is to perform the mutation to avoid trapping in a local minimum. To do so, the worst parent is selected by computing the fitness via Equations (24) and (25). Then, a new parent is randomly generated from the search space and the fitness is computed. If the new parent improves the fitness, the worst parent is replaced by the new parent, if not, the worst parent is not mutated. Additionally, a parent is randomly selected to mutate one vision parameter, which is selected in random form. To carry it out, a new vision parameter is randomly generated from the search space. Then, the new vision parameter is replaced in the selected parent and the fitness is computed via Equations (24) and (25). If the parent fitness is improved, the vision parameter is replaced by the new parameter, if not, the vision parameter is not mutated. Thus, the mutation of the current parents is completed and the parents of the (t + 1) generation are determined. Then, the crossover is carried out to create the children of the (t + 1) generation via Equations (7)-(10). In addition, the fitness of these children is computed via Equations (24) and (25). Thus, the population of the (t + 1) generation is completed. The procedure to compute the (t + 1) generation is repeated until the vision parameters (x c , y c , η, θ, f 1 , F 1 , f 2 , F 2 ) that minimize the objective function Equations (24) and (25) are obtained. Additionally, the distance from zero to the point O is determined by the expression The micro laser line coordinates (x i,j , y i,j ) are determined via pixel position and intensity. The coordinate x i,j is computed through the maximum intensity in each row of the image [47]. To do so, the pixel position and intensity are fitted to a Bezier curve by means of the expressions For Equation (26), x i,j is the pixel coordinate of the micro laser line in the x-axis and N is the pixels number of the micro laser line. For Equation (27), I i,j is the pixel intensity. In this case, the sub-indices (i, j) indicate the pixel number of the micro laser line in the x-axis and y-axis, respectively. Thus, the pixel position x i,j is replaced in Equation (26) and the intensity I i,j is substituted in Equation (27) to obtain a curve {x(u), I(u)}. In this case, a concave curve is obtained in the interval 0 ≤ u ≤ 1. Therefore, the second derivative I"(u) is positive, and the maximum intensity is determined by means of the derivative I (u) = 0. In this way, the Bisection method is employed to calculate the value u, where I (u) = 0. Then, the value u is substituted in Equation (26) to compute x(u), which is defined as the micro laser line position x i,j = x(u) in the x-axis. The micro laser line position y i,j is determined via image row number. The micro laser line edges y i,0 and y i,m are calculated by means of the first derivative in the y-axis. Thus, the micro laser line coordinates (x i,j , y i,j ) are obtained to compute the micro-scale surface topography. To do so, the microscope vision system scans the surface to perform the micro-scale surface modeling. During the scanning, the CCD camera captures the micro laser line to compute the line coordinates (x i,j , y i,j ) via Equations (26) and (27). Then, the coordinates (x i,j , y i,j ) are substituted in Equations (22) and (23) to compute the surface coordinates (z i,j , y i,j ). The surface coordinate in the x-axis corresponds to the position where the micro laser line is projected. This coordinate is provided by the slider device. Thus, the micro-scale topography is retrieved.
The radial distortion is determined via the micro laser line position. The micro laser line position (x i,j , y i,j ,) is computed via Equations (26) and (27). Thus, the radial distortion is deduced by means of the line position x i,j = x i,j + δx i and y i,j = y i,j + δy j , where (x i,j , y i,j ) are the distorted coordinates and (δx i , δy j ) are the distortion. In addition, a distorted line shifting is determined by the expression S i,j = x 1,j − x i,j , and the undistorted line shifting is defined by the expression s i,j = (x 1,j + δx 1 ) -(x i,j + δx i ). From these expressions, the distortion in the x-axis is determined by means of the expression δx i = (x 1,j − x i,j ) − s i,j + δx 1 = S i,j -s i,j + δx 1 . By placing the laser line near to the image center, the first line shifting is obtained without distortion, where, δx 1 = 0, and s 1,j = S 1,j . Thus, the undistorted shifting s i,j is computed through the first shifting S 1,j by means of the expression s i,j = i × S 1,j . Therefore, the distortion in the x-axis is calculated by the expression δx i = (x 1,j -x i,j ) -i × S 1,j . The same procedure is performed to determine the distortion in the y-axis via expressions (y i,1 − y i,j ) = (y i,1 + δy 1 )-(y i,j + δy j ) and T i,j = (y i,1 − y i,j ). From this relationship, the distortion in the y-axis is calculated by the expression δy j = (y i,1 -y i,j ) − j*T i,1 .

Results of Micro-Scale Spherical and Cylindrical Surface Modeling
The micro-scale spherical and cylindrical surface modeling is carried out by the microscope vision system shown in Figure 4a. In this way, the micro-scale spherical surface modeling is performed for the plastic surface shown in Figure 5a. The scale of this figure is represented in millimeters in the x-axis. The micro laser line projected on the plastic surface is shown in Figure 5b. Thus, the plastic surface is scanned in the x-axis via the micro laser line to compute the coordinates (x i,j , y i,j ) by means of Equations (26) and (27). Then, the coordinates (x i,j , y i,j ) are substituted in Equations (23) and (23) to compute the micro-scale surface coordinates (z i,j , y i,j ). The surface coordinate x i,j is provided by the slider device. Thus, one hundred and ninety four images are processed to retrieve the micro-scale spherical surface shown in Figure 6a. In this figure, the x-axis, y-axis, and z-axis are indicated in microns. The accuracy of the surface shown in Figure 6a is determined via relative error [48], which is computed by employing a reference contact method. Thus, the relative error is computed by the next expression For this equation, z i,j is the micro-scale surface computed via Equation (22), H i,j is the surface reference, and n·m is the data number. By computing Equation (28), the relative error for the plastic surface shown in Figure 6a is 0.8216%. From the surface shown in Figure 6a, a spherical surface model is constructed via genetic algorithm, which determines the origin coordinates (h, k, l) as described in Section 2.1.
For this equation, zi,j is the micro-scale surface computed via Equation (22), Hi,j is the surface reference, and n·m is the data number. By computing Equation (28), the relative error for the plastic surface shown in Figure 6a is 0.8216%. From the surface shown in Figure 6a, a spherical surface model is constructed via genetic algorithm, which determines the origin coordinates (h, k, l) as described in Section 2.1.
For this equation, zi,j is the micro-scale surface computed via Equation (22), Hi,j is the surface reference, and n·m is the data number. By computing Equation (28), the relative error for the plastic surface shown in Figure 6a is 0.8216%. From the surface shown in Figure 6a, a spherical surface model is constructed via genetic algorithm, which determines the origin coordinates (h, k, l) as described in Section 2.1. In this way, the genetic algorithm performs the first step to determine the initial population. To carry it out, the search space is defined based on the maximum and minimum of each parameter. For the spherical surface model, the minimum and maximum of the parameter h are defined as x 0 , 0 and x n,m , respectively. The minimum and maximum of the parameter k are defined as y 0 , 0 and y n,m , respectively. The minimum and maximum of the parameter l are defined as (l +Ř/2) and (l −Ř), respectively. Then, the initial population is determined. Typically, the metaheuristic algorithms determine the initial population from the search space in random form. However, a huge iterations number is employed to achieve the convergence. Therefore, the algorithms employ the best candidates to improve the solution quality and to speed out the convergence. The initial population plays a significant role in the genetic algorithm to provide higher qualities and better convergence [49]. Generally, the genetic algorithms generate the initial population employing the best candidates. These candidates can be obtained via random methods and by sampling the model equations [50,51]. Based on these statements, the proposed genetic algorithm performs a sampling of the model to obtain the best candidates. The sampling is carried out by solving Equations (2) and (3) to obtain the best candidates to perform the optimization. To do so, the spherical surface model is sampled at the surface coordinates (x i,j , y i,j , z i,j ), (x i+δ,j , y i+δ,j , z i+δ,j ), (x i,j+∆ , y i,j+∆ , z i,j+∆ ), and (x i+δ,j+∆ , y i+δ,j+∆ , z i+δ,j+∆ ) to obtain a good initial population (h, k, l). In this way, Equations (4)- (6) are computed by employing m = 180, n = 194, ∆ = 90, and δ = 97. Thus, the parent P 1,1 is determined via surface data whose sub-indices are (i = 0, j = 0, δ = 97, ∆ = 90), the parent P 2,1 is determined via (i = 0, j = 90, δ = 97, ∆ = 90), the parent P 3,1 is determined via sub-indices (i = 97, j = 0, δ = 97, sub-indices ∆ = 90), and the parent P 4,1 is determined via sub-indices (i = 97, j = 90, δ = 97, ∆ = 90).
Then, the genetic algorithm performs the second step via crossover to compute the children by substituting q = 0 and q = 1 in Equations (7)- (10). The probability of crossover is determined via fitness [52]. When the average fitness of the parents is improved, the crossover is carried out. This procedure leads to preventing the loss of candidates to achieve the convergence. Thus, the probability of crossover is in the interval from 0.0 to 0.5. This result is obtained by computing the same experiment several times. Then, the algorithm performs the third step to evaluate the fitness by substituting the coordinates (h, k, l) of parents and children in Equation (11). Then, the algorithm performs the fourth step to select the parents of the next generation via fitness. In this way, the parents P 1,t+1 and P 3,t+1 are selected from the pairs (P 1,t , P 2,t ) and (P 3,t , P 4,t ), respectively. Furthermore, the parents P 2,t+1 and P 4,t+1 are selected from the children(C 1,t , C 2,t , C 3,t , C 4,t ) and (C 5,t , C 6,t , C 7,t , C 8,t ), respectively.
Then, the algorithm performs the fifth step to mutate the worst parent, which is determined via fitness. In addition, a parent is randomly selected to mutate one coordinate, which is selected in random form. The mutation probability is determined via fitness. For the mutation of the parent, if the new parent improves the fitness, the worst parent is mutated, if not, the worst parent is not mutated. For the parameter mutation, if the new parameter improves the parent fitness, the parameter is mutated. Thus, the mutation probability crossover is in the interval from 0.0 to 0.62. This result is obtained by computing the same experiment several times. Then, the algorithm performs the second step to create the children of the (t + 1) generation via Equations (7)- (10). Additionally, the fitness of these children is computed via Equation (11). Thus, the population of the (t + 1) generation is completed. Then, the procedure to compute the (t + 1) generation is repeated until the op-timal parameters (h, k, l), which minimize the objective function Equation (11) are obtained. The number of generations is deduced from the iterations number to obtain the optimized parameters (h, k, l). Thus, the number of generations that obtain the surface model is 136. The optimized origin coordinates are h = 1688.3 µm, k = 1409.4 µm, l = −3685.6 µm, and R = 4390.9 µm. These coordinates are substituted in Equation (1) to obtain the spherical surface model z i,j = −3685.6 + [4390.9 2 − (x i,j −1688.3) 2 − (y i,j − 1409.4) 2 ] 1/2 , which produces the spherical surface shown in Figure 6b. The relative error produced by the spherical model is determined by the next expression For this equation, M i,j is the micro-scale surface computed via Equation (1), z i,j is the surface retrieved via micro laser line projection, and n·m is the data number. Thus, Equation (29) determines the optimality gap of the genetic algorithm [53]. By computing Equation (29), the relative error between the spherical surface model and the plastic surface shown in Figure 6b is 2.8631%. Additionally, Figure 6c shows the surface generated via the spherical surface model and the surface data over the surface model. Figure 6d shows the surface generated via the spherical surface model and the surface data under the surface model. The fitness variation with respect to the generation number is depicted by the graphic shown in Figure 7, where, the variation decreases when the generation number increases.
Thus, the optimality gap of the algorithm for the spherical surface model is 2.8631%. The solution quality is deduced based on the running time to obtain the optimal solution [54]. The running time is defined by the generation number and the computer speed. Thus, the 136 generations are computed in 22.87 s by employing a PC to 1.8 GHz. The fitness variation in each generation is shown in Figure 7. In this case, the variation decreases when the generation number increases. Thus, the spherical surface modeling is performed by the metaheuristic algorithm.
parameter improves the parent fitness, the parameter is mutated. Thus, the mutation probability crossover is in the interval from 0.0 to 0.62. This result is obtained by computing the same experiment several times. Then, the algorithm performs the second step to create the children of the (t + 1) generation via Equations (7)- (10). Additionally, the fitness of these children is computed via Equation (11). Thus, the population of the (t + 1) generation is completed. Then, the procedure to compute the (t + 1) generation is repeated until the optimal parameters (h, k, l), which minimize the objective function Equation (11) are obtained. The number of generations is deduced from the iterations number to obtain the optimized parameters (h, k, l). Thus, the number of generations that obtain the surface model is 136. The optimized origin coordinates are h = 1688.3 μm, k = 1409.4 μm, l = −3685.6 μm, and R = 4390.9 μm. These coordinates are substituted in Equation (1) For this equation, Mi,j is the micro-scale surface computed via Equation (1), zi,j is the surface retrieved via micro laser line projection, and n·m is the data number. Thus, Equation (29) determines the optimality gap of the genetic algorithm [53]. By computing Equation (29), the relative error between the spherical surface model and the plastic surface shown in Figure 6b is 2.8631%. Additionally, Figure 6c shows the surface generated via the spherical surface model and the surface data over the surface model. Figure 6d shows the surface generated via the spherical surface model and the surface data under the surface model. The fitness variation with respect to the generation number is depicted by the graphic shown in Figure 7, where, the variation decreases when the generation number increases.
Thus, the optimality gap of the algorithm for the spherical surface model is 2.8631%. The solution quality is deduced based on the running time to obtain the optimal solution [54]. The running time is defined by the generation number and the computer speed. Thus, the 136 generations are computed in 22.87 s by employing a PC to 1.8 GHz. The fitness variation in each generation is shown in Figure 7. In this case, the variation decreases when the generation number increases. Thus, the spherical surface modeling is performed by the metaheuristic algorithm. The micro-scale cylindrical surface modeling is performed for the metallic surface shown in Figure 8a. The scale of this figure is represented in millimeters in the x-axis. The micro laser line projected on the metallic surface is shown in Figure 8b. Thus, the metallic surface is scanned in the x-axis via the micro laser line to compute the coordinates (x i,j , y i,j ) by means of Equations (26) and (27). Then, the coordinates (x i,j , y i,j ) are substituted in Equations (22) and (23) to compute the micro-scale surface (z i,j , y i,j ). The surface coordinate x i,j is provided by the slider device. In this way, one hundred and eighty images are processed to retrieve the micro-scale cylindrical surface shown in Figure 9a. In this figure, the x-axis, y-axis, and z-axis are indicated in microns. The accuracy of this surface is determined via relative error in Equation (28). Where z i,j is the micro-scale surface computed via Equation (22), H i,j is the surface reference, and n·m is the data number. By computing Equation (28), the relative error for the metallic surface shown in Figure 9a is 0.8783%. coordinate xi,j is provided by the slider device. In this way, one hundred and eighty images are processed to retrieve the micro-scale cylindrical surface shown in Figure 9a. In this figure, the x-axis, y-axis, and z-axis are indicated in microns. The accuracy of this surface is determined via relative error in Equation (28). Where zi,j is the micro-scale surface computed via Equation (22), Hi,j is the surface reference, and n·m is the data number. By computing Equation (28), the relative error for the metallic surface shown in Figure 9a is 0.8783%. From the surface shown in Figure 9a, a cylindrical surface model is performed by the genetic algorithm via surface coordinates (xi,j, yi,j, zi,j). To carry it out, the genetic algorithm determines the origin and direction coordinates (k0, l0, kn, ln) as described in Section 2.2. In this way, the genetic algorithm performs the first step to determine the initial population by employing the surface coordinates (xi,j, yi,j, zi,j). Thus, a sampling of the model is carried out to obtain the best candidates. To do so, Equations (15)- (20) are computed by employing m = 160 and n = 180. Thus, the parent P1,1 is computed via surface whose sub-indices are (i = 0, j = 0, δ = 45, Δ = 80, κ = 160), the parent P2,1 is determined via sub-indices (i = 45, j = 0, δ = 45, Δ = 80, κ = 160), the parent P3,1 is computed via sub-indices (i = 90, j = 0, δ = 45, Δ = 80, κ = 160), and P4,1 is determined via sub-indices (i = 135, j = 0, δ = 45, Δ = 80, κ = 160). In this way, four coordinates (k0, l0, kn, ln) are obtained and they are defined as the first parents (P1,t, P2,t, P3,t, P4,t). Additionally, the ratio ř is defined as the average distance between the coordinates (ki, li) and the surface coordinates (xi,j, yi,j, zi,j).  (19) by employing the coordinates (ki, li) and the surface coordinates (xi,j, yi,j, zi,j). Additionally, the minimum and maximum of the coordinate k0 are defined as y0,0 and y0,m, respectively. The minimum and maximum of the coordinate kn, are defined as yn,0 and y0,m, respectively. The minimum and maximum of the coordinate l0 are defined as (l0 + ř/2) and (l0 − ř), respectively, where, l0 is computed via Equation (16). The minimum and maximum of the coordinate ln are defined as (ln + ř/2) and (ln − ř), respectively, where, ln is computed via puted by means of the coordinates (k0, l0, kn, ln) and the coordinates (ki, li), which are determined via Equation (13) and Equation (14). Then, the algorithm performs the fourth step to select the parents of the next generation. In this way, the parents P1,t+1 and P3,t+1 are selected from the pairs (P1,t, P2,t) and (P3,t, P4,t), respectively. Additionally, the parents P2,t+1 and P4,t+1 are selected from the children (C1,t, C2,t, C3,t, C4,t) and (C5,t, C6,t, C7,t, C8,t), respectively. Then, the algorithm performs the fifth step to mutate the worst parent, which is determined via fitness Equation (21). In addition, a parent is randomly selected to mutate one coordinate, which is selected in random form. The mutation probability is determined via fitness. If the parent mutation improves the fitness, the mutation is carried out. If not, the worst parent is not mutated. For the parameter mutation, if the new parameter improves the parent fitness, the parameter is mutated. Thus, the mutation probability crossover is in the interval from 0.0 to 0.65. This result is obtained by computing the same experiment several times. Then, the algorithm performs the second step to create the children of the (t + 1) generation via Equations (7)- (10). Furthermore, the fitness of these children is computed via Equation (21). Thus, the population of the (t + 1) generation is completed. The number of generations is deduced from the number of iterations to obtain the optimized parameters (h, k, l). Thus, the number of generations to obtain the surface model is 112. Then, the procedure to compute the (t + 1) generation is repeated until the optimal parameters (k0, l0, kn, ln), which minimize the objective function Equation  (29), where, Mi,j is the micro-scale surface computed via the cylindrical surface model in Equation (12), zi,j is the surface computed via micro laser line projection, and n·m is the data number. Thus, Equation (29) determines the optimality gap of the genetic algorithm. By computing Equation (29), the relative error between the cylindrical surface model and the surface data shown in Figure 9a is 3.765%. The error between the cylindrical surface model and the surface data shown in Figure 9a is computed via Equation (29), where, M i,j is the micro-scale surface computed via the cylindrical surface model in Equation (12), z i,j is the surface computed via micro laser line projection, and n·m is the data number. Thus, Equation (29) determines the optimality gap of the genetic algorithm. By computing Equation (29), the relative error between the cylindrical surface model and the surface data shown in Figure 9a is 3.765%.
Thus, the optimality gap of the algorithm for the cylindrical surface model is 3.765%. The solution quality is deduced based on the running time to obtain the optimal solution. The running time is defined by the generation number and the computer speed. Thus, the 112 generations are computed in 22.18 s by employing a PC to 1.8 GHz. Additionally, Figure 9c shows the surface generated via cylindrical surface model and the surface data over the surface model. Figure 9d shows the surface generated via cylindrical surface model and the surface data under the surface model. Thus, the cylindrical surface modeling has been performed by the metaheuristic algorithm.

Discussion
The capability of the micro-scale spherical and cylindrical surface modeling is established based on the model fitting accuracy [55,56]. Therefore, the contribution of the proposed technique is determined based on the model fitting to the surface. This statement includes the model fitting to the surface, and the algorithm efficiency. The model fitting to the surface and the algorithm efficiency are achieved in a good manner. The model fitting is determined via quality gap, which is computed via Equation (29). Thus, the proposed technique fits the spherical and cylindrical surface model to the surface data with a relative error smaller than 3.8%. The algorithm efficiency is determined via algorithm structure and solution quality, which is determined via running time. The algorithm structure provides an efficient procedure to optimize the surface model parameters. It is because the metaheuristic algorithm determines the initial population by the best candidates, which are sampled by solving the spherical and cylindrical surface models. This procedure leads to providing the initial population near the optimal parameters. Thus, the algorithm provides a low error since the first generation. This leads to reduced iterations to obtain the optimal parameters. Therefore, the running time is achieved in less than 140 iterations. Thus, the proposed micro-scale surface modeling improves the model fitting of the traditional optical microscope imaging systems. It is because the traditional optical microscope imaging systems perform micro-scale spherical and cylindrical surface modeling with a relative error over 5.0% [57,58], where, the spherical and cylindrical surface modeling is performed via polynomial regression by means of the least squared method [59,60]. In this way, a spherical model via least squared is generated for the plastic surface shown in Figure 6a and for the metallic shown in Figure 9a. However, the fitting accuracy is a relative error over 8%. This means that surface modeling via the metaheuristic algorithm improves the model fitting of the optical microscope imaging systems. Additionally, the surface data accuracy has an influence on the surface model fitting. In this matter, the optical microscope imaging systems perform the spherical and cylindrical surface modeling by means of surface, which is determined via gray-level [61,62]. However, the gray-level profile does not reproduce the surface profile under the test. Therefore, the gray-level does not help to improve the model fitting. Instead, the micro-scale contouring via micro laser line reproduces the surface profile with high accuracy. It is because the micro laser line reflection depicts the object surface profile. Additionally, the artificial intelligence algorithms have been employed by the contact methods to perform the spherical and cylindrical surface modeling [63,64]. These algorithms optimize the mathematical parameters of the spherical and cylindrical models by employing the traditional search structure [65,66]. In this matter, the proposed metaheuristic algorithm performs an analytic process to determine the search space, which provides initial values near to the optimal model parameters. This procedure is carried out via Equations (3)-(5) for the spherical surface modeling and Equations (15)-(18) for the cylindrical surface modeling. Thus, the metaheuristic algorithm determines the initial parameters by solving the surface model via surface geometry data. These initial parameters are the best candidates for the first solution of the surface model parameters. In this way, the search procedure begins on a path, which provides the optimal parameters. It is because the search procedure begins near to the optimal parameters. This leads to improving the metaheuristic algorithm efficiency by reducing iterations to find the best model parameters. It is elucidated by the low error in the first generation. Thus, the metaheuristic algorithm determines the optimal parameters from the surface data. The traditional algorithms do not provide the initial parameters near to the optimal parameters. It is because the traditional algorithms do not determine the initial values by solving the model via surface data. Furthermore, the proposed metaheuristic algorithm performs exploration and exploitation, which perform a search procedure inside and outside of parents. Thus, all search space can be analyzed. This procedure leads to finding the best solution for the model parameters in an efficient form. The capability of the proposed metaheuristic genetic algorithm is elucidated by comparison with respect to the metaheuristic algorithms. To elucidate this, the quality gap, running time, and suitable structure of the metaheuristic algorithms are mentioned as follows. The particle swarm optimization provides a quality gap of 4.44% and a running time of 253 generations for spherical and cylindrical surface modeling. The ant colony optimization provides a quality gap of 4.74% and a running time of 286 generations. The simulated annealing optimization provides a quality gap of 4.91% and a running time of 292 generations. The suitable structure is compared with the particle swarm optimization that provides better results. To do so, the population evolution of the particle swarm is described as follows. The population evolution of the particle swarm is described by the expressions V i (t+1) = wV i (t) + αR 1 where t is the number of iterations, and α and β represent the learning factors. The parameters R 1 and R 2 are random numbers ranging from 0 to 1, and w is the inertia weight. Based on these statements, the population of each generation is generated by a function that depends on five variables, which should be determined. The genetic algorithm determines the population of each generation by a function that depends on the variable β, which is computed via the spread factor between 0 and 1. Therefore, the genetic algorithm performs a structure that is more simple than the particle swarm optimization. In addition, ant colony optimization and simulated annealing optimization employ more variables than the genetic algorithm to construct surface models. From the results, the genetic algorithm elucidates a suitable structure to construct surface models. This statement is corroborated by the surface model constructed via genetic algorithm and by particle swarm optimization [67]. Based on these statements, the capability of the micro-scale spherical and cylindrical surface modeling via the metaheuristic algorithm based on the micro laser line projection is elucidated. Moreover, the low cost of the simple setup increases the viability of the proposed micro-scale spherical and cylindrical surface modeling. In this way, the micro-scale surface modeling via the genetic algorithm and micro laser line projection provides a contribution for the optical microscope imaging systems, which perform micro-scale surface modeling.
The computer employed to perform the micro-scale spherical and cylindrical surface modeling is a PC to 1.8 GHz of velocity. The frame rate of the camera is 58 fps. The slider device moves the microscope vision system via control software. Each micro laser line image is processed in 0.0074 s to determine the micro-scale surface contour. The spherical surface model for the plastic surface is determined in 26.21 s. The time of this procedure includes the surface scanning and the surface modeling. The cylindrical surface model for the metallic surface is determined in 25.48 s.

Conclusions
A powerful technique to perform micro-scale spherical and cylindrical surface modeling by means of a metaheuristic algorithm based on micro laser line projection with microns resolution has been presented. This spherical and cylindrical surface modeling via genetic algorithm improves the model fitting accuracy of the traditional optical microscope imaging system, which performs surface modeling. This contribution is achieved via model fitting accuracy and genetic algorithm efficiency. The model fitting improvement is obtained by the genetic algorithm, which fits the spherical and cylindrical surface model near the surface topography. In addition, the micro-scale surface contouring via micro laser line contributes to the model fitting accuracy. It is because the micro laser line reflection reproduces the surface topography with great accuracy. Thus, the micro-scale surface model is generated from the real surface topography. The genetic algorithm efficiency is achieved by mean of the solution space, which provides analytic equations that generate initial parameters near to optimal model parameters. This leads to reducing the iterations number to find the model with the best fitting. Thus, the proposed micro-scale spherical and cylindrical surface modeling provides a valuable tool to represent spherical and cylindrical surfaces in micro-scale metrology. Additionally, the proposed technique is implemented with a simple optical hardware, which includes an optical microscope, a diode laser, and a CCD camera. Therefore, the low cost of the setup corroborates the viability of the proposed technique to perform micro-scale spherical and cylindrical surface modeling in the interval of microns. Thus, the micro-scale spherical and cylindrical surface modeling based on micro laser line projection has been performed with good results in the micro-scale interval.
This research is still working to provide some missing tools. For instance, the method just constructs spherical and cylindrical surface models. However, free-form surface models are required. In addition, the method should determine surface deformation via surface modeling. Therefore, future work is recommended as follows. Future work includes microscale spherical and cylindrical surface deformation modeling via metaheuristic algorithms and micro laser line scanning, micro-scale free-form surface modeling via metaheuristic algorithms and micro laser line scanning, micro-scale surface pattern characterization and recognition via algorithms of artificial intelligence and micro laser line scanning, and a micro-scale surface porosity inspection via micro laser line scanning and metaheuristic algorithms.