Face recognition method, device, electronic device and computer-readable storage medium
The face recognition method enhances the base map library by adding face images based on feature extraction and quality assessment, addressing inefficiencies in existing systems and improving recognition accuracy and speed.
Patent Information
- Application Number
- CN201910045298.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-01-17
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2039-01-17
AI Technical Summary
Existing face recognition systems are affected by changes in time, seasons, and people's appearance, leading to inefficiencies and reduced speed in base map-based recognition.
A face recognition method that enriches the base map library by adding face images based on a preset update strategy, utilizing image feature extraction, scene identification, similarity determination, and quality assessment to enhance the base map library's richness and accuracy.
The method improves the accuracy and efficiency of face recognition by increasing the number of base maps, ensuring a diverse and high-quality image basis for subsequent recognitions.
Smart Images

Figure CN109871767B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a face recognition method, device, electronic equipment and computer-readable storage medium. Background Art
[0002] The basic principle of the current face recognition system in the industry is to compare the captured photos on site with the saved base map to obtain the similarity. Therefore, the requirements and reliance on the base map are particularly important. Figure 1 It is generally fixed. Changes in time, seasons, and people's appearance will affect the efficiency and speed of base map-based face recognition. Summary of the invention
[0003] In view of the above, it is necessary to propose a face recognition method, device, electronic device and computer-readable storage medium to enrich the image basis of the base map library and improve the efficiency of face recognition.
[0004] A first aspect of the present application provides a face recognition method, the method comprising:
[0005] The acquisition operation acquires the face image;
[0006] Recognize the acquired face image based on a base image library, wherein the base image library stores a target face image to be compared with the acquired face image;
[0007] Determine whether the base image library contains a target face image that matches the acquired face image according to the recognition result; and
[0008] When it is determined that there is a target face image matching the acquired face image in the base map library, the acquired face image is added to the base map library according to a preset base map update strategy to update the base map library for next face recognition.
[0009] Preferably, the step of identifying the acquired facial image based on the base image library includes:
[0010] Extracting image features from the face image;
[0011] Detecting whether the face image contains a face region based on image features in the face image to obtain a first result, and calibrating facial feature regions of the face image based on the image features in the face image to obtain a second result, wherein the first result is used to indicate whether the face image contains a face region, and the second result is used to calibrate facial feature regions in the face image; and
[0012] The first result and the second result are integrated and it is determined whether the face image matches the image in the base image library according to the integrated result to obtain a recognition result of the face image.
[0013] Preferably, when it is determined that there is a target face image matching the acquired face image in the base map library, adding the acquired face image to the base map library according to a preset base map update strategy to update the base map library comprises:
[0014] Identify scenes in images of faces for face recognition;
[0015] Determine whether the scene of the face image is included in the target face image in the base image library; and
[0016] When the scene of the face image to be recognized is not included in the target face image in the base image library, the face image is updated to the base image library.
[0017] Preferably, the identifying of scenes in a face image for face recognition includes:
[0018] Extract GIST feature values, LBP feature values and HSV feature values of face images for face recognition respectively;
[0019] Normalizing the GIST eigenvalue, LBP eigenvalue and HSV eigenvalue respectively;
[0020] The normalized GIST eigenvalue, LBP eigenvalue and HSV eigenvalue are fused to obtain a fused eigenvalue; and
[0021] The fused feature value is brought into the SVM classifier so that the SVM classifier recognizes the fused feature and outputs the category of the scene.
[0022] Preferably, when it is determined that there is a target face image matching the acquired face image in the base map library, adding the acquired face image to the base map library according to a preset base map update strategy to update the base map library comprises:
[0023] Determining whether the face image to be recognized is similar to the target face image in the base image library; and
[0024] When the face image is similar to the target face image in the base image library, the face image is updated in the base image library.
[0025] Preferably, the determining whether the face image to be recognized is similar to the target face image in the base image library comprises:
[0026] The HSV-based image similarity recognition method determines whether the face image to be recognized is similar to the target face image in the base image library.
[0027] Preferably, when it is determined that there is a target face image matching the acquired face image in the base map library, adding the acquired face image to the base map library according to a preset base map update strategy to update the base map library comprises:
[0028] Determining whether the quality of the face image to be subjected to face recognition reaches a predetermined standard and exceeds the quality of at least one target face image in the base image library; and
[0029] When the quality of the face image reaches a predetermined standard and exceeds the quality of at least one target face image in the base image library, the face image is updated to the base image library and replaces the target face image with the worst quality in the base image library.
[0030] A second aspect of the present application provides a face recognition device, the device comprising:
[0031] An acquisition module, used for acquiring a face image;
[0032] A recognition module, used for recognizing the acquired face image based on a base image library, wherein the base image library stores a target face image to be compared with the acquired face image;
[0033] A judgment module, used for judging whether there is a target face image matching the acquired face image in the base image library according to the recognition result; and
[0034] The updating module is used to add the acquired face image to the base map library and update the base map library according to a preset base map updating strategy when it is determined that there is a target face image matching the acquired face image in the base map library, so as to be used for the next face recognition.
[0035] A third aspect of the present application provides an electronic device, the electronic device comprising a processor, the processor being configured to implement the face recognition method when executing a computer program stored in a memory.
[0036] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the face recognition method when executed by a processor.
[0037] The present invention adds the face images for face recognition to the base map library to supplement the base map library. In this way, the number of base maps of users in the base map library is increased, providing a rich base map library foundation for subsequent face recognition, which is conducive to improving the accuracy of face recognition based on the base map library. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 FIG. 4 is a diagram showing an application environment of a face recognition method in one embodiment of the present invention.
[0039] Figure 2 4 is a flow chart of a face recognition method in one embodiment of the present invention.
[0040] Figure 3 It is a structural diagram of a face recognition device in one embodiment of the present invention.
[0041] Figure 4 It is a schematic diagram of the electronic device of the present invention. DETAILED DESCRIPTION
[0042] All user data collected by this application (such as user facial images, user features, etc.) are legally collected with the user's consent, and the application and use of the user data are legal.
[0043] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0046] Preferably, the face recognition method of the present invention is applied in one or more electronic devices. The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.
[0047] The electronic device may be a computing device such as a desktop computer, a laptop computer, a tablet computer, a cloud server, etc. The device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0048] Example 1
[0049] Figure 1 Schematic diagram of the application environment of the face recognition method in one embodiment of the present invention.
[0050] See also Figure 1 As shown, the face recognition method is applied to an electronic device 1. The electronic device 1 is connected to an electronic device 2 via a network 3. For example, in a specific embodiment, the network used to support the communication between the electronic device 1 and the electronic device 2 may be a wired network or a wireless network, such as radio, wireless fidelity (WIFI), cellular, satellite, broadcast, etc. In this embodiment, the electronic device 1 and the electronic device 2 may be, but are not limited to, a server, a server cluster, a computer device, a mobile phone, a tablet computer, and the like.
[0051] Figure 2 1 is a flow chart of a face recognition method in one embodiment of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.
[0052] See also Figure 2 As shown, the face recognition method specifically includes the following steps:
[0053] Step S201, obtaining a face image.
[0054] In this embodiment, the electronic device 1 includes an image acquisition unit, and the image acquisition unit is used to acquire facial images. For example, in one implementation, the image acquisition unit can be a 2D camera, and the electronic device 1 acquires the facial image of the user through the 2D camera. In another embodiment, the electronic device 1 can acquire the facial image of the user from its internal storage device. In other embodiments, the electronic device 1 can acquire the facial image from an electronic device 2 that is communicatively connected thereto. In this embodiment, the acquired facial image can be a facial picture, a facial video, etc.
[0055] Step S202: recognizing the acquired facial image based on a base image library, wherein the base image library stores a target facial image to be compared with the acquired facial image.
[0056] In this embodiment, the acquired face image can be matched with the target face image in the base image library to identify the acquired face image. In this embodiment, the electronic device 1 extracts the image features of the acquired face image and obtains the recognition result of the face image and the target face image in the base image library according to the image features.
[0057] Specifically, the electronic device 1 recognizes the acquired facial image based on the base map library, including: extracting image features in the facial image; detecting whether the facial image contains a facial area based on the image features in the facial image to obtain a first result, and calibrating the facial features area of the facial image based on the image features in the facial image to obtain a second result, wherein the first result is used to indicate whether the facial image contains a facial area, and the second result is used to calibrate the facial features area in the facial image; and integrating the first result with the second result and judging whether the facial image matches the image in the base map library based on the integrated result to obtain a recognition result of the facial image.
[0058] In this embodiment, the electronic device 1 can perform an image feature extraction on a face image that needs to be recognized, and perform face recognition and facial features calibration respectively according to the extracted image features of the face image. Among them, a first result is obtained by detecting whether the face image contains a face area; while detecting whether the face image contains a face area, a second result is obtained by calibrating the facial features area in the face image, and the first result and the second result are integrated, and it is determined whether the face image matches the image in the base map library according to the integrated result, so as to obtain the recognition result of the face image. By performing an image feature extraction on a face image to perform face recognition and facial features calibration, there is no need to perform multiple image feature extraction on the face image, which can speed up the speed of face recognition and facial features calibration on the face image, and solve the technical problem of slow face recognition in the prior art.
[0059] It should be understood that the present case is not limited by the specific face recognition method adopted. Whether it is an existing face recognition method or a face recognition method to be developed in the future, it can be applied to the face recognition method of the present case and should also be included in the protection scope of the present invention.
[0060] Step S203, judging whether the base image library contains a target face image that matches the acquired face image according to the recognition result.
[0061] Wherein, when it is determined that there is a target facial image matching the acquired facial image in the base map library, step S204 is executed; when it is not determined that there is a target facial image matching the acquired facial image in the base map library, step S202 is executed.
[0062] Step S204: adding the face image to the base map library for updating according to a preset base map update strategy, so as to be used for next face recognition.
[0063] In this implementation, the face image for face recognition is added to the base map library to supplement the base map library. In this way, the number of base maps of users in the base map library is increased, providing a rich base map library foundation for subsequent face recognition, which is conducive to improving the accuracy of face recognition based on the base map library.
[0064] In this embodiment, the preset base map update strategy is to update the target face image in the base map library according to the different scenes of the face image. Specifically, the adding of the face image to the base map library for updating according to the preset base map update strategy includes: identifying the scene in the face image for face recognition; judging whether the scene of the face image is included in the target face image in the base map library; and updating the face image to the base map library when the scene of the face image for face recognition is not included in the target face image in the base map library.
[0065] In this embodiment, if it is determined that the scene of the face image to be recognized is not included in the image in the base map library, the face image is updated to the base map library. In this way, the base map library contains pictures of various scenes of the user, which is conducive to enriching the image basis of the base map library and improving the accuracy of face recognition.
[0066] In a specific embodiment, the identifying of scenes in a face image for face recognition includes: respectively extracting GIST feature values, LBP feature values and HSV feature values of the face image for face recognition; respectively normalizing the GIST feature values, LBP feature values and HSV feature values; respectively fusing the normalized GIST feature values, LBP feature values and HSV feature values to obtain fused feature values; and bringing the fused feature values into a classifier so that the classifier recognizes the fused features and outputs the category of the scene, wherein the classifier is a SVM classifier.
[0067] In this embodiment, the method for extracting the GIST feature value of the face image includes the following steps:
[0068] Select GABOR kernels of 5 scales and 8 directions; convolve the face image with the 40 GABOR kernels in sequence to obtain 40 processed images; divide each processed image into b×b small blocks, and calculate the grayscale mean of each small block to obtain 40×b×b grayscale means, and the vector composed of 40×b×b grayscale means is the 40×b×b dimensional GIST feature value, where the value of b is 3 or 4.
[0069] In this embodiment, the method for extracting LBP feature values of a face image includes the following steps: setting a calculation window of 3 pixels × 3 pixels; adding the calculation window to the image, comparing whether the pixel values of the surrounding points of the calculation window are greater than the pixel value of the center point, if greater, setting the pixel values of the surrounding points to 1, otherwise setting them to 0, arranging the pixel values of the 8 surrounding points in sequence to obtain an 8-bit unsigned binary number, and using this unsigned binary number as the new pixel value of the center point; traversing the entire image using the calculation window to obtain a new pixel value of each non-edge pixel in the image, and setting the new pixel value of each edge pixel to a certain value, that is, obtaining an image processed by LBP; dividing the image processed by LBP into c×c small blocks, and calculating the grayscale histogram of each small block respectively, the grayscale in the grayscale histogram is represented by 64 levels, and the number of pixels distributed on 64 grayscales in each small block is obtained; and arranging the number of pixels distributed on 64 grayscales of c×c small blocks in sequence to finally obtain a c×c×64-dimensional LBP feature value, where the value is 2 or 3.
[0070] In this embodiment, the method for extracting the HSV feature value of a face image includes the following steps: calculating the H, S, and V values of each pixel in the face image according to the R, G, and B values of the pixel; dividing the image into e×e small blocks, and calculating the color histogram of each small block respectively, wherein the colors in the color histogram are represented by 90 levels, and the number of pixels distributed on 90 color levels in each small block is obtained; the number of pixels distributed on 90 gray levels of the e×e small blocks is arranged in sequence to finally obtain an HSV feature value of e×e×90 dimensions, where the value of e is 2 or 3.
[0071] In this embodiment, the preset base map update strategy is to update the image in the base map library according to the similarity of the face image. The step of adding the face image to the base map library for updating according to the preset base map update strategy includes:
[0072] (S2041) Determine whether the face image to be recognized is similar to an image in the base image library.
[0073] In this implementation, it is possible to determine whether the face image to be recognized is similar to the target face image in the base image library by using the HSV image similarity recognition method.
[0074] (S2042) When the face image is similar to the target face image in the base image library, the face image is updated to the base image library.
[0075] In this embodiment, when it is determined that the facial image is similar to the image in the base map library, the facial image is updated to the base map library, so that the base map library contains similar pictures of the user, which is conducive to enriching the image base of the base map library and improving the accuracy of facial recognition.
[0076] In this embodiment, the preset base map update strategy is to update the images in the base map library according to the quality of the face image. The adding of the face image to the base map library for updating according to the preset base map update strategy includes: judging whether the quality of the face image for face recognition reaches a predetermined standard and exceeds the quality of at least one target face image in the base map library; and when the quality of the face image reaches a predetermined standard and exceeds the quality of at least one target face image in the base map library, updating the face image to the base map library and replacing the target face image with the worst quality in the base map library.
[0077] In this embodiment, when the quality of the facial image reaches a predetermined standard and exceeds the quality of at least one image in the base map library, the facial image is updated to the base map library and replaces the worst quality base map of the user. In this way, the base map library contains pictures of users with higher quality, which is conducive to enriching the image base of the base map library and improving the accuracy of facial recognition.
[0078] Example 2
[0079] Figure 3 FIG. 4 is a structural diagram of a face recognition device 40 according to an embodiment of the present invention.
[0080] In some embodiments, the face recognition device 40 runs in an electronic device. The face recognition device 40 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the face recognition device 40 may be stored in a memory and executed by at least one processor to perform the face recognition function.
[0081] In this embodiment, the face recognition device 40 can be divided into multiple functional modules according to the functions it performs. Figure 3 As shown, the face recognition device 40 may include an acquisition module 401, an identification module 402, a judgment module 403, and an update module 404. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In some embodiments, the functions of each module will be described in detail in subsequent embodiments.
[0082] The acquisition module 401 acquires a face image.
[0083] In this embodiment, the electronic device 1 includes an image acquisition unit, and the image acquisition unit is used to acquire facial images. For example, in one implementation, the image acquisition unit can be a 2D camera, and the acquisition module 401 acquires the facial image of the user through the 2D camera. In another embodiment, the acquisition module 401 can acquire the facial image of the user from its internal storage device. In other embodiments, the acquisition module 401 can acquire the facial image from the electronic device 2 to which it is communicatively connected. In this embodiment, the acquired facial image can be a facial picture, a facial video, etc.
[0084] The recognition module 402 recognizes the acquired face image based on a base image library, wherein the base image library stores a target face image to be compared with the acquired face image.
[0085] Specifically, the recognition module 402 extracts image features from the face image, detects whether the face image contains a face area based on the image features in the face image to obtain a first result, and calibrates the facial features area of the face image based on the image features in the face image to obtain a second result. The first result is used to indicate whether the face image contains a face area, and the second result is used to calibrate the facial features area in the face image. The recognition module 402 integrates the first result with the second result, determines whether the face image matches the image in the base image library, and obtains the recognition result of the face image.
[0086] In this embodiment, the recognition module 402 can perform an image feature extraction on the face image that needs to be recognized, and perform face recognition and facial features calibration respectively according to the extracted image features of the face image. Among them, the first result is obtained by detecting whether the face image contains a face area; while detecting whether the face image contains a face area, the second result is obtained by calibrating the facial features area in the face image, and the first result and the second result are integrated, and it is determined whether the face image matches the image in the base map library according to the integrated result, so as to obtain the recognition result of the face image. By performing an image feature extraction on the face image to perform face recognition and facial features calibration, there is no need to perform multiple image feature extraction on the face image, which can speed up the speed of face recognition and facial features calibration on the face image, and solve the technical problem of slow face recognition in the prior art.
[0087] The judgment module 403 judges whether there is a target face image matching the acquired face image in the base image library according to the recognition result.
[0088] The updating module 404 is used to add the face image to the base map library for updating according to a preset base map updating strategy when there is a target face image matching the acquired face image in the base map library, so as to be used for the next face recognition.
[0089] In this implementation, the face image for face recognition is added to the base map library to supplement the base map library. In this way, the number of base maps of users in the base map library is increased, providing a rich base map library foundation for subsequent face recognition, which is conducive to improving the accuracy of face recognition based on the base map library.
[0090] In this embodiment, the preset base map update strategy is to update the target face image in the base map library according to the different scenes of the face image. Specifically, the adding of the face image to the base map library for updating according to the preset base map update strategy includes: identifying the scene in the face image for face recognition; judging whether the scene of the face image is included in the target face image in the base map library; and updating the face image to the base map library when the scene of the face image for face recognition is not included in the target face image in the base map library.
[0091] In this embodiment, if it is determined that the scene of the face image to be recognized is not included in the target face image in the base map library, the face image is updated to the base map library. In this way, the base map library contains pictures of various scenes of the user, which is conducive to enriching the image basis of the base map library and improving the accuracy of face recognition.
[0092] In a specific embodiment, the identifying of scenes in a face image for face recognition includes: respectively extracting GIST feature values, LBP feature values and HSV feature values of the face image for face recognition; respectively normalizing the GIST feature values, LBP feature values and HSV feature values; respectively fusing the normalized GIST feature values, LBP feature values and HSV feature values to obtain fused feature values; and bringing the fused feature values into a classifier so that the classifier recognizes the fused features and outputs the category of the scene, wherein the classifier is a SVM classifier.
[0093] In this embodiment, the method for extracting the GIST feature value of the face image includes the following steps:
[0094] Select GABOR kernels of 5 scales and 8 directions; convolve the face image with the 40 GABOR kernels in sequence to obtain 40 processed images; divide each processed image into b×b small blocks, and calculate the grayscale mean of each small block to obtain 40×b×b grayscale means, and the vector composed of 40×b×b grayscale means is the 40×b×b dimensional GIST feature value, where the value of b is 3 or 4.
[0095] In this embodiment, the method for extracting LBP feature values of a face image includes the following steps: setting a calculation window of 3 pixels × 3 pixels; adding the calculation window to the image, comparing whether the pixel values of the surrounding points of the calculation window are greater than the pixel value of the center point, if greater, setting the pixel values of the surrounding points to 1, otherwise setting them to 0, arranging the pixel values of the 8 surrounding points in sequence to obtain an 8-bit unsigned binary number, and using this unsigned binary number as the new pixel value of the center point; traversing the entire image using the calculation window to obtain a new pixel value of each non-edge pixel in the image, and setting the new pixel value of each edge pixel to a certain value, that is, obtaining an image processed by LBP; dividing the image processed by LBP into c×c small blocks, and calculating the grayscale histogram of each small block respectively, the grayscale in the grayscale histogram is represented by 64 levels, and the number of pixels distributed on 64 grayscales in each small block is obtained; and arranging the number of pixels distributed on 64 grayscales of c×c small blocks in sequence to finally obtain a c×c×64-dimensional LBP feature value, where the value is 2 or 3.
[0096] In this embodiment, the method for extracting the HSV feature value of a face image includes the following steps: calculating the H, S, and V values of each pixel in the face image according to the R, G, and B values of the pixel; dividing the image into e×e small blocks, and calculating the color histogram of each small block respectively, wherein the colors in the color histogram are represented by 90 levels, and the number of pixels distributed on 90 color levels in each small block is obtained; the number of pixels distributed on 90 gray levels of the e×e small blocks is arranged in sequence to finally obtain an HSV feature value of e×e×90 dimensions, where the value of e is 2 or 3.
[0097] In this embodiment, the preset base map update strategy is to update the target face image in the base map library according to the similarity of the face image, and the update module 404 determines whether the face image for face recognition is similar to the target face image in the base map library, and when the face image is similar to the target face image in the base map library, the face image is updated to the base map library.
[0098] In this implementation, it is possible to determine whether the face image to be recognized is similar to the target face image in the base image library by using the HSV image similarity recognition method.
[0099] In this embodiment, when it is determined that the facial image is similar to the target facial image in the base map library, the facial image is updated to the base map library, so that the base map library contains similar pictures of the user, which is conducive to enriching the image base of the base map library and improving the accuracy of facial recognition.
[0100] In this embodiment, the preset base map update strategy is to update the target face image in the base map library according to the quality of the face image, and the update module 404 determines whether the quality of the face image for face recognition reaches a predetermined standard and exceeds the quality of at least one target face image in the base map library; and when the quality of the face image reaches a predetermined standard and exceeds the quality of at least one target face image in the base map library, the face image is updated to the base map library and replaces the target face image with the worst quality in the base map library.
[0101] In this embodiment, when the quality of the facial image reaches a predetermined standard and exceeds the quality of at least one target facial image in the base map library, the facial image is updated to the base map library and replaces the worst quality base map of the user. In this way, the base map library contains pictures of users with higher quality, which is conducive to enriching the image base of the base map library and improving the accuracy of facial recognition.
[0102] Example 3
[0103] Figure 4 FIG. 1 is a schematic diagram of an electronic device 1 according to an embodiment of the present invention.
[0104] The electronic device 1 includes a memory 61, a processor 62, and a computer program 63 stored in the memory 61 and executable on the processor 62. When the processor 62 executes the computer program 63, the steps in the above-mentioned face recognition method embodiment are implemented, for example: Figure 2 Alternatively, when the processor 62 executes the computer program 63, the functions of each module / unit in the above-mentioned face recognition device embodiment are realized, for example Figure 3 Modules 401~404 in.
[0105] Exemplarily, the computer program 63 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 62 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 63 in the electronic device 1. For example, the computer program 63 may be divided into Figure 3 The acquisition module 401, the identification module 402, the judgment module 403, and the update module 404 in the embodiment, the specific functions of each module refer to the second embodiment.
[0106] The electronic device 1 may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. Those skilled in the art will appreciate that the schematic diagram is merely an example of the electronic device 1 and does not limit the electronic device 1. The electronic device 1 may include more or fewer components than shown in the diagram, or may combine certain components, or different components. For example, the electronic device 1 may also include input and output devices, network access devices, buses, etc.
[0107] The processor 62 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 62 may be any conventional processor, etc. The processor 62 is the control center of the electronic device 1, and uses various interfaces and lines to connect various parts of the entire electronic device 1.
[0108] The memory 61 can be used to store the computer program 63 and / or modules / units. The processor 62 implements various functions of the electronic device 1 by running or executing the computer program and / or modules / units stored in the memory 61 and calling the data stored in the memory 61. The memory 61 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device 1 (such as audio data, a phone book, etc.), etc. In addition, the memory 61 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0109] If the module / unit integrated in the electronic device 1 is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0110] In the several embodiments provided by the present invention, it should be understood that the disclosed electronic device and method can be implemented in other ways. For example, the electronic device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0111] In addition, the functional modules in the various embodiments of the present invention may be integrated into the same processing module, or each module may exist physically separately, or two or more modules may be integrated into the same module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0112] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other modules or steps, and the singular does not exclude the plural. Multiple modules or electronic devices stated in the electronic device claim can also be implemented by the same module or electronic device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A face recognition method, characterized in that: The method comprises: Get face image; Recognize the acquired face image based on a base image library, wherein the base image library stores a target face image to be compared with the acquired face image; Determine whether the base image library contains a target face image that matches the acquired face image according to the recognition result; and When it is determined that there is a target face image matching the acquired face image in the base map library, the acquired face image is added to the base map library according to a preset base map update strategy, and the base map library is updated, including: identifying the scene in the face image for face recognition; judging whether the scene is included in the target face image; if the scene is not included in the target face image, updating the face image to the base map library, and the identifying the scene in the face image for face recognition includes: respectively extracting the GIST feature value, LBP feature value and HSV feature value of the face image for face recognition; normalizing the GIST feature value, LBP feature value and HSV feature value respectively; fusing the normalized GIST feature value, LBP feature value and HSV feature value to obtain a fused feature value; and bringing the fused feature value into an SVM classifier so that the SVM classifier recognizes the fused feature and outputs the category of the scene.
2. The face recognition method according to claim 1, characterized in that: The recognition of the acquired face image based on the base image library includes: Extracting image features from the face image; Detecting whether the face image contains a face region based on image features in the face image to obtain a first result, and calibrating facial feature regions of the face image based on the image features in the face image to obtain a second result, wherein the first result is used to indicate whether the face image contains a face region, and the second result is used to calibrate facial feature regions in the face image; and The first result and the second result are integrated and, based on the integrated result, it is determined whether the face image matches an image in a base image library to obtain a recognition result of the face image.
3. The face recognition method according to claim 1, characterized in that: When it is determined that there is a target face image matching the acquired face image in the base map library, adding the acquired face image to the base map library according to a preset base map update strategy to update the base map library includes: Determining whether the face image to be recognized is similar to the target face image in the base image library; and When the face image is similar to the target face image in the base image library, the face image is updated to the base image library.
4. The face recognition method according to claim 3, characterized in that: The step of determining whether the face image to be recognized is similar to the target face image in the base image library comprises: The HSV-based image similarity recognition method determines whether the face image to be recognized is similar to the target face image in the base image library.
5. The face recognition method according to claim 1, characterized in that: When it is determined that there is a target face image matching the acquired face image in the base map library, adding the acquired face image to the base map library according to a preset base map update strategy to update the base map library includes: Determining whether the quality of the face image to be subjected to face recognition reaches a predetermined standard and exceeds the quality of at least one target face image in the base image library; and When the quality of the face image reaches a predetermined standard and exceeds the quality of at least one target face image in the base image library, the face image is updated to the base image library and replaces the target face image with the worst quality in the base image library.
6. A face recognition device, characterized in that: The device comprises a module for implementing the face recognition method according to any one of claims 1 to 5, and the device comprises: An acquisition module, used for acquiring a face image; A recognition module, used for recognizing the acquired face image based on a base image library, wherein the base image library stores a target face image to be compared with the acquired face image; A judgment module, used for judging whether there is a target face image matching the acquired face image in the base image library according to the recognition result; and The updating module is used to add the acquired face image to the base map library and update the base map library according to a preset base map updating strategy when it is determined that there is a target face image matching the acquired face image in the base map library, so as to be used for the next face recognition.
7. An electronic device, characterized in that: The electronic device comprises a processor, and the processor is used to implement the face recognition method as claimed in any one of claims 1 to 5 when executing a computer program stored in a memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the face recognition method as described in any one of claims 1 to 5 is implemented.
