Face recognition method and face recognition device
By establishing a second facial feature library in the face recognition device and processing it, the problem of the impact of device restart is solved and the efficient operation of the device is achieved.
Patent Information
- Application Number
- CN202210289269.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-22
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-03-22
AI Technical Summary
In the prior art, when new user data is added to the hard disk, the face recognition device needs to be restarted to apply for new DMA memory, which affects the operation of the device.
A second facial feature library is established in the memory through ARM, and the facial features of the new user data are stored in the library. The FPGA performs face recognition processing based on the first and second facial feature libraries to avoid device restart.
It reduces the number of device restarts, ensures the normal operation of the face recognition device, and saves time wasted due to restarts.
Smart Images

Figure CN114722229B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of face recognition technology, and in particular to a face recognition method and a face recognition device. Background Art
[0002] With the development of electronic technology, people have increasingly higher requirements for the performance of product hardware, which has led to the emergence of FPGAs (Field Programmable Gate Arrays). FPGAs have the advantages of strong flexibility and fast computing power, and therefore are used in facial recognition processing.
[0003] During the device initialization process when the face recognition device equipped with FPGA is powered on, it will apply for DMA (Direct Memory Access) memory and store the facial features in the hard disk into the DMA memory.
[0004] The storage capacity of DMA memory cannot be changed after it is requested. Therefore, when technicians store new user data on the hard drive, they need to restart the facial recognition device to re-apply for DMA memory and store the facial features on the hard drive (including those in the newly stored user data) into DMA memory before the new facial features can be used for facial recognition processing. This device restart takes a long time and affects the normal operation of the facial recognition device. Summary of the Invention
[0005] The present invention provides a face recognition method and device that can solve the problem in the prior art that the face recognition device is affected when adding new user data to the hard disk. The technical solution is as follows:
[0006] In a first aspect, a face recognition method is provided. The method is applied to a face recognition device, the face recognition device including a processor, a hard disk, and a memory. The processor includes an FPGA and an ARM. A first database is established in the hard disk. The first database includes multiple user data, each user data includes facial features. The method includes:
[0007] The ARM receives a first initialization instruction and establishes a first facial feature library in the memory based on each facial feature in the first database;
[0008] When the ARM receives a request to add first user data, the ARM stores the first user data in the hard disk, and creates a second facial feature library in the memory based on facial features in the first user data;
[0009] The FPGA performs face recognition processing based on the first face feature library and the second face feature library.
[0010] In a possible implementation, storing, by the ARM, the first user data in the hard disk includes:
[0011] The ARM establishes a second database in the hard disk and stores the first user data in the second database.
[0012] In a possible implementation, after storing the first user data in the second database, the method further includes:
[0013] When the ARM receives the second initialization instruction, the ARM merges the second database into the first database.
[0014] In a possible implementation, storing, by the ARM, the first user data in the hard disk includes:
[0015] The ARM stores the first user data in the first database.
[0016] In a possible implementation, establishing a first facial feature library in the memory based on each facial feature in the first database includes:
[0017] Determining the amount of user data in the first database;
[0018] Determining a first memory requirement corresponding to the facial feature in the first database based on the number and the amount of data of a single facial feature;
[0019] Based on the first memory requirement, applying for a first continuous consistency memory in the memory to establish a first facial feature library;
[0020] Establishing a second facial feature library in the memory based on the facial features in the first user data includes:
[0021] Determining a second memory requirement corresponding to the facial feature in the first user data based on the amount of the single facial feature data;
[0022] Based on the second memory requirement, a second continuous consistency memory is applied in the memory to establish the second facial feature library.
[0023] In a possible implementation, the first continuous consistency memory and the second continuous consistency memory are DMA memory or CMA memory.
[0024] In a possible implementation, after establishing the first facial feature library in the memory based on the multiple facial features in the multiple user data, the method further includes:
[0025] When the ARM receives a deletion instruction for the second user data, the ARM sets the second user data in the first database to zero, and sets the facial features corresponding to the second user data in the first facial feature database to zero.
[0026] In a possible implementation, after setting the facial features corresponding to the second user data in the first facial feature library to zero, the method further includes:
[0027] When the ARM receives the third initialization instruction, the ARM deletes the second user data set to zero in the hard disk.
[0028] In one possible implementation, the FPGA performs face recognition processing based on the first face feature library and the second face feature library, including:
[0029] The FPGA extracts a first facial feature from the facial image to be recognized, calculates a matching degree between the first facial feature and each facial feature in the first facial feature library and each facial feature in the second facial feature library, and if there is a second facial feature whose matching degree with the first facial feature is greater than a matching degree threshold, determines that user data corresponding to the second facial feature is user data corresponding to the facial image.
[0030] In a second aspect, a face recognition device is provided, comprising a processor, a hard disk, and a memory, wherein the processor comprises an FPGA and an ARM processor, and a first database is established in the hard disk, wherein the first database comprises a plurality of user data, each user data comprising a facial feature;
[0031] The ARM is configured to receive a first initialization instruction and establish a first facial feature library in the memory based on the facial features in the first database; upon receiving a request to add first user data, store the first user data in the hard disk and establish a second facial feature library in the memory based on the facial features in the first user data;
[0032] The FPGA is used to perform face recognition processing based on the first face feature library and the second face feature library.
[0033] In a possible implementation, the ARM is configured to establish a second database in the hard disk, and store the first user data in the second database.
[0034] In a possible implementation, the ARM is further configured to merge the second database into the first database when the ARM receives a second initialization instruction.
[0035] In a possible implementation manner, the ARM is configured to store the first user data in the first database.
[0036] In one possible implementation, the ARM is configured to:
[0037] Determining the amount of user data in the first database;
[0038] Determining a first memory requirement corresponding to the facial feature in the first database based on the number and the amount of data of a single facial feature;
[0039] Based on the first memory requirement, applying for a first continuous consistency memory in the memory to establish a first facial feature library;
[0040] The ARM is used to:
[0041] Determining a second memory requirement corresponding to the facial feature in the first user data based on the amount of the single facial feature data;
[0042] Based on the second memory requirement, a second continuous consistency memory is applied in the memory to establish the second facial feature library.
[0043] In a possible implementation, the first continuous consistency memory and the second continuous consistency memory are DMA memory or CMA memory.
[0044] In a possible implementation, the ARM is further configured to:
[0045] When the ARM receives a deletion instruction for the second user data, the ARM sets the second user data in the first database to zero, and sets the facial features corresponding to the second user data in the first facial feature database to zero.
[0046] In a possible implementation, the ARM is further configured to:
[0047] When the ARM receives the third initialization instruction, the ARM deletes the second user data set to zero in the hard disk.
[0048] In one possible implementation, the FPGA is used to:
[0049] The FPGA extracts a first facial feature from the facial image to be recognized, calculates a matching degree between the first facial feature and each facial feature in the first facial feature library and each facial feature in the second facial feature library, and if there is a second facial feature whose matching degree with the first facial feature is greater than a matching degree threshold, determines that user data corresponding to the second facial feature is user data corresponding to the facial image.
[0050] The beneficial effects of the technical solution provided by the embodiments of the present application are:
[0051] In the solution described in the embodiments of the present application, a face recognition method is applied to a face recognition device, which includes an FPGA, an ARM, a hard disk, and a memory. When new user data is stored in the hard disk, the ARM establishes a second face feature library in the memory and stores the face features of the new user data in the second face feature library. The FPGA performs face recognition processing based on the first face feature library and the second face feature library. With this solution, when new user data is added to the hard disk, there is no need to restart the face recognition device. In this way, the number of device restarts during the face recognition process is reduced, thereby ensuring that the operation of the face recognition device is not affected. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0053] Figure 1 This is a structural diagram of a face recognition device provided in an embodiment of the present application;
[0054] Figure 2 This is a flow chart of a face recognition method provided by an embodiment of the present application;
[0055] Figure 3 This is a schematic diagram of establishing a first facial feature library provided by an embodiment of the present application;
[0056] Figure 4 This is a schematic diagram of establishing a second facial feature library provided by an embodiment of the present application;
[0057] Figure 5 This is a schematic diagram of merging a first database and a second database provided in an embodiment of the present application;
[0058] Figure 6 This is a flow chart of a face recognition method provided by an embodiment of the present application;
[0059] Figure 7 This is a schematic diagram of a zeroing process provided by an embodiment of the present application;
[0060] Figure 8 This is a schematic diagram of a deletion process provided by an embodiment of the present application;
[0061] Figure 9 This is a schematic diagram of a confusing correspondence between a first database and a first facial feature library provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0063] The embodiment of the present application provides a face recognition method, which is applied to a face recognition device. Specifically, it can be applied to a face recognition device based on an FPGA (Field Programmable Gate Array).
[0064] In everyday life, facial recognition is increasingly being used due to its convenience and security. For example, residential communities use access control devices with facial recognition capabilities. The access control device captures a visitor's facial image and determines whether the facial image matches pre-stored facial features. If so, the visitor is allowed entry and the access control device displays relevant information about the visitor. Another example is facial recognition used in video conferencing. A video conferencing terminal can capture a participant's facial image, identify the data corresponding to the facial image within pre-stored data, and thus determine and display relevant information about the participant.
[0065] Next, the face recognition device and face recognition method provided in this application are introduced in detail respectively.
[0066] First, let’s introduce the face recognition device:
[0067] The embodiment of the present application provides a face recognition device. From the perspective of hardware composition, the structure of the face recognition device can be as follows: Figure 1 As shown, it includes processor, hard disk and memory.
[0068] Processors include FPGAs and ARMs (Advanced RISC Machines). The ARM can be used to receive a first initialization instruction, establish a first facial feature library, receive a data addition request, establish a second facial feature library, and so on. The FPGA can be used to extract a first facial feature from a facial image to be recognized, determine the degree of match between the first facial feature and each facial feature in the facial feature library, determine user data corresponding to the facial image, and so on.
[0069] The hard disk can be any volatile or non-volatile memory, such as an SD card (Secure Digital Memory Card), an SSD (Solid State Disk), a RAM (Random Access Memory), a magnetic tape, a floppy disk, etc. The hard disk can be used to store pre-stored data, intermediate data, and result data during the face recognition process. For example, multiple user data in the first database, first user data that needs to be added, second user data after being reset to zero, etc.
[0070] The memory may be a memory stick, SDRAM (Synchronous Dynamic Random-Access Memory), DDR (Double Data Rate Dynamic Random-Access Memory), etc. The memory may be used to store facial features in the first database, may be used to store facial features in the first user data, and so on.
[0071] In addition to the processor, hard disk and memory, the face recognition device may also include display components, image acquisition components, communication components and audio output components.
[0072] The display component can be a display panel integrated with the facial recognition device, or a display device separate from the facial recognition device but with a communication connection established. When the display component is a display panel, it can be a TN (Twisted Nematic) panel, a VA (Vertical Alignment) panel, an IPS (In-Plane Switching) panel, etc. The display component can be used to display the facial image to be recognized, the user data corresponding to the facial image, etc.
[0073] The image acquisition component can be a camera integrated with the face recognition device, or a shooting terminal (such as a monitoring probe, camera, etc.) that is separate from the face recognition device and has a communication connection. The image acquisition component can obtain the face image to be recognized, etc.
[0074] The communication component may be a wired network connector, a WiFi (Wireless Fidelity) module, a Bluetooth module, a cellular network communication module, etc. The communication component may be used to transmit data with other devices, such as other facial recognition devices, display devices separate from the facial recognition device, or camera terminals separate from the facial recognition device. For example, the camera terminal sends a facial image to be recognized to the facial recognition device, and the facial recognition device sends user data corresponding to the facial image to the camera terminal, etc.
[0075] The audio output component can be a speaker, earphones, etc., which is used to play audio.
[0076] Next, the face recognition method provided by the embodiment of the present application is introduced:
[0077] The processing flow of the face recognition method provided in the embodiment of the present application is as follows: Figure 2 As shown, the following processing steps are included:
[0078] S201. ARM receives a first initialization instruction and establishes a first facial feature library in a memory based on facial features in a first database.
[0079] The first database is established on a hard disk and includes multiple user data, each of which includes facial features. Each facial feature corresponds to the same amount of data, such as 128 bits, 512 bits, or 2048 bits. In addition to facial features, the user data may also include information such as a user identifier (such as a user ID), name, gender, and age.
[0080] When the face recognition device is turned on (also known as powered on), the ARM receives an initialization instruction (called a first initialization instruction) for initializing the device. At this time, the ARM creates a first face feature library based on the face features in the first database created on the hard disk. The process of creating the first face feature library can be as follows:
[0081] First, after receiving the first initialization instruction, the ARM determines the amount of user data included in the first database. At the same time, the ARM can also determine the amount of single facial feature data in the first database.
[0082] Next, the ARM calculates the product of the amount of user data and the amount of data for a single facial feature, and determines this product as the first memory requirement for the facial feature in the first database. For example, if the amount of user data is 10 and the amount of data for a single facial feature is 512 bits, the first memory requirement for the facial feature in the first database is 5120 bits, and so on.
[0083] Next, based on the calculated first memory requirement, the ARM requests a corresponding first contiguous consistent memory from the memory, which can be called a first DMA memory (or first CMA memory). The storage capacity of the first DMA memory is equal to the first memory requirement. For example, if the ARM determines that the first memory requirement is 5120 bits, it will request 5120 bits of contiguous memory space from the memory as the first DMA memory, and so on.
[0084] Finally, ARM stores the facial features of each user data in the first database into the first DMA memory in order to establish the first facial feature library. Figure 3 As shown, the first database includes 10 user data, and the storage order of the user data is A1-A10 (all are user data identifiers). Then ARM stores the facial features of user data A1 in the 1st-512th bits of the first DMA memory, stores the facial features of user data A2 in the 513th-1024th bits of the first DMA memory, and stores the facial features of user data A3 in the 1025th-1536th bits of the first DMA memory. And so on, all the facial features of the above 10 user data are stored in the first DMA memory, and the facial features are called the first facial feature library, and so on.
[0085] S202. When the ARM receives a request to add the first user data, the ARM stores the first user data in the hard disk, and creates a second facial feature library in the memory based on the facial features in the first user data.
[0086] When a technician adds new user data (called first user data) to the hard drive, they first send a request to the ARM to add the first user data. The first user data includes at least one piece of user data. Upon receiving the request, the ARM creates a second database on the hard drive and adds the first user data to the second database.
[0087] At the same time, ARM determines the amount of the first user data in the second database, and then calculates the product of this amount and the amount of a single facial feature data, and determines this product as the second memory requirement corresponding to the second database, thereby determining the second DMA memory and establishing a second facial feature library. The process of establishing the second facial feature library is the same as the process of establishing the first facial feature library, and will not be described in detail here. For example, the first user data is user data identified as B1, ARM establishes a second database in the hard disk, applies for a second DMA memory in the memory, establishes a second facial feature library, and adds the facial data corresponding to B1 to the second facial feature library, such as Figure 4 shown, etc.
[0088] Alternatively, the ARM may directly add the first user data to the first database. Then, the ARM determines the second memory requirement corresponding to the second database based on the amount of user data and the amount of individual facial feature data in the first user data, thereby determining the second DMA memory and establishing the second facial feature database.
[0089] S203. FPGA performs face recognition processing based on the first face feature library and the second face feature library.
[0090] The FPGA can first obtain all facial features in the first facial feature library, and then obtain all facial features in the second facial feature library. At the same time, the FPGA can obtain the facial features in the face image to be detected (called the first facial features). The FPGA calculates the matching degree of the first facial features with each facial feature in the first facial feature library and each facial feature in the second facial feature library, and assigns a sequence identifier to the matching degree according to the calculation order. For example, the matching degree of the sequence identifier 1 is 20%, the matching degree of the sequence identifier 2 is 10%, the matching degree of the sequence identifier 3 is 95%, and so on. Finally, the FPGA can compare each matching degree with the matching degree threshold.
[0091] If all matching degrees are less than the matching degree threshold, it is determined that the user data corresponding to the first facial feature is not in the first database and the second database, and an alarm is issued.
[0092] If only one matching degree (referred to as the first matching degree) is greater than the matching degree threshold, the sequence identifier corresponding to the first matching degree is determined. Furthermore, the position of the user data corresponding to the facial feature in the first database or the second database is determined based on the sequence identifier, thereby obtaining the corresponding user data. The facial recognition device may display the user data.
[0093] If there are multiple matching degrees greater than the matching degree threshold, the FPGA determines the maximum matching degree (called the second matching degree) among the above multiple matching degrees, and then determines the sequence identifier corresponding to the second matching degree. Further, the storage location corresponding to the user data corresponding to the facial feature is determined based on the sequence identifier, thereby obtaining the corresponding user data.
[0094] S204 : When the ARM receives the second initialization instruction, the ARM merges the second database into the first database.
[0095] Technicians can restart the facial recognition device according to a preset period, and the device needs to be initialized each time it is restarted. The preset period can be 1 day, 7 days, 1 month, etc.
[0096] When the technician restarts the face recognition device, ARM will receive the initialization instruction for device initialization again (called the second initialization instruction). At this time, ARM will merge the second database into the first database, that is, add the first user data in the second database to the first database and delete the second database. For example, the first database includes 10 user data items A1-A10, and the second database includes 1 user data item B1. After the merger, the first database includes 11 user data items A1-A10 and B1, and no longer has the second database. Figure 5 shown.
[0097] Next, ARM will establish a first facial feature library in the memory based on the first database after adding the first user data. The process of establishing the first facial feature library here is the same as the process of establishing the first facial feature library in step S201, and will not be repeated here.
[0098] With this solution, when technicians store new user data on the hard disk, there is no need to restart the facial recognition device. In this way, the number of device restarts is reduced during the facial recognition process, saving time wasted due to restarts, thereby ensuring that the operation of the facial recognition device will not be affected.
[0099] The above-mentioned face recognition method is aimed at the case where user data is added to the hard disk after the face recognition device completes initialization. Next, the case where user data is deleted from the hard disk after the face recognition device completes initialization will be described.
[0100] The present application provides an embodiment of Figure 6 The processing flow of the face recognition method shown includes the following processing steps:
[0101] S601. ARM receives a first initialization instruction and establishes a first facial feature library in a memory based on facial features in a first database.
[0102] When the face recognition device is powered on, ARM will receive the first initialization instruction to perform device initialization processing. At this time, ARM will establish a first face feature library based on the face features in the first database established in the hard disk. The process of establishing the first face feature library is the same as step S201 and will not be repeated here.
[0103] S602. When the ARM receives a deletion instruction for the second user data, the ARM sets the second user data in the first database to zero, and sets the facial features corresponding to the second user data in the first facial feature database to zero.
[0104] During the operation of the face recognition device, if the technician needs to delete certain user data (second user data), a deletion instruction for deleting the second user data will be sent to the ARM, wherein the deletion instruction may include an identifier of the second user data.
[0105] When the ARM receives the deletion instruction, it first searches the first database for the second user data and then resets the second user data to zero. Simultaneously, it determines the order of the second user data in the first database. Furthermore, based on this order, the ARM resets the corresponding facial features in the first feature library to zero.
[0106] For example, the first database includes 10 pieces of user data A1-A10. When ARM receives a deletion request to delete A3, ARM sets all the user data of A3 to zero. At the same time, it determines that the sequence information of A3 is 3. Furthermore, ARM sets the data of bits 1025-1536 in the first feature library to zero, that is, sets the facial features corresponding to A3 to zero. Figure 7 shown.
[0107] S603: When the ARM receives the third initialization instruction, the ARM deletes the second user data set to zero in the hard disk.
[0108] When the technician restarts the face recognition device, ARM will receive the initialization instruction for device initialization again (called the third initialization instruction). At this time, ARM deletes the user data set to zero in the first database (that is, the second user data set to zero). For example, when ARM receives the third initialization instruction, it deletes the user data of A3 that has been set to zero in the first database. After deletion, the first database includes 9 user data items, namely A1, A2, A4-A10. Figure 8 shown, etc.
[0109] Next, ARM will establish a first facial feature library in the memory based on the first database after deleting the second user data set to zero. The process of establishing the first facial feature library here is the same as the process of establishing the first facial feature library in step S201, and will not be repeated here.
[0110] After completing one initialization, the storage capacity of the DMA memory cannot be changed, and facial features cannot be added or deleted. If you want to delete a facial feature, you can delete the user data corresponding to the facial feature in the hard disk during the next initialization. This will also increase the number of device restarts and device initializations, waste time, and affect the normal operation of the face recognition device. The solution provided in the embodiment of the present application is that when you want to delete a facial feature, you can set the facial feature to zero and set the user data corresponding to the facial feature in the hard disk to zero. After setting to zero, the facial feature will no longer be recognized. In this way, the user data can be deleted without restarting the device and initializing the device.
[0111] This solution ensures that the correspondence between the user data in the hard disk and the facial features in the DMA memory is always correct. If a user data in the hard disk is directly deleted, the facial features corresponding to the user data in the DMA memory can only be reset to zero, which will cause confusion in the correspondence and lead to incorrect face recognition results. Figure 9 As shown in the figure (the user data A3 is deleted from the hard disk and the facial features corresponding to A3 are set to zero in the DMA memory). However, by adopting this method, there will be no confusion in the relationship, thereby ensuring the accuracy of the face recognition device.
[0112] In the solution mentioned in the application embodiment, the face recognition method is applied to a face recognition device, and the face recognition device includes an FPGA, an ARM, a hard disk, and a memory. When new user data is stored in the hard disk, the ARM establishes a second face feature library in the memory and stores the face features of the new user data in the second face feature library. The FPGA performs face recognition processing based on the first face feature library and the second face feature library. With this solution, when the technician stores new user data in the hard disk, there is no need to restart the face recognition device. In this way, during the face recognition process, the number of device restarts is reduced, and the time wasted due to restarts is saved, thereby ensuring that the operation of the face recognition device will not be affected.
[0113] An embodiment of the present application provides a face recognition device, comprising a processor, a hard disk, and a memory, wherein the processor comprises an FPGA and an ARM, and a first database is established in the hard disk, wherein the first database comprises a plurality of user data, each user data comprising a facial feature;
[0114] The ARM is configured to receive a first initialization instruction and establish a first facial feature library in the memory based on the facial features in the first database; upon receiving a request to add first user data, store the first user data in the hard disk and establish a second facial feature library in the memory based on the facial features in the first user data;
[0115] The FPGA is used to perform face recognition processing based on the first face feature library and the second face feature library.
[0116] In a possible implementation, the ARM is configured to establish a second database in the hard disk, and store the first user data in the second database.
[0117] In a possible implementation, the ARM is further configured to merge the second database into the first database when the ARM receives a second initialization instruction.
[0118] In a possible implementation manner, the ARM is configured to store the first user data in the first database.
[0119] In one possible implementation, the ARM is configured to:
[0120] Determining the amount of user data in the first database;
[0121] Determining a first memory requirement corresponding to the facial feature in the first database based on the number and the amount of data of a single facial feature;
[0122] Based on the first memory requirement, applying for a first continuous consistency memory in the memory to establish a first facial feature library;
[0123] The ARM is used to:
[0124] Determining a second memory requirement corresponding to the facial feature in the first user data based on the amount of the single facial feature data;
[0125] Based on the second memory requirement, a second continuous consistency memory is applied in the memory to establish the second facial feature library.
[0126] In a possible implementation, the first continuous consistency memory and the second continuous consistency memory are DMA memory or CMA memory.
[0127] In a possible implementation, the ARM is further configured to:
[0128] When the ARM receives a deletion instruction for the second user data, the ARM sets the second user data in the first database to zero, and sets the facial features corresponding to the second user data in the first facial feature database to zero.
[0129] In a possible implementation, the ARM is further configured to:
[0130] When the ARM receives the third initialization instruction, the ARM deletes the second user data set to zero in the hard disk.
[0131] In one possible implementation, the FPGA is used to:
[0132] The FPGA extracts a first facial feature from the facial image to be recognized, calculates a matching degree between the first facial feature and each facial feature in the first facial feature library and each facial feature in the second facial feature library, and if there is a second facial feature whose matching degree with the first facial feature is greater than a matching degree threshold, determines that user data corresponding to the second facial feature is user data corresponding to the facial image.
[0133] In the solution mentioned in the application embodiment, the face recognition method is applied to a face recognition device, and the face recognition device includes an FPGA, an ARM, a hard disk, and a memory. When new user data is stored in the hard disk, the ARM establishes a second face feature library in the memory and stores the face features of the new user data in the second face feature library. The FPGA performs face recognition processing based on the first face feature library and the second face feature library. With this solution, when the technician stores new user data in the hard disk, there is no need to restart the face recognition device. In this way, during the face recognition process, the number of device restarts is reduced, and the time wasted due to restarts is saved, thereby ensuring that the operation of the face recognition device will not be affected.
[0134] It should be noted that the facial recognition device provided in the above embodiments is merely an example of the division of the functional modules described above when performing facial recognition. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the facial recognition device provided in the above embodiments and the facial recognition method embodiments are based on the same concept. The specific implementation process is detailed in the method embodiments and will not be repeated here.
[0135] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals (including but not limited to signals transmitted between user terminals and other devices, etc.) involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the "user data" and "facial features" involved in this application are obtained with full authorization.
[0136] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for face recognition, characterized in that: The method is applied to a face recognition device, which includes a processor, a hard disk, and a memory. The processor includes an FPGA and an ARM. A first database is established in the hard disk. The first database includes multiple user data, each of which includes facial features. The method includes: The ARM receives a first initialization instruction and establishes a first facial feature library in the memory based on each facial feature in the first database; When the ARM receives a request to add first user data, the ARM stores the first user data in the hard disk, and creates a second facial feature library in the memory based on facial features in the first user data; The FPGA performs face recognition processing based on the first face feature library and the second face feature library; When the ARM receives a deletion instruction for the second user data, the ARM sets the second user data in the first database to zero, determines the sequence information of the second user data in the first database, and sets the corresponding facial features in the first facial feature library to zero according to the sequence information.
2. The method according to claim 1, characterized in that The ARM stores the first user data in the hard disk, including: The ARM establishes a second database in the hard disk and stores the first user data in the second database.
3. The method according to claim 2, characterized in that After storing the first user data in the second database, the method further includes: When the ARM receives the second initialization instruction, the ARM merges the second database into the first database.
4. The method according to claim 1, wherein The ARM stores the first user data in the hard disk, including: The ARM stores the first user data in the first database.
5. The method according to claim 1, wherein The step of establishing a first facial feature library in the memory based on each facial feature in the first database includes: Determining the amount of user data in the first database; Determining a first memory requirement corresponding to the facial feature in the first database based on the number and the amount of data of a single facial feature; Based on the first memory requirement, applying for a first continuous consistency memory in the memory to establish a first facial feature library; Establishing a second facial feature library in the memory based on the facial features in the first user data includes: Determining a second memory requirement corresponding to the facial feature in the first user data based on the amount of the single facial feature data; Based on the second memory requirement, a second continuous consistency memory is applied in the memory to establish the second facial feature library.
6. The method according to claim 5, characterized in that The first continuous consistency memory and the second continuous consistency memory are DMA memories or CMA memories.
7. The method according to claim 1, characterized in that After setting the corresponding facial features in the first facial feature library to zero according to the sequence information, the method further includes: When the ARM receives the third initialization instruction, the ARM deletes the second user data set to zero in the hard disk.
8. The method according to claim 1, characterized in that The FPGA performs face recognition processing based on the first face feature library and the second face feature library, including: The FPGA extracts a first facial feature from the facial image to be recognized, calculates a matching degree between the first facial feature and each facial feature in the first facial feature library and each facial feature in the second facial feature library, and if there is a second facial feature whose matching degree with the first facial feature is greater than a matching degree threshold, determines that user data corresponding to the second facial feature is user data corresponding to the facial image.
9. A face recognition device, characterized in that: The face recognition device includes a processor, a hard disk and a memory, the processor includes an FPGA and an ARM, a first database is established in the hard disk, the first database includes multiple user data, and each user data includes facial features; The ARM is configured to receive a first initialization instruction and establish a first facial feature library in the memory based on the facial features in the first database; upon receiving a request to add first user data, store the first user data in the hard disk and establish a second facial feature library in the memory based on the facial features in the first user data; The FPGA is used to perform face recognition processing based on the first face feature library and the second face feature library; The ARM is also used to, when receiving a deletion instruction for the second user data, set the second user data in the first database to zero, determine the sequence information of the second user data in the first database, and set the corresponding facial features in the first facial feature library to zero according to the sequence information.
Citation Information
Patent Citations
Word library updating method and device
CN106777253A
Method and device for processing data in solid state hard disk
CN106844222A
Garbage disposal method based on LSM database, solid state disk and storage device
CN110007860A
Scenic spot artificial intelligence photo taking system and using method thereof
CN112434179A
Image updating method and device, electronic equipment and computer readable medium
CN112818909A