[ summary of the invention ]
The invention mainly aims to provide a face recognition method based on an ARM platform, which can improve the face recognition speed.
The invention also aims to provide a face recognition system based on the ARM platform, which can improve the face recognition speed.
In order to achieve the main purpose, the method for recognizing the face based on the ARM platform comprises the steps of obtaining an original image picture collected by image collection equipment, wherein the original image picture comprises a target face object to be detected; carrying out size reduction adjustment on the original image picture to obtain a first face image area; carrying out amplification adjustment on the size of the first face image area twice respectively to obtain a position coordinate area; the method comprises the steps of carrying out face detection on a position coordinate area containing a target face object, extracting face features of the target face object from the position coordinate area, and executing face recognition operation by using the face features.
The further scheme is that a bilinear interpolation algorithm is adopted to process the original image picture, and the to-be-detected reduced image with the size 0.5 times that of the original image picture is obtained.
Further, a MTCNN model is used to perform face detection on the original image frame after size reduction, and the first face image region corresponding to the target face object is determined for performing detection screening once.
A further scheme is that a bilinear interpolation algorithm is adopted to amplify and adjust the resolution of the first face image area to obtain a position coordinate area which is 2 times of the size of the first face image area and corresponds to a target face object in the original image picture, the position coordinate area is amplified and adjusted in resolution, and the position of the position coordinate area after secondary amplification on the original image picture is used as the area range of secondary face detection.
The method comprises the steps of carrying out face detection on a position coordinate area containing a target face object to obtain a second face image area, intercepting an image of the second face area, extracting the face feature of the target face object, and carrying out face recognition operation by using the face feature.
Therefore, the face recognition method reduces the size of the image to be detected to the preset multiple size, performs face detection on the reduced image to obtain the face frame, expands the face frame by the preset multiple size, then expands the face frame by a certain multiple, and takes the corresponding area on the original image after expansion as the secondary detection range. Then, the face detection is carried out on the detection range to obtain a face frame after the face detection for the second time, a corresponding face is intercepted on an original image according to the face frame, and face features are extracted, so that the detection speed of the face is improved, the precision of the face detection cannot be reduced, the flow of the face detection is improved, the whole recognition system is lighter and has no precision loss, and the practicability is higher.
In order to achieve another object, the present invention further provides a face recognition system based on an ARM platform, including an image acquisition module, configured to acquire an original image frame acquired by an image acquisition device, where the original image frame includes a target face object to be detected; the first processing module is used for carrying out size reduction adjustment on the original image picture to obtain a first face image area; the second processing module is used for respectively carrying out two times of size amplification adjustment on the first face image area to obtain a position coordinate area; the face feature recognition module is used for carrying out face detection on a position coordinate area containing a target face object, extracting the face feature of the target face object from the position coordinate area, and executing face recognition operation by using the face feature.
The further scheme is that a bilinear interpolation algorithm is adopted to process the original image picture, and the to-be-detected reduced image with the size 0.5 times that of the original image picture is obtained.
Further, a MTCNN model is used to perform face detection on the original image frame after size reduction, and the first face image region corresponding to the target face object is determined for performing detection screening once.
A further scheme is that a bilinear interpolation algorithm is adopted to amplify and adjust the resolution of the first face image area to obtain a position coordinate area which is 2 times of the size of the first face image area and corresponds to a target face object in the original image picture, the position coordinate area is amplified and adjusted in resolution, and the position of the position coordinate area after secondary amplification on the original image picture is used as the area range of secondary face detection.
The method comprises the steps of carrying out face detection on a position coordinate area containing a target face object to obtain a second face image area, intercepting an image of the second face area, extracting the face feature of the target face object, and carrying out face recognition operation by using the face feature.
Therefore, the system provided by the invention is a high-precision face recognition system capable of facing embedded equipment, the system firstly reduces the size of the image to be detected to a preset multiple size, performs face detection on the reduced image to obtain a face frame, then expands the face frame by a certain multiple after expanding the size of the preset multiple, and takes the corresponding area on the original image after expansion as a secondary detection range. Then, the face detection is carried out on the detection range to obtain a face frame after the face detection for the second time, a corresponding face is intercepted on an original image according to the face frame, and face features are extracted, so that the detection speed of the face is improved, the precision of the face detection cannot be reduced, the flow of the face detection is improved, the whole recognition system is lighter and has no precision loss, and the practicability is higher.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
An embodiment of a face recognition method based on an ARM platform comprises the following steps:
referring to fig. 1, when detecting and recognizing the face of the user, the face recognition method of the present embodiment first executes step S1 to obtain an original image picture collected by the image collection device. In the embodiment of the present invention, the peripheral device may be a mobile phone, a camera, an access control system, or other devices with an image capturing function.
Then, step S2 is executed to perform a reduction and size adjustment on the original image screen, and a first face image area is obtained. Specifically, a bilinear interpolation algorithm is adopted to process the original image picture, so as to obtain the to-be-detected reduced image with the size 0.5 times that of the original image picture.
After the reduced image to be detected is obtained, face detection is performed on the original image picture with the reduced size by using the MTCNN model, and a first face image area corresponding to the target face object is determined so as to perform detection screening once.
Next, step S3 is executed to perform enlargement adjustment twice on the first face image area, and then obtain a position coordinate area. The method comprises the steps of adopting a bilinear interpolation algorithm to amplify and adjust the resolution of a first face image area to obtain a position coordinate area which is 2 times of the size of the first face image area and corresponds to a target face object in an original image picture, then amplifying and adjusting the resolution of the position coordinate area, and taking the position of the position coordinate area after secondary amplification on the original image picture as the area range of secondary face detection.
Then, step S4 is executed to perform face detection on the position coordinate region including the target face object.
Then, step S5 is executed to extract the facial features of the target facial object from the position coordinate region, and a face recognition operation is performed using the facial features. The face detection is carried out on the position coordinate area containing the target face object to obtain a second face image area, the image of the second face area is intercepted, the face feature of the target face object is extracted, and the face recognition operation is executed by utilizing the face feature.
In practical applications, the original image picture image01 containing the target facial object to be detected is reduced to one-half of the original size by using a bilinear interpolation algorithm. And performing face detection on the image with the reduced size by adopting an MTCNN method to obtain a face detection frame Box1, namely a first face image area.
Then, the face detection Box1 is enlarged by 2 times to obtain the corresponding position coordinate area in the original image. In the process of the resizing, the face detection frame Box1 is enlarged by 2 times in order to obtain the coordinate position of Box1 in the original image picture image 01.
And then, expanding the area by 1.2-1.5 times and cutting out a small image03, wherein the expansion by 1.2-1.5 times is used for ensuring the integrity of the human face when returning to the area where the human face is cut out by the image01 of the original image picture.
Then, face detection is performed on the thumbnail image03 obtained in the above step to obtain a face detection frame Box2, that is, a second face image region, and the image04 of the face region is extracted to extract the facial features of the target face object, and a face recognition operation is performed using the facial features. Therefore, the above steps are actually to reduce the size of the picture to improve the speed of face detection.
Specifically, first, the input original image is reduced and resized, and then the reduced image is subjected to face detection, so that a detected face detection Box1 is obtained. Since the size of the target face object to be detected becomes small, the detection speed becomes fast.
Then, face detection is performed on the image with the reduced size by using the MTCNN method to obtain a face detection frame Box1, and the detected face detection frame Box1 is enlarged by 2 times to correspond to the size of the original image to obtain a corresponding position coordinate area in the original image.
Then, the area is enlarged by 1.2 to 1.5 times, and the corresponding position on the original image is set as the area range Patch1 of the secondary detection. For example, for an image with size 1920 × 1080, the image to be detected is reduced to half to obtain a reduced image with size 960 × 540, a face detection frame Box1(x1, y1, width, height) is detected, wherein x1 and y1 are coordinates of the upper left corner of the face detection frame, the position of the face detection frame Box1 corresponding to the original image is (x1-width/2, y1-height/2, 2 width, 2 height), and the magnification is 1.5 times (x1-width, y1-height, 3 width, 3 height), and the range of the region is Patch 1.
Then, the face detection is performed again on the image included in the region range Patch1, resulting in a more accurate face detection frame Box 2. Since the size of the image contained in Patch1 is small, the detection speed of this portion is almost negligible.
Then, the face features are extracted according to the position of the face detection Box Box2 obtained by the second detection. Therefore, the detection speed of the human face is improved, and the precision of the human face detection cannot be reduced.
An embodiment of a face recognition system based on an ARM platform comprises:
as shown in fig. 2, fig. 2 is a schematic block diagram of an embodiment of a face recognition system based on an ARM platform according to the present invention. The system comprises an image acquisition module 10, a first processing module 20, a second processing module 30 and a face feature recognition module 40. The face recognition system further comprises a hardware platform, a database module and a video display module.
The hardware platform can be an upper computer and an ARM development board, the upper computer is used for transplanting a driving program and a preset face recognition program to the ARM development board, and the ARM development board is used for running the face recognition program and displaying a recognition result on a display. The face recognition system carries out image information acquisition operation through an image acquisition module, and the acquired and recognized information is stored in a database module; the system utilizes the MySQL database to develop a database management function for the convenience of managing the face database in the system for users.
The image acquisition module 10 is configured to acquire an original image picture acquired by an image acquisition device, where the original image picture includes a target face object to be detected.
The first processing module 20 is configured to perform downsizing adjustment on the original image frame to obtain a first face image region.
The second processing module 30 is configured to perform two-time size enlargement adjustment on the first face image region, respectively, to obtain a position coordinate region.
The face feature recognition module 40 is configured to perform face detection on a position coordinate region containing a target face object, extract a face feature of the target face object from the position coordinate region, and perform a face recognition operation using the face feature.
Further, the first processing module 20 is configured to perform downsizing adjustment on the original image picture, and includes: and processing the original image picture by adopting a bilinear interpolation algorithm to obtain the to-be-detected reduced image with the size 0.5 times that of the original image picture.
Further, the first processing module 20 is configured to obtain a first face image region, and includes: and performing face detection on the original image picture after the size reduction by using the MTCNN model, and determining a first face image area corresponding to the target face object so as to perform detection screening once.
Further, the second processing module 30 is configured to perform two times of size enlargement adjustment on the first face image region to obtain a position coordinate region, and specifically includes: and amplifying and adjusting the resolution of the first face image area by adopting a bilinear interpolation algorithm to obtain a position coordinate area which is 2 times of the size of the first face image area and corresponds to the target face object in the original image picture, amplifying and adjusting the resolution of the position coordinate area, and taking the corresponding position of the position coordinate area after secondary amplification on the original image picture as the area range of secondary face detection.
Further, the face feature recognition module 40 is configured to perform face detection on a position coordinate area containing the target face object, and specifically includes: and carrying out face detection on the position coordinate area containing the target face object to obtain a second face image area, intercepting the image of the second face area, extracting the face characteristics of the target face object, and executing face recognition operation by using the face characteristics.
Therefore, the system provided by the invention is a high-precision face recognition system capable of facing embedded equipment, the system firstly reduces the size of the image to be detected to a preset multiple size, performs face detection on the reduced image to obtain a face frame, then expands the face frame by a certain multiple after expanding the size of the preset multiple, and takes the corresponding area on the original image after expansion as a secondary detection range. Then, the face detection is carried out on the detection range to obtain a face frame after the face detection for the second time, a corresponding face is intercepted on an original image according to the face frame, and face features are extracted, so that the detection speed of the face is improved, the precision of the face detection cannot be reduced, the flow of the face detection is improved, the whole recognition system is lighter and has no precision loss, and the practicability is higher.
It should be noted that the above is only a preferred embodiment of the present invention, but the design concept of the present invention is not limited thereto, and any insubstantial modifications made by using the design concept also fall within the protection scope of the present invention.