[ invention ]
The invention mainly aims to provide a face recognition method based on an ARM platform, which can improve the face recognition speed.
Another object of the present invention is to provide an ARM platform-based face recognition system that can improve the face recognition speed.
In order to achieve the above main purpose, the face recognition method based on the ARM platform provided by the invention comprises the steps of obtaining an original image picture acquired by image acquisition equipment, wherein the original image picture comprises a target face object to be detected; performing reduced size adjustment on the original image picture to obtain a first face image area; the first face image area is amplified and adjusted in two times to obtain a position coordinate area; and carrying out face detection on a position coordinate area containing the target face object, extracting the face characteristics of the target face object from the position coordinate area, and executing face recognition operation by utilizing the face characteristics.
The original image picture is processed by bilinear interpolation algorithm to obtain the reduced image to be detected, the size of which is 0.5 times of that of the original image picture.
In a further scheme, the MTCNN model is utilized to perform face detection on an original image frame with a reduced size, and the first face image area corresponding to the target face object is determined so as to perform detection screening once.
In a further scheme, a bilinear interpolation algorithm is adopted to amplify and adjust the resolution of the first face image area, so that 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 is obtained, the position coordinate area is amplified and adjusted in resolution, and the position of the position coordinate area after the secondary amplification, corresponding to the position of the position coordinate area on the original image picture, is used as a region range of secondary face detection.
In a further scheme, face detection is carried out on a position coordinate area containing a target face object to obtain a second face image area, an image of the second face area is intercepted, face characteristics of the target face object are extracted, and face recognition operation is carried out by utilizing the face characteristics.
Therefore, the face recognition method of the invention firstly reduces the image to be detected to the preset multiple size, carries out face detection on the reduced image to obtain the face frame, enlarges the face frame by the preset multiple size, then enlarges by a certain multiple, and takes the area corresponding to the enlarged original image as the secondary detection range. Then, the face detection is carried out on the detection range, a face frame after the face detection is obtained, a corresponding face is intercepted on an original image according to the face frame, and the face characteristics are extracted, so that the face detection speed is improved, the face detection precision is not reduced, the face detection process is improved, the whole recognition system is lighter, the precision is not lost, and the practicability is higher.
In order to achieve the other purpose, the invention also provides a face recognition system based on the ARM platform, which comprises an image acquisition module, a detection module and a detection module, wherein the image acquisition module is used for acquiring an original image picture acquired by image acquisition equipment, and the original image picture comprises a target face object to be detected; the first processing module is used for carrying out reduced size adjustment on the original image picture to obtain a first face image area; the second processing module is used for obtaining a position coordinate area after the first face image area is respectively amplified and adjusted for two times; and the facial feature recognition module is used for carrying out facial detection on a position coordinate area containing the target facial object, extracting the facial features of the target facial object from the position coordinate area and executing facial recognition operation by utilizing the facial features.
The original image picture is processed by bilinear interpolation algorithm to obtain the reduced image to be detected, the size of which is 0.5 times of that of the original image picture.
In a further scheme, the MTCNN model is utilized to perform face detection on an original image frame with a reduced size, and the first face image area corresponding to the target face object is determined so as to perform detection screening once.
In a further scheme, a bilinear interpolation algorithm is adopted to amplify and adjust the resolution of the first face image area, so that 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 is obtained, the position coordinate area is amplified and adjusted in resolution, and the position of the position coordinate area after the secondary amplification, corresponding to the position of the position coordinate area on the original image picture, is used as a region range of secondary face detection.
In a further scheme, face detection is carried out on a position coordinate area containing a target face object to obtain a second face image area, an image of the second face area is intercepted, face characteristics of the target face object are extracted, and face recognition operation is carried out by utilizing the face characteristics.
Therefore, the system provided by the invention is a high-precision face recognition system for embedded equipment, the system firstly reduces the image to be detected to a preset multiple size, face detection is carried out on the reduced image, after a face frame is obtained, the face frame is enlarged by a preset multiple size and then enlarged by a certain multiple, and the enlarged area corresponding to the original image is used as a secondary detection range. Then, the face detection is carried out on the detection range, a face frame after the face detection is obtained, a corresponding face is intercepted on an original image according to the face frame, and the face characteristics are extracted, so that the face detection speed is improved, the face detection precision is not reduced, the face detection process is improved, the whole recognition system is lighter, the precision is not lost, and the practicability is higher.
[ detailed description ] of the invention
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
An embodiment of a face recognition method based on an ARM platform comprises the following steps:
referring to fig. 1, in the face recognition method of the present embodiment, when detecting and recognizing the face of a user, step S1 is first performed to obtain an original image acquired by an image acquisition device. In the embodiment of the invention, the peripheral equipment can be a mobile phone, a camera, an access control system or other equipment with an image acquisition function.
Then, step S2 is performed to perform a reduced size adjustment on the original image frame, so as to obtain a first face image area. Specifically, an original image picture is processed by adopting a bilinear interpolation algorithm, and a to-be-detected reduced image with the size being 0.5 times of that of the original image picture is obtained.
After the reduced image to be detected is obtained, performing face detection on the original image picture with reduced size by using an MTCNN model, and determining a first face image area corresponding to the target face object so as to perform detection screening once.
Next, step S3 is performed to obtain a position coordinate area after performing two-time size enlargement adjustment on the first face image area. The method comprises the steps of amplifying and adjusting resolution of a first face image area by adopting a bilinear interpolation algorithm to obtain a position coordinate area which is 2 times of the first face image area in size and corresponds to a target face object in an original image picture, amplifying and adjusting resolution of the position coordinate area, and taking the position of the position coordinate area which is amplified secondarily as a region range of secondary face detection.
Then, step S4 is performed to perform face detection on the position coordinate area including the target face object.
Then, step S5 is performed to extract facial features of the target face object from the position coordinate area, and face recognition operation is performed using the facial features. 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 facial features of the target face object, and executing face recognition operation by utilizing the facial features.
In practical application, an original image01 containing a target face object to be detected is reduced to one half of the original size by adopting a bilinear interpolation algorithm. And carrying out 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 a corresponding position coordinate area in the original image. In the process of size enlargement adjustment, the face detection Box1 is enlarged by 2 times to obtain the coordinate position of the Box1 in the original image 01.
Then, the area is enlarged by 1.2-1.5 times and a small image03 is cut out, wherein the enlargement of 1.2-1.5 times is used for guaranteeing the integrity of the face when the area where the original image01 is cut out is returned.
Then, face detection is performed on the small image03 obtained in the above step, so as to obtain a second face image area as a face detection Box2, and an image04 of the face area is captured, facial features of the target face object are extracted, and face recognition operation is performed by using the facial features. Therefore, the above steps are to increase the speed of face detection by reducing the size of the picture.
Specifically, firstly, an input original image is subjected to reduced size adjustment, and then the reduced image is subjected to face detection, so that a detected face detection Box1 is obtained. As the size of the target face object to be detected becomes smaller, the detection speed becomes faster.
Then, performing face detection on the image with reduced size by adopting an MTCNN method to obtain a face detection Box1, and amplifying the detected face detection Box1 by 2 times to enable the detected face detection Box1 to correspond to the size of the original image, so as to obtain a position coordinate area corresponding to the original image 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 taken as the area range Patch1 for secondary detection. For example, for an image with a size of 1920×1080, a to-be-detected reduced image with a size of 960×540 is obtained by reducing the image to half, a face detection frame Box1 (x 1, y1, width, height) is detected, where x1 and y1 are the upper left corner coordinates of the face detection frame, the position of the face detection frame Box1 in the original image is (x 1-width/2, y1-height/2,2 x width,2 x height), and then the region is amplified by 1.5 times to be (x 1-width, y1-height,3 x width,3 x height), and the region is Patch1.
Then, the face detection is performed again on the image contained in the area range Patch1, and a more accurate face detection Box2 is obtained. Since Patch1 contains a very small image size, the detection speed of this portion is almost negligible.
Then, the face features are extracted according to the position of the face detection Box2 obtained through the second detection. Thus, the detection speed of the human face is improved, and the precision of the human face detection is not reduced.
An embodiment of a face recognition system based on an ARM platform:
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 performs image information acquisition operation through the image acquisition module, and the acquired and recognized information is stored in the database module; for the convenience of the user to manage the face database in the system, a database management function is developed by using the MySQL database in the system.
The image acquisition module 10 is configured to acquire an original image frame acquired by the image acquisition device, where the original image frame includes a target face object to be detected.
The first processing module 20 is configured to perform a downsizing adjustment on the original image frame to obtain a first face image area.
The second processing module 30 is configured to obtain a position coordinate area after performing two-time size magnification adjustment on the first face image area.
The face feature recognition module 40 is configured to perform face detection on a position coordinate area containing a target face object, extract facial features of the target face object from the position coordinate area, and perform face recognition operation using the facial features.
Further, the first processing module 20 is configured to perform a resizing on an original image frame, including: and processing the original image picture by adopting a bilinear interpolation algorithm to obtain a reduced image to be detected, the size of which is 0.5 times of that of the original image picture.
Further, the first processing module 20 is configured to obtain a first face image area, including: and carrying out face detection on the original image picture with the reduced size by using the MTCNN model, and determining a first face image area corresponding to the target face object so as to carry out detection screening once.
Further, the second processing module 30 is configured to obtain a position coordinate area after performing two-time size magnification adjustment on the first face image area, 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 position of the position coordinate area which is amplified secondarily on the original image picture as the area range of the secondary face detection.
Further, the face feature recognition module 40 is configured to perform face detection on a location coordinate area including 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 facial features of the target face object, and executing face recognition operation by utilizing the facial features.
Therefore, the system provided by the invention is a high-precision face recognition system for embedded equipment, the system firstly reduces the image to be detected to a preset multiple size, face detection is carried out on the reduced image, after a face frame is obtained, the face frame is enlarged by a preset multiple size and then enlarged by a certain multiple, and the enlarged area corresponding to the original image is used as a secondary detection range. Then, the face detection is carried out on the detection range, a face frame after the face detection is obtained, a corresponding face is intercepted on an original image according to the face frame, and the face characteristics are extracted, so that the face detection speed is improved, the face detection precision is not reduced, the face detection process is improved, the whole recognition system is lighter, the precision is not lost, and the practicability is higher.
It should be noted that the foregoing 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 to the present invention by using the concept fall within the scope of the present invention.