# Micro-Scale Surface Recognition via Microscope System Based on Hu Moments Pattern and Micro Laser Line Projection

## Abstract

**:**

## 1. Introduction

^{3}adapt three-dimensional surfaces. On the other hand, microscale flat surface recognition has been performed by the means of a kernel extreme learning machine to recognize flatness surfaces [8]. The particle swarm algorithm determines the setting parameters of the kernel extreme learning machine. Moreover, microscale flat surface recognition has been performed by the means of a fuzzy neural network and a cloud model which is accomplished through a genetic algorithm [9]. The inference network is built by means of fuzzy logic and a cloud model. The above surface recognition methods perform microscale concave, convex and flat surface recognition through the data which are retrieved via microscope images. However, the image intensity profile does not represent accurately the surface contour. This leads to producing surface recognition inaccuracies which are generated due to the object’s skin material, laser diode and incident angle. Furthermore, the above-mentioned methods do not retrieve the surface contour to perform the surface recognition. Therefore, the traditional surface recognition methods produce errors on the microscale convex, concave and flat surface recognition. On the other hand, the traditional computer vision methods based on machine learning employ additional parameters to surface data to accomplish surface recognition. As a consequence of those parameters, complicated procedures should be optimized to perform surface recognition. Therefore, the microscopic convex, concave and flat shape recognition still requires better technology to improve the recognition accuracy and efficiency. This criterion indicates that the microscale convex, concave and flat surface recognition performed through the microscopic image processing needs to be improved. To enhance microscopic convex, concave and flat shape recognition, it is required to implement recognition algorithms based on contour data retrieved from the surface topography. Moreover, it is necessary to develop recognition methods based on the intelligent algorithms whose structure is performed through three-dimensional data. Unlike the above recognition methods, the proposed microscale surface recognition is carried out through the surface contour which is retrieved through the microscope vision system. The real object contour is depicted by the line image captured from the scanned object. Additionally, pattern recognition is performed by means of Hu moments which characterize a surface pattern through the surface contour data. In this way, the surface pattern characterization via surface contour improves the surface recognition accuracy which is performed by microscopic image processing.

^{2}discussion based on the accuracy results of microscale surface recognition. Thus, the contribution of the proposed microscopic surface recognition is established based on the microscale surface recognition accuracy. The section included in the paper are mentioned as follows: the Hu moments patterns of a convex, concave and flat surface model are indicated in Section 2.1, the genetic algorithm to perform the Bezier surface modeling is implemented in Section 2.2, the surface contouring in the microns interval and the microscope geometry are outlined in Section 2.3, the recognition results’ convex, concave and flat topography are depicted in Section 3, but the microscale surface recognition discussion based on microscope imaging systems is discussed in Section 4.

## 2. Materials and Methods

#### 2.1. Hu Moments Pattern for Surface Recognition at Micro-Scale

_{i}

_{,j}, y

_{j}

_{,i,j}) is the surface to be analyzed by the coordinates (x

_{i}

_{,j}, y

_{i}

_{,j}). Additionally, the sub-indexes (i,j) depict number of surface points in the x and y direction. In this way, the central moments are determined via coordinates (x

_{c},y

_{c}) by the next expression:

_{1}, ϕ

_{2}, ϕ

_{3}, ϕ

_{4}, ϕ

_{5}, ϕ

_{6}and ϕ

_{7}) which characterizes the shape of a three-dimensional surface. Thus, a surface is characterized by means of a Hu moments pattern from a surface model [13]. In this way, a Bezier surface model is built through the 4th-order functions and topographic coordinates. For the Bezier model, the coordinates (x

_{i}

_{,j}, y

_{i}

_{,j}and z

_{i}

_{,j}) represent the topographic data which are shown in Figure 1. In these topographic coordinates, the sub-indexes (i,j) indicate the number of surface points in x and y axis.

_{0i,j}, for i = 0, 1, 2, 3, …, n and j = 0, 1, 2, 3, …, m. In this case, n and m are defined in the x-direction and y-direction, respectively. From the surface data, the Bezier basis functions are defined through the next equation [14]:

_{i}

_{,j}moves the surface S

_{s}

_{,t}(u,v) toward the object contour z

_{i}

_{,j}. Additionally, (i, j) are determined by i = r + s × 4 and j = g + t × 4, respectively. In addition, the Bezier model is defined through the surfaces S

_{s}

_{,t}(u,v) for s = 0, 1, 2, 3,…, n/4 and t = 0, 1, 2, 3, …, m/4. From these surfaces, the Bezier model is generated by

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}which determine the convex, concave and flat Bezier surface model. From the Bezier surface model, the Hu moments are computed to determine the Hu moments pattern of the convex, concave and flat surface. For instance, the Hu moments are computed to define the Hu moments pattern of the flat surface. In this way, Equations (1)–(10) are computed from the flat surface shown in Figure 2a which includes random roughness. Thus, the results of the Hu moments for the flat surface are ϕ

_{1}= 0.0964, ϕ

_{2}= 0.0093, ϕ

_{3}= 1.0770 × 10

^{−8}, ϕ

_{4}= 1.0398 × 10

^{−8}, ϕ

_{5}= 1.0426 × 10

^{−16}, ϕ

_{6}= 1.8066 × 10

^{−10}and ϕ

_{7}= −1.0508 × 10

^{−16}. These Hu moments represent the Hu moments pattern of a flat surface. This pattern describes a flat line from ϕ

_{3}to ϕ

_{7}and an increasing function from ϕ

_{2}to ϕ

_{1}. In this case, ϕ

_{7}can take a negative value. Moreover, a similar Hu moment pattern is obtained in a flat surface without roughness. In the same way, the Hu moments are computed to define the Hu moments pattern of the concave topography given in Figure 2b. In this case, the Hu moments for the concave surface are ϕ

_{1}= 0.0087, ϕ

_{2}= 7.5395 × 10

^{−5}, ϕ

_{3}= 3.1626 × 10

^{−12}, ϕ

_{4}= 1.5968 × 10

^{−11}, ϕ

_{5}= −2.3344 × 10

^{−21}, ϕ

_{6}= 1.1946 × 10

^{−15}and ϕ

_{7}= 6.9730 × 10

^{−23}. These Hu moments represent the Hu moments pattern of a concave surface. In this case, the Hu pattern describes a flat line from ϕ

_{3}to ϕ

_{7}but increases from ϕ

_{2}to ϕ

_{1}. In this case, ϕ

_{5}is a negative and ϕ

_{7}can be negative. Moreover, a similar Hu moment pattern is obtained for a concave surface without roughness. Additionally, the Hu moments pattern of a convex surface is defined. To do so, the Hu moments are computed for the convex surface shown in Figure 2c. The results of the Hu moments are ϕ

_{1}= 0.0129, ϕ

_{2}= 1.6526 × 10

^{−4}, ϕ

_{3}= 3.8968 × 10

^{−10}, ϕ

_{4}= 4.0918 × 10

^{−10}, ϕ

_{5}= −5.7007 × 10

^{−20}, ϕ

_{6}= 2.7008 × 10

^{−12}and ϕ

_{7}= −2.0500 × 10

^{−20}. This Hu pattern describes a flat line from ϕ

_{3}to ϕ

_{7}but increases from ϕ

_{2}to ϕ

_{1}. In this case, ϕ

_{5}is a negative and ϕ

_{7}can be negative. Therefore, convex and concave surfaces provide a similar Hu moment pattern. However, the position of the line projection determines if the pattern corresponds to a concaveor convex surface. The genetic algorithm to compute the control points P

_{i}

_{,j}is described in Section 2.2.

#### 2.2. Bezier Surface Modeling through a Genetic Algorithm

_{i}

_{,j}, y

_{i}

_{,j}and z

_{i}

_{,j}) represent the topography coordinates, whose sub-indexes (i,j) are established in x-direction and y-direction, respectively. The Bezier model is constructed by accomplishing Equation (11) through the control points P

_{i}

_{,j}which move the Bezier surface toward the real surface contour. In this way, the control points P

_{i}

_{,j}= w

_{i}

_{,j}z

_{i}

_{,j}are determined through the weights w

_{i}

_{,j}. These weights are determined by substituting z

_{i}

_{,j}and (u

_{i}

_{,j}, v

_{i}

_{,j}) in Equation (11) and solving the next equation system

_{i}

_{,j}and v

_{i}

_{,j}are determined via expressions given in Equation (11) and S

_{s}

_{,t}(u

_{i}

_{,j},v

_{i}

_{,j}) = z

_{i}

_{,j}. By employing these parameters, a genetic algorithm computes w

_{i}

_{,j}to accomplish the Bezier surface S

_{s,t}(u,v). To do so, Equation (13) is solved via genetic algorithm to obtain the weights w

_{i}

_{,j}which accomplish the Bezier surface model Equation (12). In this case, the genetic procedure performs an exploration inside of the research space and exploitation outside of solution space to compute the optimized weights [15]. Based on these stages, a mathematical Bezier model is performed through a genetic algorithm and surface contour data. In this way, the weights are computed via the genetic algorithm which is explicated as follows.

_{i}

_{,j}= 1 to establish the solution space of each weight. In this case, Equation (11) is calculated via P

_{i}

_{,j}= z

_{i}

_{,j}. Thus, if the Bezier surface Equation (11) provides a value over the surface z

_{i}

_{,j}, the solution space is defined in the interval [0.3, 1]. However, if the Bezier surface Equation (11) provides a minor value than z

_{i}

_{,j}, the solution space is determined in the interval [1, 7]. In this way, the Bezier surface Equation (11) has determined the solution apace interval of each weight. Then, the first population is generated by taking randomly four values from the search interval. Thus, the four data define the first parents ($\mathcal{W}$

_{1,k}, $\mathcal{W}$

_{2,k}), ($\mathcal{W}$

_{3,k}, $\mathcal{W}$

_{4,k}) whose k-index depicts the number of each generation. In this way, the first weights population is defined via first parents ($\mathcal{W}$

_{1,1}, $\mathcal{W}$

_{2,1},), ($\mathcal{W}$

_{3,1}, $\mathcal{W}$

_{4,1}) of each weight. From this process, the first weight population has been determined.

_{1+3l+4q,k}are computed via parents ($\mathcal{W}$

_{1,k}and $\mathcal{W}$

_{2,k}) for

**l**= 0,

**l**= 1, q = 0 and q = 1. However, the children w

_{2+l +4q,k}are computed via ($\mathcal{W}$

_{3,k}and $\mathcal{W}$

_{4,k}). In this way, the current children are computed by means of the next expressions

**l**= 0,

**l**= 1, q = 0 and q = 1. $\mathcal{W}$

_{0}corresponds to the minimum and $\mathcal{W}$

_{5}corresponds to the maximum of each weight. Additionally, the probability distribution β is computed by means of the parameter α that is generated in the interval [0, 1]. In this way, Equation (14) computes children outside parents and Equation (15) computes children inside parents. Therefore, Equations (14) and (15) compute the children (w

_{1,k}, w

_{2,k}, w

_{3,k}and w

_{4,k}) via ($\mathcal{W}$

_{1,k}and $\mathcal{W}$

_{2,k}) and q = 0. In the same way, Equations (14) and (15) compute (w

_{5,k}, w

_{6,k}, w

_{7,k}and w

_{8,k}) via ($\mathcal{W}$

_{3,k}and $\mathcal{W}$

_{4,k}) and q = 1. From this procedure, Equations (14) and (15) compute the children in each k-generation. Additionally, the Bezier surface S

_{s}

_{,t}(u,v) should provide continuity G

^{1}. The P

_{i}

_{,j}should be smooth in the border [17]. These smooth points are computed by means of P

_{4+4×s,j}= (P

_{4+4s−1,j}+ P

_{4+4s+1,j})/2 and P

_{i}

_{,4+4t}= (P

_{i}

_{,4+4t−1}+ P

_{i}

_{,4+4t+1})/2.

_{s}

_{,t}(u

_{i}

_{,j}, v

_{i}

_{,j}) to determine the fitness. Thus, the fitness is computed by the expression

^{1}surface data z

_{i}

_{,j}and the Bezier surface S

_{s}

_{,t}(u

_{i}

_{,j},v

_{i}

_{,j}).

_{1,k+1}is taken from ($\mathcal{W}$

_{1,k}, $\mathcal{W}$

_{2,k}) and $\mathcal{W}$

_{3,k+1}is taken from ($\mathcal{W}$

_{3,k}, $\mathcal{W}$

_{4,k}). However, $\mathcal{W}$

_{2,k+1}is taken (w

_{1,k}, w

_{2,k}, w

_{3,k}, w

_{4,k}) from and $\mathcal{W}$

_{4,k+1}is taken from (w

_{5,k}, w

_{6,k}, w

_{7,k}, w

_{8,k}).

_{0,0}(u

_{i}

_{,j},v

_{i}

_{,j}) are determined from the topography contour given in Figure 2b. The steps to optimize the weights are described in the flowchart of Figure 3 which describes the structure of the genetic algorithm. Thus, the first step computes the first parents of the weights. This step computes Equation (11) via w

_{i}

_{,j}= 1 to determine the search space of each weight w

_{i}

_{,j}. Thus, if S

_{0,0}(u

_{i}

_{,j}, v

_{i}

_{,j}) is over z

_{i}

_{,j}, the research space is defined in interval [0.3, 1]. However, if the Bezier surface is under z

_{i}

_{,j}, the search space is defined in the interval [1, 1.7]. In this case, the weights, w

_{0,0}= 1 and w

_{4},

_{4}= 1, are deduced from the Bezier basis functions. However, the expressions, P

_{4+4s,j}= (P

_{4+4s−1,j}+P

_{4+4s+1,j})/2 and P

_{i}

_{,4+4t}= (P

_{i}

_{,4+4t−1}+ P

_{i}

_{,4+4t+1})/2, the weights ($\mathcal{W}$

_{4,0}, $\mathcal{W}$

_{4,1}, $\mathcal{W}$

_{4,2}, $\mathcal{W}$

_{4,3}, $\mathcal{W}$

_{0,4}, $\mathcal{W}$

_{1,4}, $\mathcal{W}$

_{2,4}, $\mathcal{W}$

_{3,4}) are determined to provide continuity G

^{1}. Thus, four values are chosen from the solution space in random form to obtain the initial parents of each weight. The first parents are pointed out in Table 1. In this table, the first column indicates the control points to be optimized and the parents ($\mathcal{W}$

_{1,1}, $\mathcal{W}$

_{2,1}, $\mathcal{W}$

_{3,1}, $\mathcal{W}$

_{4,1}) are indicated in the second to fifth column. Then, the second step computes the first children by means of Equations (14) and (15). These equations are computed via parents ($\mathcal{W}$

_{1,k}and $\mathcal{W}$

_{2,k}) for

**l**= 0,

**l**= 1 and q = 0 to obtain the children (w

_{1,k}, w

_{2,k}, w

_{3,k}and w

_{4,k}). Moreover, (w

_{5,k}, w

_{6,k}, w

_{7,k}and w

_{8,k}) are computed via Equations (14) and (15) for

**l**= 0,

**l**= 1 and q = 1. These children are pointed out in Table 1 in the sixth to thirteenth column. Next, the third step computes the fitness through the objective function Equation (16) by means of Bezier surface S

_{s}

_{,t}(u

_{i}

_{,j},v

_{i}

_{,j}) and z

_{i}

_{,j}. The fitness evaluation indicates that the initial population provides a low error.

_{1,k+1}is taken from ($\mathcal{W}$

_{1,k}and $\mathcal{W}$

_{2,k}), and $\mathcal{W}$

_{3,k+1}is chosen from ($\mathcal{W}$

_{3,k}, $\mathcal{W}$

_{4,k}). In the same way, $\mathcal{W}$

_{2,k+1}is selected from (w

_{1,k}, w

_{2,k}, w

_{3,k}and w

_{4,k}) and $\mathcal{W}$

_{4,k+1}is selected from (w

_{5,k}, w

_{6,k}, w

_{7,k}and w

_{8,k}), respectively. In this case, $\mathcal{W}$

_{1,2}= $\mathcal{W}$

_{1,1}, $\mathcal{W}$

_{3,2}= $\mathcal{W}$

_{3,1}, $\mathcal{W}$

_{2,2}= w

_{1,1}and $\mathcal{W}$

_{4,2}= w

_{5,1}.

_{4,2}is chosen to be mutated by a new parent obtained from the search space. Thus, Equation (16) is computed to determine fitness. As fitness was improved, $\mathcal{W}$

_{4,2}was changed by the new parent. Then, w

_{2,0}was randomly determined to mutate from $\mathcal{W}$

_{3,2}. Next, a new weight replaces w

_{2,0}in $\mathcal{W}$

_{3,2}to compute Equation (16), and it was improved. Therefore, the weight w

_{2,0}is changed by the new weight. Then, algorithm computes (k + 1)-generation children by means of Equations (14) and (15). Moreover, Equation (16) is computed to determine the fitness of (k + 1)-generation children. Table 2 provides the population of (k + 1)-generation. Where, the (k + 1)-generation corresponds to the second generation. In the same way, the procedure to obtain the (k + 1)-generation population is computed iteratively to minimize Equation (16). Table 2 includes the optimal control points in column fifteenth. Thus, the Bezier surface S

_{0,0}(u,v) is defined by the optimal control points P

_{i}

_{,j}= w

_{i}

_{,j}z

_{i}

_{,j}. From this procedure, the Bezier surface is generated through weight provided by the genetic algorithm. In the same procedure, the weights of the Bezier basis function S

_{1,0}(u,v), …, S

_{n}

_{/4,0}(u,v), …, S

_{n}

_{/4,m/4}(u,v) are determined to construct the Bezier model Equation (12). In this way, the Bezier model has been accomplished via weights. The optical setup to retrieve three-dimensional surfaces via an optical microscope is described in Section 2.3.

#### 2.3. Micro-Scale Surface Recovering via Micro Laser Line Projection

_{0}depicts the distance between the topography point O and the objective lens. The length d

_{1}depicts the length from the intermediate plane to the first objective lens but F

_{1}indicates the objective focus position. Length L depicts the length defined from the ocular lens to the intermediate image plane. The length d

_{2}depicts the length defined from the CCD array to ocular lens and F

_{2}indicates the ocular focus position. The lateral configuration of the microscope arrangement in y-axis is shown in Figure 4c. The position of the laser line in the image plane is indicated by (x

_{i}

_{,j}, y

_{i}

_{,j}).

_{c}and y

_{c}) represent the center of the image plane, and the pixel dimension is depicted by the symbol η. The surface height z

_{i}

_{,j}and the coordinate y

_{i}

_{,j}are defined based on the geometry depicted in Figure 4b,c. Thus, (z

_{i}

_{,j}and y

_{i}

_{,j}) are computed by the equations

_{i}

_{,j}is given by the slider device in the x-direction. Based on Equations (17) and (18), the surface height z

_{i}

_{,j}and the coordinate y

_{i}

_{,j}are computed through the vision parameters (x

_{c}, y

_{c}, η, θ, d

_{1}, F

_{1}, d

_{2}and F

_{2}). These parameters are computed from Equations (17) and (18) through the genetic algorithm steps which are mentioned as follows.

_{c}, y

_{c}, η). However, the search space of the microscope parameters (d

_{1}, F

_{1}, d

_{2}and F

_{2},θ) is obtained by means of the microscope geometry. In this way, the ocular lens ratio provides the minimum F

_{2}, but two times the ocular lens ratio provides the maximum F

_{2}. Moreover, the ocular ratio provides the minimum d

_{2}, but four times the ocular ratio provides the maximum d

_{2}. In the same way, the objective lens ratio provides the minimum F

_{1}, and two times the objective ratio provides the maximum F

_{1}. Moreover, objective ratio produces the minimum d

_{1}, and four times the objective ratio produces the maximum d

_{1}. Moreover, the minimum θ is established as 12°, and maximum θ is established as 50°. Thus, the research space has been obtained. From this search space, four parents ($\mathcal{W}$

_{1,k}, $\mathcal{W}$

_{2,k}, $\mathcal{W}$

_{3,k}and $\mathcal{W}$

_{4,k}) are randomly taken for each vision parameter. Thus, the four values of each parameter (x

_{c}, y

_{c}, η, θ, d

_{1}, F

_{1}, d

_{2}and F

_{2}) are determined as the first parents. Then, the second step computes Equations (14) and (15) to generate the current children. To do so, ($\mathcal{W}$

_{1,k}and $\mathcal{W}$

_{2,k}) are replaced in Equations (14) and (15) to compute (w

_{1,k}, w

_{2,k}, w

_{3,k}and w

_{4,k}) by employing

**l**= 0,

**l**= 1 and q = 0. Moreover, ($\mathcal{W}$

_{3,k}) are replaced in Equations (14) and (15) to compute (w

_{5,k}, w

_{6,k}, w

_{7,k}and w

_{8,k}) by employing

**l**= 0,

**l**= 1 and q = 1. Then, the third step evaluates the fitness through the microscope parameters by the next equations

_{i}

_{,j}– z

_{i}

_{,m}) and (y

_{i}

_{,j}− y

_{i}

_{,1}), but the fitness is calculated by the expression Obj = (Ob

_{1}+ Ob

_{2})/2. Then, the fourth step generates the (k + 1)-generation population. Thus, $\mathcal{W}$

_{1,k+1}is chosen from ($\mathcal{W}$

_{1,k}and $\mathcal{W}$

_{2,k}), and $\mathcal{W}$

_{3,k+1}is chosen from ($\mathcal{W}$

_{3,k}, $\mathcal{W}$

_{4,k}). In the same way, $\mathcal{W}$

_{2,k+1}is chosen from (w

_{1,k}, w

_{2,k}, w

_{3,k}and w

_{4,k}) and $\mathcal{W}$

_{4,k+1}is chosen from (w

_{5,k}, w

_{6,k}, w

_{7,k}and w

_{8,k}). Then, the fifth step mutates the worst parent determined via Equation (16). Moreover, a new parent replaces the worst parent to compute the fitness via Equations (19) and (20). If the new parent enhances the fitness, the worst parent mutation is successfully carried out. Otherwise, the mutation is not applied. In the same way, one parameter is designated in random form to be mutated. In this procedure, a new parameter replaces the selected parameter to compute Equations (19) and (20). If the new vision parameter enhances the fitness, the selected parameter is changed, if not, the mutation is not mutated applied. With this step, the mutation is finished and the (k + 1)-generation parents have been completed. Then, Equations (14) and (15) compute performed the (k + 1)-generation children. Additionally, the fitness of these children is calculated by computing Equations (19) and (20). With this step, the (k + 1)-generation population is obtained. The step to generate the (k + 1)-generation population is computed until to minimize Equations (19) and (20). Moreover, expression z

_{0}

_{,j}= η(x

_{0}

_{,j}− x

_{c}) F

_{1}F

_{2}/(F

_{1}− d

_{1})(f

_{2}− F

_{2})sinθ computes the length between zero and the point O. On the other hand, the laser line position (x

_{i}

_{,j}, y

_{i}

_{,j}) is determined from the maximum intensity in x-direction. In this way, the coordinate x

_{i}

_{,j}is calculated from the maximum intensity in x-direction [18]. To perform this procedure, a Bezier curve is generated in x-direction from the laser intensity through the expressions

_{i}

_{,j}represents the line pixel position in x-axis, I

_{i}

_{,j}represents pixel intensity and N indicates the laser line width in pixels. However, the sub-indices (i, j) depict the pixel number in x and y directions. To perform the fitting, x

_{i}

_{,j}and I

_{i}

_{,j}are substituted in Equations (21) and (22), respectively. In this way, a concave curve {x(u), I(u)} is generated. For this curve, I″(u) is positive in the interval 0 ≤ u ≤ 1. Therefore, the Bezier curve maximum is calculated through the derivative I′(u) = 0. For this derivative, u is computed through the Bisection algorithm. Thus, u is substituted in Equation (21) to compute x(u) which represents the line position x

_{i}

_{,j}= x(u) in x-direction. The coordinate y

_{i}

_{,j}is taken from the number of rows in y-direction. Moreover, the laser line edges y

_{i}

_{,0}and y

_{i}

_{,m}are computed through the first derivative in y-direction. Thus, Equation (17) computes the object height z

_{i}

_{,j}by means of x

_{i}

_{,j}, and Equation (18) computes the surface width y

_{i}

_{,j}by employing y

_{i}

_{,j}. Thus, z

_{i}

_{,j}and y

_{i}

_{,j}have been computed through the laser line image which is provided by the camera. However, the slider device provides the surface length x

_{i}

_{,j}. Thus, the microscale contouring has been computed.

_{i}

_{,j}. The coordinate x

_{i}

_{,j}is calculated via Equations (21) and (22), and y

_{i}

_{,j}is obtained through the row number. In this way, the distortion is calculated from the expressions x

_{i}

_{,j}= x

_{i}

_{,j}+ δx

_{i}and y

_{i}

_{,j}= y

_{i}

_{,j}+ δy

_{j}. Thus, the distortion is represented by (δx

_{i}, δy

_{j}), and (x

_{i}

_{,j}, y

_{i}

_{,j}) represent the distorted coordinates. Additionally, a line shifting is given by the expression s

_{i}

_{,j}= (x

_{1,j}+ δx

_{1}) − (x

_{i}

_{,j}+ δx

_{i}), but a distorted line shifting is represented by S

_{i}

_{,j}= x

_{1,j}− x

_{i}

_{,j}. From these expressions, δx

_{i}= (x

_{1,j}− x

_{i}

_{,j}) − s

_{i}

_{,j}+ δx

_{1}= S

_{i}

_{,j}− s

_{i}

_{,j}+ δx

_{1}is obtained to compute the distortion in x-direction. Furthermore, the first line shifting is obtained without distortion by projecting the line by position of the coordinate x

_{c}where δx

_{1}= 0 and s

_{1,j}= S

_{1,j}. In this way, the line shifting s

_{i}

_{,j}is calculated through the first shifting by the expression S

_{1,j}by s

_{i}

_{,j}= i × S

_{1,j}. Thus, the distortion in x-direction is determined by the expression δx

_{i}= (x

_{1,j}− x

_{i}

_{,j}) − i × S

_{1,j}. In the same way, the distortion in direction of y-axis is deduced through the 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 these expressions, δy

_{j}= (y

_{i}

_{,1}− y

_{i}

_{,j}) − j × T

_{i}

_{,1}is obtained to calculate the distortion in y-axis. In Section 3, the results of microscale convex, concave and flat surface recognition via Hu moments patterns are described.

## 3. Results

_{i}

_{,j}and y

_{i}

_{,j}) by the means of Equations (21) and (22). Then, Equation (17) computes the surface high z

_{i}

_{,j}through the x

_{i}

_{,j}, and Equation (18) computes the surface width y

_{i}

_{,j}through the y

_{i}

_{,j}. Additionally, the slider device provides the coordinate x

_{i}

_{,j}. In this way, two hundred and sixteen laser lines were employed to compute the contour topography shown in Figure 5c. The scale of x and y axis are indicated in mm, but the scale of the z-axis is given in microns. The contouring accuracy is defined via relative error [19] which is determined based on measurements given by a physical contact process. Thus, the error of the contour measurement is computed through the next equation

_{i}

_{,j}is given by the contact procedure, z

_{i}

_{,j}is determined through Equation (17) and n·m depicts the number of computed data. Then, the relative error is computed via Equation (23) for the surface given in Figure 5c, and the result is a relative error of 0.883%.

_{s}

_{,t}(u,v). However, the second step computes Equations (14) and (15) for

**l**= 0,

**l**= 1, q = 0 and q = 1 to create the first children. Then, the third step replaces the control points P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}in Equation (11) to compute the fitness via Equation (16). Then, the fourth selects the (k + 1)-parents, where $\mathcal{W}$

_{1,k+1}and $\mathcal{W}$

_{3,k+1}are selected from ($\mathcal{W}$

_{1,k}, $\mathcal{W}$

_{2,k}) and ($\mathcal{W}$

_{3,k}, $\mathcal{W}$

_{4,k}), respectively. Moreover, $\mathcal{W}$

_{2,k+1}and $\mathcal{W}$

_{4,k+1}are collected from (w

_{1,k}, w

_{2,k}, w

_{3,k}and w

_{4,k}) and (w

_{5,k}, w

_{6,k}, w

_{7,k}and w

_{8,k}), respectively. Then, the fifth step mutates the lowest fitness parent which is chosen through Equation (16). Thus, a new parent replaces the worst parent to compute Equation (16). If the new parent improves the fitness, the worst parent is mutated, if not, the mutation is not applied. In the same way, one weight is selected to be mutated from a parent that is randomly selected. To carry it out, a new weight replaces the selected weight to compute Equation (16) which determines the fitness. Thus, if the new weight enhances fitness, the selected weight is changed, if not, the mutation is not applied. Then, the second step computes Equations (14) and (15) to generate the (k + 1)-generation children. The fitness of these children is computed via Equation (16). The procedure to compute the (k + 1)-generation population is computed iteratively to find the weights which minimizes Equation (16). In this way, 247 generations were calculated to accomplish the Bezier model. Then, the optimal P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}is replaced in Equation (11) to determine the Bezier model that computes the topography contour shown in Figure 5d. The Bezier model accuracy is determined by computing Equation (23), where z

_{i}

_{,j}is determined via Equation (17), h

_{i}

_{,j}is computed via S

_{s}

_{,t}(u, v) and the number of data is represented by n·m. In this case, the Bezier model provides a relative error of 0.9012% with respect to the iron topography given in Figure 5c. Then, the Hu moments are computed from the Bezier surface to determine the Hu moments pattern. In this way, Equations (1)–(10) are computed from the Bezier surface shown in Figure 5d. Thus, the Hu moments are computed, and the results are ϕ

_{1}= 0.0098, ϕ

_{2}= 9.5861 × 10

^{−5}, ϕ

_{3}= 8.8027 × 10

^{−11}, ϕ

_{4}= 5.7037 × 10

^{−14}, ϕ

_{5}= 5.3374 × 10

^{−25}, ϕ

_{6}= −5.4946 × 10

^{−17}, ϕ

_{7}= −1.4123 × 10

^{−25}. This Hu pattern describes a flat pattern from ϕ

_{3}to ϕ

_{7}, but, and increases from ϕ

_{2}to ϕ

_{1}. In this case, ϕ

_{5}is negative, and ϕ

_{7}is negative. Therefore, the Hu moments pattern can be a convex or a concave surface as pointed out in Section 2.1. However, laser line position x

_{i}

_{,0}and x

_{i}

_{,m}corresponds to a maximum position in the x-axis; therefore, the Hu pattern corresponds to a convex surface. Thus, the surface shown in Figure 5d has been recognized as a convex surface through the Hu moments pattern.

_{i}

_{,j}and y

_{i}

_{,j}) are computed via Equations (21) and (22). Then, Equation (17) computes z

_{i}

_{,j}by employing x

_{i}

_{,j}, and Equation (18) computes y

_{i}

_{,j}by the means of y

_{i}

_{,j}. However, the slider device provides x

_{i}

_{,j}. Thus, two hundred and twenty images were employed to compute the topography contour shown in Figure 6c. The scale of the x and y axis are given in mm, but the scale of the z-axis is indicated in microns. The relative error of the surface contouring is determined by computing Equation (23),where z

_{i}

_{,j}is the topography contour computed by Equation (17) and h

_{i}

_{,j}indicates the reference surface. Thus, the relative is calculated via Equation (23), and the accuracy is a relative error of 0.7362%. Then, the Bezier model is generated by employing the contour data given in Figure 6c where the control points P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}are computed via genetic algorithm. In this way, the first step defines the search space in the interval [0.3, 1.7] for each weight. From this search space, four parents are randomly taken for each weight of the Bezier surface Equation (11). Then, the second step computes the crossover via Equations (14) and (15) to create the first children. Then, the third step computes Equation (16) via points P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}to determine the fitness. Then, the fourth step selects the (k + 1)-generation parents via fitness., $\mathcal{W}$

_{1,k+1}, $\mathcal{W}$

_{3,k+1}, $\mathcal{W}$

_{2,k+1}, and $\mathcal{W}$

_{4,k+1}are collected from ($\mathcal{W}$

_{1,k}, $\mathcal{W}$

_{2,k}), ($\mathcal{W}$

_{3,k}, $\mathcal{W}$

_{4,k}), (w

_{1,k}, w

_{2,k}, w

_{3,k}, w

_{4,k}) and (w

_{5,k}, w

_{6,k}, w

_{7,k}, w

_{8,k}), respectively. Then, the fifth step mutates the lowest fitness parent that is chosen by computing Equation (16). Thus, if the fitness is improved through the mutation, the worst parent is changed by the new parent, if not, the mutation is not applied. Moreover, one weight is selected to be mutated from a parent that is determined random form. Thus, a new weight replaces the selected weight to compute Equation (16). Thus, if the fitness is improved by the new weight, the selected weight is changed by the new weight.

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}are replaced in Equation (11) to compute the topography contour shown in Figure 6d. The Bezier model accuracy is computed via Equation (23), where z

_{i}

_{,j}is the computed by Equation (17), and h

_{i}

_{,j}is the Bezier surface S

_{s}

_{,t}(u, v). In this case, the Bezier model provides a relative error of 0.8651%. Then, the Hu moments pattern is computed from the Bezier surface data given in Figure 6d. Thus, Equations (1)–(10) are computed from the contour data shown in Figure 6d. The result of these Hu moments are ϕ

_{1}= 0.0061, ϕ

_{2}= 3.7308 × 10

^{−5}, ϕ

_{3}= 1.6666 × 10

^{−12}, ϕ

_{4}= 1.6949 × 10

^{−12}, ϕ

_{5}= 2.9203 × 10

^{−24}, ϕ

_{6}= 1.8667 × 10

^{−15}and ϕ

_{7}= −2.8675 × 10

^{−24}. This pattern describes a flat line from ϕ

_{3}to ϕ

_{7}, but an increasing function from ϕ

_{2}to ϕ

_{1}. In this case, ϕ

_{7}is a negative value. Therefore, the Hu moment pattern is established as a flat surface as pointed out in Section 2.1. Thus, the surface shown in Figure 6d has been recognized as a flat surface through the Hu moments pattern.

_{i}

_{,j}and y

_{i}

_{,j}) are computed by Equations (21) and (22). Then, Equation (17) computes z

_{i}

_{,j}through the position x

_{i}

_{,j}, and Equation (18) computes y

_{i}

_{,j}through the position y

_{i}

_{,j}. However, the slider device provides the coordinate x

_{i}

_{,j}. In this case, two hundred and fourteen images were employed to retrieve the topography shown in Figure 7c, where the scale of the x and y axis are given in mm, but the scale of the z-axis is given in microns. The relative error of the contoured surface is calculated via Equation (23) by employing the reference surface h

_{i}

_{,j}. Thus, Equation (23) is computed, and the result is a relative error of 0.902%. Then, the Bezier model is computed from the contour data given in Figure 7c. Thus, the control points P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}are computed via genetic algorithm, where the first step determines the search space in the interval [0.3, 1.7], and four parents are randomly taken for each weight w

_{i}

_{,j}. Then, the second step computes the first children via crossover Equations (14) and (15). Then, the third step computes the fitness Equation (16) via control points P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}. Then, the fourth step selects ($\mathcal{W}$

_{1,k+1}, $\mathcal{W}$

_{3,k+1}, $\mathcal{W}$

_{2,k+1}and $\mathcal{W}$

_{4,k+1}) from ($\mathcal{W}$

_{1,k}and $\mathcal{W}$

_{2,k}), ($\mathcal{W}$

_{3,k}and $\mathcal{W}$

_{4,k}), (w

_{1,k}, w

_{2,k}, w

_{3,k}and w

_{4,k}) and (w

_{5,k}, w

_{6,k}, w

_{7,k}and w

_{8,k}). Then, the lowest fitness parent is mutated in the fifth step. Moreover, one weight designated in random form is mutated. Then, the second step computes the (k + 1)-generation children via Equations (14) and (15). The procedure to compute the (k + 1)-generation population is computed iteratively to minimize Equation (16). In this procedure, 228 generations were employed to compute the optimal weights. Then, the Bezier model Equation (11) is computed by employing P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}to obtain the surface shown in Figure 7d. The relative error of this Bezier surface is computed via Equation (23), where z

_{i}

_{,j}is determined by Equation (17) and h

_{i}

_{,j}is the Bezier surface S

_{s}

_{,t}(u,v) computed via Equation (11). Thus, the Bezier surface model provides a relative error of 0.981%. Then, the Hu moments pattern is determined from the Bezier surface. In this way, Equations (1)–(10) are computed from the contour topography data given in Figure 6d to establish the Hu moments pattern. The results are ϕ

_{1}= 0.0128, ϕ

_{2}= 1.6507 × 10

^{−4}, ϕ

_{3}= 4.1305 × 10

^{−10}, ϕ

_{4}= 4.3164 × 10

^{−10}, ϕ

_{5}= −4.4624 × 10

^{−20}, ϕ

_{6}= 2.9023 × 10

^{−12}and ϕ

_{7}= −3.4863 × 10

^{−20}. This Hu pattern describes a flat pattern from ϕ

_{3}to ϕ

_{7}, but increases from ϕ

_{2}to ϕ

_{1}. In this case, ϕ

_{5}is negative and ϕ

_{7}is negative. Therefore, the Hu moments pattern can be a convex or a concave surface as pointed out in Section 2.1. However, the laser line position x

_{i}

_{,0}and x

_{i}

_{,m}correspond to a minimum position in the x-axis; therefore, the Hu pattern corresponds to a concave surface. Thus, the surface shown in Figure 7d has been recognized as a concave surface through the Hu moments pattern.

_{i}

_{,j}, y

_{i}

_{,j}) are computed by Equations (21) and (22). Then, Equation (17) computes surface height z

_{i}

_{,j}, Equation (18) computes the coordinate y

_{i}

_{,j}, but the slider device provides surface width x

_{i}

_{,j}. In this case, two hundred and twenty two images were employed to retrieve the surface. The surface accuracy is computed via Equation (23), and the result is a relative error of 0.896%. Next, the Bezier model is computed from the surface height z

_{i}

_{,j}by computing the control points P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}through the genetic algorithm. To do so, the search space is determined in the first step in the interval [0.3, 1.7] and four parents are randomly taken for each weight w

_{i}

_{,j}.

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}. Then, the fourth step selects ($\mathcal{W}$

_{1,k+1}, $\mathcal{W}$

_{3,k+1}, $\mathcal{W}$

_{2,k+1}and $\mathcal{W}$

_{4,k+1}) from ($\mathcal{W}$

_{1,k}and $\mathcal{W}$

_{2,k}), ($\mathcal{W}$

_{3,k}and $\mathcal{W}$

_{4,k}), (w

_{1,k}, w

_{2,k}, w

_{3,k}and w

_{4,k}) and (w

_{5,k}, w

_{6,k}, w

_{7,k}and w

_{8,k}). Then, the fifth step mutates the lowest fitness parent, and one weight from a parent which is randomly selected. Then, the second step computes the (k + 1)-generation children through Equations (14) and (15). Thus, the procedure to generate the (k + 1)-generation population is computed iteratively to minimize Equation (16). In this procedure, 238 iterations were computed to find the optimal weights. Then, the Bezier model Equation (11) is computed by means of P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}to obtain the surface shown in Figure 8b. The relative error of this Bezier surface is computed through Equation (23), where z

_{i}

_{,j}is computed via Equation (17) and h

_{i}

_{,j}is the Bezier surface S

_{s}

_{,t}(u,v) computed via Equation (11). Thus, the Bezier surface model provides a relative error of 0.932%. Then, the Hu moments pattern is determined from the Bezier surface shown in Figure 8b. In this way, Equations (1)–(10) are computed from the Bezier surface to establish the Hu moments pattern. The results are ϕ

_{1}= 0.0096, ϕ

_{2}= 9.2463 × 10

^{−5}, ϕ

_{3}= 1.8333 × 10

^{−11}, ϕ

_{4}= 4.1469 × 10

^{−12}, ϕ

_{5}= −5.0870 × 10

^{−22}, ϕ

_{6}= 5.4574 × 10

^{−16}and ϕ

_{7}= 2.3880 × 10

^{−23}. This Hu pattern describes a flat pattern from ϕ

_{3}to ϕ

_{7}, but increases from ϕ

_{2}to ϕ

_{1}. In this case, ϕ

_{5}is negative. Therefore, the Hu moments pattern can be a convex or a concave surface as pointed out in Section 2.1. However, the line position x

_{i}

_{,0}and x

_{i}

_{,m}correspond to a maximum position in the x-axis; therefore, the Hu pattern corresponds to a convex surface. Thus, the topography contour shown in Figure 8b has been recognized as a convex surface through the Hu moments pattern.

_{i}

_{,j}, y

_{i}

_{,j}) through Equations (21) and (22). Then, (z

_{i}

_{,j}, y

_{i}

_{,j}) are computed via Equations (17) and (18), but x

_{i}

_{,j}is collected from the slider device. In this case, two hundred and eighteen images were employed to compute the surface topography. The surface accuracy is determined by computing Equation (23) which provides a relative error of 0.921%. Then, the Bezier surface is computed from the surface z

_{i}

_{,j}by computing the control points P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}. Thus, the first step determines the search space in the interval [0.3, 1.7] and four parents are randomly taken for each weight w

_{i}

_{,j}. The second step computes the first children via Equations (14) and (15). The third step computes the fitness Equation (16). Then, the fourth step selects ($\mathcal{W}$

_{1,k+1}, $\mathcal{W}$

_{3,k+1}, $\mathcal{W}$

_{2,k+1}and $\mathcal{W}$

_{4,k+1}) from ($\mathcal{W}$

_{1,k}and $\mathcal{W}$

_{2,k}), ($\mathcal{W}$

_{3,k}and $\mathcal{W}$

_{4,k}), (w

_{1,k}, w

_{2,k}, w

_{3,k}and w

_{4,k}) and (w

_{5,k}, w

_{6,k}, w

_{7,k}and w

_{8,k}), respectively. Then, the fifth step mutates the lowest fitness parent and one weight from a parent which is randomly selected. Then, the second step computes the (k + 1)-generation children via Equations (14) and (15). Thus, the procedure to generate the (k + 1)-generation population is computed iteratively to minimize Equation (16). Thus, 208 generations were computed to determine the optimal weights. Then, the Bezier model Equation (11) is computed via the means of P

_{i}

_{,j}= z

_{i}

_{,j}w

_{i}

_{,j}to obtain the surface topography shown in Figure 8d. The relative error of this topography is computed via Equation (23), where z

_{i}

_{,j}is computed via Equation (17) and h

_{i}

_{,j}is the Bezier surface S

_{s}

_{,t}(u, v) computed via Equation (11). Thus, the Bezier surface model provides a relative error of 0.952%. Then, the Hu moments pattern is determined from the Bezier surface shown in Figure 8d. Thus, Equations (1)–(10) are computed from the Bezier surface to establish the Hu moments pattern. The result of these Hu moments are ϕ

_{1}= 0.0059, ϕ

_{2}= 3.4819 × 10

^{−5}, ϕ

_{3}= 3.5756 × 10

^{−11}, ϕ

_{4}= 3.5594 × 10

^{−11}, ϕ

_{5}= 1.2611 × 10

^{−21}, ϕ

_{6}= 3.7812 × 10

^{−14}and ϕ

_{7}= −1.2610 × 10

^{−21}. This Hu pattern describes a flat line from ϕ

_{3}to ϕ

_{7}, but an increasing function from ϕ

_{2}to ϕ

_{1}. In this case, ϕ

_{7}is a negative value. Therefore, the Hu moment pattern is established as a flat surface as pointed out in Section 2.1. Thus, the paper surface shown in Figure 8d has been recognized as a flat surface through the Hu moments pattern.

## 4. Discussion

_{3}to ϕ

_{7}but an increasing value from ϕ

_{2}to ϕ

_{1}. The small variations of the Hu moments pattern are produced due to the surface roughness. In this way, the variation of the Hu moments pattern for the flat surface is 0.527% which is computed through the relative error. Moreover, the recognition via Hu moments pattern and microlaser line projection always recognize concave and convex metallic surfaces. It is because concave and convex metallic surfaces always produce the same Hu moments pattern which describes a flat line from ϕ

_{3}to ϕ

_{7}, where ϕ

_{5}is a negative value. However, the Hu moments pattern provides an increasing value from ϕ

_{2}to ϕ

_{1}. Additionally, the laser line position x

_{i}

_{,0}and x

_{i}

_{,m}determine if the surface is concave based on the maximum and minimum position in the x-axis. The small variation of the Hu moments pattern due to the surface roughness for the concave and convex surface is a relative error of 0.674%. To elucidate the viability of the proposed surface recognition, the accuracy of the concave, convex and flat surface recognition reported in recent years is commented on as follows. The surface recognition accuracy of the optical microscope vision system is related to surface contouring which is not included in surface recognition via microscope image processing. Typically, microscopic concave, convex and flat surface recognition is performed with a relative error of over 2.5% [25,26,27], where the surface shape is determined through microscope images based on gray level. Therefore, surface recognition is not carried out through the surface topography contour. The missing of this process reduces the surface recognition accuracy. Moreover, the traditional optical microscope techniques compute the contour data via image intensity to characterize the surface pattern [28,29]. However, the image intensity does not depict the topography contour with great accuracy. Thus, the surface pattern characterizing is not so accurate. Instead, the microlaser line reproduces the topography contour on the image plane with great accuracy. It is because the laser line reflects the real surface contour in the image plane through the microscope. This procedure leads to obtaining the same Hu moments pattern for each surface shape which includes roughness. This criterion has been corroborated through the results of the concave, convex and flat surface recognition pointed out in Section 3. On the other hand, the efficiency of the proposed surface recognition is established through the system structure to perform the surface recognition. For instance, the microlaser line contouring performs topography measurement at microscale in the accurate form. It is because the laser line reflects the topography contour in the CCD camera. Also, the Bezier surface model Equation (11) provides all necessary surface points to compute the Hu moments pattern. In this way, the Hu moments provide the same characteristic pattern for a flat surface. Moreover, the Hu moments provide the same characteristic pattern for a concave and a convex surface, where the microlaser line position establishes if the pattern corresponds to a concave or a convex surface. Thus, pattern characterization is carried out through efficient stages which produce an efficient and accurate surface recognition. It is because pattern characterization always produces the same pattern for the same surface topography. These statements have been corroborated by several microscale concave, convex and flat surface recognition trials. Instead, deep learning methods have emerged for surface recognition. The deep learning methods lie in a well-designed convolutional neural network and a huge data set of images related to the target. Thus, the recent methods based on deep learning perform pattern training through several hundred images [30] which do not produce the same pattern. It is because pattern characterization is carried out via image intensity which does not depict the surface topography in its accurate form. In this way, the pattern characterization depends on the surface reflectance, light pattern intensity and reflection angle. Thus, the training via image gray level requires several hundred samples of the same surface topography to perform pattern characterization. Thus, the suitable structure of the surface recognition via Hu moments pattern and micro laser line contouring gives a better efficiency than the surface recognition performed via pattern characterization based on gray-level images. This criterion has been corroborated through the steps of the surface recognition via Hu moments pattern and micro laser line contouring. Moreover, the capability of microscale surface recognition via Hu moments pattern has been corroborated by performing surface recognition on other materials, such as plastic and paper. In the case of the plastic surface, the laser line image depicts the real topography contour. This statement is corroborated by the microlaser line displayed in Figure 8a. Therefore, the Bezier surface model Equation (11) computes the surface topography with great accuracy and a relative error of 0.932%. Moreover, the Bezier surface produces a Hu moments pattern which is very similar to the Hu moments pattern of the metalic surface. The variation of the Hu moments pattern for the convex surface is a relative error of 0.624%. Additionally, the laser line position x

_{i}

_{,0}and x

_{i}

_{,m}determine that the Hu pattern corresponds to a convex surface. Thus, it is elucidated that the microscale laser line contouring provides good surface recognition at the microscale of metals and other materials. This criterion is also elucidated by performing surface recognition on the paper surface. In the case of the paper surface, the laser line image depicts the real topography contour. This statement is demonstrated by the micro laser line illustrated in Figure 8a. Therefore, the Bezier surface model Equation (11) computes the surface topography with great accuracy and a relative error of 0.952%. Moreover, the Bezier surface produces a Hu moment pattern which is very similar to the Hu moments pattern of the flat metallic surface, where the variation of the Hu moments pattern for the flat surface is 0.502%. From these criteria, it is corroborated that the microscale surface recognition via micro laser line provides good surface recognition for different surface materials. It is the difference in recognition techniques based on microscope gray-level images, where the surface material modifies the image intensity which determines the topographic data. This limitation decreases surface recognition accuracy. Thus, the viability of the microscale concave, convex and flat surface recognition via the Hu moments pattern and microlaser line projection has been corroborated. In addition, the basic optical setup provides an inexpensive system that increases the viability of the proposed microscale concave, convex and flat surface recognition. Thus, the proposed surface recognition makes an enhancement in the field of the microscale concave, convex and flat surface recognition of the microscope imaging systems.

## 5. Conclusions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Pacella, M.; Nekouieb, V.; Badiee, A. Surface engineering of ultra-hard polycrystalline structures using a nanosecond Yb fibre laser: Effect of process parameters on microstructure, hardness and surface finish. J. Mater. Process. Technol.
**2019**, 266, 311–328. [Google Scholar] [CrossRef] - Cheng, Y.; Wang, Q.; Jiao, W.; Yu, R.; Chen, S.; Zhang, Y.M.; Xiao, J. Detecting dynamic development of weld pool using machine learning from innovative composite images for adaptive welding. J. Manuf. Process.
**2020**, 56, 908–915. [Google Scholar] [CrossRef] - Song, K.; Yan, Y. Micro surface defect detection method for silicon steel strip based on saliency convex active contour model. Math. Probl. Eng.
**2013**, 2013, 429094. [Google Scholar] [CrossRef] - Ono, H.; Ogawa, A.; Yamasaki, T.; Koshihara, T.; Kodama, T.; Iizuka, Y.; Oshige, T. Twin-illumination and subtraction technique for detection of concave and convex defects on steel pipes in hot condition. ISIJ Int.
**2019**, 59, 1820–1827. [Google Scholar] [CrossRef] - Feng, X.; Gao, X.; Luo, L.A. ResNet50-based method for classifying surface defects in hot-rolled strip steel. Mathematics
**2021**, 9, 2359. [Google Scholar] [CrossRef] - Cheng, Y.; Deng, H.G.; Feng, Y.X.; Xiang, J.J. Weld defect detection and image defect recognition using deep learning technology. Res. Sq.
**2021**, 1, 1–14. [Google Scholar] - Wei, R.; Song, Y.; Zhang, Y. Enhanced faster region convolutional neural networks for steel surface defect detection. ISIJ Int.
**2020**, 60, 539–545. [Google Scholar] [CrossRef] - Li, X.; Fang, Y.; Liu, L. Kernel extreme learning machine for flatness pattern recognition in cold rolling mill based on particle swarm optimization. J Braz. Soc. Mech. Sci. Eng.
**2020**, 42, 270. [Google Scholar] [CrossRef] - Zhang, X.; Zhao, L.; Zang, J.; Fan, H. Visualization of flatness pattern recognition based on T-S cloud inference network. J. Cent. South Univ.
**2015**, 22, 560–566. [Google Scholar] [CrossRef] - Yang, J.H.; Fang, H.Y. Research into different methods for measuring the particle-size distribution of aggregates: An experimental comparison. Constr. Build. Mater.
**2019**, 221, 469–478. [Google Scholar] [CrossRef] - Muñoz Rodríguez, J.A.; Rodríguez-Vera, R.; Asundi, A. Recognition of a light line pattern by Hu moments for 3-D reconstruction of a rotated object. Opt. Laser Technol.
**2005**, 37, 131–138. [Google Scholar] [CrossRef] - Gornale, S.S.; Patravali, P.U.; Hiremath, P.S. Automatic Detection and Classification of Knee Osteoarthritis Using Hu’s Invariant Moments. Front. Robot. AI
**2020**, 7, 591827. [Google Scholar] [CrossRef] [PubMed] - Madrigal, C.A.; Branch, J.W.; Restrepo, A.; Mery, D. 3A method for automatic surface inspection using a model-based 3D descriptor. Sensors
**2017**, 17, 2262. [Google Scholar] [CrossRef] - Akleman, E.; Srinivasan, V.; Chen, J. Interactive modeling of smooth manifold meshes with arbitrary topology: G
^{1}stitched bi-cubic Bézier patches. Comput. Graph.**2017**, 66, 64–73. [Google Scholar] [CrossRef] - Hussain, K.; Salleh, M.N.M.; Cheng, S.; Shi, Y. On the exploration and exploitation in popular swarm-based metaheuristic algorithms. Neural Comput. Appl.
**2019**, 31, 7665–7683. [Google Scholar] [CrossRef] - Tan, K.C.; Chiam, S.C.; Mamun, A.A.; Goh, C.K. Balancing exploration and exploitation with adaptive variation for evolutionary multi–objective optimization. Eur. J. Oper. Res.
**2009**, 197, 701–713. [Google Scholar] [CrossRef] - Li, C.Y.; Zhu, C.G. G
^{1}continuity of four pieces of developable surfaces with Bézier boundaries. J. Comput. Appl. Math.**2018**, 329, 164–172. [Google Scholar] [CrossRef] - Muñoz-Rodríguez, J.A.; Rodríguez-Vera, R. Evaluation of the light line displacement location for object shape detection. J. Mod. Opt.
**2003**, 50, 137–154. [Google Scholar] [CrossRef] - Yu, H.; Huang, Q.; Zhao, J. Fabrication of an optical fiber micro-sphere with a diameter of several tens of micrometers. Materials
**2014**, 7, 4878–4895. [Google Scholar] [CrossRef] - Wang, Q.; Li, J.; Wang, X.; Yang, Q.; Wu, Z. Evaluation method and application of cold rolled strip flatness quality based on multi-objective decision- making. Metals
**2022**, 12, 1977. [Google Scholar] [CrossRef] - Czimmermann, T.; Ciuti, G.; Milazzo, M.; Chiurazzi, M.; Roccella, S.; Oddo, C.M.; Dario, P. Visual-based befect betection and classification approaches for industrial applications—A survey. Sensors
**2020**, 20, 1459. [Google Scholar] [CrossRef] - Shi, J.; Yang, J.; Zhang, Y. Research on steel surface defect detection based on YOLOv5 with attention mechanism. Electronics
**2022**, 11, 3735. [Google Scholar] [CrossRef] - Zhang, X.; Xu, T.; Zhao, L.; Fan, H.; Zang, J. Research on flatness intelligent control via GA–PIDNN. Intell. Manuf.
**2015**, 26, 359–367. [Google Scholar] [CrossRef] - Choi, E.; Sul, O.; Lee, J.; Seo, H.; Kim, S.; Yeom, S.; Ryu, G.; Yang, H.; Shin, Y.; Lee, S.-B. Biomimetic tactile sensors with bilayer fingerprint ridges demonstrating texture recognition. Micromachines
**2019**, 10, 642. [Google Scholar] [CrossRef] [PubMed] - Chen, Z.; Deng, J.; Zhu, Q.; Wang, H.; Chen, Y. A systematic review of machine-vision-based leather surface defect inspection. Electronics
**2022**, 11, 2383. [Google Scholar] [CrossRef] - Yang, L.; Huang, X.; Ren, Y.; Huang, Y. Steel plate surface defect detection based on dataset enhancement and lightweight convolution neural network. Machines
**2022**, 10, 523. [Google Scholar] [CrossRef] - Luo, Q.; Fang, X.; Su, J.; Zhou, J.; Zhou, B.; Yang, C.; Liu, L.; Gui, W.; Tian, L. Automated visual defect classification for flat steel surface: A Survey. IEEE Trans. Instrum. Meas.
**2020**, 69, 9329–9349. [Google Scholar] [CrossRef] - Fang, H.; Zhu, H.; Yang, J.; Huang, X.; Hu, X. Three-dimensional angularity characterization of coarse aggregates based on experimental comparison of selected methods. Part. Sci. Technol.
**2021**, 1, 1–9. [Google Scholar] [CrossRef] - Chen, L.C. Automatic 3D surface reconstruction and sphericity measurement of micro spherical balls of miniaturized coordinate measuring probes. Meas. Sci. Technol.
**2007**, 18, 1748–1755. [Google Scholar] [CrossRef] - Deng, H.; Cheng, Y.; Feng, Y.; Xiang, J. Industrial laser welding defect detection and image defect recognition based on deep learning model developed. Symmetry
**2021**, 13, 1731. [Google Scholar] [CrossRef]

**Figure 2.**(

**a**) Flat topography to compute Hu moments pattern. (

**b**) Concave surface to compute Hu moments pattern. (

**c**) Convex surface to compute Hu moments pattern.

**Figure 4.**(

**a**) Optical microscope setup to retrieve surface contour at microscale. (

**b**) Optical microscope geometry in x-axis. (

**c**) Optical microscope geometry in y-axis.

**Figure 5.**(

**a**) Iron topography with scale in mm in x-direction. (

**b**) Micro laser line that scans the iron topography. (

**c**) Surface contour retrieved through the laser line contouring. (

**d**) Microscale topography generated by the Bezier model Equation (11).

**Figure 6.**(

**a**) Iron surface with scale in mm in x-direction. (

**b**) Micro laser line projected on the iron topography. (

**c**) Surface contour recovered through the laser line contouring. (

**d**) Surface computed by the Bezier model Equation (11).

**Figure 7.**(

**a**) Metallic surface with scale in mm in x-axis. (

**b**) Microlaser line projected on the surface. (

**c**) Microscale surface recovered via micro laser line scanning. (

**d**) Surface computed via Bezier surface model Equation (11).

**Figure 8.**(

**a**) Plastic surface topography to compute microscale surface recognition. (

**b**) Bezier surface computed via Equation (11). (

**c**) Paper surface to compute microscale surface recognition. (

**d**) Bezier surface computed via Equation (11).

P_{i,j} | $\mathcal{W}$_{1,1} | $\mathcal{W}$_{2,1} | $\mathcal{W}$_{3,1} | $\mathcal{W}$_{4,1} | w_{1.1} | w_{2,1} | w_{3,1} | w_{4,1} | w_{5,1} | w_{6,1} | w_{7,1} | w_{8,1} |
---|---|---|---|---|---|---|---|---|---|---|---|---|

P_{0,1} | 4.7773 | 4.7800 | 4.7583 | 3.9536 | 4.1286 | 4.7785 | 4.7789 | 4.8174 | 3.1435 | 4.1669 | 4.5235 | 4.7871 |

P_{0,2} | 3.5287 | 2.8255 | 1.9636 | 4.2704 | 2.3522 | 3.1669 | 3.2724 | 3.7293 | 1.6870 | 2.6238 | 3.3893 | 4.3249 |

P_{0,3} | 3.6140 | 3.7200 | 1.7605 | 3.2390 | 2.8483 | 3.6670 | 3.6705 | 3.8549 | 1.7513 | 2.4157 | 2.6209 | 3.7004 |

P_{1,0} | 2.2926 | 3.6831 | 3.6715 | 4.0298 | 2.1644 | 2.9004 | 3.1384 | 4.2026 | 3.4689 | 3.8051 | 3.8911 | 4.1741 |

P_{1,1} | 1.9470 | 2.2920 | 1.3373 | 2.4125 | 1.8310 | 2.0431 | 2.1852 | 3.2480 | 1.3371 | 1.6601 | 1.9109 | 2.4792 |

P_{1,2} | 2.0331 | 3.2020 | 2.2460 | 3.8576 | 1.8880 | 2.5084 | 2.7590 | 3.6850 | 2.0772 | 2.9500 | 3.2875 | 3.9469 |

P_{1,3} | 6.0711 | 5.0629 | 4.8280 | 5.0324 | 4.9800 | 5.4444 | 5.6921 | 6.4131 | 4.5137 | 4.8863 | 4.9614 | 5.5557 |

P_{2,0} | 4.4185 | 4.2947 | 1.4866 | 1.5336 | 3.3928 | 4.3534 | 4.3615 | 4.4331 | 1.4474 | 1.5069 | 1.5193 | 2.1067 |

P_{2,1} | 3.1289 | 2.6901 | 1.5340 | 3.3676 | 2.6680 | 2.8453 | 2.9708 | 3.2359 | 1.5219 | 2.0230 | 2.5697 | 3.4520 |

P_{2,2} | 5.5178 | 4.2465 | 5.1380 | 6.6700 | 4.2402 | 4.6895 | 5.0558 | 5.5786 | 4.7730 | 5.7343 | 5.9294 | 6.6918 |

P_{2,3} | 6.0749 | 5.6100 | 5.9917 | 4.2305 | 5.3861 | 5.7350 | 5.9156 | 6.2530 | 4.0962 | 4.7596 | 5.3026 | 6.2314 |

P_{3,0} | 3.7742 | 2.8934 | 3.9840 | 2.5912 | 2.8176 | 3.2176 | 3.4539 | 3.8605 | 2.3545 | 3.2651 | 3.4773 | 4.1501 |

P_{3,1} | 3.1066 | 1.8414 | 1.2777 | 1.4801 | 1.7958 | 2.4197 | 2.4955 | 3.4937 | 1.2734 | 1.3341 | 1.4050 | 2.7164 |

P_{3,2} | 2.9129 | 3.0561 | 3.0618 | 2.3274 | 2.8058 | 2.9828 | 2.9981 | 3.2064 | 2.0881 | 2.6173 | 2.7638 | 3.3897 |

P_{3,3} | 3.1086 | 1.2363 | 3.1767 | 3.2293 | 1.1794 | 1.7222 | 2.2487 | 3.2756 | 2.7820 | 3.1970 | 3.2035 | 3.3208 |

fitness | 0.3224 | 0.6652 | 1.1678 | 1.4217 | 1.7809 | 2.3323 | 3.2111 | 4.9090 | 5.4896 | 7.1749 | 10.0922 | 16.4013 |

P_{i,j} | $\mathcal{W}$_{1,2} | $\mathcal{W}$_{2,2} | $\mathcal{W}$_{3,2} | $\mathcal{W}$_{4,2} | w_{1.2} | w_{2,2} | w_{3,2} | w_{4,2} | w_{5,2} | w_{6,2} | w_{7,2} | w_{8,2} | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|

P_{0,1} | 4.7773 | 4.1286 | 4.7583 | 2.7363 | 3.4413 | 4.4383 | 4.5722 | 4.7776 | 2.3527 | 3.2636 | 3.9482 | 4.8031 | 4.5975 |

P_{0,2} | 3.5287 | 2.3522 | 1.9636 | 3.7694 | 1.9998 | 2.6527 | 3.0004 | 3.7899 | 1.6586 | 2.7490 | 3.0989 | 3.9729 | 4.1833 |

P_{0,3} | 3.6140 | 2.8483 | 1.7605 | 3.6536 | 2.5338 | 3.1380 | 3.3748 | 3.6551 | 1.7501 | 2.5315 | 3.0352 | 3.9397 | 4.2334 |

P_{1,0} | 2.2926 | 2.1644 | 3.6715 | 2.7929 | 1.9997 | 2.2243 | 2.2440 | 3.5333 | 2.5505 | 3.1600 | 3.4020 | 3.8566 | 4.6253 |

P_{1,1} | 1.9470 | 1.8310 | 1.3373 | 2.1250 | 1.7871 | 1.8690 | 1.8967 | 2.5211 | 1.3370 | 1.5576 | 1.8690 | 3.0055 | 4.2622 |

P_{1,2} | 2.0331 | 1.8880 | 2.2460 | 2.2674 | 1.5818 | 1.9460 | 1.9653 | 2.8178 | 1.8023 | 2.2558 | 2.2569 | 2.7300 | 4.1903 |

P_{1,3} | 6.0711 | 4.9800 | 4.8280 | 6.7910 | 4.9363 | 5.3483 | 5.7853 | 6.2568 | 4.6187 | 5.7769 | 6.0519 | 6.8100 | 4.0716 |

P_{2,0} | 4.4185 | 3.3928 | 4.6059 | 2.8543 | 3.0938 | 3.8314 | 4.0990 | 4.4219 | 2.7964 | 3.4144 | 4.0651 | 4.6444 | 4.2639 |

P_{2,1} | 3.1289 | 2.6680 | 1.5340 | 2.3397 | 2.0968 | 2.8553 | 2.9337 | 3.3264 | 1.4366 | 1.9030 | 2.1008 | 2.7721 | 4.0849 |

P_{2,2} | 5.5178 | 4.2402 | 5.1380 | 6.1288 | 4.1506 | 4.5613 | 4.9948 | 5.9815 | 4.7658 | 5.4646 | 5.6353 | 6.3440 | 4.0963 |

P_{2,3} | 6.0749 | 5.3861 | 5.9917 | 4.8183 | 4.6421 | 5.6249 | 5.8653 | 6.0755 | 4.4173 | 5.2168 | 5.4574 | 6.1211 | 3.8562 |

P_{3,0} | 3.7742 | 2.8176 | 3.9840 | 4.0754 | 2.6532 | 3.1648 | 3.3098 | 3.9525 | 3.4286 | 4.0254 | 4.0311 | 4.0868 | 4.3741 |

P_{3,1} | 3.1066 | 1.7958 | 1.2777 | 1.7333 | 1.7056 | 2.1418 | 2.7726 | 3.3674 | 1.2461 | 1.4267 | 1.5330 | 2.6698 | 3.9306 |

P_{3,2} | 2.9129 | 2.8058 | 3.0618 | 2.1111 | 2.0253 | 2.8559 | 2.8778 | 3.0425 | 1.7954 | 2.4762 | 2.8058 | 3.1492 | 3.7650 |

P_{3,3} | 3.1086 | 1.1794 | 3.1767 | 3.3495 | 1.1421 | 1.9837 | 2.3739 | 3.2132 | 2.4318 | 3.2527 | 3.2940 | 3.4383 | 3.5289 |

fitness | 0.3224 | 1.7809 | 1.1678 | 5.4896 | 0.7635 | 0.9486 | 1.0912 | 1.3764 | 1.8031 | 2.2433 | 2.8813 | 4.3100 | 0.000342 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Rodríguez, J.A.M.
Micro-Scale Surface Recognition via Microscope System Based on Hu Moments Pattern and Micro Laser Line Projection. *Metals* **2023**, *13*, 889.
https://doi.org/10.3390/met13050889

**AMA Style**

Rodríguez JAM.
Micro-Scale Surface Recognition via Microscope System Based on Hu Moments Pattern and Micro Laser Line Projection. *Metals*. 2023; 13(5):889.
https://doi.org/10.3390/met13050889

**Chicago/Turabian Style**

Rodríguez, J. Apolinar Muñoz.
2023. "Micro-Scale Surface Recognition via Microscope System Based on Hu Moments Pattern and Micro Laser Line Projection" *Metals* 13, no. 5: 889.
https://doi.org/10.3390/met13050889