2. Materials and Methods
2.1. Hu Moments Pattern for Surface Recognition at Micro-Scale
The microscale convex, concave and flat surface recognition is performed by means of Hu moments pattern and a surface is retrieved via contouring based on line image processing. Typically, the topography recognition in the micron interval is performed via microscopic image processing. Surface recognition is performed through statistical, spectral and model-based methods. However, these methods do not perform the surface recognition through the surface contour and they produce inaccuracies in the results. Instead, the Hu moments have been defined based on the surface form to characterize three-dimensional shapes [
10]. Therefore, a pattern based on Hu moments is generated to perform microscale convex, concave and flat surface recognition [
11]. The Hu invariant moments are described based on the discrete statistical moments which are determined by the next expression:
For this equation,
f(
xi,j,
yj,i,j) is the surface to be analyzed by the coordinates (
xi,j,
yi,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 (
xc,
yc) by the next expression:
This equation provides the surface moments which are normalized based on center coordinates. These moments are invariant to translation and scale. In this way, the normalized moments are determined via the central moments through the expression:
From these normalized moments, seven shape descriptors are defined and they are not changed by the scale, translation and orientation change [
12]. These descriptors are represented by means of the next expressions
These invariant moments provide a pattern (
ϕ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 (
xi,j,
yi,j and
zi,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.
Thus, the Bezier basis functions are constructed through the surface data
z0i,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]:
For this equation,
u and
v are established in
x and
y axis, respectively. However, the control
Pi,j moves the surface
Ss,t(
u,
v) toward the object contour
zi,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
Ss,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
This equation system is accomplished by computing the control points
Pi,j =
zi,jwi,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
Pi,j is described in
Section 2.2.
2.2. Bezier Surface Modeling through a Genetic Algorithm
The microscale surface recognition of a Bezier surface model is accomplished through the surface contour which is retrieved at microscale through the microscope arrangement. In this way, a Bezier surface model represents the object shape under study. Thus, mathematical model is generated from the surface contour indicated in
Figure 1, where (
xi,j,
yi,j and
zi,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
Pi,j which move the Bezier surface toward the real surface contour. In this way, the control points
Pi,j =
wi,jzi,j are determined through the weights
wi,j. These weights are determined by substituting
zi,j and (
ui,j,
vi,j) in Equation (11) and solving the next equation system
For this equation system,
ui,j and
vi,j are determined via expressions given in Equation (11) and
Ss,t(
ui,j,
vi,j) =
zi,j. By employing these parameters, a genetic algorithm computes
wi,j to accomplish the Bezier surface
Ss,t(
u,
v). To do so, Equation (13) is solved via genetic algorithm to obtain the weights
wi,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.
In the first step, the research space is defined to compute the first weights population. To do so, the Bezier surface Equation (11) is computed via wi,j = 1 to establish the solution space of each weight. In this case, Equation (11) is calculated via Pi,j = zi,j. Thus, if the Bezier surface Equation (11) provides a value over the surface zi,j, the solution space is defined in the interval [0.3, 1]. However, if the Bezier surface Equation (11) provides a minor value than zi,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 (1,k, 2,k), (3,k, 4,k) whose k-index depicts the number of each generation. In this way, the first weights population is defined via first parents (1,1, 2,1,), (3,1, 4,1) of each weight. From this process, the first weight population has been determined.
Then, the second step performs a crossover to generate the children of current
k-generation. The crossover computes the inside parents’ children via exploration and the outside parents’ children through exploitation [
16]. Thus, the current children
w1+3l+4q,k are computed via parents (
1,k and
2,k) for
l = 0,
l = 1,
q = 0 and
q = 1. However, the children
w2+l +4q,k are computed via (
3,k and
4,k). In this way, the current children are computed by means of the next expressions
These equations are computed for
l = 0,
l = 1,
q = 0 and
q = 1.
0 corresponds to the minimum and
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 (
w1,k,
w2,k,
w3,k and
w4,k) via (
1,k and
2,k) and
q = 0. In the same way, Equations (14) and (15) compute (
w5,k,
w6,k,
w7,k and
w8,k) via (
3,k and
4,k) and
q = 1. From this procedure, Equations (14) and (15) compute the children in each
k-generation. Additionally, the Bezier surface
Ss,t(
u,
v) should provide continuity
G1. The
Pi,j should be smooth in the border [
17]. These smooth points are computed by means of
P4+4×s,j = (
P4+4s−1,j +
P4+4s+1,j)/2 and
Pi,4+4t =
(Pi,4+4t−1 +
Pi,4+4t+1)/2.
The third step computes an objective function by employing the surface
Ss,t(
ui,j,
vi,j) to determine the fitness. Thus, the fitness is computed by the expression
This fitness expression is computed trough the1 surface data zi,j and the Bezier surface Ss,t(ui,j,vi,j).
Then, the fourth step selects the (k + 1)-generation parents by means of fitness. Thus, 1,k+1 is taken from (1,k, 2,k) and 3,k+1 is taken from (3,k, 4,k). However, 2,k+1 is taken (w1,k, w2,k, w3,k, w4,k) from and 4,k+1 is taken from (w5,k, w6,k, w7,k, w8,k).
Then, the fifth step mutates one parent to elude trapping in a local minimum. To do so, a new parent replaces the worst parent which is determined via Equation (16). In this way, the Bezier surface Equation (13) is calculated to compute the fitness via Equation (16). If fitness is enhanced, the selected worst parent is successfully mutated. Otherwise, the mutation is not achieved. Additionally, one weight is mutated from a parent that is randomly designated. To carry it out, the selected weight is substituted with a new weight in the Bezier surface Equation (13) to compute the fitness via Equation (16). If the new weight provides better fitness, the mutation is successful. Otherwise, the mutation is achieved. From this mutation procedure, the (k + 1)-generation parents have been accomplished. Moreover, Equations (14) and (15) compute the (k + 1)-generation children. With this step, the (k + 1)-generation population is determined. The procedure to determine the (k + 1)-generation population is computed iteratively until optimizing Equation (16).
To illustrate the weights optimization, the weights of the
S0,0(
ui,j,
vi,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
wi,j = 1 to determine the search space of each weight
wi,j. Thus, if
S0,0(
ui,j,
vi,j) is over
zi,j, the research space is defined in interval [0.3, 1]. However, if the Bezier surface is under
zi,j, the search space is defined in the interval [1, 1.7]. In this case, the weights,
w0,0 = 1 and
w4,
4 = 1, are deduced from the Bezier basis functions. However, the expressions,
P4+4s,j = (
P4+4s−1,j +
P4+4s+1,j)/2 and
Pi,4+4t =
(Pi,4+4t−1 +
Pi,4+4t+1)/2, the weights (
4,0,
4,1,
4,2,
4,3,
0,4,
1,4,
2,4,
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 (
1,1,
2,1,
3,1,
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 (
1,k and
2,k) for
l = 0,
l = 1 and
q = 0 to obtain the children (
w1,k,
w2,k,
w3,k and
w4,k). Moreover, (
w5,k,
w6,k,
w7,k and
w8,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
Ss,t(
ui,j,
vi,j) and
zi,j. The fitness evaluation indicates that the initial population provides a low error.
Then, the fourth step determines the (k + 1)-generation parents through the current population. To do so, 1,k+1 is taken from (1,k and 2,k), and 3,k+1 is chosen from (3,k, 4,k). In the same way, 2,k+1 is selected from (w1,k, w2,k, w3,k and w4,k) and 4,k+1 is selected from (w5,k, w6,k, w7,k and w8,k), respectively. In this case, 1,2 = 1,1, 3,2 = 3,1, 2,2 = w1,1 and 4,2 = w5,1.
In the fifth step,
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,
4,2 was changed by the new parent. Then,
w2,0 was randomly determined to mutate from
3,2. Next
, a new weight replaces
w2,0 in
3,2 to compute Equation (16), and it was improved. Therefore, the weight
w2,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
S0,0(
u,
v) is defined by the optimal control points
Pi,j =
wi,jzi,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
S1,0(
u,
v), …,
Sn/4,0(
u,
v), …,
Sn/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
The optical setup to retrieve contour topography at microscale is exposed in
Figure 4a. This microscopic vision system is implemented by means through an optical microscope that includes a digital camera and a laser line projector. This optical microscope is placed on a movement system which is moved through a computer to scan the surface via projector line. In this microscope setup, the topography area is established in
x and
y axis but the object height is indicated in
z-direction. The microscope geometry in
x-direction is depicted in
Figure 4b. The laser diode projects a 40 μm line on the object contour which is reflected on the CCD array through the microscope. In this case, the symbol
θ represents the microscope alignment angle. Moreover, the length
d0 depicts the distance between the topography point
O and the objective lens. The length
d1 depicts the length from the intermediate plane to the first objective lens but
F1 indicates the objective focus position. Length
L depicts the length defined from the ocular lens to the intermediate image plane. The length
d2 depicts the length defined from the CCD array to ocular lens and
F2 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 (
xi,j,
yi,j).
The coordinates (
xc and
yc) represent the center of the image plane, and the pixel dimension is depicted by the symbol
η. The surface height
zi,j and the coordinate
yi,j are defined based on the geometry depicted in
Figure 4b,c. Thus, (
zi,j and
yi,j) are computed by the equations
The surface length xi,j is given by the slider device in the x-direction. Based on Equations (17) and (18), the surface height zi,j and the coordinate yi,j are computed through the vision parameters (xc, yc, η, θ, d1, F1, d2 and F2). These parameters are computed from Equations (17) and (18) through the genetic algorithm steps which are mentioned as follows.
The first step computes the solution space of each parameter. From the image size, the maximum and minimum are determined for the parameters (
xc,
yc,
η). However, the search space of the microscope parameters (
d1,
F1,
d2 and
F2,
θ) is obtained by means of the microscope geometry. In this way, the ocular lens ratio provides the minimum
F2, but two times the ocular lens ratio provides the maximum
F2. Moreover, the ocular ratio provides the minimum
d2, but four times the ocular ratio provides the maximum
d2. In the same way, the objective lens ratio provides the minimum
F1, and two times the objective ratio provides the maximum
F1. Moreover, objective ratio produces the minimum
d1, and four times the objective ratio produces the maximum
d1. 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 (
1,k,
2,k,
3,k and
4,k) are randomly taken for each vision parameter. Thus, the four values of each parameter (
xc,
yc,
η,
θ,
d1,
F1,
d2 and
F2) are determined as the first parents. Then, the second step computes Equations (14) and (15) to generate the current children. To do so, (
1,k and
2,k) are replaced in Equations (14) and (15) to compute (
w1,k,
w2,k,
w3,k and
w4,k) by employing
l = 0,
l = 1 and
q = 0. Moreover, (
3,k) are replaced in Equations (14) and (15) to compute (
w5,k,
w6,k,
w7,k and
w8,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
These equations are computed by employing the known data (
zi,j –
zi,m) and (
yi,j −
yi,1), but the fitness is calculated by the expression
Obj = (
Ob1 +
Ob2)/2. Then, the fourth step generates the (
k + 1)-generation population. Thus,
1,k+1 is chosen from (
1,k and
2,k), and
3,k+1 is chosen from (
3,k,
4,k). In the same way,
2,k+1 is chosen from (
w1,k,
w2,k,
w3,k and
w4,k) and
4,k+1 is chosen from (
w5,k,
w6,k,
w7,k and
w8,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
z0,j =
η(
x0,j −
xc)
F1 F2/(
F1 −
d1)(
f2 −
F2)
sinθ computes the length between zero and the point
O. On the other hand, the laser line position (
xi,j,
yi,j) is determined from the maximum intensity in
x-direction. In this way, the coordinate
xi,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
For these equations, xi,j represents the line pixel position in x-axis, Ii,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, xi,j and Ii,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 xi,j = x(u) in x-direction. The coordinate yi,j is taken from the number of rows in y-direction. Moreover, the laser line edges yi,0 and yi,m are computed through the first derivative in y-direction. Thus, Equation (17) computes the object height zi,j by means of xi,j, and Equation (18) computes the surface width yi,j by employing yi,j. Thus, zi,j and yi,j have been computed through the laser line image which is provided by the camera. However, the slider device provides the surface length xi,j. Thus, the microscale contouring has been computed.
In the microscope system, the radial distortion is deduced via line coordinate
xi,j. The coordinate
xi,j is calculated via Equations (21) and (22), and
yi,j is obtained through the row number. In this way, the distortion is calculated from the expressions
xi,j =
xi,j +
δxi and
yi,j =
yi,j +
δyj. Thus, the distortion is represented by (
δxi,
δyj), and (
xi,j,
yi,j) represent the distorted coordinates. Additionally, a line shifting is given by the expression
si,j = (
x1,j +
δx1) − (
xi,j +
δxi), but a distorted line shifting is represented by
Si,j =
x1,j −
xi,j. From these expressions,
δxi = (
x1,j −
xi,j) −
si,j +
δx1 =
Si,j −
si,j +
δx1 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
xc where
δx1 = 0 and
s1,j =
S1,j. In this way, the line shifting
si,j is calculated through the first shifting by the expression
S1,j by
si,j =
i ×
S1,j. Thus, the distortion in
x-direction is determined by the expression
δxi = (
x1,j −
xi,j) −
i ×
S1,j. In the same way, the distortion in direction of
y-axis is deduced through the expressions (
yi,1 −
yi,j) = (
yi,1 +
δy1) − (
yi,j +
δyj) and
Ti,j = (
yi,1 −
yi,j). From these expressions,
δyj = (
yi,1 −
yi,j) −
j ×
Ti,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
The microscale convex, concave and flat surface recognition is computed by means of the microscope setup given in
Figure 4a. The surface recognition is performed on concave, convex and flat metallic iron. In this way, the first shape recognition at the microscale is carried out for the convex iron surface which is illustrated in
Figure 5a, where the scale in the
x-axis is indicated in mm.
Figure 5b shows a laser line projected on the iron surface. In this way, surface recognition is performed through the surface contour which is recovered via the microbe vision system. To retrieve the surface contour, the iron topography is scanned by the laser line in the
x-direction. In this procedure, the camera aquires the line reflection to calculate the coordinates (
xi,j and
yi,j) by the means of Equations (21) and (22). Then, Equation (17) computes the surface high
zi,j through the
xi,j, and Equation (18) computes the surface width
yi,j through the
yi,j. Additionally, the slider device provides the coordinate
xi,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
where
hi,j is given by the contact procedure,
zi,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%.
Then, a Bezier model is built via a genetic algorithm by employing the topography data shown in
Figure 5c as described in
Section 2.3. To do so, the first step determines the search space and the first parents of each weight. Thus, the search space is established in the interval [0.3, 1.7] for each weight. From the search space, four parents are randomly chosen for the weights of the functions
Ss,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
Pi,j =
zi,jwi,j in Equation (11) to compute the fitness via Equation (16). Then, the fourth selects the (
k + 1)-parents, where
1,k+1 and
3,k+1 are selected from (
1,k,
2,k) and (
3,k,
4,k), respectively. Moreover,
2,k+1 and
4,k+1 are collected from (
w1,k,
w2,k,
w3,k and
w4,k) and (
w5,k,
w6,k,
w7,k and
w8,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
Pi,j =
zi,jwi,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
zi,j is determined via Equation (17),
hi,j is computed via
Ss,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
xi,0 and
xi,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.
The second surface recognition is carried out for the metallic iron topography shown in
Figure 6a. However,
Figure 6b illustrates the laser line projected on the iron topography. In this way, the iron topography is scanned in the
x-direction. During the scanning, the coordinates (
xi,j and
yi,j) are computed via Equations (21) and (22). Then, Equation (17) computes
zi,j by employing
xi,j, and Equation (18) computes
yi,j by the means of
yi,j. However, the slider device provides
xi,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
zi,j is the topography contour computed by Equation (17) and
hi,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
Pi,j =
zi,jwi,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
Pi,j =
zi,jwi,j to determine the fitness. Then, the fourth step selects the (
k + 1)-generation parents via fitness.,
1,k+1,
3,k+1,
2,k+1, and
4,k+1 are collected from (
1,k,
2,k), (
3,k,
4,k), (
w1,k,
w2,k,
w3,k,
w4,k) and (
w5,k,
w6,k,
w7,k,
w8,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.
Then, the second step computes the children of the (
k + 1)-generation via Equations (14) and (15). The procedure to compute the (
k + 1)-generation population is repeated to minimize the objective function Equation (16) where 203 iterations were performed to obtain the optimal weights. Thus, the optimal control points
Pi,j =
zi,jwi,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
zi,j is the computed by Equation (17), and
hi,j is the Bezier surface
Ss,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.
The third iron surface recognition at microscale is computed for the concave topography shown in
Figure 7a. However,
Figure 7b shows the microlaser line projected on the iron object. To perform the recognition, the object topography is retrieved via laser line scanning in the
x-direction. From the scanning, the coordinates (
xi,j and
yi,j) are computed by Equations (21) and (22). Then, Equation (17) computes
zi,j through the position
xi,j, and Equation (18) computes
yi,j through the position
yi,j. However, the slider device provides the coordinate
xi,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
hi,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
Pi,j =
zi,jwi,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
wi,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
Pi,j =
zi,jwi,j. Then, the fourth step selects (
1,k+1,
3,k+1,
2,k+1 and
4,k+1) from (
1,k and
2,k), (
3,k and
4,k), (
w1,k,
w2,k,
w3,k and
w4,k) and (
w5,k,
w6,k,
w7,k and
w8,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
Pi,j =
zi,jwi,j to obtain the surface shown in
Figure 7d. The relative error of this Bezier surface is computed via Equation (23), where
zi,j is determined by Equation (17) and
hi,j is the Bezier surface
Ss,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.
Additionally, the surface recognition at microscale is computed on materials, such as plastic and paper. Thus, surface recognition is computed for the plastic topography shown in
Figure 8a. To do so, the plastic surface is retrieved is scaned in
x-axis, where the coordinates (
xi,j,
yi,j) are computed by Equations (21) and (22). Then, Equation (17) computes surface height
zi,j, Equation (18) computes the coordinate
yi,j, but the slider device provides surface width
xi,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
zi,j by computing the control points
Pi,j =
zi,jwi,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
wi,j.
The second step computes Equations (14) and (15) to determine the first children. The third step computes the fitness Equation (16) via control points
Pi,j =
zi,jwi,j. Then, the fourth step selects (
1,k+1,
3,k+1,
2,k+1 and
4,k+1) from (
1,k and
2,k), (
3,k and
4,k), (
w1,k,
w2,k,
w3,k and
w4,k) and (
w5,k,
w6,k,
w7,k and
w8,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
Pi,j =
zi,jwi,j to obtain the surface shown in
Figure 8b. The relative error of this Bezier surface is computed through Equation (23), where
zi,j is computed via Equation (17) and
hi,j is the Bezier surface
Ss,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
xi,0 and
xi,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.
In the same way, the microscale surface recognition is computed for the paper surface given in
Figure 8c. This procedure is carried out by scanning the paper topography in the
x-direction to compute the coordinates (
xi,j,
yi,j) through Equations (21) and (22). Then, (
zi,j,
yi,j) are computed via Equations (17) and (18), but
xi,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
zi,j by computing the control points
Pi,j =
zi,jwi,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
wi,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 (
1,k+1,
3,k+1,
2,k+1 and
4,k+1) from (
1,k and
2,k), (
3,k and
4,k), (
w1,k,
w2,k,
w3,k and
w4,k) and (
w5,k,
w6,k,
w7,k and
w8,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
Pi,j =
zi,jwi,j to obtain the surface topography shown in
Figure 8d. The relative error of this topography is computed via Equation (23), where
zi,j is computed via Equation (17) and
hi,j is the Bezier surface
Ss,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.
To elucidate the validity of the proposed microscale surface recognition, the advantages over the optical microscope imaging systems are described as follows. Firstly, the Hu moments pattern and microlaser provide a recognition accuracy of a relative error of 0.674% for microscale concave, convex and flat surface recognition, where the recognition accuracy is computed via a relative error in Equation (23). In this case, Equation (23) is computed by employing the Hu moments provided on the surface contoured via microlaser line projection and Hu moments provided by the surface contoured through a contact method. This recognition accuracy represents an advantage over the optical microscope imaging systems which provide a relative error of over 2%. Secondly, the Hu moments pattern and microlaser line provide good robustness for characterizing microscale concave, convex and flat surface patterns. In this matter, a flat surface contoured via microlaser line produces always the same Hu moments pattern. Therefore, the microscale flat surface is always recognized with a small relative error of 0.527%. In the same way, the Hu moments pattern always provides the same pattern for a concave and convex surface. However, the laser line position in the
x-direction determines if the topography is concave or convex. In this way, the microscopic convex and concave surface are always recognized with a small relative error of 0.674%. This robustness is not provided by optical microscope systems based on image processing. It is because the Hu moments pattern varies with the image intensity variation. In this way, the robustness characterizing represents an advantage over the optical microscope imaging systems. Thirdly, the contouring based on a microscopic laser line provides the real surface shape at microscale. This contouring accuracy is achieved because the microlaser line reflects the real object contour on the camera image plane. Instead, the optical microscope imaging systems do not depict the topography contour accurately and the surface recognition is not so accurate. Therefore, surface contouring represents an advantage over the optical microscope systems which determine topographic data by means of gray-level image processing. Fourthly, the simple method for surface recognition provides a very easy form to perform the surface recognition, where the recognition procedure is performed by computing Hu moments for Equations (4)–(10) from a Bezier surface which is computed from surface data contoured via laser line scanning. Instead, the image processing of an optical microscope requires complicated procedures and great quantity of sampled images to perform the training procedures. Therefore, the recognition structure based on the Hu moments pattern and the microlaser line provides a suitable structure algorithm for surface recognition at the microscale. Based on these criteria, the concave, convex and flat surface recognition at the microscale has been achieved in a good manner. A discussion of the viability of the proposed surface recognition is explained in
Section 4.