Biological feature recognition method and device, computer equipment and storage medium
By adjusting exposure parameters and using an AI-trained target detection model, the problem of poor accuracy in biometric recognition due to insufficient brightness was solved, achieving higher recognition accuracy and success rate.
Patent Information
- Application Number
- CN202410263657.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2025-09-09
AI Technical Summary
Existing biometric recognition technology has the problem of poor recognition accuracy due to insufficient brightness during image acquisition.
By adjusting the exposure parameters, capturing the second image and determining the second recognition range, ensuring that the image brightness is within the preset brightness range for biometric recognition, and using artificial intelligence technology to train the target detection model for biometric recognition.
The accuracy and success rate of biometric recognition are improved, and recognition errors or failures caused by unclear images are avoided.
Smart Images

Figure CN120612504A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a biometric recognition method, apparatus, computer device, and storage medium. Background Art
[0002] With the development of computer technology, biometric recognition technology is becoming increasingly widely used. It can be applied in various scenarios, such as payment and card processing, to verify user identities through biometric recognition. Currently, when an image containing biometric features is captured, biometric recognition is performed on the image. However, this method results in poor biometric recognition accuracy. Summary of the Invention
[0003] The embodiments of the present application provide a biometric identification method, apparatus, computer device, and storage medium that can improve the accuracy of biometric identification. The technical solution is as follows:
[0004] In one aspect, a biometric feature recognition method is provided, the method comprising:
[0005] determining a first recognition range from a first image, where the image within the first recognition range includes a biometric feature, and the first image is acquired based on a first exposure parameter;
[0006] If the brightness of the image within the first recognition range does not fall within a preset brightness range, adjusting the first exposure parameter to obtain a second exposure parameter;
[0007] capturing a second image based on the second exposure parameter, wherein the second image includes the biometric feature;
[0008] determining a second recognition range from the second image based on the coordinates of the first recognition range in the first image, wherein the coordinates of the second recognition range in the second image are the same as the coordinates of the first recognition range in the first image;
[0009] Adjusting the coordinates of the second recognition range in the second image to obtain a third recognition range, wherein the image within the third recognition range contains the biometric feature;
[0010] When the brightness of the image within the third recognition range falls within the preset brightness range, biometric feature recognition is performed on the image within the third recognition range to identify the object to which the biometric feature contained in the image within the third recognition range belongs.
[0011] In another aspect, a biometric feature recognition device is provided, comprising:
[0012] A determination module, configured to determine a first recognition range from a first image, where the image within the first recognition range contains a biometric feature, and the first image is acquired based on a first exposure parameter;
[0013] an adjusting module, configured to adjust the first exposure parameter to obtain a second exposure parameter when the brightness of the image within the first recognition range does not fall within a preset brightness range;
[0014] an acquisition module, configured to acquire a second image based on the second exposure parameter, wherein the second image includes the biometric feature;
[0015] The determining module is further configured to determine a second recognition range from the second image based on the coordinates of the first recognition range in the first image, wherein the coordinates of the second recognition range in the second image are the same as the coordinates of the first recognition range in the first image;
[0016] The adjustment module is further configured to adjust the coordinates of the second recognition range in the second image to obtain a third recognition range, wherein the image within the third recognition range contains the biometric feature;
[0017] The recognition module is used to perform biometric feature recognition on the image within the third recognition range when the brightness of the image within the third recognition range falls within the preset brightness range, so as to identify the object to which the biometric feature contained in the image within the third recognition range belongs.
[0018] In one possible implementation, the determination module is used to perform multiple scale transformations on the features of the first image to obtain multiple first features, and the scales of the multiple first features are different; based on the multiple first features, each first feature is updated separately to obtain the second feature corresponding to each first feature; each second feature is processed to obtain a fourth recognition range, and the image within the fourth recognition range contains the biometric feature; based on the multiple fourth recognition ranges obtained, the first recognition range is determined.
[0019] In another possible implementation, the determination module is used to divide the first image into blocks to obtain multiple image blocks; classify each image block to obtain the category to which each image block belongs; based on the categories to which the multiple image blocks belong, the image blocks belonging to the target category constitute a regional image, and the target category indicates that the image block contains the biological feature; and perform multiple scale transformations on the features of the regional image to obtain the multiple first features.
[0020] In another possible implementation, the determination module is used to determine the fourth recognition range with the highest confidence as the first recognition range based on the confidence of each fourth recognition range, and the confidence indicates the possibility that the image within the fourth recognition range contains the biometric feature.
[0021] In another possible implementation, the apparatus further includes:
[0022] an extraction module, configured to perform feature extraction on the first image and the second image respectively to obtain a third feature and a fourth feature, wherein the third feature indicates the first image and the fourth feature indicates the second image;
[0023] a processing module, configured to process the third feature and the fourth feature to obtain motion information, wherein the motion information indicates a change in a position of the biometric feature in the second image relative to the first image;
[0024] an updating module, configured to update the motion information based on the third feature;
[0025] The processing module is further configured to process the fourth feature and the updated motion information to obtain the third recognition range.
[0026] In another possible implementation, the adjustment module is used to determine, for each pixel point within the second recognition range, the probability that the second recognition range contains the biometric feature when the second recognition range is centered on the pixel point; and based on the determined probability, adjust the coordinates of the second recognition range in the second image to obtain the third recognition range.
[0027] In another possible implementation, the adjustment module is used to determine the target coordinates based on the determined probability, where the target coordinates are the coordinates of the target pixel point within the second recognition range, wherein, in the determined probability, when the second recognition range is centered on the target pixel point, the probability that the second recognition contains the biometric feature is the largest; and the third recognition range is determined with the target coordinates as the center, and the size of the third recognition range is the same as the size of the second recognition range.
[0028] In another possible implementation, the determination module is used to perform key point detection on the first image to obtain multiple target key points in the first image; based on the relative position relationship between the multiple target key points and the biometric features and the coordinates of the multiple target key points in the first image, determine the first recognition range from the first image.
[0029] In another possible implementation, the adjustment module is used to determine the moving distance and moving direction of the biometric feature based on the coordinates of the first key point in the first image and the coordinates of the second key point in the second image, where the first key point and the second key point are the same key point of the biometric feature; based on the moving distance and the moving direction, the second recognition range is moved to obtain the third recognition range.
[0030] In another possible implementation, the adjustment module is further configured to adjust the second exposure parameter to obtain a third exposure parameter when the brightness of the image within the third recognition range does not fall within the preset brightness range;
[0031] The acquisition module is further configured to acquire a next image based on the third exposure parameter.
[0032] In another possible implementation, the recognition module is further used to perform biometric recognition on the image within the first recognition range when the brightness of the image within the first recognition range falls within the preset brightness range, so as to identify the object to which the biometric contained in the image within the first recognition range belongs.
[0033] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the biometric recognition method as described in the above aspects.
[0034] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the biometric recognition method as described in the above aspects.
[0035] On the other hand, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the operations performed by the biometric recognition method as described in the above aspects.
[0036] In the solution provided by the embodiment of the present application, during the process of biometric feature recognition, a first recognition range is determined from the captured first image to determine the position of the biometric feature in the first image, and whether the brightness of the image within the first recognition range is sufficient is detected to determine whether the biometric feature in the first image is clear enough. If the brightness of the image within the first recognition range does not fall within the preset brightness range, it is determined that the biometric feature in the first image is not clear enough, and the exposure parameters are adjusted so that the next image can be captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image. Considering that the time interval between capturing the first image and capturing the second image is short, the time interval between capturing the first image and capturing the second image and capturing the biometric feature in the first recognition range is short. Compared with the position of the first image, the position of the biometric feature in the second image does not change much. Therefore, the coordinates of the first recognition range in the first image are used to determine the second recognition range from the second image, so that the third recognition range can be determined from the second image as soon as possible using the second recognition range, so that the image within the third recognition range contains the biometric feature, so that when the brightness of the image within the third recognition range falls within the preset brightness range, the image within the third recognition range is subjected to biometric feature recognition to identify which object the biometric feature belongs to, so as to avoid recognition errors or recognition failures due to unclear biometric features in the image, so as to ensure the accuracy and success rate of biometric recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] 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 embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 This is a schematic diagram of the structure of an implementation environment provided by an embodiment of the present application;
[0039] Figure 2 This is a flow chart of a biometric identification method provided in an embodiment of the present application;
[0040] Figure 3 is a flow chart of another biometric recognition method provided by an embodiment of the present application;
[0041] Figure 4 This is a structural diagram of a camera collector provided in an embodiment of the present application;
[0042] Figure 5 This is a schematic diagram of the structure of a target detection model provided in an embodiment of the present application;
[0043] Figure 6This is a flow chart of another biometric identification method provided in an embodiment of the present application;
[0044] Figure 7 This is a flow chart for determining a third identification range provided by an embodiment of the present application;
[0045] Figure 8 This is a flowchart of training a target detection model provided by an embodiment of the present application;
[0046] Figure 9 is a schematic diagram of a sample image provided in an embodiment of the present application;
[0047] Figure 10 This is a flow chart for packaging a model provided by an embodiment of the present application;
[0048] Figure 11 This is a flow chart of another biometric identification method provided in an embodiment of the present application;
[0049] Figure 12 is a schematic diagram of the weight of the first image provided in an embodiment of the present application;
[0050] Figure 13 This is a flow chart of another biometric identification method provided in an embodiment of the present application;
[0051] Figure 14 This is a flow chart of another biometric identification method provided in an embodiment of the present application;
[0052] Figure 15 This is a schematic diagram of the structure of a biometric identification device provided in an embodiment of the present application;
[0053] Figure 16 is a schematic structural diagram of another biometric feature recognition device provided in an embodiment of the present application;
[0054] Figure 17 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0055] Figure 18 This is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0057] As used herein, the terms "first," "second," "third," "fourth," and the like may be used to describe various concepts herein, but unless otherwise specified, these concepts are not limited by these terms. These terms are merely used to distinguish one concept from another. For example, a first feature can be referred to as a second feature, and similarly, a second feature can be referred to as a first feature without departing from the scope of this application.
[0058] As used herein, the terms "at least one," "a plurality," "each," and "any" include one, two, or more than two, "a plurality" includes two or more than two, "each" refers to each of the corresponding plurality, and "any" refers to any one of the plurality. For example, a plurality of pixels includes three pixels, and "each" refers to each of the three pixels. "Any" refers to any one of the three pixels, which may be the first pixel, the second pixel, or the third pixel.
[0059] 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, storage, and display, etc.), and signals 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 images involved in this application were obtained with full authorization.
[0060] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0061] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI disciplines. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0062] Computer vision (CV) is the science of making machines "see." Specifically, it refers to using cameras and computers to replace the human eye in identifying and measuring objects, and then further processing them to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems that can extract information from images or multidimensional data. Large model technology has brought significant changes to the development of computer vision technology. Pre-trained models in the field of vision, such as SwinTransformer (a deep learning model), ViT (Vision Transformer, a deep learning model), V-MOE (a visual model), and MAE (Masked Auto Encoders), can be quickly and widely applied to specific downstream tasks after fine-tuning. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D (3D) technology, virtual reality, augmented reality, simultaneous positioning and mapping, biometric recognition and other technologies.
[0063] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by demonstration. Pretrained models are the latest development in deep learning, integrating these techniques.
[0064] The solution provided in the embodiment of the present application is based on artificial intelligence machine learning technology, which can train a target detection model and implement a biometric recognition method using the trained target detection model.
[0065] The biometric feature recognition method provided in the embodiments of the present application can be executed by a computer device. Optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, smart voice interaction device, smart home appliance and car terminal, etc., but is not limited to this.
[0066] In some embodiments, the computer program involved in the embodiments of the present application can be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected through a communication network. Multiple computer devices distributed at multiple locations and interconnected through a communication network can constitute a blockchain system.
[0067] In some embodiments, the computer device is provided as a server. Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 1 The implementation environment includes a terminal 101 and a server 102, and the terminal 101 and the server 102 are connected via a wireless or wired network.
[0068] The terminal 101 is used to capture images and send the captured images to the server 102 via a network connection with the server 102. The server 102 is used to receive the images sent by the terminal 101 and process the images to identify biometric features contained in the images.
[0069] In some embodiments, terminal 101 is installed with an application provided by server 102, and terminal 101 can use this application to implement functions such as data transmission and message exchange. Optionally, the application is an application in the operating system of terminal 101, or an application provided by a third party. For example, the application is any application that has a biometric feature recognition function. Of course, the application can also have other functions, such as review functions, shopping functions, navigation functions, game functions, etc.
[0070] The terminal 101 is used to log in to the application based on the account, and send the collected image to the server 102 through the application. The server 102 is used to receive the image sent by the terminal 101 and process the image to identify the biometric features in the image.
[0071] Figure 2 This is a flow chart of a biometric identification method provided by an embodiment of the present application, which is executed by a computer device, such as Figure 2 As shown, the method includes:
[0072] 201. A computer device determines a first recognition range from a first image, where the image within the first recognition range includes a biometric feature, and the first image is acquired based on a first exposure parameter.
[0073] In an embodiment of the present application, in response to a biometric recognition instruction, an image containing a biometric feature is captured so that the image containing the biometric feature can be subsequently recognized. Considering that content other than the biometric feature in the image may affect the accuracy of biometric recognition, and the brightness of the partial image containing the biometric feature may affect the clarity of the biometric feature, thereby also affecting the accuracy of biometric recognition, a first recognition range is determined from the captured image to determine the location of the biometric feature in the first image. The brightness of the image within the first recognition range is detected to determine whether it falls within a preset brightness range to determine whether the partial image containing the biometric feature is sufficiently clear. If the partial image containing the biometric feature is not clear enough, the exposure parameters are adjusted so that the next image is captured using the adjusted exposure parameters to make the partial image containing the biometric feature in the next captured image clearer. Only when the partial image containing the biometric feature is clear enough will biometric recognition be performed on the partial image containing the biometric feature to identify the object to which the biometric feature belongs, thereby ensuring the accuracy and success rate of biometric recognition.
[0074] Among them, biometrics refers to the basic attributes or characteristics possessed by organisms, and the biometrics of different organisms may be different. The biometric feature may be at any position in the first image, for example, the biometric feature is at the upper left corner of the first image, or at the upper right corner of the first image. The first recognition range is the range where the biometric feature is identified from the first image, and the image within the first recognition range contains the complete biometric feature. The first recognition range can be a range of any shape, and the first recognition range is a circular range or a square range. In an embodiment of the present application, determining the first recognition range from the first image refers to determining the coordinates of the first recognition range in the first image, that is, determining the position of the biometric feature from the first image. Exposure parameters are used to capture images, and the exposure parameters include aperture, shutter speed or sensitivity, etc. The first exposure parameters refer to the exposure parameters used when capturing the first image.
[0075] 202. When the brightness of the image within the first recognition range does not fall within a preset brightness range, the computer device adjusts the first exposure parameter to obtain a second exposure parameter.
[0076] In the embodiment of the present application, the preset brightness range is an arbitrary brightness range. If the brightness of the image within the first recognition range falls within the preset brightness range, it indicates that the partial image containing the biometric feature is sufficiently clear. If the brightness of the image within the first recognition range does not fall within the preset brightness range, it indicates that the partial image containing the biometric feature is not clear enough. Furthermore, considering that the exposure parameters will affect the brightness of the captured image, that is, whether the image is clear is related to the exposure parameters used when capturing the image, when determining the first recognition range from the first image, it is detected whether the brightness of the image within the first recognition range falls within the preset brightness range. If the brightness of the image within the first recognition range does not fall within the preset brightness range, it is determined that the partial image containing the biometric feature is not clear enough. The first exposure parameters used to capture the first image are adjusted to obtain new exposure parameters so that the next image can be captured using the new exposure parameters, thereby improving the clarity of the partial image containing the biometric feature in the next captured image.
[0077] The image within the first recognition range is equivalent to the partial image of the first image that contains the biometric feature. The second exposure parameter is different from the first exposure parameter, for example, one or more of the aperture, shutter speed, or sensitivity of the first exposure parameter and the second exposure parameter are different.
[0078] 203. The computer device captures a second image based on the second exposure parameter, where the second image includes a biometric feature.
[0079] In the embodiment of the present application, when the second exposure parameter is obtained, an image is captured using the second exposure parameter to obtain a second image, so that the second image can be used to perform biometric feature recognition subsequently.
[0080] 204. The computer device determines a second recognition range from the second image based on the coordinates of the first recognition range in the first image, where the coordinates of the second recognition range in the second image are the same as the coordinates of the first recognition range in the first image.
[0081] In an embodiment of the present application, the first image and the second image are acquired in response to a biometric instruction, and the second image is acquired after the first image. The position of the biometric feature in the second image may change relative to the first image, but considering that the time interval between acquiring the first image and acquiring the second image is short, the position of the biometric feature in the second image does not change much compared to the position of the biometric feature in the first image. Therefore, the coordinates of the first recognition range in the first image are used to determine the second recognition range from the second image, so that the third recognition range can be determined from the second image as soon as possible using the second recognition range, so that the image within the third recognition range contains the biometric feature.
[0082] The second recognition range has the same shape as the first recognition range and is equivalent to the area obtained by mapping the first recognition range onto the second image. For example, the first image and the second image have the same size, the second recognition range has the same size, and the coordinates of the second recognition range in the second image are the same as the coordinates of the first recognition range in the first image. The coordinates of the first recognition range in the first image indicate the position of the first recognition range in the first image. For example, if the first recognition range is a rectangular range, the coordinates of the first recognition range in the first image are the coordinates of the four corners of the rectangular range.
[0083] 205. The computer device adjusts the coordinates of the second recognition range in the second image to obtain a third recognition range, and the image within the third recognition range contains the biometric feature.
[0084] In the embodiment of the present application, since the second recognition range is determined based on the first recognition range in the first image, and considering that the position of the biometric feature may change when the first and second images are captured, thereby resulting in different positions of the biometric feature in the first and second images, the coordinates of the second recognition range in the second image are adjusted. The adjusted recognition range is the third recognition range determined from the second image, so that the image within the third recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained third recognition range. In the embodiment of the present application, determining the third recognition range from the second image means determining the coordinates of the third recognition range in the second image, that is, determining the position of the biometric feature from the second image.
[0085] 206. When the brightness of the image within the third identification range falls within a preset brightness range, the computer device performs biometric feature recognition on the image within the third identification range to identify the object to which the biometric feature contained in the image within the third identification range belongs.
[0086] Biometric recognition refers to identifying the biometric features contained in an image to identify the object to which the biometric features belong. For example, a computer device stores reference images corresponding to multiple objects, each of which contains the biometric features of the object. If the brightness of an image within a third recognition range falls within a preset brightness range, the image within the third recognition range is compared with the multiple reference images to determine which reference image contains the same biometric features as the image within the third recognition range. If the biometric features contained in the image within the third recognition range are the same as those contained in any of the reference images, the biometric features contained in the image within the third recognition range are determined to be the biometric features of the object corresponding to the reference image.
[0087] In the embodiment of the present application, the image within the third identification range is equivalent to the partial image of the second image containing the biometric feature. The brightness of the image within the third identification range falls within the preset brightness range, indicating that the partial image of the second image containing the biometric feature is clear enough. Therefore, biometric feature recognition can be performed on the partial image of the second image containing the biometric feature to identify which object the biometric feature belongs to, so as to ensure the accuracy of biometric feature recognition.
[0088] In the solution provided by the embodiment of the present application, during the process of biometric feature recognition, a first recognition range is determined from the captured first image to determine the position of the biometric feature in the first image, and whether the brightness of the image within the first recognition range is sufficient is detected to determine whether the biometric feature in the first image is clear enough. If the brightness of the image within the first recognition range does not fall within the preset brightness range, it is determined that the biometric feature in the first image is not clear enough, and the exposure parameters are adjusted so that the next image can be captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image. Considering that the time interval between capturing the first image and capturing the second image is short, the time interval between capturing the first image and capturing the second image and capturing the biometric feature in the first recognition range is short. Compared with the position of the first image, the position of the biometric feature in the second image does not change much. Therefore, the coordinates of the first recognition range in the first image are used to determine the second recognition range from the second image, so that the third recognition range can be determined from the second image as soon as possible using the second recognition range, so that the image within the third recognition range contains the biometric feature, so that when the brightness of the image within the third recognition range falls within the preset brightness range, the image within the third recognition range is subjected to biometric feature recognition to identify which object the biometric feature belongs to, so as to avoid recognition errors or recognition failures due to unclear biometric features in the image, so as to ensure the accuracy and success rate of biometric recognition.
[0089] exist Figure 2 On the basis of the illustrated embodiment, the embodiment of the present application can also adopt a multiple scale transformation method to utilize the multi-scale features of the first image to determine the first recognition range. The specific process is detailed in the following embodiment.
[0090] Figure 3 This is a flow chart of another biometric identification method provided by an embodiment of the present application, which is executed by a computer device, such as Figure 3 As shown, the method includes:
[0091] 301. A computer device performs multiple scale transformations on features of a first image to obtain multiple first features, where the scales of the multiple first features are different.
[0092] In the embodiment of the present application, considering that the meanings expressed by different scale features of the first image may be different, multi-scale features of the first image are obtained to enrich the feature expression method of the first image, so that the multi-scale features of the first image can be subsequently used to detect the position of the biometric features in the first image, thereby ensuring the accuracy of the subsequently determined recognition range.
[0093] Among them, the features of the first image are used to characterize the first image, and the features of the first image can be any type of features. For example, the features of the first image are color histogram features, directional gradient histogram (Histogram Of Gradient) features, etc. Multiple rescaling refers to performing multiple rescaling on features to obtain features of multiple scales, and the scales of the features obtained by each rescaling are different. For example, the features of the first image are subjected to multiple dimensionality reductions, and the features obtained by each dimensionality reduction are a first feature. Performing multiple dimensionality reductions on the features of the first image is equivalent to performing multiple rescaling on the features of the first image. For another example, the features of the first image are subjected to multiple dimensionality increases, and the features obtained by each dimensionality increase are a first feature. Performing multiple dimensionality increases on the features of the first image is equivalent to performing multiple rescaling on the features of the first image.
[0094] In one possible implementation, the first image is an image captured in response to a biometric feature recognition instruction, and the first image is captured based on a first exposure parameter.
[0095] The biometric feature recognition instruction instructs to collect an image for biometric feature recognition. The first image may be the first image collected, or may not be the first image collected.
[0096] In an embodiment of the present application, when the first image is the first image captured in response to a biometric recognition instruction, the first exposure parameter is a default exposure parameter; when the first image is the nth image captured in response to a biometric recognition instruction, the first exposure parameter is adjusted based on the exposure parameter used to capture the n-1th image, where n is an integer greater than 1.
[0097] In an embodiment of the present application, in response to a biometric recognition instruction, an image is captured, and then the biometric features in the captured image are recognized. After the image is captured, a recognition range is determined from the captured image to determine the position of the biometric features in the captured image, and whether the brightness of the image within the recognition range falls within a preset brightness range is detected. If the brightness of the image within the recognition range does not fall within the preset brightness range, the exposure parameters are adjusted so that the next image can be captured using the adjusted exposure parameters, and then detected again. The above process is repeated until the brightness of the image within the recognition range determined from the currently captured image falls within the preset brightness range, and biometric recognition is performed on the image within the current recognition range.
[0098] Optionally, the computer device collects images of the shooting area through a camera collector to obtain a first image. The camera collector is used to collect images, such as Figure 4 As shown, the camera collector includes an IR (Infrared Radiation) emission polarization zone, an IR receiving polarization zone, an RGB (Red Green Blue) light guide ring, an IR camera, an RGB camera, an IR LED (light-emitting diode), etc. For example, the camera collector can monitor whether a biometric feature exists in a shooting area. If a biometric feature is detected in the shooting area, the shooting area is photographed to obtain an image.
[0099] In one possible implementation, step 301 includes: reducing the dimension of the features of the first image to obtain the 1st first feature, reducing the dimension of the i-th first feature to obtain the i+1-th first feature, where i is an integer greater than 0.
[0100] In an embodiment of the present application, first features at multiple scales are obtained by multiple dimensionality reduction of features of the first image, so that the first features at multiple scales can all represent the first image, thereby ensuring the accuracy of the obtained multiple first features.
[0101] In one possible implementation, step 301 includes: dividing the first image into blocks to obtain multiple image blocks; classifying each image block to obtain the category to which each image block belongs; based on the categories to which the multiple image blocks belong, forming a regional image from the image blocks belonging to a target category, the target category indicating that the image block contains a biological feature; performing multiple scale transformations on the features of the regional image to obtain multiple first features.
[0102] In an embodiment of the present application, considering that the first image may contain other content in addition to the biometric features, the first image is divided into blocks and the image blocks contained in the first image are classified to extract a local image containing the biometric features from the first image, and then the features of the local image are extracted. The features of the local image are used as the features of the first image so that the features of the local image can be subsequently used to perform biometric feature recognition, thereby weakening the influence of other content in the first image and ensuring that the extracted first features can more accurately represent the biometric features.
[0103] The size of the image block can be any size, for example, the size of the image block is 5×5. The sizes of multiple image blocks may be the same or different. Among the multiple image blocks, any image block may contain a biometric feature, any image block may contain a partial biometric feature, and any image block may not contain a biometric feature. The category to which the image block belongs indicates whether the image block contains a biometric feature. An image block belonging to a target category contains a biometric feature, and an image block belonging to a target category may contain a partial biometric feature or a complete biometric feature. The regional image is a local image in the first image that contains a biometric feature. The features of the regional image are used to represent the regional image. The features of the regional image can be any type of features, for example, the features of the regional image are color histogram features, directional gradient histogram features, etc.
[0104] Optionally, each image block is classified to obtain a weight for each image block, where the weight represents the possibility that the image block contains a biological feature. When the weight of the image block is not less than a threshold, the image block is determined to belong to the target category; when the weight of the image block is less than the threshold, the image block is determined to belong to another category.
[0105] The categories to which an image block belongs include target categories or other categories, where other categories are categories different from the target category. The greater the weight of an image block, the greater the likelihood that the image block contains a biometric feature. For example, the weight of an image block ranges from (0, 1), where a weight of 0 indicates that the image block does not contain a biometric feature; a weight of 1 indicates that the image block contains a biometric feature. The threshold is an arbitrary value, such as 0.8.
[0106] For example, if the weight of an image block is 0.9 and the threshold is 0.8, and the weight of the image block is not less than the threshold, then the image block belongs to the target category. For another example, if the weight of an image block is 0.7 and the threshold is 0.8, and the weight of the image block is not less than the threshold, then the image block belongs to another category.
[0107] Optionally, the process of determining the weight of the image block includes: performing feature extraction on the image block to obtain features of the image block; and performing feature conversion on the features of the image block to obtain the weight of the image block.
[0108] In an embodiment of the present application, features of an image block are extracted and feature conversion is performed, for example, convolution processing is performed on the features of the image block to convert the features of the image block into a value to represent the weight of the image block, so that the weight of the image block can indicate the possibility that the image block contains biological features, thereby ensuring the accuracy of the weight.
[0109] Optionally, the process of obtaining the features of the regional image includes: dividing the regional image into blocks to obtain multiple first image blocks, performing feature extraction on each first image block to obtain the features of each first image block; and splicing the features of multiple first image blocks to obtain the features of the regional image.
[0110] For example, the feature of each first image block is a histogram of oriented gradient feature, and the features of multiple first image blocks are adjacent end to end and spliced into a vector as the feature of the regional image.
[0111] Optionally, the process of obtaining a regional image includes: dividing the first image into blocks through an image recognition model to obtain multiple image blocks; classifying each image block to obtain the category to which each image block belongs; and based on the categories to which the multiple image blocks belong, forming a regional image from the image blocks belonging to the target category.
[0112] The image recognition model is any network model, for example, a lightweight convolutional neural network. This network model can segment the input image into blocks, determine the weight of each block, and then output an image of the region containing the biometric features based on the weights. For example, the image recognition model segments the input image into blocks to obtain features of multiple blocks. The features of the multiple blocks are passed through an attention layer to obtain weights for each block, and then output an image of the region containing the biometric features based on the weights.
[0113] In one possible implementation, before obtaining the features of the first image, the sample image can also be denoised to eliminate noise pixels in the sample image. That is, the process of filtering the noise pixels in the first image includes: processing the noise pixels in the first image by using median filtering.
[0114] In the embodiment of the present application, median filtering is adopted to reduce noise on the sample image to adjust the pixel values of the noise pixels in the first image to ensure the accuracy of the filtered first image.
[0115] Optionally, based on a set window, pixel values of pixels in the first image are adjusted in a collection and traversal manner.
[0116] For example, the width and height of the first image are determined, and the width and height of the window are determined; based on the window, traverse from the upper left corner of the first image, sort the pixel values of the pixels in the window to obtain a pixel value queue, and use the pixel value in the middle position of the pixel value queue as the pixel value of the pixel corresponding to the center of the window. After that, move the window according to the step size, and sort the pixel values of the pixels in the window again in the above manner, so as to update the pixel values of the pixels corresponding to the center of the window, and so on, to complete the update of the pixel values of the pixels in the sample image.
[0117] Optionally, based on the pixel value of the pixel point in the first image, the noise pixel point in the first image is determined, and based on a window centered on the noise pixel point, multiple reference pixel points are determined. The multiple reference pixel points are pixel points contained in the window centered on the noise pixel point. The pixel values of the multiple reference pixel points are sorted to obtain a pixel value queue, and the pixel value located in the middle position of the pixel value queue is used as the pixel value of the noise pixel point.
[0118] Optionally, the process of determining noise pixel points includes: traversing the first image based on a preset window, and during the traversal process, determining the average pixel value of the pixel points in the preset window, and determining that the pixel point is a noise pixel point when the difference between the pixel value of any pixel point in the preset window and the average pixel value is greater than a threshold.
[0119] 302. The computer device updates each first feature based on the multiple first features to obtain a second feature corresponding to each first feature.
[0120] In an embodiment of the present application, each first feature is updated separately through multiple first features so that each updated second feature incorporates other first features, thereby enhancing the correlation between features of different scales and ensuring the accuracy of the obtained second features.
[0121] In one possible implementation, step 302 includes: performing scale transformation on the fifth feature so that the scale of the scale-transformed fifth feature is the same as that of the sixth feature, and fusing the scale-transformed fifth feature and the sixth feature to obtain the second feature.
[0122] The sixth feature is any one of the multiple first features, and the fifth feature is a feature of the multiple first features except the sixth feature.
[0123] In the embodiment of the present application, since the scales of the multiple first features are different, each first feature is updated by first performing scale transformation and then fusing them to ensure the accuracy of the obtained second feature.
[0124] 303. The computer device processes each second feature to obtain a fourth recognition range, where the image within the fourth recognition range contains the biometric feature.
[0125] In the embodiment of the present application, each second feature can represent the first image. By processing each second feature, the position of the biological feature in the first image can be predicted through the second feature of each scale, that is, multiple fourth recognition ranges can be obtained.
[0126] In the embodiments of the present application, determining the fourth recognition range from the first image refers to determining the location of the fourth recognition range in the first image, that is, determining the location of the biometric feature from the first image. Obtaining multiple fourth recognition ranges refers to determining multiple possible locations of the biometric feature from the first image.
[0127] In one possible implementation, step 303 includes: performing biometric detection on each second feature to obtain a fourth identification range.
[0128] In the embodiment of the present application, the features of the image are utilized and a biometric detection method is adopted to detect the position of the biometric in the image and obtain the recognition range, so that the recognition range indicates the position of the biometric, thereby ensuring the accuracy of the recognition range.
[0129] It should be noted that the above steps 301 to 303 can be performed by a target detection model. The target detection model is used to determine the location of the biological features in the image using the input image features. The target detection model can be any neural network model, for example, the target detection model includes a convolutional or feedforward neural network.
[0130] In one possible implementation, the target detection model includes a Backbone sub-model, a Neck sub-model, and a Head sub-model.
[0131] Wherein, the Neck sub-model is used to execute the above step 302 and update the features of multiple scales. The Head sub-model is used to execute the above step 303 and output the position of the biological features in the image based on the features of each scale. The Backbone sub-model is used to perform multiple scale transformations on the input image features. The Backbone sub-model can be any network model. For example, the Backbone sub-model is a neural network model composed of a convolution layer and a GRU (Gate Recurrent Unit) layer, and the convolution layer is a 2D (2Dimensions, three-dimensional) convolution layer. For example, the Backbone sub-model includes a 2D convolution layer, a nonlinear activation function, a Dropout (a network layer), a pooling layer, a fully connected layer, etc. For another example, the Backbone sub-model is a neural network model composed of a convolution layer and an LSTM (Long Short-Term Memory, long short-term memory network) layer, and the convolution layer is a 3D convolution layer. For another example, the Backbone sub-model is composed of a 2D convolution layer and a maximum convolution network.
[0132] For example, the structure of the target detection model is as follows Figure 5 As shown, the Backbone sub-model includes multiple convolutional layers for performing multiple scale transformations on input image features. The Neck sub-model includes upsampling, downsampling, and pooling layers, which enable updating features at each scale based on features at multiple scales. The Head sub-model includes multiple detection modules, each of which detects features at different scales and outputs the location of the biometric feature. The detection module is YOLO V3 (You Only Look Once V3, currently the third version of the detection algorithm).
[0133] 304. The computer device determines a first recognition range based on the obtained multiple fourth recognition ranges, and the image within the first recognition range contains a biometric feature.
[0134] In the embodiment of the present application, considering that the meanings expressed by different scale features of the first image may be different, multi-scale features of the first image are obtained to enrich the feature expression of the first image, and the multi-scale features of the first image are used to determine the possible location of the biometric feature from the first image, that is, to determine multiple fourth recognition ranges. Based on the multiple fourth recognition ranges, the exact location of the biometric feature can be determined, that is, the first recognition range can be determined to ensure the accuracy of the determined first recognition range.
[0135] In one possible implementation, step 304 includes: based on the confidence of each fourth recognition range, determining the fourth recognition range with the highest confidence as the first recognition range, where the confidence indicates the possibility that the image within the fourth recognition range contains the biometric feature.
[0136] The greater the confidence level of the fourth identification range, the greater the likelihood that the image within the fourth identification range contains the biometric feature. For example, the confidence level of the fourth identification range ranges from (0 to 1). A confidence level of 0 indicates that the fourth identification range does not contain the biometric feature, while a confidence level of 1 indicates that the fourth identification range contains the biometric feature.
[0137] In an embodiment of the present application, when each fourth identification range is obtained, the confidence of each fourth identification range can also be obtained. The confidence can reflect the possibility that the fourth identification range contains biometric features. Therefore, the fourth identification range with the highest confidence is determined as the first identification range to ensure that the determined first identification range contains biometric features and to ensure the accuracy of the first identification range.
[0138] Optionally, the process of obtaining the confidence level of the fourth recognition range includes: performing biometric detection on the second feature to obtain the fourth recognition range and the confidence level of the fourth recognition range.
[0139] 305. When the brightness of the image within the first recognition range does not fall within the preset brightness range, the computer device adjusts the first exposure parameter to obtain a second exposure parameter.
[0140] In one possible implementation, the process of determining the brightness of the image within the first recognition range includes: determining the brightness of the image within the first recognition range based on pixel values of pixels in the image within the first recognition range.
[0141] In an embodiment of the present application, since the pixel values of the pixel points in the image within the first recognition range can reflect the brightness of each pixel point, the brightness of the image within the first recognition range is determined based on the pixel values of the pixel points in the image within the first recognition range to ensure the accuracy of the determined brightness.
[0142] Optionally, the pixel value of each pixel is expressed in RGB (Red Green Blue) format, and the process of determining the brightness of the image within the first recognition range includes: for each pixel in the image within the first recognition range, weighting the R value, G value and B value of the pixel to obtain the brightness of the pixel, and determining the average value of the brightness of the pixels in the image within the first recognition range as the brightness of the image within the first recognition range.
[0143] In an embodiment of the present application, the pixel value of each pixel is represented by the color of the three channels of red, green and blue. By weighting the color values of the three channels of red, green and blue for each pixel, the brightness of each pixel can be obtained, and then based on the brightness of the pixels in the image within the first recognition range, the brightness of the image within the first recognition range can be determined.
[0144] In one possible implementation, the method of adjusting the first exposure parameter includes: when the brightness of the image within the first recognition range is less than the minimum value in the preset brightness range, increasing the first exposure parameter to obtain the second exposure parameter; or, when the brightness of the image within the first recognition range is greater than the maximum value in the preset brightness range, reducing the first exposure parameter to obtain the second exposure parameter.
[0145] In an embodiment of the present application, when the brightness of the image within the first recognition range does not fall within the preset brightness range, the first exposure parameter is adjusted based on the relationship between the brightness of the image within the first recognition range and the brightness value within the preset brightness range, so that when the image is subsequently captured based on the obtained second exposure parameter, the brightness of the image within the range where the biological feature is located in the captured image can be ensured to fall within the preset brightness range as much as possible, so as to ensure the accuracy of the determined second exposure parameter.
[0146] 306. The computer device captures a second image based on the second exposure parameter, where the second image includes a biometric feature.
[0147] In one possible implementation, the computer device includes an image sensor, and step 306 includes: adjusting an exposure parameter of the image sensor to a second exposure parameter, and capturing an image using the adjusted image sensor to obtain a second image.
[0148] In an embodiment of the present application, the image sensor in the computer device is used to capture images. The computer device captures the screen within the shooting area into an image through the image sensor. Therefore, the exposure parameter of the image sensor is first adjusted to a second exposure parameter, so that the image can be captured with the second exposure parameter through the adjusted image sensor to obtain a second image.
[0149] 307. The computer device determines a second recognition range from the second image based on the coordinates of the first recognition range in the first image, where the coordinates of the second recognition range in the second image are the same as the coordinates of the first recognition range in the first image.
[0150] In one possible implementation, step 307 includes: determining position parameters of the first recognition range in the first image, and based on the position parameters of the first recognition range in the first image, determining a second recognition range in the second image, wherein the position parameters of the second recognition range in the second image are the same as the position parameters of the first recognition range in the first image.
[0151] The position parameter of the first identification range in the first image indicates the position of the first identification range in the first image, and the position parameter includes coordinates. The position parameter of the first identification range in the first image can be expressed in any form. For example, if the first identification range is a square area, the position parameter of the first identification range in the first image includes the center coordinates and side lengths of the first identification range; or, the position parameter of the first identification range in the first image includes the coordinates of the four corners. For another example, if the first identification range is a circular area, the position parameter of the first identification range in the first image includes the center coordinates and radius of the first identification range.
[0152] In an embodiment of the present application, the first image and the second image have the same size. By determining the position parameters of the first recognition range in the first image, the second recognition range can be determined in the second image according to the position parameters of the first recognition range in the first image, so as to ensure that the position of the determined second recognition range in the second image is the same as the position of the first recognition range in the first image, thereby ensuring the accuracy of the determined second recognition range.
[0153] 308. The computer device adjusts the coordinates of the second recognition range in the second image to obtain a third recognition range, and the image within the third recognition range contains the biometric feature.
[0154] In one possible implementation, step 308 includes: for each pixel point within the second identification range, determining the probability that the second identification range contains the biometric feature when the second identification range is centered on the pixel point; and based on the determined probability, adjusting the coordinates of the second identification range in the second image to obtain a third identification range.
[0155] The determined probabilities include multiple ones, and each probability corresponds to a pixel point within the second recognition range.
[0156] In this embodiment of the present application, for each pixel within the second recognition range, the probability that the second recognition range contains the biometric feature is determined when the second recognition range is centered on the pixel, thereby determining the likelihood that the second recognition range contains the biometric feature when the second recognition range is centered on each pixel. Based on the determined probabilities, the coordinates of the second recognition range in the second image are adjusted so that the image within the adjusted third recognition range contains the biometric feature, thereby ensuring the accuracy of the third recognition range.
[0157] Optionally, the process of determining the third identification range includes: determining the target coordinates based on the determined probability, the target coordinates being the coordinates of the target pixel point within the second identification range, wherein, in the determined probability, when the second identification range is centered on the target pixel point, the probability that the second identification contains the biometric feature is the largest; determining the third identification range with the target coordinates as the center, the size of the third identification range being the same as the size of the second identification range.
[0158] In an embodiment of the present application, when the second recognition range is centered on any pixel point, the greater the probability that the second recognition range contains the biometric feature, the greater the possibility that the second recognition range contains the biometric feature when the second recognition range is centered on the pixel point. Therefore, the maximum probability is determined from the multiple probabilities determined, and the coordinates of the pixel point corresponding to the maximum probability are determined as the target coordinates, and then the second recognition range is moved so that the center of the moved recognition range is located on the target coordinates, so as to ensure that the image within the obtained third recognition range contains the biometric feature, and thus ensure the accuracy of the obtained third recognition range.
[0159] It should be noted that the embodiment of the present application is explained by taking the adjustment of the coordinates of the second recognition range as an example. In another embodiment, the new recognition range can also be determined with the target coordinates in the above manner; then, for each pixel point within the new recognition range, when the new recognition range is centered on each pixel point, the probability that the new recognition range contains the biometric feature is determined, and based on the currently determined probability, the next target coordinates are determined so as to determine the next recognition range with the next target coordinates as the center; when the distance between the currently determined target coordinates and the previous target coordinates is less than the first threshold, or when the maximum probability currently determined is greater than the second threshold, the currently determined recognition range is determined as the third recognition range.
[0160] Optionally, the process of determining the probability includes: determining the pixel features of each pixel point within the second identification range, for the first pixel point within the second identification range, determining the distance between the pixel features of each second pixel point and the pixel features of the first pixel point, and determining the average value of multiple distances as the probability corresponding to the first pixel point. The probability corresponding to the first pixel point is the probability that the second identification range contains the biological feature when the second identification range is centered on the first pixel point.
[0161] The first pixel is any pixel within the second recognition range, and the second pixel is a pixel other than the first pixel within the second recognition range. The pixel feature of the pixel can be represented in any form, for example, the pixel feature of the pixel is a color histogram feature of the pixel.
[0162] In the embodiment of the present application, a Mean Shift method is adopted to determine the probability that the second recognition range contains a biometric feature when the second recognition range is centered on each pixel point.
[0163] In an embodiment of the present application, the optical flow method is used to determine the third recognition range on the second image. Considering that in the process of biometric feature recognition, the position difference of the biometric features in the two adjacent images collected is small, therefore, the first recognition range on the first image is combined to determine the second recognition range on the second image, and then the pixel clustering method is adopted to determine the third recognition range to ensure the accuracy of the determined third recognition range.
[0164] Optionally, the process of determining the target coordinates includes: determining the color histogram features of the pixels within the second recognition range, taking kernel density estimation based on the color histogram features of the pixels within the second recognition range, determining the probability distribution of the coordinates, and determining the coordinates with the largest probability density in the probability distribution as the target coordinates.
[0165] In one possible implementation, step 308 includes: determining the movement distance and movement direction of the biometric feature based on the coordinates of the first key point in the first image and the coordinates of the second key point in the second image, where the first key point and the second key point are the same key point of the biometric feature; and moving the second recognition range based on the movement distance and movement direction to obtain a third recognition range.
[0166] The first key point is a key point of the biometric feature in the first image, and the second key point is a key point of the biometric feature in the second image. The first key point and the second key point are the same key point of the biometric feature. For example, the first key point is the center point of the biometric feature in the first image, and the second key point is the center point of the biometric feature in the second image. The first key point can be any key point, for example, the center point of the biometric feature, or an edge point of the biometric feature.
[0167] In an embodiment of the present application, the position of the biometric feature in the second image may change relative to the first image, and the key points of the biometric feature will also change. Therefore, when determining the area where the biometric feature is located in the first image, the key points of the biometric feature in the first image and the key points of the biometric feature in the second image are identified, so as to determine the movement distance and movement direction of the biometric feature in the second image compared with the first image according to the positions of the key points of the biometric feature in the first image and the key points in the second image, and then move the mapped second recognition range according to the movement distance and movement direction to change the coordinates of the second recognition range to obtain a third recognition range, so as to ensure that the image within the obtained third recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained third recognition range.
[0168] Optionally, the process of determining the first key point includes: performing key point recognition on the image within the first recognition range to obtain the first key point.
[0169] In an embodiment of the present application, by performing key point recognition on images within the first recognition range, there is no need to perform key point recognition on images in other areas, so as to ensure that the first key point can be obtained as soon as possible, and to ensure the accuracy and efficiency of obtaining the first key point.
[0170] It should be noted that the process of determining the second key point is the same as the process of determining the first key point mentioned above, and will not be repeated here.
[0171] It should be noted that the embodiment of the present application is described using a first key point and a second key point as an example. In another embodiment, the moving distance and moving direction of the biometric feature can be determined based on the coordinates of multiple first key points in the first image and the coordinates of multiple second key points in the second image. The multiple first key points correspond one-to-one to the multiple second key points, and the first key point and the corresponding second key point are the same key point of the biometric feature. Based on the moving distance and moving direction, the second recognition range is moved to obtain the third recognition range.
[0172] In one possible implementation, the process of determining the moving distance and moving direction of a biometric feature based on multiple first key points and multiple second key points includes: for each first key point, determining a first distance and a first direction based on the coordinates of the first key point and the coordinates of the corresponding second key point, where the first direction points from the first key point to the second key point, determining the average of the multiple first distances as the moving distance of the biometric feature, and determining the average of the multiple first directions as the moving direction of the biometric feature.
[0173] In the embodiment of the present application, the first direction is expressed as an angle, which is equivalent to the angle between the ray pointing from the point corresponding to the coordinates of the first key point to the point corresponding to the coordinates of the second key point in the XY coordinate system and the X-axis.
[0174] In one possible implementation, step 308 includes: determining the movement distance and movement direction of the biometric feature based on the coordinates of the first key point in the first image and the coordinates of the second key point in the second image, where the first key point and the second key point are the same key point of the biometric feature; moving the second recognition range based on the movement distance and movement direction to obtain a fifth recognition range; for each pixel point within the fifth recognition range, determining the probability that the fifth recognition range contains the biometric feature when the fifth recognition range is centered on the pixel point; based on the determined probability, adjusting the coordinates of the fifth recognition range in the second image to obtain a third recognition range.
[0175] In an embodiment of the present application, the position of the biometric feature in the second image may change relative to the first image, and the key point of the biometric feature will also change. Considering the possibility that any recognition range contains the biometric feature when it is centered on any pixel point within the recognition range, when the first recognition range is determined from the first image, the key points of the biometric feature in the first image and the key points in the second image are identified, so as to determine the movement distance and movement direction of the biometric feature in the second image compared with the first image according to the coordinates of the key points of the biometric feature in the first image and the coordinates of the key points in the second image. Then, according to the movement distance and movement direction, the mapped second recognition range is moved to obtain a fifth recognition range. Thereafter, based on the probability corresponding to the pixel points within the fifth recognition range, the coordinates of the fifth recognition range in the second image are adjusted so that the image within the adjusted third recognition range contains the biometric feature, thereby ensuring the accuracy of the third recognition range.
[0176] 309. When the brightness of the image within the third identification range falls within a preset brightness range, the computer device performs biometric feature recognition on the image within the third identification range to identify the object to which the biometric feature contained in the image within the third identification range belongs.
[0177] In one possible implementation, the process of performing biometric recognition on an image includes: when the brightness of the image within the third recognition range falls within a preset brightness range, comparing the image within the third recognition range with multiple reference images, obtaining the similarity between the image within the third recognition range and each reference image, and determining the object information of the reference image corresponding to the maximum similarity as the object information that matches the image within the third recognition range.
[0178] In the embodiment of the present application, each reference image contains a biometric feature. Multiple reference images contain different biometric features. Each reference image corresponds to an object. The biometric feature contained in the reference image is the biometric feature of the object represented by the object information. The greater the similarity between an image within the third recognition range and any reference image, the more similar the biometric feature contained in the image within the third recognition range is to the biometric feature contained in the reference image. Therefore, determining similarity is used to perform biometric recognition to ensure the accuracy of biometric recognition.
[0179] In the solution provided by the embodiment of the present application, during the process of biometric feature recognition, a first recognition range is determined from the captured first image to determine the position of the biometric feature in the first image, and whether the brightness of the image within the first recognition range is sufficient is detected to determine whether the biometric feature in the first image is clear enough. If the brightness of the image within the first recognition range does not fall within the preset brightness range, it is determined that the biometric feature in the first image is not clear enough, and the exposure parameters are adjusted so that the next image can be captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image. Considering that the time interval between capturing the first image and capturing the second image is short, the time interval between capturing the first image and capturing the second image and capturing the biometric feature in the first recognition range is short. Compared with the position of the first image, the position of the biometric feature in the second image does not change much. Therefore, the coordinates of the first recognition range in the first image are used to determine the second recognition range from the second image, so that the third recognition range can be determined from the second image as soon as possible using the second recognition range, so that the image within the third recognition range contains the biometric feature, so that when the brightness of the image within the third recognition range falls within the preset brightness range, the image within the third recognition range is subjected to biometric feature recognition to identify which object the biometric feature belongs to, so as to avoid recognition errors or recognition failures due to unclear biometric features in the image, so as to ensure the accuracy and success rate of biometric recognition.
[0180] It should be noted that the above Figure 3 The embodiment shown is described by taking the case where the brightness of the image within the first recognition range does not fall within the preset brightness range and the brightness of the image within the third recognition range falls within the preset brightness range as an example. In another embodiment, biometric recognition can also be performed on images within other recognition ranges.
[0181] In a possible implementation, the method further includes: performing biometric feature recognition on the image within the first recognition range when the brightness of the image within the first recognition range falls within a preset brightness range.
[0182] In an embodiment of the present application, when the brightness of the image within the first recognition range falls within the preset brightness range, it means that the image within the first recognition range is clear enough, and the biometric features contained in the image within the first recognition range can be biometrically recognized. Therefore, when the brightness of the image within the first recognition range falls within the preset brightness range, biometric recognition is performed on the image within the first recognition range without collecting other images, so as to ensure the efficiency of biometric recognition.
[0183] In one possible implementation, the method further includes: when the brightness of the image within the third recognition range does not fall within a preset brightness range, adjusting the second exposure parameter to obtain a third exposure parameter; and capturing the next image based on the third exposure parameter.
[0184] In an embodiment of the present application, when the brightness of the image within the third recognition range does not fall within the preset brightness range, it means that the image within the first recognition range is not clear enough, so the exposure parameters used when capturing the current image are adjusted so that the next image can be captured using the adjusted exposure parameters, so that a clearer image can be captured to ensure the accuracy of subsequent biometric recognition.
[0185] For example, in response to a biometric recognition instruction, a first image is captured based on a first exposure parameter, a first recognition range is determined from the first image, and the image within the first recognition range contains the biometric feature; if the brightness of the image within the first recognition range on the first image falls within a preset brightness range, biometric recognition is performed on the image within the first recognition range; if the brightness of the image within the first recognition range does not fall within the preset brightness range, the first exposure parameter is adjusted to obtain a second exposure parameter; a second image is captured based on the second exposure parameter; a second recognition range is determined from the second image, and the image within the second recognition range contains the biometric feature; if the brightness of the image within the second recognition range falls within the preset brightness range, biometric recognition is performed on the image within the second recognition range; if the brightness of the image within the second recognition range does not fall within the preset brightness range, the second exposure parameter is adjusted to obtain a third exposure parameter; so that a next image is captured based on the third exposure parameter, and the above process is repeated to ensure that the brightness of the image within the currently determined recognition range falls within the preset brightness range, and biometric recognition is then performed on the image within the currently determined recognition range.
[0186] It should be noted that the above Figure 3 The illustrated embodiment uses the features of the first image to determine the first recognition range as an example. In another embodiment, the above steps 301-304 do not need to be performed, but other methods are used to determine the first recognition range from the first image.
[0187] In one possible implementation, when the first image is not the first image collected in response to a biometric recognition instruction, the seventh recognition range is determined from the first image based on the coordinates of the sixth recognition range in the third image, the coordinates of the sixth recognition range in the third image are the same as the coordinates of the seventh recognition range in the first image, the image within the sixth recognition range contains biometrics, and the third image is the previous image of the first image; the coordinates of the seventh recognition range in the first image are adjusted to obtain the first recognition range.
[0188] The process of determining the first identification range is similar to the above steps 307 - 308 and will not be repeated here.
[0189] In one possible implementation, the process of determining the first recognition range includes: performing key point detection on the first image to obtain multiple target key points in the first image; and determining the first recognition range from the first image based on the relative position relationship between the multiple target key points and the biometric features and the coordinates of the multiple target key points in the first image.
[0190] A target keypoint is any keypoint. For example, if the target keypoint is a finger keypoint and the biometric feature is a feature of the palm region, then in an image containing a hand, the relative positional relationship between the finger and palm region remains unchanged regardless of the location of the palm region in the image. The relative positional relationship indicates the relationship between the positions of multiple target keypoints and the positions of the biometric feature. For example, the relative positional relationship indicates that the biometric feature is located below multiple target keypoints, or indicates that the biometric feature is located between multiple target keypoints.
[0191] In the embodiment of the present application, a relative positional relationship exists between the biometric feature and multiple target key points. In the captured image, regardless of the biometric feature's location within the image, the relative positional relationship between the biometric feature and the multiple target key points remains unchanged. Therefore, key point detection is performed on the first image to detect multiple target key points that have a relative positional relationship with the biometric feature. Based on the positions of the multiple target key points within the first image and the relative positional relationship between the multiple target key points and the biometric feature, a first recognition range is determined from the first image. This first recognition range can reflect the location of the biometric feature, thus ensuring the accuracy of the obtained first recognition range.
[0192] In the above Figures 2 to 3 On the basis of the embodiment shown, the embodiment of the present application can also determine the third recognition range by comparing the first image with the second image. The specific process is detailed in the following embodiment.
[0193] Figure 6 This is a flow chart of another biometric identification method provided by an embodiment of the present application, which is executed by a computer device, such as Figure 6 As shown, the method includes:
[0194] 601. A computer device determines a first recognition range from a first image, where the image within the first recognition range contains a biometric feature, and the first image is acquired based on a first exposure parameter.
[0195] 602. When the brightness of the image within the first recognition range does not fall within a preset brightness range, the computer device adjusts the first exposure parameter to obtain a second exposure parameter.
[0196] 603. The computer device captures a second image based on the second exposure parameter, where the second image includes a biometric feature.
[0197] Steps 601-603 are similar to the above steps 201-203 and will not be repeated here.
[0198] 604. The computer device extracts features from the first image and the second image respectively to obtain a third feature and a fourth feature, where the third feature indicates the first image and the fourth feature indicates the second image.
[0199] The third feature and the fourth feature can be expressed in any form.
[0200] In one possible implementation, the method of obtaining the third feature includes: dividing the first image into blocks to obtain multiple image blocks, performing feature extraction on each image block to obtain the features of each image block, and splicing the features of multiple image blocks to obtain the features of the first image.
[0201] The features of the image blocks can be any type of features, for example, the features of the image blocks are oriented gradient histogram features. The oriented gradient histogram features of multiple image blocks in the first image are adjacent to each other to form a vector to obtain the features of the first image.
[0202] It should be noted that the process of obtaining the fourth feature is the same as that of obtaining the third feature, and will not be repeated here.
[0203] 605. The computer device processes the third feature and the fourth feature to obtain motion information, where the motion information indicates a change in the position of the biometric feature in the second image relative to the first image.
[0204] In an embodiment of the present application, the third feature is used to represent the first image, and the fourth feature is used to represent the second image, that is, the third feature can represent the position of the biometric feature in the first image, and the fourth feature can represent the position of the biometric feature in the second image. By processing the third feature and the fourth feature, the comparison between the first image and the second image can be achieved to determine the change in the position of the biometric feature in the second image compared with the first image.
[0205] The operation information can be represented in any form, for example, the motion information can be represented in the form of a probability map.
[0206] 606. The computer device updates the motion information based on the third feature.
[0207] In an embodiment of the present application, the motion information is updated based on the third feature so that the updated motion information can better reflect the change in the position of the biometric feature in the second image compared with the first image, so as to subsequently determine whether to use the first recognition range on the first image to determine the position of the biometric feature in the second image.
[0208] 607. The computer device processes the fourth feature and the updated motion information to obtain a third recognition range.
[0209] In an embodiment of the present application, the third feature can indicate the position of the biometric feature in the first image, and the fourth feature can indicate the position of the biometric feature in the second image. By processing the third feature and the fourth feature, a comparison between the first image and the second image can be achieved to determine the change in the position of the biometric feature in the second image compared with the first image. Based on the third feature, the motion information is updated so that the updated motion information can better reflect the change in the position of the biometric feature in the second image compared with the first image. The fourth feature can indicate the content of the second image. The fourth feature and the updated motion information are processed to obtain the position of the biometric feature in the second image to ensure the accuracy of the third recognition range.
[0210] In one possible implementation, steps 604-607 are performed by a target detection model.
[0211] like Figure 7 As shown, through the target detection model, the third feature and the fourth feature are convolved to obtain motion information, which can be represented by a probability map. The third feature and the motion probability map are convolved to obtain updated motion information. The updated motion information includes a first label or a second label. The first label indicates that the position of the biometric feature in the second image has changed too much relative to the first image. The first label and the features of the second image are then combined to determine the third recognition range. The second label indicates that the position of the biometric feature in the second image has not changed much relative to the first image. The third recognition range in the second image can be determined based on the first recognition range in the first image. When the updated motion information is the first label, the first label and the fourth feature are convolved to obtain the third recognition range.
[0212] Optionally, the process of processing the fourth feature and the updated motion information includes: fusing the fourth feature and the updated motion information to obtain a fused feature; performing multiple scale transformations on the fused feature to obtain multiple seventh features, and the scales of the multiple seventh features are different; based on the multiple seventh features, updating each seventh feature respectively to obtain an eighth feature corresponding to each seventh feature; processing each eighth feature to obtain an eighth recognition range, and the eighth recognition range is the position of the biological feature in the first image; and determining the third recognition range based on the multiple eighth recognition ranges obtained.
[0213] It should be noted that the process of determining the third identification range is similar to the above steps 301-304, and will not be repeated here.
[0214] 608. When the brightness of the image within the third recognition range falls within a preset brightness range, the computer device performs biometric feature recognition on the image within the third recognition range.
[0215] The step 608 is similar to the above step 309 and will not be described again here.
[0216] In the solution provided by the embodiment of the present application, during the process of biometric feature recognition, a first recognition range is determined from the captured first image to determine the position of the biometric feature in the first image, and whether the brightness of the image within the first recognition range is sufficient is detected to determine whether the biometric feature in the first image is clear enough. If the brightness of the image within the first recognition range does not fall within the preset brightness range, it is determined that the biometric feature in the first image is not clear enough, and the exposure parameters are adjusted so that the next image can be captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image. Considering that the time interval between capturing the first image and capturing the second image is short, the time interval between capturing the first image and capturing the second image and capturing the biometric feature in the first recognition range is short. Compared with the position of the first image, the position of the biometric feature in the second image does not change much. Therefore, the coordinates of the first recognition range in the first image are used to determine the second recognition range from the second image, so that the third recognition range can be determined from the second image as soon as possible using the second recognition range, so that the image within the third recognition range contains the biometric feature, so that when the brightness of the image within the third recognition range falls within the preset brightness range, the image within the third recognition range is subjected to biometric feature recognition to identify which object the biometric feature belongs to, so as to avoid recognition errors or recognition failures due to unclear biometric features in the image, so as to ensure the accuracy and success rate of biometric recognition.
[0217] It should be noted that in the above Figure 6 Based on the embodiment shown, before implementing the biometric feature recognition method through the target detection model, the target detection model needs to be trained. The training process of the target detection model is as follows: Figure 8 As shown, the method includes: image acquisition, image annotation, image preprocessing, model construction, initialization of model weights, model training and model parameter adjustment.
[0218] (1) Image acquisition and image annotation: multiple sample images are acquired and a sample label for each sample image is determined. The sample label indicates the type of biometric features contained in the sample image. The sample recognition range is determined from the sample image. The images within the sample recognition range contain biometric features.
[0219] In the embodiment of the present application, the biometric features include multiple types. For example, if the biometric features are features of the left hand or the right hand, the label includes a first sample label or a second sample label. The first sample label indicates the left and right biometric features, and the second sample label indicates the right hand biometric features. For example, the sample image is as follows: Figure 9 shown.
[0220] The sample images include positive sample images or negative sample images. The positive sample images are obtained by photographing the biometric features, and the negative sample images are images that do not contain the biometric features, or images that contain unclear biometric features.
[0221] In one possible implementation, when a sample image is obtained, the sample image will also be cleaned. The process of cleaning the sample image includes: filtering out repeated sample images among multiple sample images, sample images containing incomplete biometric features, sample images with too low clarity, etc.
[0222] In the embodiment of the present application, the sample images are cleaned to ensure the quality of the sample images, thereby ensuring the quality of subsequent model training.
[0223] (2) Image preprocessing: Use median filtering to reduce the noise of the sample image to eliminate the noise pixels in the sample image; then, use block segmentation to divide the sample image into multiple image blocks, determine the category of each image block, and form a regional image with the image blocks belonging to the target category. The regional image contains biological features; use the method of extracting directional gradient histogram features to extract the directional gradient histogram features of each image block in the regional image; connect the directional gradient histogram features of multiple image blocks in the regional image end to end and combine them into a one-dimensional vector, which is used as the feature of the sample image.
[0224] In one possible implementation, the following function is used to determine the directional gradient histogram feature of the image block:
[0225]
[0226]
[0227] θ(x,y)∈[0,360°), or θ(x,y)∈[0,180°)
[0228] Among them, x is used to represent the horizontal coordinate of the pixel point in the image block, y is used to represent the vertical coordinate of the pixel point in the image block, and I x Used to represent the gradient value of the pixel in the horizontal direction, I y It is used to represent the gradient value in the vertical direction of the pixel point, M(x, y) is used to represent the magnitude of the gradient, and θ(x, y) is used to represent the direction of the gradient.
[0229] In the embodiment of the present application, the resolution is 60x60, the Sobel (edge detection) algorithm is adopted, and the directional gradient histogram feature of the image block is determined according to the above function.
[0230] (3) Model construction and initialization of model weights: Build an initialized target detection model and initialize the weights of the target detection model.
[0231] (4) Model training and model parameter adjustment: The features of the sample image are processed through the target detection model to obtain the predicted recognition range; based on the sample recognition range and the predicted recognition range, the model parameters of the target detection model are adjusted to achieve the training of the target detection model.
[0232] In one possible implementation, the IOU (Intersection Of Union) and mapIOU (mean Average Precision Intersection Of Union) methods are used to determine a loss value based on the sample recognition range and the predicted recognition range. The loss value indicates the difference between the sample recognition range and the predicted recognition range. The target detection model is trained based on the loss value.
[0233] It should be noted that after the target detection model is trained according to the above embodiment, the target detection model can be packaged into an SDK (Software Development Kit). Figure 10 As shown in the figure, the model packaging process includes: selecting the inference device, converting the target detection model, deploying it on the terminal side, deeply optimizing the model, and obtaining SDK integration.
[0234] Among them, the inference device includes NPU (Neural Network Processing Unit) or CPU (Central Processing Unit). The data type includes INT8 (a data type) or INT16 (a data type). The terminal-side deployment method includes hardware abstraction layer, platform abstraction or model parsing. The deep optimization method includes operator optimization, scheduling optimization or memory optimization. For example, select NPU as the inference device, select data types as INT8 and INT16, adopt hardware abstraction layer deployment, adopt scheduling optimization method, and generate SDK.
[0235] Based on the above Figures 2 to 9 The embodiment shown in the figure, the embodiment of the present application also provides a flow chart of a biometric identification method, as shown in FIG. Figure 11As shown, the method includes:
[0236] Step 1: In response to a biometric recognition instruction, capture the first image based on default exposure parameters.
[0237] Step 2: Detect the first image through the target detection model to obtain the first recognition range. The image within the first recognition range contains the biological feature.
[0238] Step 3: Set the weights of the pixels within the first recognition range in the first image to 255, and set the weights of the remaining pixels in the first image to 0; determine the brightness of the first image according to the pixel values and weights of the pixels in the first image; since the weights of the pixels outside the first recognition range in the first image are 0, the brightness of the first image is the brightness of the image within the first recognition range.
[0239] like Figure 12 As shown in FIG, the weight of the pixel points in the first recognition range in the first image is set to 255, and the weights of the pixel points in the remaining positions are set to 0.
[0240] Step 4: Determine whether the brightness of the image within the first recognition range falls within a preset brightness range.
[0241] Step 5: When the brightness of the image within the first recognition range falls within a preset brightness range, biometric feature recognition can be performed on the image within the first recognition range.
[0242] In addition, when the brightness of the image within the first recognition range falls within the preset brightness range, it can also be determined that the biometric features in the image captured based on the default exposure parameters are clear enough. Subsequently, multiple images can be captured based on the default exposure parameters, and the recognition range can be determined from each image, and then biometric features can be recognized on the images within the recognition range in the multiple images.
[0243] Step 6. If the brightness of the image within the first recognition range does not fall within the preset brightness range, adjust the current exposure parameters, and use the adjusted exposure parameters to capture the next image. Then, according to the above process, determine the next recognition range from the next image, and judge whether the brightness of the image within the next recognition range falls within the preset brightness range, until the brightness of the image within the recognition range in the current image falls within the preset brightness range, and perform biometric recognition on the image within the current recognition range.
[0244] In addition, when the brightness of the image within the currently obtained recognition range falls within the preset brightness range, it can also be determined that the biometric features in the image captured based on the current exposure parameters are clear enough. Subsequently, multiple images can be captured based on the current exposure parameters, and the recognition range can be determined from each image, and then biometric feature recognition can be performed on the images within the recognition range in multiple images.
[0245] It should be noted that in the above Figure 10 Based on the embodiment shown, Figure 13 As shown, in the process of performing biometric recognition in response to the biometric recognition instruction, for images other than the first image, the optical flow method is adopted, and the coordinates of the recognition range in the previous image can be used to determine the recognition range in the current image. This process is the same as the above steps 307-308 and will not be repeated here.
[0246] Based on the above Figures 2 to 8 The embodiment shown in the figure, the embodiment of the present application also provides a flow chart of a biometric identification method, as shown in FIG. Figure 14 As shown, the method includes: photographing the environment through the image sensor in the optical camera to obtain the first image; processing the first image through the image processing module, and obtaining the features of the processed first image through the feature extractor; processing the features of the processed first image through the channel compression layer, average pooling layer, maximum pooling layer, fully connected layer, etc. in the first network model to obtain automatic exposure control parameters; obtaining multi-scale histogram features of the first image, and determining the exposure parameters of the image sensor through the convolution layer and fully connected layer in the second network model in combination with the automatic exposure control parameters; adjusting the exposure parameters of the image sensor based on the exposure parameters; repeating the above process until the clarity of the biological features in the image captured by the current image sensor is sufficient. The environment is photographed through the current image sensor to obtain the next image, taking the j-th image as an example, where j is an integer greater than 1; the j-th image is processed through the image processing module; the features of the processed j-th image are obtained through the feature extractor; the features of the processed j-th image are subjected to biometric feature detection through the target detection model to obtain the recognition range, and the image within the recognition range in the j-th image contains the biometric feature.
[0247] Among them, the image processing module is Software ISP (Software Image Signal Processing, image signal processing software).
[0248] In the embodiments of this application, automatic exposure automatically adjusts exposure parameters based on ambient light brightness to ensure that images are properly exposed under varying lighting conditions. Furthermore, an object detection model and algorithm are introduced to improve the accuracy of the photometry algorithm, ensuring sufficient clarity of biometric features in the resulting image, thereby ensuring accurate biometric recognition.
[0249] The biometric recognition method provided in the embodiments of the present application can be applied in a variety of scenarios, for example, in payment scenarios or card-punching scenarios.
[0250] Taking the clocking-in scenario as an example, when the clocking-in device detects that there are biometric features in the shooting area, the biometric features of the shooting area are collected based on the default exposure parameters to obtain an image containing the biometric features; according to the solution provided in the embodiment of the present application, an image with sufficiently high clarity and containing biometric features can be collected, and then the collected image can be compared with the pre-stored image to determine the object information that matches the collected image, and determine that the object indicated by the object information has completed the clocking-in.
[0251] Taking the payment scenario as an example, when paying for an order, if the scanning device detects that there are biometric features in the shooting area, the biometric features of the shooting area are collected based on the default exposure parameters to obtain an image containing the biometric features; according to the solution provided in the embodiment of the present application, an image with sufficiently high clarity and containing biometric features can be collected, and then the collected image can be compared with the pre-stored image to determine the object information that matches the collected image, and according to the number of resources to be paid for the order, the resources of that number are transferred from the account of the object information.
[0252] Figure 15 This is a schematic diagram of the structure of a biometric identification device provided in an embodiment of the present application. Figure 15 As shown, the device includes:
[0253] A determination module 1501 is configured to determine a first recognition range from a first image, where the image within the first recognition range contains a biometric feature, and the first image is acquired based on a first exposure parameter;
[0254] An adjusting module 1502 is configured to adjust the first exposure parameter to obtain a second exposure parameter when the brightness of the image within the first recognition range does not fall within a preset brightness range;
[0255] An acquisition module 1503 is configured to acquire a second image based on a second exposure parameter, where the second image includes a biometric feature;
[0256] The determining module 1501 is further configured to determine a second recognition range from the second image based on the coordinates of the first recognition range in the first image, wherein the coordinates of the second recognition range in the second image are the same as the coordinates of the first recognition range in the first image;
[0257] The adjustment module 1502 is further configured to adjust the coordinates of the second recognition range in the second image to obtain a third recognition range, wherein the image within the third recognition range contains the biometric feature;
[0258] The recognition module 1504 is configured to perform biometric feature recognition on the image within the third recognition range when the brightness of the image within the third recognition range falls within a preset brightness range, so as to identify the object to which the biometric feature contained in the image within the third recognition range belongs.
[0259] In one possible implementation, the determination module 1501 is used to perform multiple scale transformations on the features of the first image to obtain multiple first features, and the scales of the multiple first features are different; based on the multiple first features, each first feature is updated separately to obtain a second feature corresponding to each first feature; each second feature is processed to obtain a fourth recognition range, and the image within the fourth recognition range contains a biological feature; based on the obtained multiple fourth recognition ranges, the first recognition range is determined.
[0260] In another possible implementation, the determination module 1501 is used to divide the first image into blocks to obtain multiple image blocks; classify each image block to obtain the category to which each image block belongs; based on the categories to which the multiple image blocks belong, the image blocks belonging to the target category are formed into a regional image, and the target category indicates that the image block contains a biological feature; and perform multiple scale transformations on the features of the regional image to obtain multiple first features.
[0261] In another possible implementation, the determination module 1501 is configured to determine the fourth recognition range with the highest confidence as the first recognition range based on the confidence of each fourth recognition range, where the confidence indicates the possibility that the image within the fourth recognition range contains the biometric feature.
[0262] In another possible implementation, Figure 16 As shown, the device also includes:
[0263] An extraction module 1505 is configured to extract features from the first image and the second image respectively to obtain a third feature and a fourth feature, wherein the third feature indicates the first image and the fourth feature indicates the second image;
[0264] a processing module 1506 for processing the third feature and the fourth feature to obtain motion information, where the motion information indicates a change in the position of the biometric feature in the second image relative to the first image;
[0265] An updating module 1507, configured to update the motion information based on the third feature;
[0266] The processing module 1506 is further configured to process the fourth feature and the updated motion information to obtain a third recognition range.
[0267] In another possible implementation, the adjustment module 1502 is used to determine, for each pixel point within the second recognition range, the probability that the second recognition range contains the biometric feature when the second recognition range is centered on the pixel point; and based on the determined probability, adjust the coordinates of the second recognition range in the second image to obtain a third recognition range.
[0268] In another possible implementation, the adjustment module 1502 is used to determine the target coordinates based on the determined probability, where the target coordinates are the coordinates of the target pixel point within the second recognition range, wherein, in the determined probability, when the second recognition range is centered on the target pixel point, the probability that the second recognition range contains the biometric feature is the highest; and determine the third recognition range with the target coordinates as the center, and the size of the third recognition range is the same as the size of the second recognition range.
[0269] In another possible implementation, the determination module 1501 is used to perform key point detection on the first image to obtain multiple target key points in the first image; based on the relative position relationship between the multiple target key points and the biometric features and the coordinates of the multiple target key points in the first image, determine the first recognition range from the first image.
[0270] In another possible implementation, the adjustment module 1502 is used to determine the movement distance and movement direction of the biometric feature based on the coordinates of the first key point in the first image and the coordinates of the second key point in the second image, where the first key point and the second key point are the same key point of the biometric feature; based on the movement distance and movement direction, the second recognition range is moved to obtain a third recognition range.
[0271] In another possible implementation, the adjustment module 1502 is further configured to adjust the second exposure parameter to obtain a third exposure parameter when the brightness of the image within the third recognition range does not fall within the preset brightness range.
[0272] The acquisition module 1503 is further configured to acquire the next image based on the third exposure parameter.
[0273] In another possible implementation, the recognition module 1504 is further configured to perform biometric recognition on the image within the first recognition range when the brightness of the image within the first recognition range falls within a preset brightness range, so as to identify the object to which the biometric contained in the image within the first recognition range belongs.
[0274] It should be noted that the biometric recognition device provided in the above embodiment is merely an example of the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the biometric recognition device provided in the above embodiment and the biometric recognition method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0275] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the biometric recognition method of the above embodiment.
[0276] Optionally, the computer device is provided as a terminal. Figure 17 FIG1 shows a block diagram of a terminal 1700 provided by an exemplary embodiment of the present application. The terminal 1700 includes a processor 1701 and a memory 1702 .
[0277] The processor 1701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1701 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1701 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1701 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1701 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0278] Memory 1702 may include one or more computer-readable storage media, which may be non-transitory. Memory 1702 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 1702 is used to store at least one computer program, which is executed by processor 1701 to implement the biometric feature recognition method provided in the method embodiment of the present application.
[0279] In some embodiments, terminal 1700 may optionally include a peripheral device interface 1703 and at least one peripheral device. Processor 1701, memory 1702, and peripheral device interface 1703 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1703 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1704, a display screen 1705, a camera assembly 1706, an audio circuit 1707, and a power supply 1708.
[0280] The peripheral device interface 1703 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 1701 and the memory 1702. In some embodiments, the processor 1701, the memory 1702, and the peripheral device interface 1703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1701, the memory 1702, and the peripheral device interface 1703 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0281] RF circuit 1704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. RF circuit 1704 communicates with communication networks and other communication devices via electromagnetic signals. RF circuit 1704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. RF circuit 1704 may optionally include an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. RF circuit 1704 may communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, RF circuit 1704 may also include circuitry related to Near Field Communication (NFC), although this application does not limit this.
[0282] The display screen 1705 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1705 is a touch screen display, the display screen 1705 also has the ability to collect touch signals on the surface or above the surface of the display screen 1705. The touch signal can be input as a control signal to the processor 1701 for processing. At this time, the display screen 1705 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, there can be one display screen 1705, which is set on the front panel of the terminal 1700; in other embodiments, there can be at least two display screens 1705, which are respectively set on different surfaces of the terminal 1700 or in a folding design; in other embodiments, the display screen 1705 can be a flexible display screen, which is set on the curved surface or folding surface of the terminal 1700. Even more, the display screen 1705 can be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1705 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0283] The camera assembly 1706 is used to capture images or videos. Optionally, the camera assembly 1706 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1706 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. The dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0284] The audio circuit 1707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 1701 for processing, or input into the radio frequency circuit 1704 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 1700. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 1701 or the radio frequency circuit 1704 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as distance measurement. In some embodiments, the audio circuit 1707 may also include a headphone jack.
[0285] Power supply 1708 is used to power various components in terminal 1700. Power supply 1708 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1708 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is charged via a wired line, while a wireless rechargeable battery is charged via a wireless coil. The rechargeable battery can also support fast charging technology.
[0286] In some embodiments, the terminal 1700 further includes one or more sensors 1709 . The one or more sensors 1709 include, but are not limited to: an optical sensor 1710 .
[0287] Optical sensor 1710 is used to detect ambient light intensity. In one embodiment, processor 1701 can control the display brightness of display screen 1705 based on the ambient light intensity detected by optical sensor 1710. Specifically, when the ambient light intensity is high, the display brightness of display screen 1705 is increased; when the ambient light intensity is low, the display brightness of display screen 1705 is decreased. In another embodiment, processor 1701 can also dynamically adjust the shooting parameters of camera assembly 1706 based on the ambient light intensity detected by optical sensor 1710.
[0288] Those skilled in the art will understand that Figure 17 The structure shown in the figure does not constitute a limitation on the terminal 1700, and the terminal 1700 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0289] Optionally, the computer device is provided as a server. Figure 18 1 is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1800 may vary significantly due to different configurations or performance, and may include one or more processors (Central Processing Units, CPUs) 1801 and one or more memories 1802. The memories 1802 store at least one computer program, which is loaded and executed by the processor 1801 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.
[0290] An embodiment of the present application further provides a computer-readable storage medium, which stores at least one computer program. The at least one computer program is loaded and executed by a processor to implement the operations performed by the biometric recognition method of the above embodiment.
[0291] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the operations performed by the biometric recognition method of the above embodiment.
[0292] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0293] The above description is merely an optional embodiment of the embodiments of the present application and is not intended to limit the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included in the scope of protection of the present application.
Claims
1. A biometric identification method, characterized in that: The method comprises: determining a first recognition range from a first image, where the image within the first recognition range includes a biometric feature, and the first image is acquired based on a first exposure parameter; If the brightness of the image within the first recognition range does not fall within a preset brightness range, adjusting the first exposure parameter to obtain a second exposure parameter; capturing a second image based on the second exposure parameter, wherein the second image includes the biometric feature; determining a second recognition range from the second image based on the coordinates of the first recognition range in the first image, wherein the coordinates of the second recognition range in the second image are the same as the coordinates of the first recognition range in the first image; Adjusting the coordinates of the second recognition range in the second image to obtain a third recognition range, wherein the image within the third recognition range contains the biometric feature; When the brightness of the image within the third recognition range falls within the preset brightness range, biometric feature recognition is performed on the image within the third recognition range to identify the object to which the biometric feature contained in the image within the third recognition range belongs.
2. The method according to claim 1, characterized in that The determining the first recognition range from the first image includes: Performing multiple scale transformations on the features of the first image to obtain corresponding multiple first features, where the multiple first features have different scales; Based on the multiple first features, each first feature is updated respectively to obtain a second feature corresponding to each first feature; Processing each second feature to obtain a fourth recognition range, wherein an image within the fourth recognition range contains the biometric feature; The first recognition range is determined based on the obtained multiple fourth recognition ranges.
3. The method according to claim 1 or 2, characterized in that The performing multiple scale transformations on the features of the first image to obtain multiple first features includes: Dividing the first image into blocks to obtain a plurality of image blocks; Classify each image block to obtain the category to which each image block belongs; Based on the categories to which the plurality of image blocks belong, forming a regional image from the image blocks belonging to a target category, the target category indicating that the image blocks contain the biometric feature; Perform multiple scale transformations on the features of the region image to obtain the multiple first features.
4. The method according to any one of claims 1 to 3, characterized in that The determining the first identification range based on the obtained plurality of fourth identification ranges includes: Based on the confidence of each fourth recognition range, the fourth recognition range with the largest confidence is determined as the first recognition range, and the confidence indicates the possibility that the image within the fourth recognition range contains the biometric feature.
5. The method according to any one of claims 1 to 4, characterized in that After acquiring the second image based on the second exposure parameter, the method further includes: performing feature extraction on the first image and the second image respectively to obtain a third feature and a fourth feature, wherein the third feature indicates the first image and the fourth feature indicates the second image; processing the third feature and the fourth feature to obtain motion information, where the motion information indicates a change in a position of the biometric feature in the second image relative to the first image; Based on the third feature, updating the motion information; The fourth feature and the updated motion information are processed to obtain the third recognition range.
6. The method according to any one of claims 1 to 5, characterized in that The adjusting the coordinates of the second recognition range in the second image to obtain a third recognition range includes: For each pixel point within the second identification range, determining a probability that the second identification range contains the biometric feature when the second identification range is centered on the pixel point; Based on the determined probability, the coordinates of the second recognition range in the second image are adjusted to obtain the third recognition range.
7. The method according to any one of claims 1 to 6, characterized in that The adjusting, based on the determined probability, the coordinates of the second recognition range in the second image to obtain the third recognition range includes: determining target coordinates based on the determined probabilities, the target coordinates being coordinates of a target pixel within the second recognition range, wherein, among the determined probabilities, when the second recognition range is centered on the target pixel, a probability that the second recognition range contains the biometric feature is greatest; The third recognition range is determined with the target coordinates as the center, and the size of the third recognition range is the same as the size of the second recognition range.
8. The method according to any one of claims 1 to 7, characterized in that The determining the first recognition range from the first image includes: Performing key point detection on the first image to obtain a plurality of target key points in the first image; The first recognition range is determined from the first image based on the relative positional relationship between the multiple target key points and the biometric features and the coordinates of the multiple target key points in the first image.
9. The method according to any one of claims 1 to 8, characterized in that The adjusting the coordinates of the second recognition range in the second image to obtain a third recognition range includes: determining a movement distance and a movement direction of the biometric feature based on coordinates of a first key point in the first image and coordinates of a second key point in the second image, wherein the first key point and the second key point are the same key point of the biometric feature; The second recognition range is moved based on the moving distance and the moving direction to obtain the third recognition range.
10. The method according to any one of claims 1 to 9, characterized in that After adjusting the coordinates of the second recognition range in the second image to obtain a third recognition range, the method further includes: If the brightness of the image within the third recognition range does not fall within the preset brightness range, adjusting the second exposure parameter to obtain a third exposure parameter; A next image is acquired based on the third exposure parameter.
11. The method according to any one of claims 1 to 9, characterized in that After determining the first recognition range from the first image, the method further includes: When the brightness of the image within the first recognition range falls within the preset brightness range, biometric feature recognition is performed on the image within the first recognition range to identify the object to which the biometric feature contained in the image within the first recognition range belongs.
12. A biometric identification device, characterized in that: The device comprises: A determination module, configured to determine a first recognition range from a first image, where the image within the first recognition range contains a biometric feature, and the first image is acquired based on a first exposure parameter; an adjusting module, configured to adjust the first exposure parameter to obtain a second exposure parameter when the brightness of the image within the first recognition range does not fall within a preset brightness range; an acquisition module, configured to acquire a second image based on the second exposure parameter, wherein the second image includes the biometric feature; The determining module is further configured to determine a second recognition range from the second image based on the coordinates of the first recognition range in the first image, wherein the coordinates of the second recognition range in the second image are the same as the coordinates of the first recognition range in the first image; The adjustment module is further configured to adjust the coordinates of the second recognition range in the second image to obtain a third recognition range, wherein the image within the third recognition range contains the biometric feature; The recognition module is used to perform biometric feature recognition on the image within the third recognition range when the brightness of the image within the third recognition range falls within the preset brightness range, so as to identify the object to which the biometric feature contained in the image within the third recognition range belongs.
13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the biometric recognition method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the operations performed by the biometric recognition method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the operations performed by the biometric recognition method according to any one of claims 1 to 11 are implemented.