# A New Face Recognition Method for Intelligent Security
## 4 3D Human Face Recognition Method
### Improved Layered Elastic Matching Method
#### 4.2.1 Establish a Shape Tree  
We use open and ordered curves; A represents a curve consisting of a series of sampling points (\(a_{1}\), \(a_{2}\),..., \(a_{n}\)), and point \(a_{i}\) on A is chosen as the midpoint, generally taking \(i=[(1+n)/2]\). \(L(a_{i}|a_{1}\), \(a_{n})\) is used to indicate the position of \(a_{i}\) relative to \(a_{i}\) and \(a_{n}\). This is the Bookstein coordinate [25] of \(a_{i}\) relative to \(a_{1}\) and \(a_{n}\), that is, the coordinates obtained by mapping the first and last sampling points to a fixed position in a coordinate system. Due to the known position of the first and last sampling points, one Bookstein coordinate of an intermediate sampling point can well represent the relative positional relationship of the three points. First, mapping \(a_{1}\) to \((-0.5\), \(0)\) and \(a_{n}\) to \((0.5\), \(0)\), then the positions \(L(a_{i}|a_{1}\), \(a_{n})=(a^{(1)}\), \(a^{(2)})\) and \((a^{(1)}\), \(a^{(2)})\) of \(a_{i}\) relative to \(a_{1}\) and \(a_{n}\) are obtained by Equation (2):  
\[\left\{\begin{array}{c}a^{(1)}=\frac{[(a_{n}^{(1)}-a_{1}^{(1)})(a_{i}^{(1)}-a _{1}^{(1)})+(a_{n}^{(2)}-a_{1}^{(2)})(a_{i}^{(2)}-a_{1}^{(2)})]}{D_{12}^{2}}- \frac{1}{2},\\ a^{(2)}=\frac{[(a_{n}^{(1)}-a_{1}^{(1)})(a_{i}^{(2)}-a_{1}^{(2)})+(a_{n}^{(2)}- a_{1}^{(2)})(a_{i}^{(1)}-a_{1}^{(1)})]}{D_{12}^{2}},\end{array}\right. \tag{2}\]  
where \(D_{12}^{2}=\sqrt{\left(a_{n}^{(1)}-a_{1}^{(1)}\right)^{2}+\left(a_{n}^{(2)}-a_ {1}^{(2)}\right)^{2}}\) and \((a^{(1)},a^{(2)})\) are two-dimensional coordinates of \(a_{k}\) (\(k=1\), \(2\),..., \(n\)).  
The selected midpoint \(a_{i}\) divides the curve \(A\) into two parts: \(A_{1}=(a_{1}\),..., \(a_{i})\) and \(A_{2}=(a_{i}\),..., \(a_{n})\). The layered description of curve \(A\) is recursive (i.e., the layered description of curve A consists of the relative position of \(L(a_{i}|a_{1}\), \(a_{n})\) and a layered description of \(A_{1}\) and \(A_{2}\)). The layered description can be characterized by a binary tree, and the binary tree representation of the curve is referred to as a shape tree, as shown in Figure 9. The root node of the shape tree describes the position \(L(a_{i}|a_{1}\), \(a_{n})\) of the midpoint \(a_{i}\) in the curve \(A\) relative to \(a_{1}\) and \(a_{n}\), the left child node describes the position of the intermediate node \(a_{[(1+i)/2]}\) in \(A_{1}\) relative to \(a_{1}\) and \(a_{n}\), and the right child node describes the position of the intermediate node \(a_{[(i+n)/2]}\) in \(A_{1}\) relative to \(a_{1}\) and \(a_{n}\). For the subcurve \(C=(a_{p},\cdots,a_{q})\), where \(p\), \(q\) is the position of the first and last endpoints of the subcurve \(C\), the midpoint is selected as \(a_{k}\) (\(k=\lfloor(p+q)/2\rfloor\)), and the corresponding subnode is described as \(L(a_{k}|a_{p},a_{q})\). The layered description is sequentially performed until \(\lfloor(p+q)/2\rfloor=p\), and the shape tree is established.  
The subtree rooted at a node represents the shape tree of the subcurve. Each node on the shape tree records the relative position of the midpoint of the curve and the first and last sampling points. The bottom node of the shape tree represents the relative positions of three consecutive points on the curve, and these nodes contain local geometric information, such as the relative position of the midpoint and adjacent sampling points.  
Curve \(A\), with the first and last sampling points, can recursively reconstruct the curve according to the shape tree. Placing the initial points at any position is equivalent to performing a translation,  
Figure 8: Characteristic curve.  
rotation, and scale transformation on curve \(A\). Thus, the layered matching algorithm is invariant to translation, rotation, and scale transformation.