WO2025185139A1 - Biometric feature recognition method and apparatus, computer device, and storage medium - Google Patents
Biometric feature recognition method and apparatus, computer device, and storage mediumInfo
- Publication number
- WO2025185139A1 WO2025185139A1 PCT/CN2024/121294 CN2024121294W WO2025185139A1 WO 2025185139 A1 WO2025185139 A1 WO 2025185139A1 CN 2024121294 W CN2024121294 W CN 2024121294W WO 2025185139 A1 WO2025185139 A1 WO 2025185139A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- recognition range
- recognition
- range
- feature
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
- G06N3/0442—Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4038—Image mosaicing, e.g. composing plane images from plane sub-images
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
Definitions
- 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.
- biometric recognition technology is becoming increasingly widely used. It can be applied in a variety of scenarios, such as payment and card processing, to verify user identities.
- biometric recognition process involves capturing an image containing biometric features and then performing biometric recognition on the image to identify the object to which the biometric features belong.
- the embodiments of the present application provide a biometric identification method, apparatus, computer device, and storage medium that can improve the accuracy and success rate of biometric identification.
- the technical solution is as follows:
- a biometric feature recognition method is provided, the method being executed by a computer device, the method comprising:
- 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
- the object to which the biometric feature contained in the image within the second recognition range belongs is recognized.
- a biometric feature recognition device comprising:
- 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 reference 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, wherein the image within the second recognition range contains the biometric feature;
- the recognition module is configured to recognize the object to which the biometric feature contained in the image within the second recognition range belongs when the brightness of the image within the second recognition range falls within the reference brightness range.
- a computer device 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 so that the computer device implements the operations performed by the biometric recognition method described in the above aspects.
- a non-volatile computer-readable storage medium in which at least one computer program is stored.
- the at least one computer program is loaded and executed by a processor to enable the computer to implement the operations performed by the biometric recognition method described in the above aspects.
- a computer program product comprising a computer program, wherein the computer program is executed by a processor to enable a computer to implement the operations performed by the biometric recognition method as described in the above aspects.
- a first recognition range is determined from a captured first 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 the biometric feature in the first image is sufficiently clear. If the brightness of the image within the first recognition range does not fall within a reference brightness range, it is determined that the biometric feature in the first image is not clear enough.
- the exposure parameters are adjusted so that the next image (i.e., the second image) is captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image.
- biometric feature recognition is performed on the image within the second recognition range to identify the biometric feature of the object. This can avoid recognition errors or recognition failures due to unclear biometric features in the image, thereby improving the accuracy and success rate of biometric feature recognition.
- FIG1 is a schematic diagram of a structure of an implementation environment provided by an embodiment of the present application.
- FIG2 is a flow chart of a biometric identification method provided in an embodiment of the present application.
- FIG3 is a flow chart of another biometric identification method provided in an embodiment of the present application.
- FIG4 is a schematic structural diagram of a camera collector provided in an embodiment of the present application.
- FIG5 is a schematic diagram of the structure of a target detection model provided in an embodiment of the present application.
- FIG6 is a flow chart of another biometric identification method provided in an embodiment of the present application.
- FIG7 is a flow chart of determining a second identification range according to an embodiment of the present application.
- FIG8 is a flowchart of training a target detection model provided by an embodiment of the present application.
- FIG9 is a schematic diagram of a sample image provided in an embodiment of the present application.
- FIG10 is a flow chart of a model packaging method provided by an embodiment of the present application.
- FIG11 is a flow chart of another biometric identification method provided in an embodiment of the present application.
- FIG12 is a schematic diagram of the weight of a first image provided in an embodiment of the present application.
- FIG13 is a flow chart of another biometric identification method provided in an embodiment of the present application.
- FIG14 is a flow chart of another biometric identification method provided in an embodiment of the present application.
- FIG15 is a schematic structural diagram of a biometric identification device provided in an embodiment of the present application.
- FIG16 is a schematic structural diagram of another biometric feature recognition device provided in an embodiment of the present application.
- FIG17 is a schematic structural diagram of a terminal provided in an embodiment of the present application.
- FIG18 is a schematic diagram of the structure of a server provided in an embodiment of the present application.
- first 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.
- the terms "at least one,””aplurality,””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.
- 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.
- 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.
- 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.
- the images involved in this application were obtained with full authorization.
- the biometric feature recognition method provided in the embodiment of the present application can be executed by a computer device.
- the computer device is a terminal or a server.
- 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.
- 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.
- 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.
- FIG1 is a schematic diagram of an implementation environment provided by an embodiment of the present application.
- 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.
- 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.
- 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.
- the application is an application in the operating system of terminal 101, or an application provided by a third party.
- the application is any application that has a biometric feature recognition function.
- the application can also have other functions, such as review functions, shopping functions, navigation functions, game functions, etc.
- 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.
- FIG2 is a flow chart of a biometric feature recognition method provided in an embodiment of the present application. The method is executed by a computer device. As shown in FIG2 , the method includes the following steps 201 to 205:
- 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.
- an image containing a biometric feature in response to a biometric recognition instruction, is captured so that the image containing the biometric feature can be subsequently recognized.
- content other than the biometric feature in the image may affect the accuracy of biometric recognition
- 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 reference brightness range to determine whether the partial image containing the biometric feature is sufficiently clear.
- 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.
- Biometrics refer to the basic attributes or characteristics of a living being, and different living beings may have different biometrics.
- the embodiments of this application do not limit the types of biometrics.
- the types of biometrics may include but are not limited to fingerprint features, iris features, facial features, palm print features, etc.
- 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 identified from the first image is located, and the image within the first recognition range contains the complete biometric feature.
- the first recognition range can be a range of any shape, for example, the first recognition range is a circular range or a square range.
- determining the first recognition range from the first image refers to determining the position of the first recognition range in the first image, for example, the position can be expressed by coordinates, 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.
- the computer device captures an image of the captured area using an image capture device configured with first exposure parameters to obtain a first image.
- the image capture device can be any device with image capture capabilities.
- the image capture device can also be referred to as a camera collector, an image sensor, etc.
- the computer device captures a first image in response to a biometric recognition instruction.
- the computer device includes a biometric recognition control, and the computer device obtains the biometric recognition instruction in response to a triggering operation of the biometric recognition control.
- the computer device obtains the biometric recognition instruction in response to detecting that a biometric feature is in a shooting area.
- the computer device obtains the biometric recognition instruction in response to detecting an execution request for a target operation, where the execution request for the target operation is used to request execution of the target operation, where the target operation refers to an operation that needs to be executed based on the biometric recognition result.
- the embodiments of this application do not limit the type of computer device, and may be related to a specific biometric recognition scenario.
- the computer device may refer to a clock-in device; if the biometric recognition scenario is a payment scenario, the computer device may refer to a payment device, a scanning device, etc.
- the computer device adjusts the first exposure parameter to obtain a second exposure parameter.
- the reference brightness range is an arbitrary brightness range. If the brightness of the image within the first recognition range falls within the reference 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 reference 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 the first recognition range is determined from the first image, it is detected whether the brightness of the image within the first recognition range falls within the reference brightness range.
- 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.
- the reference brightness range can be determined by: obtaining historical images that have undergone biometric identification and the identification results of the historical images, where the identification results of the historical images include identification success and identification failure, where identification success is used to indicate that the process of performing biometric identification on the historical images is successful, and identification failure is used to indicate that the process of performing biometric identification on the historical images is unsuccessful; determining a candidate image in the historical images whose identification result is a successful identification, and using the brightness range of the candidate image as the reference brightness range.
- 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.
- the computer device captures a second image based on the second exposure parameter, where the second image includes a biometric feature.
- 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 later.
- the computer device determines a second identification range from the second image, where the image within the second identification range contains biometric features.
- the process of a computer device determining a second recognition range from a second image includes: determining a third recognition range from the second image based on the position of the first recognition range in the first image, the position of the third recognition range in the second image being the same as the position of the first recognition range in the first image; and adjusting the position of the third recognition range in the second image to obtain a second recognition range.
- the first image and the second image are captured in response to a biometric recognition instruction
- the second image is an image captured after the first image.
- the position of the biometric feature in the second image may change, but considering that the time interval between capturing the first image and capturing 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 position of the first recognition range in the first image is used to determine the third recognition range from the second image, so that the second recognition range can be determined from the second image as soon as possible using the third recognition range, so that the image within the second recognition range contains the biometric feature.
- the third recognition range has the same shape as the first recognition range, and is equivalent to the area obtained by mapping the first recognition range to the second image.
- the first image and the second image have the same size
- the third recognition range has the same size as the first recognition range
- the position of the third recognition range in the second image is the same as the position of the first recognition range in the first image.
- the position of the first recognition range in the first image can be represented by the coordinates of the first recognition range in the first image.
- the first recognition range is a rectangular range or a square range
- the position of the first recognition range in the first image can be represented by the coordinates of the four corners of the rectangular range or the square range.
- the position of the first identification range in the first image can also be represented by other types of information.
- the first identification range is a circular range
- the position of the first identification range in the first image can be represented by the center coordinates of the circular range and the radius of the circular range
- the first identification range is a square range
- the position of the first identification range in the first image can be represented by the center coordinates of the square range and the side length of the square range
- the first identification range is a rectangular range
- the position of the first identification range in the first image can be represented by the upper left corner coordinates of the rectangular range and the length and width of the rectangular range.
- the position of the third recognition range in the second image is adjusted.
- the adjusted recognition range is the second recognition range determined from the second image, so that the image within the second recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained second recognition range.
- determining the second recognition range from the second image means determining the position of the second recognition range in the second image, that is, determining the position of the biometric feature from the second image.
- the computer device identifies the object to which the biometric feature contained in the image within the second recognition range belongs.
- the computer device when the brightness of the image within the second recognition range falls within the reference brightness range, the computer device performs biometric feature recognition on the image within the second recognition range to identify the object to which the biometric feature contained in the image within the second recognition range belongs.
- Biometric recognition refers to the identification of biometric features contained in an image in order to identify the object to which the biometric features belong.
- a computer device stores reference images corresponding to multiple objects, each of which contains the object's biometric features. If the brightness of an image within a second recognition range falls within the reference brightness range, the image within the second recognition range is compared with the multiple reference images to determine which reference image contains the same biometric features as the image within the second recognition range. If the image within the second recognition range contains the same biometric features as any of the reference images, the biometric features contained in the image within the second recognition range are determined to be the biometric features of the object corresponding to the reference image.
- the image within the second identification range is equivalent to the local image of the second image containing the biometric feature.
- the brightness of the image within the second identification range falls within the reference brightness range, indicating that the local image of the second image containing the biometric feature is clear enough. Therefore, biometric feature recognition can be performed on the local 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.
- a first recognition range is determined from the captured first image to determine the position of the biometric feature in the first image, and the brightness of the image within the first recognition range 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 reference 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 (i.e., the second image) is captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image.
- the image within the second recognition range on the second image (i.e., the image containing the biometric feature)
- the image containing the biometric feature When the brightness falls within the reference brightness range, it means that the biometric features in the second image are clear enough.
- biometric feature recognition is performed on the image within the second recognition range to identify which object the biometric features belong to. This can avoid recognition errors or recognition failures due to unclear biometric features in the image, thereby improving the accuracy and success rate of biometric recognition.
- 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 position of the first recognition range in the first image can be used to determine the third recognition range from the second image, so that the second recognition range can be determined from the second image as quickly as possible using the third recognition range, thereby improving the efficiency of determining the second recognition range on the basis of ensuring that the image within the second recognition range contains the biometric feature.
- the embodiment of the present application can also adopt multiple scale transformations 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.
- FIG3 is a flow chart of another biometric feature recognition method provided by an embodiment of the present application.
- the method is executed by a computer device. As shown in FIG3 , the method includes steps 301 to 309:
- 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.
- 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 first recognition range determined subsequently.
- the features of the first image are used to characterize the first image.
- the features of the first image can be any type of features.
- the features of the first image are color histogram features, Histogram of Oriented Gradients (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.
- 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.
- 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.
- Dimensionality reduction is used to reduce the scale of a feature
- dimensionality increase is used to increase the scale of a feature.
- the scale of a feature can also be understood as the dimension of the feature.
- 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.
- 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.
- the first exposure parameter 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.
- an image is captured, and then the biometric features in the captured image are recognized.
- 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 reference brightness range is detected. If the brightness of the image within the recognition range does not fall within the reference 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 reference brightness range, and biometric recognition is performed on the image within the current recognition range.
- 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.
- the camera collector includes an IR (Infrared Radiation) emission polarization area, an IR receiving polarization area, an RGB (Red Green Blue) light guide ring, an IR camera, an RGB camera, and a RGB camera. Head, IR LED (light emitting diode), etc.
- the camera collector can monitor whether there is a biometric feature in the shooting area, and when the biometric feature is detected in the shooting area, the shooting area is photographed to obtain an image.
- step 301 includes: performing dimensionality reduction on the features of the first image to obtain a 1st first feature, performing dimensionality reduction on the i-th first feature to obtain an i+1-th first feature, where i is an integer greater than 0 and less than n.
- n refers to the number of first features, and n is an integer greater than 1. The value of n can be set based on experience or flexibly adjusted according to the application scenario, and is not limited in this embodiment of the present application.
- first features of multiple scales are obtained, so that the first features of multiple scales can all represent the first image, thereby ensuring the accuracy of the multiple first features obtained, thereby improving the accuracy of the determined first recognition range and improving the accuracy of biometric recognition.
- step 301 includes: upgrading the feature of the first image to obtain the 1st first feature, upgrading the ith first feature to obtain the (i+1)th first feature, where i is an integer greater than 0 and less than n.
- first features of multiple scales are obtained, so that the first features of multiple scales can all represent the first image, thereby ensuring the accuracy of the multiple first features obtained, thereby improving the accuracy of the determined first recognition range and improving the accuracy of biometric recognition.
- step 301 includes: dividing the first image into blocks to obtain multiple image blocks; classifying each image block to obtain a 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.
- the first image may contain other content in addition to 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 characterize the biometric features, thereby improving the accuracy of the determined first recognition range and improving the accuracy of biometric feature recognition.
- 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.
- any image block may contain a complete 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 the target category contains a biometric feature, and an image block belonging to the 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.
- 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.
- 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.
- the categories to which an image block belongs include the target category or other categories, where other categories are categories different from the target category.
- the weight of an image block is positively correlated with the likelihood that the image block contains a biometric feature. That is, the greater the weight of an image block, the greater the likelihood that the image block contains a biometric feature.
- 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.
- 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 less than the threshold, then the image block belongs to another category.
- 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.
- the features of the image block are extracted and the feature conversion is adopted, for example, convolution 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 is
- the weight can indicate the possibility that the image block contains biometric features, ensuring the accuracy of the weight, thereby ensuring the accuracy of the category to which the image block belongs, which is conducive to improving the reliability of the first feature, and then improving the accuracy of the determined first recognition range, thereby improving the accuracy of biometric feature recognition.
- 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.
- 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.
- 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.
- the image recognition model is any network model, for example, a lightweight convolutional neural network.
- the image recognition model can divide the input image into blocks, determine the weight of each image block, and then output the area image containing the biometric features according to the weight.
- the image recognition model divides the input image into blocks to obtain the features of multiple image blocks.
- the features of the multiple image blocks are passed through the Attention layer to obtain the weight of each image block, and then output the area image containing the biometric features according to the weight.
- the first image before acquiring the features of the first image, can also be subjected to noise reduction to eliminate noise pixels in the first image, that is, the noise pixels in the first image are filtered.
- the process of filtering the noise pixels in the first image includes: processing the noise pixels in the first image using a median filter.
- Median filtering is a nonlinear smoothing technique that sets the pixel value of each pixel to the median of the pixel values of all pixels within a certain neighborhood window of the pixel.
- median filtering is adopted to reduce the noise of the first image to adjust the pixel values of the noise pixels in the first image to ensure the accuracy of the filtered first image.
- the pixel values of the pixels in the first image are adjusted in a traversal manner.
- 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 queue in the pixel value queue (that is, the median of the pixel values of the pixels in the window) 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 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.
- the process of determining noise pixel points includes: traversing the first image based on a reference window, determining the average pixel value of the pixel points in the reference window during the traversal process, and determining that the pixel point is a noise pixel point when the absolute value of the difference between the pixel value of any pixel point in the reference window and the average pixel value is greater than a difference threshold.
- the difference threshold can be set based on experience or flexibly adjusted according to the application scenario, and this is not limited in the embodiments of the present application.
- the size of the reference window can be set based on experience or flexibly adjusted according to the application scenario, and this is not limited in the embodiments of the present application.
- the method for obtaining the features of the first image is: obtaining the first image after noise reduction; and performing feature extraction on the first image after noise reduction to obtain the features of the first image.
- the computer device updates each first feature respectively to obtain a second feature corresponding to each first feature.
- 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.
- step 302 includes: performing a scale transformation on the fifth feature to obtain a scaled fifth feature, where the scale of the scaled fifth feature is the same as the scale of the sixth feature; and fusing the scaled fifth feature with the sixth feature to obtain a second feature corresponding to the sixth feature.
- the sixth feature is any first feature from among the plurality of first features
- the fifth feature is any feature from among the plurality of first features other than the sixth feature.
- each first feature is updated by first performing scale transformation and then fusing them to ensure the accuracy of the obtained second feature.
- the computer device processes each second feature to obtain a fourth identification range.
- each second feature can represent the first image.
- 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.
- 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.
- step 303 includes performing biometric detection on each second feature to obtain a fourth identification range.
- the biometric detection is used to detect whether the first image contains a biometric feature based on the second feature, and if the first image is detected to contain a biometric feature, predict the location of the biometric feature in the first image.
- the location of the biometric feature in the first image predicted by the biometric detection is the fourth identification range.
- 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.
- 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.
- the target detection model includes a Backbone sub-model, a Neck sub-model, and a Head sub-model.
- the Neck sub-model is used to execute the above step 302 and update the features at multiple scales.
- the Head sub-model is used to execute the above step 303 and output the location of the biometric feature in the image based on the features at each scale (i.e., the fourth recognition range).
- 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.
- the Backbone sub-model is a neural network model composed of convolutional layers and GRU (Gate Recurrent Unit) layers, and the convolutional layers are 2D (2 Dimensions, two-dimensional) convolutional layers.
- the Backbone sub-model includes 2D convolutional layers, nonlinear activation functions, Dropout (a type of network layer), pooling layers, fully connected layers, etc.
- the Backbone sub-model is a neural network model composed of convolutional layers and LSTM (Long Short-Term Memory, long short-term memory network) layers, and the convolutional layers are 3D convolutional layers.
- the Backbone sub-model is composed of 2D convolutional layers and maximum convolutional networks.
- the Backbone sub-model includes multiple convolutional layers for performing multiple scale transformations on the input image features.
- the Neck sub-model includes upsampling layers, downsampling layers, and pooling layers. Through these layers, the features at each scale can be updated based on features at multiple scales.
- the Head sub-model includes multiple detection modules, each of which is used to detect features at different scales and output the location of the biometric feature. For example, the detection module is YOLO V3 (You Only Look Once V3, currently the third version of the detection algorithm).
- 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.
- 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.
- step 304 includes: based on the confidence of each fourth recognition range, determining the fourth recognition range with the highest confidence among multiple fourth recognition ranges as the first recognition range, and the confidence of each fourth recognition range indicates the possibility that the image within each fourth recognition range contains biometric features.
- the confidence level of the fourth identification range is positively correlated with the likelihood that an image within the fourth identification range contains a biometric feature. That is, the greater the confidence level of the fourth identification range, the greater the likelihood that an image within the fourth identification range contains a biometric feature.
- the confidence level of the fourth identification range ranges from [0, 1]. A confidence level of 0 indicates that an image within the fourth identification range does not contain a biometric feature; a confidence level of 1 indicates that an image within the fourth identification range contains a biometric feature.
- the confidence of each fourth recognition range can also be obtained.
- the confidence can reflect the possibility that the image within the fourth recognition range contains biometric features. Therefore, the fourth recognition range with the highest confidence is determined as the first recognition range to ensure that the image within the determined first recognition range contains biometric features, ensure the accuracy of the first recognition range, and improve the accuracy of biometric recognition.
- 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.
- the biometric detection further outputs the confidence level of the predicted fourth recognition range.
- the computer device adjusts the first exposure parameter to obtain a second exposure parameter.
- 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.
- 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.
- the pixel value of each pixel is expressed in RGB (Red Green Blue) format
- 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.
- the pixel value of each pixel is represented by the color of the three channels of red, green and blue.
- 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.
- 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 reference 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 reference brightness range, reducing the first exposure parameter to obtain the second exposure parameter.
- 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 reference 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 biometric feature is located in the captured image can be guaranteed to fall within the reference brightness range as much as possible, so as to ensure the accuracy of the determined second exposure parameter.
- the probability of the brightness of the image within the second recognition range on the second image falling within the reference brightness range is high, which is conducive to increasing the possibility of directly performing biometric recognition based on the image within the second recognition range, thereby improving the efficiency of biometric recognition.
- the computer device captures a second image based on the second exposure parameter, where the second image includes a biometric feature.
- the computer device includes an image sensor
- 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.
- the image sensor in the computer device is used to collect images.
- the computer device collects the pictures in the shooting area into images through the image sensor. Therefore, the exposure parameter of the image sensor is first adjusted to the second exposure parameter. number, so that the image is captured by the adjusted image sensor with the second exposure parameter to obtain a second image.
- the computer device determines a third recognition range from the second image based on the position of the first recognition range in the first image, where the position of the third recognition range in the second image is the same as the position of the first recognition range in the first image.
- 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 third recognition range in the second image, and the position parameters of the third recognition range in the second image are the same as the position parameters of the first recognition range in the first image.
- the position parameters of the first recognition range in the first image indicate the position of the first recognition range in the first image, and the position parameters include coordinates.
- the position parameters of the first recognition range in the first image can be expressed in any form. For example, if the first recognition range is a square range, the position parameters of the first recognition range in the first image include the center coordinates and side lengths of the first recognition range; or, the position parameters of the first recognition range in the first image include the coordinates of the four corners. For another example, if the first recognition range is a circular area, the position parameters of the first recognition range in the first image include the center coordinates and radius of the first recognition range.
- the first image and the second image have the same size.
- the third 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 third 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 third recognition range.
- the computer device adjusts the position of the third recognition range in the second image to obtain a second recognition range, and the image within the second recognition range contains the biometric feature.
- step 308 includes: for each pixel point within the third recognition range, determining the probability corresponding to each pixel point, where the probability corresponding to each pixel point is the probability that the image within the reference recognition range centered on each pixel point contains the biometric feature, and the size of the reference recognition range is the same as the size of the third recognition range; based on the probability corresponding to each pixel point within the third recognition range, adjusting the position of the third recognition range in the second image to obtain the second recognition range.
- the determined probabilities include multiple ones, each corresponding to a pixel within the third recognition range.
- the probability corresponding to any pixel indicates the likelihood that an image within the reference recognition range centered on that pixel contains the biometric feature.
- the probability corresponding to any pixel is positively correlated with the likelihood that an image within the reference recognition range centered on that pixel contains the biometric feature. That is, the greater the probability corresponding to any pixel, the greater the likelihood that an image within the reference recognition range centered on that pixel contains the biometric feature.
- the reference recognition range is a recognition range of the same size as the third recognition range.
- a probability corresponding to each pixel within the third recognition range is determined to determine the likelihood that the image within the reference recognition range centered on each pixel contains the biometric feature. Based on the determined probability, the position of the third recognition range within the second image is adjusted so that the image within the adjusted second recognition range contains the biometric feature, thereby ensuring the accuracy of the second recognition range and, consequently, the accuracy of biometric recognition.
- the process of determining the second recognition range includes: determining the target pixel point with the highest probability among the pixel points within the third recognition range; adjusting the position of the third recognition range in the second image to a position centered on the target pixel point to obtain the second recognition range, and the size of the third recognition range is the same as the size of the second recognition range.
- the greater the probability corresponding to any pixel point the greater the possibility that the image within the reference recognition range centered on the pixel point contains the biometric feature. Therefore, the maximum probability is determined from the multiple probabilities determined, and the pixel point corresponding to the maximum probability is determined as the target pixel point, and then the third recognition range is moved so that the center of the moved recognition range is located on the target pixel point, so as to ensure that the image within the obtained second recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained second recognition range, and thereby ensuring the accuracy of biometric feature recognition.
- the embodiment of the present application is explained by taking the adjustment of the position of the third recognition range as an example.
- the determined identification range is determined as the second identification range.
- the first threshold and the second threshold can be set based on experience or flexibly adjusted according to application scenarios, which is not limited in the embodiment of the present application.
- the process of determining the probability includes: determining the pixel features of each pixel point within the third identification range, for the first pixel point within the third 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, and the probability corresponding to the first pixel point is the probability that the image within the reference identification range centered on the first pixel point contains the biological feature.
- the first pixel is any pixel within the third identification range
- the second pixel is a pixel other than the first pixel within the reference identification range centered on the first pixel.
- the pixel features of the pixel can be represented in any form, for example, the pixel features of the pixel are color histogram features of the pixel.
- the Mean Shift method is adopted to determine the probability corresponding to each pixel point within the third recognition range, that is, to determine the probability that the image within the reference recognition range centered on each pixel point within the third recognition range contains the biological feature.
- the optical flow method is used to determine the second recognition range on the second image. Taking into account 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 third recognition range on the second image, and then the second recognition range is determined by pixel clustering to ensure the accuracy of the determined second recognition range.
- the process of determining the target pixel point includes: determining the color histogram characteristics of the pixel points within the third recognition range, taking kernel density estimation based on the color histogram characteristics of the pixel points within the third recognition range, determining the probability distribution of the pixel points, and determining the pixel point with the largest probability density in the probability distribution as the target pixel point.
- step 308 includes: determining an adjustment distance and an adjustment direction based on the position of a first key point in the first image and the position of a 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 adjusting the position of the third recognition range in the second image based on the adjustment distance and the adjustment direction to obtain a second recognition range.
- the adjustment distance and the adjustment direction may also be referred to as the movement distance and movement direction of the biometric feature, where the movement distance and movement direction of the biometric feature refer to the movement distance and movement direction of the biometric feature in the second image compared to the first image.
- Adjusting the position of the third recognition range in the second image based on the adjustment distance and the adjustment direction may refer to moving the third recognition range based on the movement distance and movement direction of the biometric feature.
- the first key point is a key point of the biometric feature in the first image
- 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.
- the first key point is the center point of the biometric feature in the first image
- 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.
- 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 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 third recognition range according to the movement distance and movement direction to change the position of the third recognition range to obtain the second recognition range, so as to ensure that the image within the obtained second recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained second recognition range and the accuracy of biometric recognition.
- 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.
- the embodiment of the present application is described by taking one first key point and one second key point as an example.
- the position in the image is determined to adjust the distance and the direction, multiple first key points correspond one-to-one with 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 adjustment distance and the adjustment direction, the position of the third recognition range in the second image is adjusted to obtain the second recognition range.
- the process of determining the adjustment distance and adjustment direction based on multiple first key points and multiple second key points includes: for each first key point, based on the position of the first key point and the position of the corresponding second key point, determining the first distance and the first direction, the first direction points from the first key point to the second key point, determining the average value of the multiple first distances as the adjustment distance, and determining the average value of the multiple first directions as the adjustment direction.
- 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.
- step 308 includes: determining an adjustment distance and an adjustment direction based on the position of the first key point in the first image and the position 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; adjusting the position of the third recognition range in the second image based on the adjustment distance and the adjustment direction to obtain a fifth recognition range; for each pixel point in the fifth recognition range, determining the probability corresponding to each pixel point in the fifth recognition range, where the probability corresponding to each pixel point is the probability that the image within the reference recognition range centered on each pixel point contains the biometric feature; adjusting the position of the fifth recognition range in the second image based on the determined probability corresponding to each pixel point in the fifth recognition range to obtain a second recognition range.
- 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.
- the image within the reference recognition range centered on any pixel point within the recognition range contains the biometric feature
- 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 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 positions of the key points in the second image.
- the mapped third recognition range is moved to obtain a fifth recognition range.
- the position of the fifth recognition range in the second image is adjusted so that the image within the adjusted second recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained second recognition range and thus ensuring the accuracy of biometric recognition.
- the computer device identifies the object to which the biometric feature contained in the image within the second recognition range belongs.
- the computer device when the brightness of the image within the second recognition range falls within the reference brightness range, the computer device performs biometric feature recognition on the image within the second recognition range to identify the object to which the biometric feature contained in the image within the second recognition range belongs.
- the process of performing biometric feature recognition on an image includes: when the brightness of an image within a second recognition range falls within a reference brightness range, comparing the image within the second recognition range with multiple reference images, obtaining similarities between the image within the second recognition range and each reference image, and determining object information of the reference image corresponding to the greatest similarity as the object information matching the image within the second recognition range.
- the object information matching the image within the second recognition range is used to characterize the object to which the biometric feature contained in the image within the second recognition range belongs.
- 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 second recognition range and any reference image the more similar the biometric feature contained in the image within the second 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.
- 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 reference 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 (i.e., the second image) is captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image.
- the biometric feature The position of the biometric feature in the second image does not change much compared to its position in the first image. Therefore, the position of the first recognition range in the first image is used to determine the third recognition range from the second image. This allows the third recognition range to be used to quickly determine the second recognition range from the second image, ensuring that 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 reference brightness range, it indicates that the biometric feature in the second image is sufficiently clear. In this case, biometric recognition is performed on the image within the second recognition range to identify the biometric feature of the object. This can avoid recognition errors or failures caused by unclear biometric features in the image, thereby improving the accuracy and success rate of biometric recognition.
- 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 reference brightness range. In other words, when the brightness of the image within the first recognition range falls within the reference brightness range, identifying the object to which the biometric feature contained in the image within the first recognition range belongs.
- the brightness of the image within the first recognition range falls within the reference brightness range, it indicates 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 reference 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.
- the method further includes: when the brightness of the image within the second recognition range does not fall within the reference brightness range, adjusting the second exposure parameter to obtain a third exposure parameter; capturing a next image based on the third exposure parameter, and performing biometric recognition based on the next image.
- 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.
- 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 reference 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 reference 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 reference 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 reference 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
- FIG3 is described by using the features of the first image to determine the first recognition range as an example. In another embodiment, there is no need to perform the above steps 301-304, but other methods are adopted to determine the first recognition range from the first image.
- the seventh recognition range is determined from the first image based on the position of the sixth recognition range in the third image, the position of the sixth recognition range in the third image is the same as the position 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 position of the seventh recognition range in the first image is adjusted to obtain the first recognition range.
- the process of determining the first identification range is similar to the above steps 307 - 308 and will not be repeated here.
- 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 positional relationship between the multiple target key points and the biometric features and the positions of the multiple target key points in the first image.
- a target keypoint is any type of keypoint.
- the target keypoint is a finger keypoint and the biometric feature is a feature of the palm region (i.e., a palm print feature)
- the relative positional relationship between the finger and palm regions remains unchanged regardless of where the palm region is located 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.
- a relative positional relationship exists between the biometric feature and multiple target key points.
- 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.
- a first recognition range is determined from the first image. The first recognition range can reflect the location of the biometric feature, thus ensuring the accuracy of the first recognition range and, in turn, the accuracy of biometric feature recognition.
- the embodiment of the present application can also determine the second recognition range by comparing the first image with the second image.
- the specific process is detailed in the following embodiment.
- FIG6 is a flowchart of another biometric feature recognition method provided by an embodiment of the present application. The method is executed by a computer device. As shown in FIG6 , the method includes steps 601 to 608:
- 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.
- the computer device adjusts the first exposure parameter to obtain a second exposure parameter.
- the computer device captures a second image based on the second exposure parameter, where the second image includes a biometric feature.
- Steps 601-603 are similar to the above steps 201-203 and will not be repeated here.
- the computer device performs feature extraction on 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.
- the third feature and the fourth feature can be represented in any form.
- the third feature and the fourth feature can be represented in the form of color histogram features, directional gradient histogram features, etc.
- 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 (i.e., the third feature).
- 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 end to end to form a vector to obtain the features of the first image.
- 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.
- the third feature is used to represent the first image
- the fourth feature is used to represent the second image
- the third feature can represent the position of the biometric feature in the first image
- the fourth feature can represent the position of the biometric feature in the second image.
- the motion information can be represented in any form, for example, the motion information is represented in the form of a probability map.
- the computer device updates the motion information based on the third feature to obtain updated motion information.
- 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.
- the computer device processes the fourth feature and the updated motion information to obtain a second recognition range.
- the third feature can indicate the position of the biometric feature in the first image
- the fourth feature can indicate the position of the biometric feature in the second image.
- 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.
- 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 second recognition range, thereby ensuring the accuracy of the biometric recognition.
- steps 604-607 are performed by a target detection model.
- the target detection model convolves the third and fourth features 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, which 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 significantly relative to the first image; the first label and the features of the second image are then combined to determine the second recognition range, while 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 second recognition range in the second image can be determined based on the first recognition range in the first image. If the updated motion information is the first label, the first label and the fourth feature are convolved to obtain the second recognition range.
- 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, each of which has a different scale; updating each seventh feature based on the multiple seventh features to obtain an eighth feature corresponding to each seventh feature; processing each eighth feature to obtain an eighth recognition range; and determining a second recognition range based on the obtained multiple eighth recognition ranges. It should be noted that the process of determining the second recognition range is similar to steps 301-304 above and will not be repeated here.
- the computer device identifies the object to which the biometric feature contained in the image within the second recognition range belongs.
- the step 608 is similar to the above step 309 and will not be described again here.
- a first recognition range is determined from a captured first image to determine the position of the biometric feature in the first image.
- the brightness of the image within the first recognition range is detected to determine whether it is sufficient to determine whether the biometric feature in the first image is sufficiently clear. If the brightness of the image within the first recognition range does not fall within a reference brightness range, it is determined that the biometric feature in the first image is not clear enough.
- the exposure parameters are adjusted so that the next image (i.e., the second image) is captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image.
- 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 position of the first recognition range in the first image is used to determine a third recognition range from the second image, so that the second recognition range can be determined from the second image as quickly as possible using the third recognition range, so that the image within the second recognition range contains the biometric feature.
- the brightness of the image within the second recognition range falls within the reference brightness range, it means that the biometric features in the second image are clear enough.
- biometric feature recognition is performed on the image within the second recognition range to identify which object the biometric features belong to. This can avoid recognition errors or recognition failures due to unclear biometric features in the image, thereby improving the accuracy and success rate of biometric recognition.
- the second recognition range can be determined from the second image by performing multiple scale transformations on the features of the second image to obtain multiple ninth features, each of which has a different scale; and based on the multiple ninth features, respectively
- Each ninth feature is updated to obtain the corresponding tenth feature; each tenth feature is processed to obtain a ninth identification range; and a second identification range is determined based on the obtained plurality of ninth identification ranges.
- the principle of determining the second identification range is the same as the principle of determining the first identification range based on steps 301 to 304, and will not be further described here.
- determining the second recognition range from the second image can include performing key point detection on the second image to obtain multiple target key points in the second image; and determining the second recognition range from the second image based on the relative positional relationship between the multiple target key points and the biometric features, as well as the positions of the multiple target key points in the second image.
- the principles of this process for determining the second recognition range are the same as those of determining the first recognition range by performing key point detection on the first image, as described above, and will not be further elaborated here.
- the target detection model training process is shown in FIG8 .
- the method includes: image acquisition, image annotation, image preprocessing, model construction, initialization of model weights, model training, and model parameter adjustment.
- 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.
- the biometric features include multiple types.
- the label includes a first sample label or a second sample label.
- the first sample label indicates the biometric features of the left hand
- the second sample label indicates the biometric features of the right hand.
- the sample image is shown in Figure 9.
- the sample images include positive sample images or negative sample images.
- the positive sample images are images obtained by photographing the biometric features
- the negative sample images are images that do not contain the biometric features, or images that contain unclear biometric features.
- the sample image 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.
- the sample images are cleaned to ensure the quality of the sample images, thereby ensuring the quality of subsequent model training.
- 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.
- the following function is used to determine the directional gradient histogram feature of the image block:
- x represents the horizontal coordinate of a pixel in an image block
- y represents the vertical coordinate of a pixel in an image block
- Ix represents the horizontal gradient of the pixel
- Iy represents the vertical gradient of the pixel
- M(x,y) represents the magnitude of the gradient
- ⁇ (x,y) represents the direction of the gradient.
- the magnitude and direction of the gradient are the features of the histogram of oriented gradients.
- 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.
- Model construction and initialization of model weights Build an initialized target detection model and initialize the weights of the target detection model.
- 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.
- the IOU Intersection Of Union
- MAPIOU mean Average Precision Intersection Of Union
- the target detection model can be packaged into an SDK (Software Development Kit), as shown in Figure 10.
- 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.
- Inference devices include NPUs (Neural Network Processing Units) or CPUs (Central Processing Units).
- Data types include INT8 (a data type) or INT16 (a data type).
- Terminal-side deployment methods include hardware abstraction layers, platform abstraction, or model parsing. Deep optimization methods include operator optimization, scheduling optimization, or memory optimization. For example, select the NPU as the inference device, select INT8 and INT16 as the data types, deploy using the hardware abstraction layer, and use scheduling optimization to generate the SDK.
- the present embodiment further provides a flow chart of a biometric feature recognition method, as shown in FIG. 11 .
- the method includes the following steps 1 to 6:
- Step 1 In response to a biometric recognition instruction, capture the first image based on default exposure parameters.
- 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.
- 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.
- the weights of the pixels within the first recognition range in the first image are set to 255, and the weights of the pixels at other positions are set to 0.
- Step 4 Determine whether the brightness of the image within the first recognition range falls within the reference brightness range.
- Step 5 When the brightness of the image within the first recognition range falls within the reference brightness range, perform biometric feature recognition on the image within the first recognition range.
- the biometric features in the image captured based on the default exposure parameters are clear enough.
- 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.
- Step 6 If the brightness of the image within the first recognition range does not fall within the reference 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 reference brightness range, until the brightness of the image within the recognition range in the currently obtained image falls within the reference brightness range, and perform biometric recognition on the image within the currently obtained recognition range.
- the biometric features in the image captured based on the current exposure parameters are clear enough.
- 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.
- the embodiments of the present application also provide a flowchart of a biometric feature recognition method, as shown in Figure 14, the method includes: photographing the environment through the image sensor in the optical camera to obtain a 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.
- 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, and adjusting the exposure parameters of the image sensor based on the exposure parameters; repeating the above process until the clarity of the biometric 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 a recognition range, and the image within the recognition range in the j-th image contains the biometric feature.
- the image processing module is Software ISP (Software Image Signal Processing, image signal processing software).
- 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.
- 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.
- 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.
- 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;
- 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.
- FIG15 is a schematic diagram of the structure of a biometric identification device provided in an embodiment of the present application. As shown in FIG15 , the device includes:
- 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;
- 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 the reference brightness range;
- 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
- the determination module 1501 is further configured to determine a second recognition range from the second image, wherein the image within the second recognition range contains the biometric feature;
- the recognition module 1504 is configured to recognize the object to which the biometric feature contained in the image within the second recognition range belongs when the brightness of the image within the second recognition range falls within the reference brightness range.
- 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; update each first feature separately to obtain a second feature corresponding to each first feature; process each second feature to obtain a fourth recognition range; and determine the first recognition range based on the obtained multiple fourth recognition ranges.
- 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, form a regional image from the image blocks belonging to a target category, where 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.
- the determination module 1501 is used to determine the fourth recognition range with the highest confidence among multiple fourth recognition ranges as the first recognition range based on the confidence of each fourth recognition range, and the confidence of each fourth recognition range indicates the possibility that the image within each fourth recognition range contains biometric features.
- the apparatus further includes:
- An extraction module 1505 is 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;
- 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 position of the biometric feature in the second image relative to the first image;
- An updating module 1507 is configured to update the motion information based on the third feature to obtain updated motion information
- the processing module 1506 is further configured to process the fourth feature and the updated motion information to obtain a second recognition range.
- the determining module 1501 is configured to determine a third recognition range from the second image based on a position of the first recognition range in the first image, where the position of the third recognition range in the second image is the same as the position of the first recognition range in the first image;
- the adjustment module 1502 is configured to adjust the position of the third recognition range in the second image to obtain a second recognition range.
- the adjustment module 1502 is used to determine the probability corresponding to each pixel point within the third recognition range, where the probability corresponding to each pixel point is the probability that the image within the reference recognition range centered on each pixel point contains the biometric feature, and the size of the reference recognition range is the same as the size of the third recognition range; based on the probability corresponding to each pixel point within the third recognition range, the position of the third recognition range in the second image is adjusted to obtain the second recognition range.
- the adjustment module 1502 is used to determine the target pixel point with the highest probability among the pixel points within the third recognition range; and adjust the position of the third recognition range in the second image to a position centered on the target pixel point to obtain the second recognition range.
- the adjustment module 1502 is used to determine the adjustment distance and adjustment direction based on the position of the first key point in the first image and the position 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 adjustment distance and adjustment direction, the position of the third recognition range in the second image is adjusted to obtain the second recognition range.
- 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 positions of the multiple target key points in the first image, determine the first recognition range from the first image.
- 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 second recognition range does not fall within the reference brightness range;
- the acquisition module 1503 is further configured to acquire a next image based on the third exposure parameter
- the recognition module 1504 is further configured to perform biometric recognition based on the next image.
- the recognition module 1504 is further configured to recognize the object to which the biometric feature contained in the image within the first recognition range belongs when the brightness of the image within the first recognition range falls within a reference brightness range.
- the adjustment module 1502 is configured to adjust the brightness of the image within the first recognition range to be less than a reference value.
- the first exposure parameter is reduced to obtain the second exposure parameter.
- biometric recognition device provided in the above embodiment is merely an example of the division of the aforementioned functional modules.
- 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.
- 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.
- 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 enable the computer device to implement the operations performed by the biometric recognition method of the above embodiment.
- FIG17 shows a block diagram of a terminal 1700 provided in an exemplary embodiment of the present application.
- the terminal 1700 includes: a processor 1701 and a memory 1702.
- the processor 1701 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc.
- the processor 1701 may be implemented in at least one hardware form selected from the group consisting of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and 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.
- 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.
- the processor 1701 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
- AI Artificial Intelligence
- 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.
- the terminal 1700 may optionally further include: a display screen 1705 , a camera assembly 1706 , and an optical sensor 1710 .
- Display screen 1705 is used to display a UI (User Interface).
- the UI may include graphics, text, icons, videos, or any combination thereof.
- display screen 1705 is a touch screen display, it is also capable of collecting touch signals on or above the surface of display screen 1705.
- the touch signals may be input as control signals to processor 1701 for processing.
- display screen 1705 may also be used to provide virtual buttons and/or virtual keyboards, also known as soft buttons and/or soft keyboards.
- display screen 1705 there may be one display screen 1705, disposed on the front panel of terminal 1700; in other embodiments, there may be at least two display screens 1705, disposed on different surfaces of terminal 1700 or in a foldable design; in other embodiments, display screen 1705 may be a flexible display, disposed on a curved or foldable surface of terminal 1700. Display screen 1705 may even be configured as a non-rectangular irregular shape, i.e., 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).
- the camera assembly 1706 is used to capture images or videos.
- the camera assembly 1706 includes a front camera and a rear camera.
- the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal.
- 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.
- the camera assembly 1706 may also include a flash.
- the flash can be a monochrome temperature flash or a dual-color flash. Color temperature flash. Dual color temperature flash refers to a combination of warm light flash and cool light flash, which can be used to compensate for light at different color temperatures.
- Optical sensor 1710 is used to detect ambient light intensity.
- 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.
- processor 1701 can also dynamically adjust the shooting parameters of camera assembly 1706 based on the ambient light intensity detected by optical sensor 1710.
- FIG17 does not constitute a limitation on the terminal 1700 , and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
- the computer device is provided as a server.
- Figure 18 is a schematic diagram of the structure of a server provided in an embodiment of the present application.
- the server 1800 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1801 and one or more memories 1802, wherein the memory 1802 stores at least one computer program, and the at least one computer program is loaded and executed by the processor 1801 to implement the biometric feature recognition method provided by each of the above method embodiments.
- the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output.
- the server may also include other components for implementing device functions, which will not be described in detail here.
- An embodiment of the present application also provides a non-volatile 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 enable the computer to implement the operations performed by the biometric recognition method of the above embodiment.
- An embodiment of the present application further provides a computer program product, including a computer program, which is executed by a processor to enable a computer to implement the operations performed by the biometric recognition method of the above embodiment.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Molecular Biology (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Databases & Information Systems (AREA)
- Medical Informatics (AREA)
- Collating Specific Patterns (AREA)
- Image Analysis (AREA)
Abstract
Description
本申请要求于2024年03月07日提交的申请号为202410263657.0、发明名称为“生物特征识别方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese patent application number 202410263657.0, filed on March 7, 2024, entitled “Biometric Identification Method, Device, Computer Equipment and Storage Medium,” the entire contents of which are incorporated herein by reference.
本申请实施例涉及计算机技术领域,特别涉及一种生物特征识别方法、装置、计算机设备及存储介质。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.
随着计算机技术的发展,生物特征识别技术应用越来越广泛,能够应用在多种场景下,如在支付场景或打卡场景等,通过生物特征识别,能够对用户身份进行验证。目前,生物特征识别的过程包括:在采集到包含生物特征的图像的情况下,对图像进行生物特征识别,以识别出图像包含的生物特征所属的对象。With the development of computer technology, biometric recognition technology is becoming increasingly widely used. It can be applied in a variety of scenarios, such as payment and card processing, to verify user identities. Currently, the biometric recognition process involves capturing an image containing biometric features and then performing biometric recognition on the image to identify the object to which the biometric features belong.
发明内容Summary of the Invention
本申请实施例提供了一种生物特征识别方法、装置、计算机设备及存储介质,能够提高生物特征识别的准确性和成功率。所述技术方案如下:The embodiments of the present application provide a biometric identification method, apparatus, computer device, and storage medium that can improve the accuracy and success rate of biometric identification. The technical solution is as follows:
一方面,提供了一种生物特征识别方法,所述方法由计算机设备执行,所述方法包括:In one aspect, a biometric feature recognition method is provided, the method being executed by a computer device, the method comprising:
从第一图像上确定第一识别范围,所述第一识别范围内的图像包含生物特征,所述第一图像基于第一曝光参数采集得到;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 the reference 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, where the image within the second recognition range contains the biometric feature;
在所述第二识别范围内的图像的亮度落入所述参考亮度范围的情况下,识别所述第二识别范围内的图像包含的所述生物特征所属的对象。When the brightness of the image within the second recognition range falls within the reference brightness range, the object to which the biometric feature contained in the image within the second recognition range belongs is recognized.
另一方面,提供了一种生物特征识别装置,所述装置包括:In another aspect, a biometric feature recognition device is provided, comprising:
确定模块,用于从第一图像上确定第一识别范围,所述第一识别范围内的图像包含生物特征,所述第一图像基于第一曝光参数采集得到;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 reference 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, wherein the image within the second recognition range contains the biometric feature;
识别模块,用于在所述第二识别范围内的图像的亮度落入所述参考亮度范围的情况下,识别所述第二识别范围内的图像包含的所述生物特征所属的对象。The recognition module is configured to recognize the object to which the biometric feature contained in the image within the second recognition range belongs when the brightness of the image within the second recognition range falls within the reference brightness range.
另一方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条计算机程序,所述至少一条计算机程序由所述处理器加载并执行,以使所述计算机设备实现如上述方面所述的生物特征识别方法所执行的操作。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 so that the computer device implements the operations performed by the biometric recognition method described in the above aspects.
另一方面,提供了一种非易失性计算机可读存储介质,所述非易失性计算机可读存储介质中存储有至少一条计算机程序,所述至少一条计算机程序由处理器加载并执行,以使计算机实现如上述方面所述的生物特征识别方法所执行的操作。 On the other hand, a non-volatile 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 enable the computer to implement the operations performed by the biometric recognition method described in the above aspects.
再一方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行,以使计算机实现如上述方面所述的生物特征识别方法所执行的操作。On the other hand, a computer program product is provided, comprising a computer program, wherein the computer program is executed by a processor to enable a computer to implement the operations performed by the biometric recognition method as described in the above aspects.
本申请实施例提供的方案中,在生物特征识别的过程中,从采集到的第一图像上确定第一识别范围,以确定出生物特征在第一图像中所处的位置,检测第一识别范围内的图像的亮度是否足够,以确定第一图像中的生物特征是否足够清晰,在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,确定第一图像中的生物特征不够清晰,则调整曝光参数,以便利用调整后的曝光参数采集下一个图像(也即第二图像),以使采集到的下一个图像中的生物特征的清晰度提升。在第二图像上的第二识别范围内的图像(也即包含生物特征的图像)的亮度落入参考亮度范围的情况下,说明第二图像中的生物特征足够清晰,此时对第二识别范围内的图像进行生物特征识别,以识别该生物特征是哪个对象的生物特征,能够避免由于图像中的生物特征不清晰而导致识别错误或识别失败的情况,提高生物特征识别的准确性和成功率。In the solution provided in the embodiments of the present application, during the biometric feature recognition process, a first recognition range is determined from a captured first 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 the biometric feature in the first image is sufficiently clear. If the brightness of the image within the first recognition range does not fall within a reference brightness range, it is determined that the biometric feature in the first image is not clear enough. Then, the exposure parameters are adjusted so that the next image (i.e., the second image) is captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image. If the brightness of the image within the second recognition range (i.e., the image containing the biometric feature) on the second image falls within the reference brightness range, it indicates that the biometric feature in the second image is sufficiently clear. At this time, biometric feature recognition is performed on the image within the second recognition range to identify the biometric feature of the object. This can avoid recognition errors or recognition failures due to unclear biometric features in the image, thereby improving the accuracy and success rate of biometric feature recognition.
图1是本申请实施例提供的一种实施环境的结构示意图;FIG1 is a schematic diagram of a structure of an implementation environment provided by an embodiment of the present application;
图2是本申请实施例提供的一种生物特征识别方法的流程图;FIG2 is a flow chart of a biometric identification method provided in an embodiment of the present application;
图3是本申请实施例提供的另一种生物特征识别方法的流程图;FIG3 is a flow chart of another biometric identification method provided in an embodiment of the present application;
图4是本申请实施例提供的一种摄像头采集器的结构示意图;FIG4 is a schematic structural diagram of a camera collector provided in an embodiment of the present application;
图5是本申请实施例提供的一种目标检测模型的结构示意图;FIG5 is a schematic diagram of the structure of a target detection model provided in an embodiment of the present application;
图6是本申请实施例提供的再一种生物特征识别方法的流程图;FIG6 is a flow chart of another biometric identification method provided in an embodiment of the present application;
图7是本申请实施例提供的一种确定第二识别范围的流程图;FIG7 is a flow chart of determining a second identification range according to an embodiment of the present application;
图8是本申请实施例提供的一种对目标检测模型进行训练的流程图;FIG8 is a flowchart of training a target detection model provided by an embodiment of the present application;
图9是本申请实施例提供的一种样本图像的示意图;FIG9 is a schematic diagram of a sample image provided in an embodiment of the present application;
图10是本申请实施例提供的一种对模型打包的流程图;FIG10 is a flow chart of a model packaging method provided by an embodiment of the present application;
图11是本申请实施例提供的再一种生物特征识别方法的流程图;FIG11 is a flow chart of another biometric identification method provided in an embodiment of the present application;
图12是本申请实施例提供的一种第1个图像的权重的示意图;FIG12 is a schematic diagram of the weight of a first image provided in an embodiment of the present application;
图13是本申请实施例提供的再一种生物特征识别方法的流程图;FIG13 is a flow chart of another biometric identification method provided in an embodiment of the present application;
图14是本申请实施例提供的再一种生物特征识别方法的流程图;FIG14 is a flow chart of another biometric identification method provided in an embodiment of the present application;
图15是本申请实施例提供的一种生物特征识别装置的结构示意图;FIG15 is a schematic structural diagram of a biometric identification device provided in an embodiment of the present application;
图16是本申请实施例提供的另一种生物特征识别装置的结构示意图;FIG16 is a schematic structural diagram of another biometric feature recognition device provided in an embodiment of the present application;
图17是本申请实施例提供的一种终端的结构示意图;FIG17 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
图18是本申请实施例提供的一种服务器的结构示意图。FIG18 is a schematic diagram of the structure of a server provided in an embodiment of the present application.
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。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.
本申请所使用的术语“第一”、“第二”、“第三”、“第四”等可在本文中用于描述各种概念,但除非特别说明,这些概念不受这些术语限制。这些术语仅用于将一个概念与另一个概念区分。举例来说,在不脱离本申请的范围的情况下,能够将第一特征称为第二特征,且类似地,可将第二特征称为第一特征。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.
本申请所使用的术语“至少一个”、“多个”、“每个”、“任一”,至少一个包括一个、两个或两个以上,多个包括两个或两个以上,而每个是指对应的多个中的每一个,任一是指多个中的任意一个。举例来说,多个像素点包括3个像素点,而每个是指这3个像素点中的每一个像素点,任一是指这3个像素点中的任意一个,能够是第一个像素点,或者,是第二个像素点,或者,是第三个像素点。 As used herein, the terms "at least one,""aplurality,""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.
需要说明的是,本申请所涉及的信息(包括但不限于用户设备信息、用户个人信息等)、数据(包括但不限于用于分析的数据、存储的数据、展示的数据等)以及信号,均为经用户授权或者经过各方充分授权的,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。例如,本申请中涉及到的图像都是在充分授权的情况下获取的。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.
本申请实施例提供的生物特征识别方法,能够由计算机设备执行。可选地,该计算机设备为终端或服务器。可选地,该服务器是独立的物理服务器,或者,是多个物理服务器构成的服务器集群或者分布式系统,或者,是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。可选地,该终端是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表、智能语音交互设备、智能家电及车载终端等,但并不局限于此。The biometric feature recognition method provided in the embodiment 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.
在一些实施例中,本申请实施例所涉及的计算机程序可被部署在一个计算机设备上执行,或者在位于一个地点的多个计算机设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算机设备上执行,分布在多个地点且通过通信网络互连的多个计算机设备能够组成区块链系统。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.
在一些实施例中,计算机设备提供为服务器。图1是本申请实施例提供的一种实施环境的示意图。参见图1,该实施环境包括终端101和服务器102,终端101和服务器102之间通过无线或者有线网络连接。In some embodiments, the computer device is provided as a server. FIG1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Referring to FIG1 , 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.
终端101用于采集图像,并通过与服务器102的网络连接,向服务器102发送采集到的图像。服务器102用于接收终端101发送的图像,并对图像进行处理,以便对图像包含的生物特征进行识别。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.
在一些实施例中,终端101上安装有由服务器102提供服务的应用,终端101能够通过该应用实现例如数据传输、消息交互等功能。可选地,应用为终端101操作系统中的应用,或者为第三方提供的应用。例如,应用为任意的应用,该应用具有生物特征识别的功能,当然,该应用还能够具有其他功能,例如,点评功能、购物功能、导航功能、游戏功能等。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.
终端101用于基于账号登录应用,通过应用向服务器102发送采集到的图像,服务器102用于接收终端101发送的图像,对该图像进行处理,以便对图像中的生物特征进行识别。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.
图2是本申请实施例提供的一种生物特征识别方法的流程图,该方法由计算机设备执行,如图2所示,该方法包括以下步骤201至步骤205:FIG2 is a flow chart of a biometric feature recognition method provided in an embodiment of the present application. The method is executed by a computer device. As shown in FIG2 , the method includes the following steps 201 to 205:
201、计算机设备从第一图像上确定第一识别范围,第一识别范围内的图像包含生物特征,第一图像基于第一曝光参数采集得到。201. 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.
在本申请实施例中,响应于生物特征识别指令,采集包含生物特征的图像,以便后续能够对包含生物特征的图像进行识别。考虑到图像中除生物特征以外的内容会影响生物特征识别的准确性,包含生物特征的局部图像的亮度会影响生物特征的清晰度,进而也会影响生物特征识别的准确性,因此,从采集到的图像上确定第一识别范围,以确定出生物特征在第一图像中所处的位置,检测第一识别范围内的图像的亮度是否落入参考亮度范围,以检测包含生物特征的局部图像是否足够清晰,在包含生物特征的局部图像不够清晰的情况下,会调整曝光参数,以便利用调整的曝光参数来采集下一个图像,以使采取到的下一个图像中包含生物特征的局部图像更清晰,而在包含生物特征的局部图像足够清晰的情况下,才会对包含生物特征的局部图像进行生物特征识别,以识别生物特征所属的对象,保证了生物特征识别的准确性和成功率。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 reference 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.
生物特征是指生物所具备的基本属性或特征,不同生物的生物特征可能不同。本申请实施例对生物特征的类型不加以限定,示例性地,生物特征的类型可以包括但不限于指纹特征、虹膜特征、面部特征、掌纹特征等。 Biometrics refer to the basic attributes or characteristics of a living being, and different living beings may have different biometrics. The embodiments of this application do not limit the types of biometrics. For example, the types of biometrics may include but are not limited to fingerprint features, iris features, facial features, palm print features, etc.
生物特征可能处于第一图像中的任一位置,例如,生物特征处于第一图像的左上角,或者,处于第一图像的右上角。第一识别范围是从第一图像中识别出的生物特征所处的范围,第一识别范围内的图像包含完整的生物特征。第一识别范围能够是任意形状的范围,例如,第一识别范围为圆形范围或方形范围。在本申请实施例中,从第一图像上确定第一识别范围是指确定第一识别范围在第一图像中的位置,例如,位置可以利用坐标表示,也即是,从第一图像中确定生物特征所处的位置。曝光参数用于采集图像,该曝光参数包括光圈、快门速度或感光度等。第一曝光参数是指采集第一图像时所采用的曝光参数。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 identified from the first image is located, and the image within the first recognition range contains the complete biometric feature. The first recognition range can be a range of any shape, for example, 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 position of the first recognition range in the first image, for example, the position can be expressed by coordinates, 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.
示例性地,计算机设备通过配置有第一曝光参数的图像采集设备对拍摄区域进行图像采集,得到第一图像。图像采集设备可以是任一种具有图像采集功能的装置。在一些实施例中,图像采集设备还可以称为摄像头采集器、图像传感器等。Exemplarily, the computer device captures an image of the captured area using an image capture device configured with first exposure parameters to obtain a first image. The image capture device can be any device with image capture capabilities. In some embodiments, the image capture device can also be referred to as a camera collector, an image sensor, etc.
示例性地,计算机设备响应于生物特征识别指令,采集第一图像。本申请实施例对计算机设备获取生物特征识别指令的方式不加以限定。示例性地,计算机设备中具有生物特征识别控件,计算机设备响应于生物特征识别控件的触发操作,获取生物特征识别指令。示例性地,计算机设备响应于检测到有生物特征处于拍摄区域,获取生物特征识别指令。示例性地,计算机设备响应于检测到目标操作的执行请求,获取生物特征识别指令,目标操作的执行请求用于请求执行目标操作,目标操作是指需要依赖生物特征识别结果执行的操作。Exemplarily, the computer device captures a first image in response to a biometric recognition instruction. The embodiments of the present application do not limit the manner in which the computer device obtains the biometric recognition instruction. Exemplarily, the computer device includes a biometric recognition control, and the computer device obtains the biometric recognition instruction in response to a triggering operation of the biometric recognition control. Exemplarily, the computer device obtains the biometric recognition instruction in response to detecting that a biometric feature is in a shooting area. Exemplarily, the computer device obtains the biometric recognition instruction in response to detecting an execution request for a target operation, where the execution request for the target operation is used to request execution of the target operation, where the target operation refers to an operation that needs to be executed based on the biometric recognition result.
本申请实施例对计算机设备的类型不加以限定,可以与具体的生物特征识别场景有关。示例性地,若生物特征识别场景为打卡场景,则计算机设备可以是指打卡设备;若生物特征识别场景为支付场景,则计算机设备可以是指支付设备、扫描设备等。The embodiments of this application do not limit the type of computer device, and may be related to a specific biometric recognition scenario. For example, if the biometric recognition scenario is a clock-in scenario, the computer device may refer to a clock-in device; if the biometric recognition scenario is a payment scenario, the computer device may refer to a payment device, a scanning device, etc.
202、计算机设备在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,调整第一曝光参数,得到第二曝光参数。202. When the brightness of the image within the first recognition range does not fall within the reference brightness range, the computer device adjusts the first exposure parameter to obtain a second exposure parameter.
在本申请实施例中,参考亮度范围是一个任意的亮度范围,第一识别范围内的图像的亮度落入参考亮度范围,表示包含生物特征的局部图像足够清晰,第一识别范围内的图像的亮度未落入参考亮度范围,表示包含生物特征的局部图像不够清晰。并且,考虑到曝光参数会影响采集到的图像的亮度,即图像是否清晰与采集图像时所使用的曝光参数有关,因此,在从第一图像上确定第一识别范围的情况下,检测第一识别范围内的图像的亮度是否落入参考亮度范围,在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,确定包含生物特征的局部图像不够清晰,则对采集第一图像所使用的第一曝光参数进行调整,得到新的曝光参数,以便能够利用新的曝光参数采集下一个图像,以使采集到的下一个图像中包含生物特征的局部图像的清晰度提升。In the embodiment of the present application, the reference brightness range is an arbitrary brightness range. If the brightness of the image within the first recognition range falls within the reference 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 reference 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 the first recognition range is determined from the first image, it is detected whether the brightness of the image within the first recognition range falls within the reference brightness range. If the brightness of the image within the first recognition range does not fall within the reference brightness range, it is determined that the partial image containing the biometric feature is not clear enough. Then, 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.
在示例性实施例中,确定参考亮度范围的方式可以为:获取已进行过生物特征识别的历史图像以及历史图像的识别结果,历史图像的识别结果包括识别成功和识别失败,识别成功用于指示对历史图像进行生物特征识别的过程成功,识别失败用于指示对历史图像进行生物特征识别的过程失败;在历史图像中确定出识别结果为识别成功的候选图像,将候选图像的亮度的范围作为参考亮度范围。In an exemplary embodiment, the reference brightness range can be determined by: obtaining historical images that have undergone biometric identification and the identification results of the historical images, where the identification results of the historical images include identification success and identification failure, where identification success is used to indicate that the process of performing biometric identification on the historical images is successful, and identification failure is used to indicate that the process of performing biometric identification on the historical images is unsuccessful; determining a candidate image in the historical images whose identification result is a successful identification, and using the brightness range of the candidate image as the reference brightness range.
第一识别范围内的图像相当于是第一图像中包含生物特征的局部图像。第二曝光参数与第一曝光参数不同,例如,第一曝光参数与第二曝光参数的光圈、快门速度或感光度中的一项或多项不同。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.
203、计算机设备基于第二曝光参数采集第二图像,第二图像包含生物特征。203. The computer device captures a second image based on the second exposure parameter, where the second image includes a biometric feature.
在本申请实施例中,在得到第二曝光参数的情况下,利用第二曝光参数采集图像,得到第二图像,以便后续能够利用第二图像来进行生物特征识别。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 later.
204、计算机设备从第二图像上确定第二识别范围,第二识别范围内的图像包含生物特征。204. The computer device determines a second identification range from the second image, where the image within the second identification range contains biometric features.
示例性地,计算机设备从第二图像上确定第二识别范围的过程包括:基于第一识别范围在第一图像中的位置,从第二图像上确定第三识别范围,第三识别范围在第二图像中的位置与第一识别范围在第一图像中的位置相同;调整第三识别范围在第二图像中的位置,得到第二识别范围。 Exemplarily, the process of a computer device determining a second recognition range from a second image includes: determining a third recognition range from the second image based on the position of the first recognition range in the first image, the position of the third recognition range in the second image being the same as the position of the first recognition range in the first image; and adjusting the position of the third recognition range in the second image to obtain a second recognition range.
在本申请实施例中,第一图像和第二图像是响应于一次生物特征识别指令采集得到,且第二图像是在第一图像之后采集到的图像,相对于第一图像,生物特征在第二图像中所处位置可能会发生变化,但考虑到采集第一图像与采集第二图像的时间间隔较短,则与生物特征在第一图像所处的位置相比,生物特征在第二图像中所处位置变化不大,因此,利用第一识别范围在第一图像中的位置,从第二图像上确定第三识别范围,以便能够利用第三识别范围尽快从第二图像上确定出第二识别范围,以使第二识别范围内的图像包含生物特征。In an embodiment of the present application, the first image and the second image are captured in response to a biometric recognition instruction, and the second image is an image captured after the first image. Relative to the first image, the position of the biometric feature in the second image may change, but considering that the time interval between capturing the first image and capturing 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 position of the first recognition range in the first image is used to determine the third recognition range from the second image, so that the second recognition range can be determined from the second image as soon as possible using the third recognition range, so that the image within the second recognition range contains the biometric feature.
第三识别范围与第一识别范围的形状相同,第三识别范围相当于将第一识别范围映射到第二图像中得到的区域。例如,第一图像与第二图像的尺寸相同,第三识别范围的尺寸和第一识别范围的尺寸相同,且第三识别范围在第二图像中的位置与第一识别范围在第一图像中的位置相同。示例性地,第一识别范围在第一图像中的位置可以利用第一识别范围在第一图像中的坐标表示,例如,第一识别范围为矩形范围或方形范围,第一识别范围在第一图像中的位置可以利用矩形范围或方形范围的四个角的坐标表示。The third recognition range has the same shape as the first recognition range, and is equivalent to the area obtained by mapping the first recognition range to the second image. For example, the first image and the second image have the same size, the third recognition range has the same size as the first recognition range, and the position of the third recognition range in the second image is the same as the position of the first recognition range in the first image. Exemplarily, the position of the first recognition range in the first image can be represented by the coordinates of the first recognition range in the first image. For example, if the first recognition range is a rectangular range or a square range, the position of the first recognition range in the first image can be represented by the coordinates of the four corners of the rectangular range or the square range.
第一识别范围在第一图像中的位置还可以利用其他类型的信息表示,例如,第一识别范围为圆形范围,第一识别范围在第一图像中的位置可以利用圆形范围的中心坐标以及圆形范围的半径表示;再例如,第一识别范围为方形范围,第一识别范围在第一图像中的位置可以利用方形范围的中心坐标以及方形范围的边长表示;再例如,第一识别范围为矩形范围,第一识别范围在第一图像中的位置可以利用矩形范围的左上角坐标以及矩形范围的长度和宽度表示。The position of the first identification range in the first image can also be represented by other types of information. For example, if the first identification range is a circular range, the position of the first identification range in the first image can be represented by the center coordinates of the circular range and the radius of the circular range; for another example, if the first identification range is a square range, the position of the first identification range in the first image can be represented by the center coordinates of the square range and the side length of the square range; for another example, if the first identification range is a rectangular range, the position of the first identification range in the first image can be represented by the upper left corner coordinates of the rectangular range and the length and width of the rectangular range.
在本申请实施例中,由于第三识别范围是基于第一图像中的第一识别范围确定,考虑到采集第一图像和第二图像时,生物特征所处位置可能会发生变化,进而导致第一图像与第二图像中生物特征所处的位置不同,因此,对第三识别范围在第二图像中的位置进行调整,调整后的识别范围即为从第二图像上确定的第二识别范围,以使第二识别范围内的图像包含生物特征,以保证得到的第二识别范围的准确性。在本申请实施例中,从第二图像上确定第二识别范围是指确定第二识别范围在第二图像中的位置,也即是,从第二图像中确定生物特征所处的位置。In the embodiment of the present application, since the third 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 causing the position of the biometric feature in the first and second images to be different, the position of the third recognition range in the second image is adjusted. The adjusted recognition range is the second recognition range determined from the second image, so that the image within the second recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained second recognition range. In the embodiment of the present application, determining the second recognition range from the second image means determining the position of the second recognition range in the second image, that is, determining the position of the biometric feature from the second image.
205、计算机设备在第二识别范围内的图像的亮度落入参考亮度范围的情况下,识别第二识别范围内的图像包含的生物特征所属的对象。205. When the brightness of the image within the second recognition range falls within the reference brightness range, the computer device identifies the object to which the biometric feature contained in the image within the second recognition range belongs.
示例性地,计算机设备在第二识别范围内的图像的亮度落入参考亮度范围的情况下,对第二识别范围内的图像进行生物特征识别,以识别第二识别范围内的图像包含的生物特征所属的对象。Exemplarily, when the brightness of the image within the second recognition range falls within the reference brightness range, the computer device performs biometric feature recognition on the image within the second recognition range to identify the object to which the biometric feature contained in the image within the second recognition range belongs.
生物特征识别是指对图像包含的生物特征进行识别,以识别该生物特征所属的对象。例如,计算机设备存储有多个对象对应的参考图像,对象对应的参考图像包含该对象的生物特征,在第二识别范围内的图像的亮度落入参考亮度范围的情况下,将第二识别范围内的图像与多个参考图像进行对比,以确定第二识别范围内的图像包含的生物特征与哪个参考图像包含的生物特征相同,在第二识别范围内的图像与任一参考图像包含的生物特征相同的情况下,确定第二识别范围内的图像包含的生物特征为该参考图像对应的对象的生物特征。Biometric recognition refers to the identification of biometric features contained in an image in order 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 object's biometric features. If the brightness of an image within a second recognition range falls within the reference brightness range, the image within the second recognition range is compared with the multiple reference images to determine which reference image contains the same biometric features as the image within the second recognition range. If the image within the second recognition range contains the same biometric features as any of the reference images, the biometric features contained in the image within the second recognition range are determined to be the biometric features of the object corresponding to the reference image.
在本申请实施例中,第二识别范围内的图像相当于是第二图像中包含生物特征的局部图像,第二识别范围内的图像的亮度落入参考亮度范围,表示第二图像中包含生物特征的局部图像足够清晰,因此,能够对第二图像中包含生物特征的局部图像进行生物特征识别,以识别该生物特征是哪个对象的生物特征,以保证生物特征识别的准确性。In the embodiment of the present application, the image within the second identification range is equivalent to the local image of the second image containing the biometric feature. The brightness of the image within the second identification range falls within the reference brightness range, indicating that the local image of the second image containing the biometric feature is clear enough. Therefore, biometric feature recognition can be performed on the local 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.
本申请实施例提供的方案中,在生物特征识别的过程中,从采集到的第一图像上确定第一识别范围,以确定出生物特征在第一图像中所处的位置,检测第一识别范围内的图像的亮度是否足够,以确定第一图像中的生物特征是否足够清晰,在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,确定第一图像中的生物特征不够清晰,则调整曝光参数,以便利用调整后的曝光参数采集下一个图像(也即第二图像),以使采集到的下一个图像中生物特征的清晰度提升。在第二图像上的第二识别范围内的图像(也即包含生物特征的图像) 的亮度落入参考亮度范围的情况下,说明第二图像中的生物特征足够清晰,此时对第二识别范围内的图像进行生物特征识别,以识别该生物特征是哪个对象的生物特征,能够避免由于图像中的生物特征不清晰而导致识别错误或识别失败的情况,提高生物特征识别的准确性和成功率。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 the brightness of the image within the first recognition range 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 reference 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 (i.e., the second image) is captured using the adjusted exposure parameters to improve the clarity of the biometric feature in the next captured image. The image within the second recognition range on the second image (i.e., the image containing the biometric feature) When the brightness falls within the reference brightness range, it means that the biometric features in the second image are clear enough. At this time, biometric feature recognition is performed on the image within the second recognition range to identify which object the biometric features belong to. This can avoid recognition errors or recognition failures due to unclear biometric features in the image, thereby improving the accuracy and success rate of biometric recognition.
此外,考虑到采集第一图像与采集第二图像的时间间隔较短,则与生物特征在第一图像所处的位置相比,生物特征在第二图像中所处的位置变化不大,因此,可以利用第一识别范围在第一图像中的位置,从第二图像上确定第三识别范围,以便能够利用第三识别范围尽快从第二图像上确定出第二识别范围,以在保证第二识别范围内的图像包含生物特征的基础上提高确定第二识别范围的效率。In addition, considering that the time interval between capturing the first image and capturing 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 position of the first recognition range in the first image can be used to determine the third recognition range from the second image, so that the second recognition range can be determined from the second image as quickly as possible using the third recognition range, thereby improving the efficiency of determining the second recognition range on the basis of ensuring that the image within the second recognition range contains the biometric feature.
在图2所示实施例的基础上,本申请实施例还能够采取多次尺度变换的方式利用第一图像的多尺度特征来确定第一识别范围,具体过程详见下述实施例。Based on the embodiment shown in FIG2 , the embodiment of the present application can also adopt multiple scale transformations 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.
图3是本申请实施例提供的另一种生物特征识别方法的流程图,该方法由计算机设备执行,如图3所示,该方法包括步骤301至步骤309:FIG3 is a flow chart of another biometric feature recognition method provided by an embodiment of the present application. The method is executed by a computer device. As shown in FIG3 , the method includes steps 301 to 309:
301、计算机设备对第一图像的特征执行多次尺度变换,得到多个第一特征,多个第一特征的尺度不同。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.
在本申请实施例中,考虑到第一图像的不同尺度特征所表达的含义可能不同,因此,通过获取第一图像的多尺度特征,以丰富第一图像的特征表达方式,以便后续利用第一图像的多尺度特征,检测第一图像中生物特征所处的位置,进而保证后续确定的第一识别范围的准确性。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 first recognition range determined subsequently.
第一图像的特征用于表征第一图像,第一图像的特征能够是任意类型的特征,例如,第一图像的特征为颜色直方图特征、方向梯度直方图(Histogram Of Gradient)特征等。多次尺度变换(Multiple Rescaling)是指对特征执行多次尺度变换,以获取多种不同尺度的特征,且每次尺度变换得到的特征的尺度不同。例如,对第一图像的特征进行多次降维,每次降维得到的特征即为一个第一特征,对第一图像的特征进行多次降维,相当于对第一图像的特征执行多次尺度变换。再例如,对第一图像的特征进行多次升维,每次升维得到的特征即为一个第一特征,对第一图像的特征进行多次升维,相当于对第一图像的特征执行多次尺度变换。降维用于降低特征的尺度,升维用于增大特征的尺度。在一些实施例中,特征的尺度还可以理解为特征的维度。The features of the first image are used to characterize the first image. The features of the first image can be any type of features. For example, the features of the first image are color histogram features, Histogram of Oriented Gradients (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. Dimensionality reduction is used to reduce the scale of a feature, and dimensionality increase is used to increase the scale of a feature. In some embodiments, the scale of a feature can also be understood as the dimension of the feature.
在一种可能实现方式中,第一图像是响应于生物特征识别指令采集到的图像,且第一图像基于第一曝光参数采集得到。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.
生物特征识别指令指示采集图像进行生物特征识别。该第一图像可能是采集到的第1个图像,也可能不是采集到的第1个图像。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.
在本申请实施例中,在第一图像是响应于生物特征识别指令采集到的第1个图像的情况下,第一曝光参数为默认曝光参数;在第一图像是响应于生物特征识别指令采集到的第n个图像的情况下,第一曝光参数基于采集第n-1个图像所采用的曝光参数调整得到,n为大于1的整数。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.
在本申请实施例中,响应于生物特征识别指令,采集图像,进而对采集到的图像中的生物特征进行识别,而在采集到的图像后,从采集到的图像上确定识别范围,以确定生物特征在采集到的图像中的位置,检测识别范围内的图像的亮度是否落入参考亮度范围,而在识别范围内的图像的亮度未落入参考亮度范围的情况下,会调整曝光参数,以便利用调整后的曝光参数采集下一个图像,进而再次检测,重复上述过程,直至从当前采集到的图像上确定的识别范围内的图像的亮度落入参考亮度范围,则对当前识别范围内的图像进行生物特征识别。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 reference brightness range is detected. If the brightness of the image within the recognition range does not fall within the reference 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 reference brightness range, and biometric recognition is performed on the image within the current recognition range.
可选地,计算机设备通过摄像头采集器对拍摄区域进行图像采集,得到第一图像。摄像头采集器用于采集图像,如图4所示,摄像头采集器包括IR(Infrared Radiation,红外线)发射偏振区、IR接收偏振区、RGB(Red Green Blue,红绿蓝)导光圈、IR摄像头、RGB摄像 头、IR LED(发光二极管)等。例如,通过摄像头采集器能够监测拍摄区域是否存在生物特征,在检测到拍摄区域存在生物特征的情况下,对拍摄区域进行拍摄,得到图像。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. As shown in FIG4 , the camera collector includes an IR (Infrared Radiation) emission polarization area, an IR receiving polarization area, an RGB (Red Green Blue) light guide ring, an IR camera, an RGB camera, and a RGB camera. Head, IR LED (light emitting diode), etc. For example, the camera collector can monitor whether there is a biometric feature in the shooting area, and when the biometric feature is detected in the shooting area, the shooting area is photographed to obtain an image.
在一种可能实现方式中,该步骤301包括:对第一图像的特征进行降维,得到第1个第一特征,对第i个第一特征进行降维,得到第i+1个第一特征,i为大于0且小于n的整数。n是指第一特征的数量,n为大于1的整数,n的取值可以根据经验设置,也可以根据应用场景灵活调整,本申请实施例对此不加以限定。In one possible implementation, step 301 includes: performing dimensionality reduction on the features of the first image to obtain a 1st first feature, performing dimensionality reduction on the i-th first feature to obtain an i+1-th first feature, where i is an integer greater than 0 and less than n. n refers to the number of first features, and n is an integer greater than 1. The value of n can be set based on experience or flexibly adjusted according to the application scenario, and is not limited in this embodiment of the present application.
在本申请实施例中,通过对第一图像的特征多次降维,得到多个尺度的第一特征,以使多个尺度的第一特征均能够表征第一图像,以保证得到的多个第一特征的准确性,进而提高确定出的第一识别范围的准确性,提高生物特征识别的准确性。In an embodiment of the present application, by multiple dimensionality reduction of the features of the first image, first features of multiple scales are obtained, so that the first features of multiple scales can all represent the first image, thereby ensuring the accuracy of the multiple first features obtained, thereby improving the accuracy of the determined first recognition range and improving the accuracy of biometric recognition.
在一种可能实现方式中,该步骤301包括:对第一图像的特征进行升维,得到第1个第一特征,对第i个第一特征进行升维,得到第i+1个第一特征,i为大于0且小于n的整数。In one possible implementation, step 301 includes: upgrading the feature of the first image to obtain the 1st first feature, upgrading the ith first feature to obtain the (i+1)th first feature, where i is an integer greater than 0 and less than n.
通过对第一图像的特征多次升维,得到多个尺度的第一特征,以使多个尺度的第一特征均能够表征第一图像,以保证得到的多个第一特征的准确性,进而提高确定出的第一识别范围的准确性,提高生物特征识别的准确性。By multiple times upgrading the dimensions of the features of the first image, first features of multiple scales are obtained, so that the first features of multiple scales can all represent the first image, thereby ensuring the accuracy of the multiple first features obtained, thereby improving the accuracy of the determined first recognition range and improving the accuracy of biometric recognition.
在一种可能实现方式中,该步骤301包括:对第一图像分块,得到多个图像块;对每个图像块分类,得到每个图像块所属的类别;基于多个图像块所属的类别,将属于目标类别的图像块构成区域图像,目标类别指示图像块包含生物特征;对区域图像的特征执行多次尺度变换,得到多个第一特征。In one possible implementation, step 301 includes: dividing the first image into blocks to obtain multiple image blocks; classifying each image block to obtain a 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.
在本申请实施例中,考虑到第一图像中除了包含生物特征外,还可能包含其他的内容,因此,通过对第一图像进行分块,以对第一图像包含的图像块进行分类的方式,从第一图像中提取出包含生物特征的局部图像,进而提取局部图像的特征,将局部图像的特征作为第一图像的特征,以便后续利用局部图像的特征来进行生物特征识别,以削弱第一图像中其他内容的影响,以保证提取到的第一特征更能准确地表征出生物特征,进而提高确定出的第一识别范围的准确性,提高生物特征识别的准确性。In an embodiment of the present application, considering that the first image may contain other content in addition to 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 characterize the biometric features, thereby improving the accuracy of the determined first recognition range and improving the accuracy of biometric feature recognition.
图像块的尺寸能够是任意的尺寸,例如,图像块的尺寸为5×5。多个图像块的尺寸可能相同也可能不同。在多个图像块中,任一图像块中可能包含完整的生物特征,任一图像块可能包含部分生物特征,任一图像块也能不包含生物特征,图像块所属的类别指示图像块是否包含生物特征,属于目标类别的图像块包含生物特征,属于目标类别的图像块可能包含部分生物特征也可能包含完整的生物特征。区域图像是第一图像中包含生物特征的局部图像。区域图像的特征用于表示区域图像,区域图像的特征能够是任意类型的特征,例如,区域图像的特征为颜色直方图特征、方向梯度直方图特征等。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 complete 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 the target category contains a biometric feature, and an image block belonging to the 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.
可选地,对每个图像块进行分类,得到每个图像块的权重,该权重表示图像块包含生物特征的可能性,在图像块的权重不小于阈值的情况下,确定图像块属于目标类别,在图像块的权重小于阈值的情况下,确定图像块属于其他类别。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.
图像块所属的类别包括目标类别或其他类别,其他类别是与目标类别不同的类别。图像块的权重与图像块包含生物特征的可能性呈正相关关系,也即,图像块的权重越大,表示图像块包含生物特征的可能性越大。例如,图像块的权重取值范围为[0,1],图像块的权重为0表示图像块不包含生物特征;图像块的权重为1表示图像块包含生物特征。阈值为任意的数值,例如阈值为0.8。The categories to which an image block belongs include the target category or other categories, where other categories are categories different from the target category. The weight of an image block is positively correlated with the likelihood that the image block contains a biometric feature. That is, 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.
例如,图像块的权重为0.9,阈值为0.8,图像块的权重不小于阈值,则图像块属于目标类别。再例如,图像块的权重为0.7,阈值为0.8,图像块的权重小于阈值,则图像块属于其他类别。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 less than the threshold, then the image block belongs to another category.
可选地,确定图像块的权重的过程包括:对图像块进行特征提取,得到图像块的特征;对图像块的特征进行特征转换,得到图像块的权重。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.
在本申请实施例中,通过提取图像块的特征,并采取特征转换的方式,例如,对图像块的特征进行卷积处理,以将图像块的特征转换为一个值来表示图像块的权重,以使图像块的 权重能够指示出图像块包含生物特征的可能性,保证权重的准确性,从而保证图像块所属的类别的准确性,有利于提高第一特征的可靠性,进而提高确定出的第一识别范围的准确性,提高生物特征识别的准确性。In the embodiment of the present application, the features of the image block are extracted and the feature conversion is adopted, for example, convolution 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 is The weight can indicate the possibility that the image block contains biometric features, ensuring the accuracy of the weight, thereby ensuring the accuracy of the category to which the image block belongs, which is conducive to improving the reliability of the first feature, and then improving the accuracy of the determined first recognition range, thereby improving the accuracy of biometric feature recognition.
可选地,获取区域图像的特征的过程包括:对区域图像进行分块,得到多个第一图像块,对每个第一图像块进行特征提取,得到每个第一图像块的特征;将多个第一图像块的特征进行拼接,得到区域图像的特征。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.
例如,每个第一图像块的特征为方向梯度直方图特征,将多个第一图像块的特征首尾相邻,拼接成一个向量,作为区域图像的特征。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.
可选地,获取区域图像的过程包括:通过图像识别模型,对第一图像分块,得到多个图像块;对每个图像块分类,得到每个图像块所属的类别;基于多个图像块所属的类别,将属于目标类别的图像块构成区域图像。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.
示例性地,图像识别模型为任意的网络模型,例如,图像识别模型为轻量级卷积神经网络。该图像识别模型能够对输入的图像进行分块,并确定出每个图像块的权重,进而按照权重输出包含生物特征的区域图像。例如,图像识别模型通过对输入的图像进行分块,得到多个图像块的特征,多个图像块的特征经过Attention(注意力)层,得到每个图像块的权重,进而按照权重输出包含生物特征的区域图像。Exemplarily, the image recognition model is any network model, for example, a lightweight convolutional neural network. The image recognition model can divide the input image into blocks, determine the weight of each image block, and then output the area image containing the biometric features according to the weight. For example, the image recognition model divides the input image into blocks to obtain the features of multiple image blocks. The features of the multiple image blocks are passed through the Attention layer to obtain the weight of each image block, and then output the area image containing the biometric features according to the weight.
在一种可能实现方式中,在获取第一图像的特征之前,还能够对第一图像进行降噪,以消除第一图像中的噪声像素点,也即是,对第一图像中噪声像素点进行过滤。示例性地,对第一图像中噪声像素点进行过滤的过程,包括:采取中值滤波的方式,对第一图像中的噪声像素点进行处理。中值滤波是一种非线性平滑技术,它将每一像素点的像素值设置为该像素点某邻域窗口内的所有像素点的像素值的中值。In one possible implementation, before acquiring the features of the first image, the first image can also be subjected to noise reduction to eliminate noise pixels in the first image, that is, the noise pixels in the first image are filtered. Exemplarily, the process of filtering the noise pixels in the first image includes: processing the noise pixels in the first image using a median filter. Median filtering is a nonlinear smoothing technique that sets the pixel value of each pixel to the median of the pixel values of all pixels within a certain neighborhood window of the pixel.
在本申请实施例中,采取中值滤波的方式,对第一图像进行降噪,以调整第一图像中噪声像素点的像素值,以保证过滤后的第一图像的准确性。In the embodiment of the present application, median filtering is adopted to reduce the noise of the first image to adjust the pixel values of the noise pixels in the first image to ensure the accuracy of the filtered first image.
可选地,基于设定的窗口,采用遍历的方式,对第一图像中的像素点的像素值进行调整。Optionally, based on the set window, the pixel values of the pixels in the first image are adjusted in a traversal manner.
例如,确定第一图像的宽度和高度,确定窗口的宽度和高度;基于窗口从第一图像的左上角开始遍历,对于窗口内的像素点的像素值进行排序,得到像素值队列,将像素值队列中位于队列的中间位置的像素值(也即窗口内的像素点的像素值的中值),作为该窗口中心对应的像素点的像素值,之后,按照步长移动窗口,按照上述方式对窗口内的像素点的像素值再次进行排序,以便对窗口中心对应的像素点的像素值进行更新,以此类推,完成对第一图像中像素点的像素值的更新。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 queue in the pixel value queue (that is, the median of the pixel values of the pixels in the window) 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 first image.
可选地,基于第一图像中像素点的像素值,确定第一图像中的噪声像素点,基于窗口以该噪声像素点为中心,确定出多个参考像素点,该多个参考像素点是以该噪声像素点为中心的窗口包含的像素点,对于多个参考像素点的像素值进行排序,得到像素值队列,将像素值队列中位于队列的中间位置的像素值,作为噪声像素点的像素值。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.
可选地,确定噪声像素点的过程包括:基于参考窗口遍历第一图像,在遍历过程中,确定参考窗口内像素点的像素值平均值,在参考窗口内的任一像素点的像素值与该像素值平均值之间的差值的绝对值大于差值阈值的情况下,确定该像素点为噪声像素点。差值阈值可以根据经验设置,也可以根据应用场景灵活调整,本申请实施例对此不加以限定。参考窗口的尺寸可以根据经验设置,也可以根据应用场景灵活调整,本申请实施例对此不加以限定。Optionally, the process of determining noise pixel points includes: traversing the first image based on a reference window, determining the average pixel value of the pixel points in the reference window during the traversal process, and determining that the pixel point is a noise pixel point when the absolute value of the difference between the pixel value of any pixel point in the reference window and the average pixel value is greater than a difference threshold. The difference threshold can be set based on experience or flexibly adjusted according to the application scenario, and this is not limited in the embodiments of the present application. The size of the reference window can be set based on experience or flexibly adjusted according to the application scenario, and this is not limited in the embodiments of the present application.
在示例性实施例中,对于在获取第一图像的特征之前,对第一图像进行降噪的情况,获取第一图像的特征的方式为:获取降噪后的第一图像;对降噪后的第一图像进行特征提取,得到第一图像的特征。In an exemplary embodiment, in the case where noise reduction is performed on the first image before obtaining the features of the first image, the method for obtaining the features of the first image is: obtaining the first image after noise reduction; and performing feature extraction on the first image after noise reduction to obtain the features of the first image.
302、计算机设备分别更新每个第一特征,得到每个第一特征对应的第二特征。302. The computer device updates each first feature respectively to obtain a second feature corresponding to each first feature.
在本申请实施例中,通过多个第一特征,分别对每个第一特征进行更新,以使更新得到的每个第二特征中融入了其他的第一特征,以增强不同尺度的特征之间的关联性,以保证得到的第二特征的准确性。 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.
在一种可能实现方式中,该步骤302包括:对第五特征进行尺度变换,得到尺度变换后的第五特征,尺度变换后的第五特征的尺度与第六特征的尺度相同;融合尺度变换后的第五特征及第六特征,得到第六特征对应的第二特征。第六特征为多个第一特征中的任一第一特征,第五特征为多个第一特征中除第六特征以外的特征。In one possible implementation, step 302 includes: performing a scale transformation on the fifth feature to obtain a scaled fifth feature, where the scale of the scaled fifth feature is the same as the scale of the sixth feature; and fusing the scaled fifth feature with the sixth feature to obtain a second feature corresponding to the sixth feature. The sixth feature is any first feature from among the plurality of first features, and the fifth feature is any feature from among the plurality of first features other than the sixth feature.
在本申请实施例中,由于多个第一特征的尺度不同,通过采取先尺度变换再融合的方式,来更新每个第一特征,以保证得到的第二特征的准确性。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.
303、计算机设备处理每个第二特征,得到第四识别范围。303. The computer device processes each second feature to obtain a fourth identification range.
在本申请实施例中,每个第二特征均能够表征第一图像,则通过对每个第二特征进行处理,即可通过每个尺度的第二特征预测出第一图像中生物特征所处的位置,即得到多个第四识别范围。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.
在本申请实施例中,从第一图像上确定第四识别范围是指确定第四识别范围在第一图像中的位置,也即是,从第一图像中确定生物特征所处的位置。得到多个第四识别范围是指从第一图像中确定出生物特征可能所处的多个位置。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.
在一种可能实现方式中,该步骤303包括:对每个第二特征执行生物特征检测,得到第四识别范围。生物特征检测用于基于第二特征检测第一图像是否包含生物特征,并且在检测到第一图像包含生物特征的情况下预测生物特征在第一图像中所处的位置,通过生物特征检测预测的生物特征在第一图像中所处的位置即为第四识别范围。In one possible implementation, step 303 includes performing biometric detection on each second feature to obtain a fourth identification range. The biometric detection is used to detect whether the first image contains a biometric feature based on the second feature, and if the first image is detected to contain a biometric feature, predict the location of the biometric feature in the first image. The location of the biometric feature in the first image predicted by the biometric detection is the fourth identification range.
在本申请实施例中,利用图像的特征,采取生物特征检测的方式,以检测生物特征在图像中的位置,得到识别范围,以使识别范围指示出生物特征所处的位置,进而保证识别范围的准确性。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.
需要说明的是,上述步骤301-步骤303能够通过目标检测模型执行。该目标检测模型用于利用输入的图像特征来确定出图像中生物特征所处的位置,该目标检测模型能够是任意的神经网络模型,例如,该目标检测模型为包含卷积或前馈神经网络。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.
在一种可能实现方式中,该目标检测模型包括Backbone(躯干)子模型、Neck(颈部)子模型和Head(头部)子模型。In one possible implementation, the target detection model includes a Backbone sub-model, a Neck sub-model, and a Head sub-model.
Neck子模型用于执行上述步骤302,对多个尺度的特征进行更新。Head子模型用于执行上述步骤303,基于每个尺度的特征来输出图像中生物特征所处的位置(也即第四识别范围)。Backbone子模型用于对输入的图像特征执行多次尺度变换,该Backbone子模型能够是任意的网络模型,例如,Backbone子模型是由卷积层和GRU(Gate Recurrent Unit,门控循环单元)层构成的神经网络模型,卷积层为2D(2Dimensions,二维)卷积层,如,Backbone子模型包括2D卷积层、非线性激活函数、Dropout(一种网络层)、池化层、全连接层等。再例如,Backbone子模型是由卷积层和LSTM(Long Short-Term Memory,长短期记忆网络)层构成的神经网络模型,卷积层为3D卷积层。再例如,Backbone子模型由2D卷积层和最大卷积网络构成。The Neck sub-model is used to execute the above step 302 and update the features at multiple scales. The Head sub-model is used to execute the above step 303 and output the location of the biometric feature in the image based on the features at each scale (i.e., the fourth recognition range). 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 convolutional layers and GRU (Gate Recurrent Unit) layers, and the convolutional layers are 2D (2 Dimensions, two-dimensional) convolutional layers. For example, the Backbone sub-model includes 2D convolutional layers, nonlinear activation functions, Dropout (a type of network layer), pooling layers, fully connected layers, etc. For another example, the Backbone sub-model is a neural network model composed of convolutional layers and LSTM (Long Short-Term Memory, long short-term memory network) layers, and the convolutional layers are 3D convolutional layers. For another example, the Backbone sub-model is composed of 2D convolutional layers and maximum convolutional networks.
例如,目标检测模型的结构如图5所示,Backbone子模型包括多个卷积层,用于对输入的图像特征执行多次尺度变换,Neck子模型包括上采样层、下采样层、池化层,通过上采样层、下采样层、池化层,能够基于多个尺度的特征,对每个尺度的特征进行更新。Head子模型包括多个检测模块,不同的检测模块用于对不同尺度的特征进行检测,以输出生物特征所处的位置,例如,检测模块为YOLO V3(You Only Look Once V3,目前检测算法第三版)。For example, the structure of the target detection model is shown in Figure 5. The Backbone sub-model includes multiple convolutional layers for performing multiple scale transformations on the input image features. The Neck sub-model includes upsampling layers, downsampling layers, and pooling layers. Through these layers, the features at each scale can be updated based on features at multiple scales. The Head sub-model includes multiple detection modules, each of which is used to detect features at different scales and output the location of the biometric feature. For example, the detection module is YOLO V3 (You Only Look Once V3, currently the third version of the detection algorithm).
304、计算机设备基于得到的多个第四识别范围,确定第一识别范围,第一识别范围内的图像包含生物特征。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.
在本申请实施例中,考虑到第一图像的不同尺度特征所表达的含义可能不同,因此,通过获取第一图像的多尺度特征,以丰富第一图像的特征表达,利用第一图像的多尺度特征,从第一图像中确定出生物特征可能所处的位置,即确定多个第四识别范围,则基于多个第四识别范围,以便能确定出生物特征的准确位置,即能够确定出第一识别范围,以保证确定出的第一识别范围的准确性。 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.
在一种可能实现方式中,该步骤304包括:基于每个第四识别范围的置信度,将多个第四识别范围中的置信度最大的第四识别范围,确定为第一识别范围,每个第四识别范围的置信度指示每个第四识别范围内的图像包含生物特征的可能性。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 among multiple fourth recognition ranges as the first recognition range, and the confidence of each fourth recognition range indicates the possibility that the image within each fourth recognition range contains biometric features.
第四识别范围的置信度与第四识别范围内的图像包含生物特征的可能性呈正相关关系,也即,第四识别范围的置信度越大,表示第四识别范围内的图像包含生物特征的可能性越大。例如,第四识别范围的置信度的取值范围为[0,1],第四识别范围的置信度为0,表示第四识别范围内的图像不包含生物特征;第四识别范围的置信度为1,表示第四识别范围内的图像包含生物特征。The confidence level of the fourth identification range is positively correlated with the likelihood that an image within the fourth identification range contains a biometric feature. That is, the greater the confidence level of the fourth identification range, the greater the likelihood that an image within the fourth identification range contains a biometric feature. For example, the confidence level of the fourth identification range ranges from [0, 1]. A confidence level of 0 indicates that an image within the fourth identification range does not contain a biometric feature; a confidence level of 1 indicates that an image within the fourth identification range contains a biometric feature.
在本申请实施例中,在得到每个第四识别范围时还能够得到每个第四识别范围的置信度,该置信度能够反映出第四识别范围内的图像包含生物特征的可能性,因此,将置信度最大的第四识别范围确定为第一识别范围,以保证确定出的第一识别范围内的图像包含生物特征,保证第一识别范围的准确性,提高生物特征识别的准确性。In an embodiment of the present application, when each fourth recognition range is obtained, the confidence of each fourth recognition range can also be obtained. The confidence can reflect the possibility that the image within the fourth recognition range contains biometric features. Therefore, the fourth recognition range with the highest confidence is determined as the first recognition range to ensure that the image within the determined first recognition range contains biometric features, ensure the accuracy of the first recognition range, and improve the accuracy of biometric recognition.
可选地,对于获取第四识别范围的置信度的过程包括:对第二特征执行生物特征检测,得到第四识别范围及第四识别范围的置信度。也就是说,生物特征检测除了用于基于第二特征检测第一图像是否包含生物特征,并且在检测到第一图像包含生物特征的情况下预测第四识别范围外,还用于输出预测得到的第四识别范围的置信度。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. In other words, in addition to detecting whether the first image contains the biometric feature based on the second feature and predicting the fourth recognition range if the first image is detected to contain the biometric feature, the biometric detection further outputs the confidence level of the predicted fourth recognition range.
305、计算机设备在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,调整第一曝光参数,得到第二曝光参数。305. If the brightness of the image within the first recognition range does not fall within the reference brightness range, the computer device adjusts the first exposure parameter to obtain a second exposure parameter.
在一种可能实现方式中,确定第一识别范围内的图像的亮度的过程包括:基于第一识别范围内的图像中像素点的像素值,确定第一识别范围内的图像的亮度。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.
在本申请实施例中,由于第一识别范围内的图像中像素点的像素值能够反映出各个像素点的亮度,则基于第一识别范围内的图像中像素点的像素值,确定第一识别范围内的图像的亮度,以保证确定出的亮度的准确性。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.
可选地,每个像素点的像素值以RGB(Red Green Blue,红绿蓝)形式表示,则确定第一识别范围内的图像的亮度的过程包括:对于第一识别范围内的图像中每个像素点,对该像素点的R值、G值及B值进行加权,得到该像素点的亮度,将第一识别范围内的图像中像素点的亮度的平均值,确定为第一识别范围内的图像的亮度。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.
在本申请实施例中,每个像素点的像素值是以红绿蓝三通道的颜色表示,则通过对每个像素点的红绿蓝三通道的颜色值进行加权,即可得到每个像素点的亮度,进而基于第一识别范围内的图像中像素点的亮度,确定出第一识别范围内的图像的亮度。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.
在一种可能实现方式中,调整第一曝光参数的方式,包括:在第一识别范围内的图像的亮度小于参考亮度范围中的最小值的情况下,增大第一曝光参数,得到第二曝光参数;或者,在第一识别范围内的图像的亮度大于参考亮度范围中的最大值的情况下,减小第一曝光参数,得到第二曝光参数。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 reference 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 reference brightness range, reducing the first exposure parameter to obtain the second exposure parameter.
在本申请实施例中,在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,基于第一识别范围内的图像的亮度与参考亮度范围内亮度值的大小关系,对第一曝光参数进行调整,以使后续基于得到的第二曝光参数来采集图像时,能够保证采集到的图像中的生物特征所处范围内的图像的亮度尽可能落入参考亮度范围,以保证确定出的第二曝光参数的准确性,在根据此种第二曝光参数采集第二图像后,第二图像上的第二识别范围内的图像的亮度落入参考亮度范围的几率较高,从而有利于提高直接根据第二识别范围内的图像进行生物特征识别的可能性,提高生物特征识别的效率。In an embodiment of the present application, when the brightness of the image within the first recognition range does not fall within the reference 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 reference 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 biometric feature is located in the captured image can be guaranteed to fall within the reference brightness range as much as possible, so as to ensure the accuracy of the determined second exposure parameter. After the second image is captured according to such second exposure parameter, the probability of the brightness of the image within the second recognition range on the second image falling within the reference brightness range is high, which is conducive to increasing the possibility of directly performing biometric recognition based on the image within the second recognition range, thereby improving the efficiency of biometric recognition.
306、计算机设备基于第二曝光参数采集第二图像,第二图像包含生物特征。306. The computer device captures a second image based on the second exposure parameter, where the second image includes a biometric feature.
在一种可能实现方式中,计算机设备包括图像传感器,则该步骤306包括:将图像传感器的曝光参数调整为第二曝光参数,通过调整后的图像传感器采集图像,得到第二图像。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.
在本申请实施例中,计算机设备中的图像传感器用于采集图像,计算机设备通过图像传感器将拍摄区域内的画面采集成图像,因此,先将图像传感器的曝光参数调整为第二曝光参 数,以便通过调整后的图像传感器,以第二曝光参数来采集图像,得到第二图像。In the embodiment of the present application, the image sensor in the computer device is used to collect images. The computer device collects the pictures in the shooting area into images through the image sensor. Therefore, the exposure parameter of the image sensor is first adjusted to the second exposure parameter. number, so that the image is captured by the adjusted image sensor with the second exposure parameter to obtain a second image.
307、计算机设备基于第一识别范围在第一图像中的位置,从第二图像中确定第三识别范围,第三识别范围在第二图像中的位置与第一识别范围在第一图像中的位置相同。307. The computer device determines a third recognition range from the second image based on the position of the first recognition range in the first image, where the position of the third recognition range in the second image is the same as the position of the first recognition range in the first image.
在一种可能实现方式中,该步骤307包括:确定第一识别范围在第一图像中的位置参数,基于第一识别范围在第一图像中的位置参数,在第二图像中确定出第三识别范围,第三识别范围在第二图像中的位置参数与第一识别范围在第一图像中的位置参数相同。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 third recognition range in the second image, and the position parameters of the third recognition range in the second image are the same as the position parameters of the first recognition range in the first image.
示例性地,第一识别范围在第一图像中的位置参数指示第一识别范围在第一图像中的位置,位置参数包含坐标。第一识别范围在第一图像中的位置参数能够以任意的形式表示,例如,第一识别范围为方形范围,第一识别范围在第一图像中的位置参数包括第一识别范围的中心坐标和边长;或者,第一识别范围在第一图像中的位置参数包括四个角的坐标。再例如,第一识别范围为圆形区域,第一识别范围在第一图像中的位置参数包括第一识别范围的中心坐标和半径。Exemplarily, the position parameters of the first recognition range in the first image indicate the position of the first recognition range in the first image, and the position parameters include coordinates. The position parameters of the first recognition range in the first image can be expressed in any form. For example, if the first recognition range is a square range, the position parameters of the first recognition range in the first image include the center coordinates and side lengths of the first recognition range; or, the position parameters of the first recognition range in the first image include the coordinates of the four corners. For another example, if the first recognition range is a circular area, the position parameters of the first recognition range in the first image include the center coordinates and radius of the first recognition range.
在本申请实施例中,第一图像与第二图像的尺寸相同,确定出第一识别范围在第一图像中的位置参数,即可按照第一识别范围在第一图像中的位置参数,在第二图像中确定出第三识别范围,以保证确定出的第三识别范围在第二图像中的位置与第一识别范围在第一图像中的位置相同,保证确定出的第三识别范围的准确性。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 third 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 third 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 third recognition range.
308、计算机设备调整第三识别范围在第二图像中的位置,得到第二识别范围,第二识别范围内的图像包含生物特征。308. The computer device adjusts the position of the third recognition range in the second image to obtain a second recognition range, and the image within the second recognition range contains the biometric feature.
在一种可能实现方式中,该步骤308包括:对于第三识别范围内的每个像素点,确定每个像素点对应的概率,每个像素点对应的概率为以每个像素点为中心的参考识别范围内的图像包含生物特征的概率,参考识别范围的尺寸与第三识别范围的尺寸相同;基于第三识别范围内的各个像素点对应的概率,调整第三识别范围在第二图像中的位置,得到第二识别范围。In one possible implementation, step 308 includes: for each pixel point within the third recognition range, determining the probability corresponding to each pixel point, where the probability corresponding to each pixel point is the probability that the image within the reference recognition range centered on each pixel point contains the biometric feature, and the size of the reference recognition range is the same as the size of the third recognition range; based on the probability corresponding to each pixel point within the third recognition range, adjusting the position of the third recognition range in the second image to obtain the second recognition range.
确定的概率包括多个,每个概率与第三识别范围内一个像素点对应。任一像素点对应的概率用于指示以该像素点为中心的参考识别范围内的图像包含生物特征的可能性,任一像素点对应的概率与以该像素点为中心的参考识别范围内的图像包含生物特征的可能性呈正相关关系,也即,任一像素点对应的概率越大,以该像素点为中心的参考识别范围内的图像包含生物特征的可能性越大。参考识别范围是一个尺寸与第三识别范围的尺寸相同的识别范围。The determined probabilities include multiple ones, each corresponding to a pixel within the third recognition range. The probability corresponding to any pixel indicates the likelihood that an image within the reference recognition range centered on that pixel contains the biometric feature. The probability corresponding to any pixel is positively correlated with the likelihood that an image within the reference recognition range centered on that pixel contains the biometric feature. That is, the greater the probability corresponding to any pixel, the greater the likelihood that an image within the reference recognition range centered on that pixel contains the biometric feature. The reference recognition range is a recognition range of the same size as the third recognition range.
在本申请实施例中,对于第三识别范围内的每个像素点,确定每个像素点对应的概率,以确定以各个像素点为中心的参考识别范围内的图像包含生物特征的可能性。因此,基于确定的概率,对第三识别范围在第二图像中的位置进行调整,以使调整得到的第二识别范围内的图像包含生物特征,以保证得到的第二识别范围的准确性,进而保证生物特征识别的准确性。In this embodiment of the present application, a probability corresponding to each pixel within the third recognition range is determined to determine the likelihood that the image within the reference recognition range centered on each pixel contains the biometric feature. Based on the determined probability, the position of the third recognition range within the second image is adjusted so that the image within the adjusted second recognition range contains the biometric feature, thereby ensuring the accuracy of the second recognition range and, consequently, the accuracy of biometric recognition.
可选地,确定第二识别范围的过程包括:在第三识别范围内的各个像素点中,确定概率最大的目标像素点;将第三识别范围在第二图像中的位置调整到以目标像素点为中心的位置,得到第二识别范围,第三识别范围的尺寸与第二识别范围的尺寸相同。Optionally, the process of determining the second recognition range includes: determining the target pixel point with the highest probability among the pixel points within the third recognition range; adjusting the position of the third recognition range in the second image to a position centered on the target pixel point to obtain the second recognition range, and the size of the third recognition range is the same as the size of the second recognition range.
在本申请实施例中,任一像素点对应的概率越大,表示以该像素点为中心的参考识别范围内的图像包含生物特征的可能性越大,因此,从确定的多个概率中确定出最大概率,将最大概率对应的像素点,确定为目标像素点,进而移动第三识别范围以使移动后的识别范围的中心位于目标像素点上,以保证得到的第二识别范围内的图像包含生物特征,进而保证得到的第二识别范围的准确性,进而保证生物特征识别的准确性。In the embodiment of the present application, the greater the probability corresponding to any pixel point, the greater the possibility that the image within the reference recognition range centered on the pixel point contains the biometric feature. Therefore, the maximum probability is determined from the multiple probabilities determined, and the pixel point corresponding to the maximum probability is determined as the target pixel point, and then the third recognition range is moved so that the center of the moved recognition range is located on the target pixel point, so as to ensure that the image within the obtained second recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained second recognition range, and thereby ensuring the accuracy of biometric feature recognition.
需要说明的是,本申请实施例是以对第三识别范围的位置进行一次调整为例进行说明,而在另一实施例中,还能够按照上述方式,以目标像素点确定新的识别范围;进而对于新的识别范围内的每个像素点,确定新的识别范围内的每个像素点对应的概率,基于当前确定的概率,确定下一个目标像素点,以便以下一个目标像素点为中心确定下一个识别范围;在当前确定的目标像素点与上一个目标像素点之间的距离小于第一阈值的情况下,或者,在当前确定的最大概率(也即当前确定的目标像素点对应的概率)大于第二阈值的情况下,将当前 确定的识别范围确定为第二识别范围。第一阈值和第二阈值可以根据经验设置,也可以根据应用场景灵活调整,本申请实施例对此不加以限定。It should be noted that the embodiment of the present application is explained by taking the adjustment of the position of the third recognition range as an example. In another embodiment, it is also possible to determine a new recognition range with the target pixel point in the above manner; and then for each pixel point in the new recognition range, determine the probability corresponding to each pixel point in the new recognition range, and determine the next target pixel point based on the currently determined probability, so as to determine the next recognition range as the center of the next target pixel point; when the distance between the currently determined target pixel point and the previous target pixel point is less than the first threshold, or when the currently determined maximum probability (that is, the probability corresponding to the currently determined target pixel point) is greater than the second threshold, the current target pixel point is adjusted. The determined identification range is determined as the second identification range. The first threshold and the second threshold can be set based on experience or flexibly adjusted according to application scenarios, which is not limited in the embodiment of the present application.
可选地,确定概率的过程包括:确定第三识别范围内每个像素点的像素特征,对于第三识别范围内的第一像素点,确定每个第二像素点的像素特征与第一像素点的像素特征之间的距离,将多个距离的平均值确定为第一像素点对应的概率,第一像素点对应的概率为以第一像素点为中心的参考识别范围内的图像包含生物特征的概率。Optionally, the process of determining the probability includes: determining the pixel features of each pixel point within the third identification range, for the first pixel point within the third 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, and the probability corresponding to the first pixel point is the probability that the image within the reference identification range centered on the first pixel point contains the biological feature.
第一像素点为第三识别范围内任一像素点,第二像素点为以第一像素点为中心的参考识别范围内除第一像素点以外的像素点。像素点的像素特征能够以任意的形式表示,例如,像素点的像素特征为像素点的颜色直方图特征。The first pixel is any pixel within the third identification range, and the second pixel is a pixel other than the first pixel within the reference identification range centered on the first pixel. The pixel features of the pixel can be represented in any form, for example, the pixel features of the pixel are color histogram features of the pixel.
在本申请实施例中,采取Mean Shift(均值偏移)方法,能够确定第三识别范围内的每个像素点对应的概率,也即确定出以第三识别范围内的每个像素点为中心的参考识别范围内的图像包含生物特征的概率。In an embodiment of the present application, the Mean Shift method is adopted to determine the probability corresponding to each pixel point within the third recognition range, that is, to determine the probability that the image within the reference recognition range centered on each pixel point within the third recognition range contains the biological feature.
在本申请实施例中,通过采取光流法来确定第二图像上的第二识别范围,考虑到在生物特征识别的过程中,生物特征在采集到的相邻两个图像中所处位置差异小,因此,结合第一个图像上的第一识别范围,在第二图像上确定第三识别范围,进而采取像素点聚类的方式,确定出第二识别范围,以保证确定出的第二识别范围的准确性。In an embodiment of the present application, the optical flow method is used to determine the second recognition range on the second image. Taking into account 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 third recognition range on the second image, and then the second recognition range is determined by pixel clustering to ensure the accuracy of the determined second recognition range.
可选地,确定目标像素点的过程包括:确定第三识别范围内像素点的颜色直方图特征,基于第三识别范围内像素点的颜色直方图特征,采取核密度估计,确定出像素点的概率分布,将概率分布中概率密度最大的像素点,确定为目标像素点。Optionally, the process of determining the target pixel point includes: determining the color histogram characteristics of the pixel points within the third recognition range, taking kernel density estimation based on the color histogram characteristics of the pixel points within the third recognition range, determining the probability distribution of the pixel points, and determining the pixel point with the largest probability density in the probability distribution as the target pixel point.
在一种可能实现方式中,该步骤308包括:基于第一关键点在第一图像中的位置及第二关键点在第二图像中的位置,确定调整距离及调整方向,第一关键点和第二关键点为生物特征的同一关键点;基于调整距离及调整方向,调整第三识别范围在第二图像中的位置,得到第二识别范围。示例性地,调整距离和调整方向还可以称为生物特征的移动距离和移动方向,生物特征的移动距离和移动方向是指与第一图像相比第二图像中生物特征的移动距离和移动方向。基于调整距离及调整方向,调整第三识别范围在第二图像中的位置的过程可以是指基于生物特征的移动距离和移动方向,移动第三识别范围的过程。In one possible implementation, step 308 includes: determining an adjustment distance and an adjustment direction based on the position of a first key point in the first image and the position of a 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 adjusting the position of the third recognition range in the second image based on the adjustment distance and the adjustment direction to obtain a second recognition range. Exemplarily, the adjustment distance and the adjustment direction may also be referred to as the movement distance and movement direction of the biometric feature, where the movement distance and movement direction of the biometric feature refer to the movement distance and movement direction of the biometric feature in the second image compared to the first image. Adjusting the position of the third recognition range in the second image based on the adjustment distance and the adjustment direction may refer to moving the third recognition range based on the movement distance and movement direction of the biometric feature.
第一关键点是第一图像中生物特征的关键点,第二关键点是第二图像中生物特征的关键点,且第一关键点与第二关键点为生物特征的同一关键点,例如,第一关键点是第一图像中生物特征的中心点,第二关键点是第二图像中生物特征的中心点。第一关键点为任意的关键点,例如,第一关键点为生物特征的中心点,或者为生物特征的边缘点等。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.
在本申请实施例中,相对于第一图像,第二图像中生物特征所处位置可能会发生变化,则生物特征的关键点也会发生变化,因此,在确定生物特征在第一图像中所处区域的情况下,识别出生物特征在第一图像中的关键点及在第二图像中的关键点,以便按照生物特征在第一图像中的关键点及在第二图像中的关键点的位置,确定与第一图像相比第二图像中生物特征的移动距离和移动方向,进而按照移动距离和移动方向,对映射得到的第三识别范围进行移动,以改变第三识别范围的位置,得到第二识别范围,以保证得到的第二识别范围内的图像包含生物特征,进而保证得到的第二识别范围的准确性,保证生物特征识别的准确性。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 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 third recognition range according to the movement distance and movement direction to change the position of the third recognition range to obtain the second recognition range, so as to ensure that the image within the obtained second recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained second recognition range and the accuracy of biometric recognition.
可选地,确定第一关键点的过程包括:对第一识别范围内的图像进行关键点识别,得到第一关键点。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.
在本申请实施例中,通过对第一识别范围内的图像进行关键点识别,无需再对其他区域的图像进行关键点识别,以保证尽快能够得到第一关键点,保证获取第一关键点的准确性和效率。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.
需要说明的是,确定第二关键点的过程,与上述确定第一关键点的过程同理,在此不再赘述。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.
需要说明的是,本申请实施例是以一个第一关键点和一个第二关键点为例进行说明,而在另一实施例中,还能够基于多个第一关键点在第一图像中的位置及多个第二关键点在第二 图像中的位置,确定调整距离及调整方向,多个第一关键点与多个第二关键点一一对应,第一关键点和对应的第二关键点为生物特征的同一关键点;基于调整距离及调整方向,调整第三识别范围在第二图像中的位置,得到第二识别范围。It should be noted that the embodiment of the present application is described by taking one first key point and one second key point as an example. In another embodiment, it is also possible to determine the position of multiple first key points in the first image and multiple second key points in the second image based on the position of multiple first key points in the first image. The position in the image is determined to adjust the distance and the direction, multiple first key points correspond one-to-one with 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 adjustment distance and the adjustment direction, the position of the third recognition range in the second image is adjusted to obtain the second recognition range.
在一种可能实现方式中,基于多个第一关键点及多个第二关键点,确定调整距离和调整方向的过程,包括:对于每个第一关键点,基于第一关键点的位置及对应的第二关键点的位置,确定第一距离及第一方向,第一方向由第一关键点指向第二关键点,将多个第一距离的平均值,确定为调整距离,将多个第一方向的平均值确定为调整方向。In one possible implementation, the process of determining the adjustment distance and adjustment direction based on multiple first key points and multiple second key points includes: for each first key point, based on the position of the first key point and the position of the corresponding second key point, determining the first distance and the first direction, the first direction points from the first key point to the second key point, determining the average value of the multiple first distances as the adjustment distance, and determining the average value of the multiple first directions as the adjustment direction.
在本申请实施例中,第一方向以角度表示,相当于在XY坐标系中由第一关键点的坐标对应的点指向第二关键点的坐标对应的点的射线与X轴之间的角度。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.
在一种可能实现方式中,该步骤308包括:基于第一关键点在第一图像中的位置及第二关键点在第二图像中的位置,确定调整距离及调整方向,第一关键点和第二关键点为生物特征的同一关键点;基于调整距离及调整方向,调整第三识别范围在第二图像中的位置,得到第五识别范围;对于第五识别范围内的每个像素点,确定第五识别范围内的每个像素点对应的概率,每个像素点对应的概率为以每个像素点为中心的参考识别范围内的图像包含生物特征的概率;基于确定的第五识别范围内的各个像素点对应的概率,调整第五识别范围在第二图像中的位置,得到第二识别范围。In one possible implementation, step 308 includes: determining an adjustment distance and an adjustment direction based on the position of the first key point in the first image and the position 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; adjusting the position of the third recognition range in the second image based on the adjustment distance and the adjustment direction to obtain a fifth recognition range; for each pixel point in the fifth recognition range, determining the probability corresponding to each pixel point in the fifth recognition range, where the probability corresponding to each pixel point is the probability that the image within the reference recognition range centered on each pixel point contains the biometric feature; adjusting the position of the fifth recognition range in the second image based on the determined probability corresponding to each pixel point in the fifth recognition range to obtain a second recognition range.
在本申请实施例中,相对于第一图像,第二图像中生物特征所处位置可能会发生变化,则生物特征的关键点也会发生变化,并且考虑到以识别范围内任一像素点为中心的参考识别范围内的图像包含生物特征的可能性,因此,在从第一图像上确定第一识别范围的情况下,识别出生物特征在第一图像中的关键点及在第二图像中的关键点,以便按照生物特征在第一图像中的关键点的位置及在第二图像中的关键点的位置,确定与第一图像相比第二图像中生物特征的移动距离和移动方向,进而按照移动距离和移动方向,对映射得到的第三识别范围进行移动,得到第五识别范围,之后再基于第五识别范围内像素点对应的概率对第五识别范围在第二图像中的位置进行调整,以使调整得到的第二识别范围内的图像包含生物特征,以保证得到的第二识别范围的准确性,进而保证生物特征识别的准确性。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. Considering the possibility that the image within the reference recognition range centered on any pixel point within the recognition range contains the biometric feature, when determining the first recognition range 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 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 positions of the key points in the second image. Then, according to the movement distance and the movement direction, the mapped third 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 position of the fifth recognition range in the second image is adjusted so that the image within the adjusted second recognition range contains the biometric feature, thereby ensuring the accuracy of the obtained second recognition range and thus ensuring the accuracy of biometric recognition.
309、计算机设备在第二识别范围内的图像的亮度落入参考亮度范围的情况下,识别第二识别范围内的图像包含的生物特征所属的对象。309. When the brightness of the image within the second recognition range falls within the reference brightness range, the computer device identifies the object to which the biometric feature contained in the image within the second recognition range belongs.
示例性地,计算机设备在第二识别范围内的图像的亮度落入参考亮度范围的情况下,对第二识别范围内的图像进行生物特征识别,以识别第二识别范围内的图像包含的生物特征所属的对象。Exemplarily, when the brightness of the image within the second recognition range falls within the reference brightness range, the computer device performs biometric feature recognition on the image within the second recognition range to identify the object to which the biometric feature contained in the image within the second recognition range belongs.
在一种可能实现方式中,对图像进行生物特征识别的过程包括:在第二识别范围内的图像的亮度落入参考亮度范围的情况下,将第二识别范围内的图像与多个参考图像进行对比,得到第二识别范围内的图像与每个参考图像的相似度,将最大相似度对应的参考图像的对象信息,确定为与第二识别范围内的图像匹配的对象信息。与第二识别范围内的图像匹配的对象信息用于表征第二识别范围内的图像包含的生物特征所属的对象。In one possible implementation, the process of performing biometric feature recognition on an image includes: when the brightness of an image within a second recognition range falls within a reference brightness range, comparing the image within the second recognition range with multiple reference images, obtaining similarities between the image within the second recognition range and each reference image, and determining object information of the reference image corresponding to the greatest similarity as the object information matching the image within the second recognition range. The object information matching the image within the second recognition range is used to characterize the object to which the biometric feature contained in the image within the second recognition range belongs.
在本申请实施例中,每个参考图像包含一个生物特征,多个参考图像包含的生物特征不同,每个参考图像对应一个对象信息,参考图像包含的生物特征即为该对象信息所表征对象的生物特征,第二识别范围内的图像与任一参考图像的相似度越大,表示第二识别范围内的图像所包含的生物特征与该参考图像包含的生物特征越相似。因此,采取确定相似度的方式来进行生物特征识别,以保证生物特征识别的准确性。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 second recognition range and any reference image, the more similar the biometric feature contained in the image within the second 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.
本申请实施例提供的方案中,在生物特征识别的过程中,从采集到的第一图像上确定第一识别范围,以确定出生物特征在第一图像中所处的位置,检测第一识别范围内的图像的亮度是否足够,以确定第一图像中的生物特征是否足够清晰,在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,确定第一图像中的生物特征不够清晰,则调整曝光参数,以便利用调整后的曝光参数采集下一个图像(也即第二图像),以使采集到的下一个图像中生物特征的清晰度提升,考虑到采集第一图像与采集第二图像的时间间隔较短,则与生物特征 在第一图像所处的位置相比,生物特征在第二图像中所处的位置变化不大,因此,利用第一识别范围在第一图像中的位置,从第二图像上确定第三识别范围,以便能够利用第三识别范围尽快从第二图像上确定出第二识别范围,以使第二识别范围内的图像包含生物特征。在第二识别范围内的图像的亮度落入参考亮度范围的情况下,说明第二图像中的生物特征足够清晰,此时对第二识别范围内的图像进行生物特征识别,以识别该生物特征是哪个对象的生物特征,能够避免由于图像中的生物特征不清晰而导致识别错误或识别失败的情况,提高生物特征识别的准确性和成功率。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 reference 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 (i.e., the second image) is 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 biometric feature The position of the biometric feature in the second image does not change much compared to its position in the first image. Therefore, the position of the first recognition range in the first image is used to determine the third recognition range from the second image. This allows the third recognition range to be used to quickly determine the second recognition range from the second image, ensuring that 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 reference brightness range, it indicates that the biometric feature in the second image is sufficiently clear. In this case, biometric recognition is performed on the image within the second recognition range to identify the biometric feature of the object. This can avoid recognition errors or failures caused by unclear biometric features in the image, thereby improving the accuracy and success rate of biometric recognition.
需要说明的是,上述图3所示的实施例是以第一识别范围内的图像的亮度未落入参考亮度范围、且第二识别范围内的图像的亮度落入参考亮度范围为例进行说明,而在另一实施例中,还能够对其他识别范围内的图像进行生物特征识别。It should be noted that the embodiment shown in Figure 3 above is illustrated by taking the example that the brightness of the image within the first recognition range does not fall within the reference brightness range, and the brightness of the image within the second recognition range falls within the reference brightness range. In another embodiment, biometric recognition can also be performed on images within other recognition ranges.
在一种可能实现方式中,该方法还包括:在第一识别范围内的图像的亮度落入参考亮度范围的情况下,对第一识别范围内的图像进行生物特征识别。也就是说,在第一识别范围内的图像的亮度落入参考亮度范围的情况下,识别第一识别范围内的图像包含的生物特征所属的对象。In one 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 reference brightness range. In other words, when the brightness of the image within the first recognition range falls within the reference brightness range, identifying the object to which the biometric feature contained in the image within the first recognition range belongs.
在本申请实施例中,在第一识别范围内的图像的亮度落入参考亮度范围的情况下,表示第一识别范围内的图像足够清晰,则第一识别范围内的图像所包含的生物特征能够进行生物特征识别,因此,在第一识别范围内的图像的亮度落入参考亮度范围的情况下,对第一识别范围内的图像进行生物特征识别,无需再采集其他图像,以保证生物特征识别的效率。In an embodiment of the present application, when the brightness of the image within the first recognition range falls within the reference brightness range, it indicates 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 reference 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.
在一种可能实现方式中,该方法还包括:在第二识别范围内的图像的亮度未落入参考亮度范围的情况下,调整第二曝光参数,得到第三曝光参数;基于第三曝光参数采集下一个图像,基于下一个图像执行生物特征识别。In one possible implementation, the method further includes: when the brightness of the image within the second recognition range does not fall within the reference brightness range, adjusting the second exposure parameter to obtain a third exposure parameter; capturing a next image based on the third exposure parameter, and performing biometric recognition based on the next image.
在本申请实施例中,在第二识别范围内的图像的亮度未落入参考亮度范围的情况下,表示第二识别范围内的图像不够清晰,则调整采集当前的图像时所采用的曝光参数,以便利用调整后的曝光参数来采集下一个图像,以便能够采集到更清晰的图像,以保证后续生物特征识别的准确性。In an embodiment of the present application, if the brightness of the image within the second recognition range does not fall within the reference brightness range, it means that the image within the second 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.
例如,响应于生物特征识别指令,基于第1个曝光参数采集第1个图像,从第1个图像上确定第1个识别范围,第1个识别范围内的图像包含生物特征;在第1个图像上的第1个识别范围内的图像的亮度落入参考亮度范围的情况下,对第1个识别范围内的图像进行生物特征识别;在第1个识别范围内的图像的亮度未落入参考亮度范围的情况下,对第1个曝光参数进行调整,得到第2个曝光参数;基于第2个曝光参数采集第2个图像;从第2个图像上确定第2个识别范围,第2个识别范围内的图像包含生物特征;在第2个识别范围内的图像的亮度落入参考亮度范围的情况下,对第2个识别范围内的图像进行生物特征识别;在第2个识别范围内的图像的亮度未落入参考亮度范围的情况下,对第2个曝光参数进行调整,得到第3个曝光参数;以便基于第3个曝光参数采集下一个图像,重复上述过程,以使当前确定的识别范围内的图像的亮度落入参考亮度范围,进而对当前确定的识别范围内的图像进行生物特征识别。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 reference 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 reference 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 reference 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 reference 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 reference brightness range, and biometric recognition is then performed on the image within the currently determined recognition range.
需要说明的是,上述图3所示的实施例是以利用第一图像的特征来确定第一识别范围为例进行说明,而在另一实施例中,无需执行上述步骤301-304,而是采取其他方式,从第一图像上确定第一识别范围。It should be noted that the embodiment shown in FIG3 is described by using the features of the first image to determine the first recognition range as an example. In another embodiment, there is no need to perform the above steps 301-304, but other methods are adopted to determine the first recognition range from the first image.
在一种可能实现方式中,在第一图像不是响应于生物特征识别指令采集到的第1个图像的情况下,基于第六识别范围在第三图像中的位置,从第一图像上确定第七识别范围,第六识别范围在第三图像中的位置与第七识别范围在第一图像中的位置相同,第六识别范围内的图像包含生物特征,第三图像为第一图像的前一个图像;调整第七识别范围在第一图像中的位置,得到第一识别范围。 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 position of the sixth recognition range in the third image, the position of the sixth recognition range in the third image is the same as the position 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 position of the seventh recognition range in the first image is adjusted to obtain the first recognition range.
上述确定第一识别范围的过程,与上述步骤307-308同理,在此不再赘述。The process of determining the first identification range is similar to the above steps 307 - 308 and will not be repeated here.
在一种可能实现方式中,确定第一识别范围的过程,包括:对第一图像执行关键点检测,得到第一图像中的多个目标关键点;基于多个目标关键点与生物特征之间的相对位置关系及多个目标关键点在第一图像中的位置,从第一图像中确定第一识别范围。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 positional relationship between the multiple target key points and the biometric features and the positions of the multiple target key points in the first image.
目标关键点是任一类型的关键点,例如,目标关键点为手指关键点,而生物特征为手掌区域的特征(也即掌纹特征),则在包含手部的图像中,无论手掌区域位于图像的哪个位置,手指与手掌区域之间的相对位置关系保持不变。相对位置关系指示多个目标关键点的位置与生物特征的位置之间的关系。例如,相对位置关系指示生物特征位于多个目标关键点的下方,或者,指示生物特征位于多个目标关键点中间。A target keypoint is any type of keypoint. For example, if the target keypoint is a finger keypoint and the biometric feature is a feature of the palm region (i.e., a palm print feature), then in an image containing a hand, the relative positional relationship between the finger and palm regions remains unchanged regardless of where the palm region is located 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.
在本申请实施例中,生物特征与多个目标关键点之间具有相对位置关系,在采集到的图像中,无论生物特征位于图像中的哪个位置,但是生物特征与多个目标关键点之间的相对位置关系保持不变。因此,通过对第一图像进行关键点检测,以检测出与生物特征具有相对位置关系的多个目标关键点,进而基于多个目标关键点在第一图像之间的位置及多个目标关键点与生物特征之间的相对位置关系,从第一图像上确定第一识别范围,第一识别范围能够体现出生物特征所处的位置,即保证得到的第一识别范围的准确性,进而保证生物特征识别的准确性。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. The first recognition range can reflect the location of the biometric feature, thus ensuring the accuracy of the first recognition range and, in turn, the accuracy of biometric feature recognition.
在上述图2至图3所示的实施例的基础上,本申请实施例还能够采取对比第一图像与第二图像的方式,确定第二识别范围,具体过程详见下述实施例。On the basis of the embodiments shown in FIG. 2 to FIG. 3 above, the embodiment of the present application can also determine the second recognition range by comparing the first image with the second image. The specific process is detailed in the following embodiment.
图6是本申请实施例提供的再一种生物特征识别方法的流程图,该方法由计算机设备执行,如图6所示,该方法包括步骤601至步骤608:FIG6 is a flowchart of another biometric feature recognition method provided by an embodiment of the present application. The method is executed by a computer device. As shown in FIG6 , the method includes steps 601 to 608:
601、计算机设备从第一图像中确定第一识别范围,第一识别范围内的图像包含生物特征,第一图像基于第一曝光参数采集得到。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.
602、计算机设备在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,调整第一曝光参数,得到第二曝光参数。602. When the brightness of the image within the first recognition range does not fall within the reference brightness range, the computer device adjusts the first exposure parameter to obtain a second exposure parameter.
603、计算机设备基于第二曝光参数采集第二图像,第二图像包含生物特征。603. The computer device captures a second image based on the second exposure parameter, where the second image includes a biometric feature.
该步骤601-603与上述步骤201-203同理,在此不再赘述。Steps 601-603 are similar to the above steps 201-203 and will not be repeated here.
604、计算机设备分别对第一图像及第二图像执行特征提取,得到第三特征及第四特征,第三特征指示第一图像,第四特征指示第二图像。604. The computer device performs feature extraction on 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.
示例性地,第三特征及第四特征均能够以任意的形式表示。例如,第三特征及第四特征的表示形式可以为颜色直方图特征、方向梯度直方图特征等。Exemplarily, the third feature and the fourth feature can be represented in any form. For example, the third feature and the fourth feature can be represented in the form of color histogram features, directional gradient histogram features, etc.
在一种可能实现方式中,获取第三特征的方式包括:对第一图像分块,得到多个图像块,对每个图像块执行特征提取,得到每个图像块的特征,将多个图像块的特征拼接,得到第一图像的特征(也即第三特征)。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 (i.e., the third feature).
示例性地,图像块的特征能够为任意类型的特征,例如,图像块的特征为方向梯度直方图特征。将第一图像中多个图像块的方向梯度直方图特征首尾相邻,组成一个向量,得到第一图像的特征。Exemplarily, 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 end to end to form a vector to obtain the features of the first image.
需要说明的是,获取第四特征的过程,与获取第三特征的过程同理,在此不再赘述。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.
605、计算机设备处理第三特征及第四特征,得到运动信息,运动信息指示相对于第一图像,第二图像中的生物特征所处位置的变化情况。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.
在本申请实施例中,第三特征用于表示第一图像,第四特征用于表示第二图像,即第三特征能够表示出生物特征在第一图像中的位置,第四特征能够表示出生物特征在第二图像中的位置,则通过对第三特征及第四特征进行处理,能够实现第一图像与第二图像之间的对比,以确定出与第一图像相比第二图像中生物特征所处位置的变化情况。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.
示例性地,运动信息能够以任意的形式表示,例如,运动信息以概率图的形式表示。Exemplarily, the motion information can be represented in any form, for example, the motion information is represented in the form of a probability map.
606、计算机设备基于第三特征,更新运动信息,得到更新后的运动信息。 606. The computer device updates the motion information based on the third feature to obtain updated motion information.
在本申请实施例中,基于第三特征,对运动信息进行更新,以使更新后的运动信息更能体现出与第一图像相比第二图像中生物特征所处位置的变化情况,以便后续确定是否利用第一图像上的第一识别范围来确定第二图像中生物特征所处的位置。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.
607、计算机设备处理第四特征及更新后的运动信息,得到第二识别范围。607. The computer device processes the fourth feature and the updated motion information to obtain a second recognition range.
在本申请实施例中,第三特征能够表示出生物特征在第一图像中的位置,第四特征能够表示出生物特征在第二图像中的位置,则通过对第三特征及第四特征进行处理,能够实现第一图像与第二图像之间的对比,以确定出与第一图像相比第二图像中生物特征所处位置的变化情况,基于第三特征,对运动信息进行更新,以使更新后的运动信息更能体现出与第一图像相比第二图像中生物特征所处位置的变化情况,而第四特征能够表示第二图像的内容,则对第四特征及更新后的运动信息进行处理,得到第二图像中生物特征所处的位置,以保证得到的第二识别范围的准确性,进而保证生物特征识别的准确性。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 second recognition range, thereby ensuring the accuracy of the biometric recognition.
在一种可能实现方式中,上述步骤604-607通过目标检测模型执行。In one possible implementation, steps 604-607 are performed by a target detection model.
如图7所示,通过目标检测模型,对第三特征及第四特征进行卷积,得到运动信息,该运动信息能够以概率图表示,对第三特征及运动概率图进行卷积,得到更新后的运动信息,更新后的运动信息包括第一标签或第二标签;第一标签指示相对于第一图像,第二图像中生物特征所处位置的变化过大;则后续结合第一标签及第二图像的特征来确定第二识别范围,而第二标签指示相对于第一图像,第二图像中生物特征所处位置的变化不大;则能够基于第一图像中的第一识别范围来确定第二图像中的第二识别范围。在更新后的运动信息为第一标签的情况下,则对第一标签及第四特征进行卷积处理,得到第二识别范围。As shown in Figure 7, the target detection model convolves the third and fourth features 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, which 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 significantly relative to the first image; the first label and the features of the second image are then combined to determine the second recognition range, while 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 second recognition range in the second image can be determined based on the first recognition range in the first image. If the updated motion information is the first label, the first label and the fourth feature are convolved to obtain the second recognition range.
可选地,处理第四特征及更新后的运动信息的过程,包括:融合第四特征及更新后的运动信息,得到融合特征;对融合特征执行多次尺度变换,得到多个第七特征,多个第七特征的尺度不同;基于多个第七特征,分别更新每个第七特征,得到每个第七特征对应的第八特征;处理每个第八特征,得到第八识别范围;基于得到的多个第八识别范围,确定第二识别范围。需要说明的是,上述确定第二识别范围的过程,与上述步骤301-304同理,在此不再赘述。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, each of which has a different scale; updating each seventh feature based on the multiple seventh features to obtain an eighth feature corresponding to each seventh feature; processing each eighth feature to obtain an eighth recognition range; and determining a second recognition range based on the obtained multiple eighth recognition ranges. It should be noted that the process of determining the second recognition range is similar to steps 301-304 above and will not be repeated here.
608、计算机设备在第二识别范围内的图像的亮度落入参考亮度范围的情况下,识别第二识别范围内的图像包含的生物特征所属的对象。608. When the brightness of the image within the second recognition range falls within the reference brightness range, the computer device identifies the object to which the biometric feature contained in the image within the second recognition range belongs.
该步骤608与上述步骤309同理,在此不再赘述。The step 608 is similar to the above step 309 and will not be described again here.
本申请实施例提供的方案中,在生物特征识别的过程中,从采集到的第一图像上确定第一识别范围,以确定出生物特征在第一图像中所处的位置,检测第一识别范围内的图像的亮度是否足够,以确定第一图像中的生物特征是否足够清晰,在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,确定第一图像中的生物特征不够清晰,则调整曝光参数,以便利用调整后的曝光参数采集下一个图像(也即第二图像),以使采集到的下一个图像中生物特征的清晰度提升,考虑到采集第一图像与采集第二图像的时间间隔较短,则与生物特征在第一图像所处的位置相比,生物特征在第二图像中所处的位置变化不大,因此,利用第一识别范围在第一图像中的位置,从第二图像上确定第三识别范围,以便能够利用第三识别范围尽快从第二图像上确定出第二识别范围,以使第二识别范围内的图像包含生物特征。在第二识别范围内的图像的亮度落入参考亮度范围的情况下,说明第二图像中的生物特征足够清晰,此时对第二识别范围内的图像进行生物特征识别,以识别该生物特征是哪个对象的生物特征,能够避免由于图像中的生物特征不清晰而导致识别错误或识别失败的情况,提高生物特征识别的准确性和成功率。In the solution provided in the embodiments of the present application, during the biometric feature recognition process, a first recognition range is determined from a captured first image to determine the position of the biometric feature in the first image. The brightness of the image within the first recognition range is detected to determine whether it is sufficient to determine whether the biometric feature in the first image is sufficiently clear. If the brightness of the image within the first recognition range does not fall within a reference brightness range, it is determined that the biometric feature in the first image is not clear enough. Then, the exposure parameters are adjusted so that the next image (i.e., the second image) is 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 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 position of the first recognition range in the first image is used to determine a third recognition range from the second image, so that the second recognition range can be determined from the second image as quickly as possible using the third recognition range, so that the image within the second recognition range contains the biometric feature. When the brightness of the image within the second recognition range falls within the reference brightness range, it means that the biometric features in the second image are clear enough. At this time, biometric feature recognition is performed on the image within the second recognition range to identify which object the biometric features belong to. This can avoid recognition errors or recognition failures due to unclear biometric features in the image, thereby improving the accuracy and success rate of biometric recognition.
需要说明的是,以上所述的从第二图像上确定第二识别范围的方式仅为示例性说明,本申请实施例并不局限于此。It should be noted that the above-mentioned method of determining the second recognition range from the second image is only an exemplary description, and the embodiments of the present application are not limited thereto.
在一些实施例中,从第二图像上确定第二识别范围的方式可以为:对第二图像的特征执行多次尺度变换,得到多个第九特征,多个第九特征的尺度不同;基于多个第九特征,分别 更新每个第九特征,得到每个第九特征对应的第十特征;处理每个第十特征,得到第九识别范围;基于得到的多个第九识别范围,确定第二识别范围。此种确定第二识别范围的过程的原理与基于步骤301至步骤304确定第一识别范围的过程的原理相同,此处不再加以赘述。In some embodiments, the second recognition range can be determined from the second image by performing multiple scale transformations on the features of the second image to obtain multiple ninth features, each of which has a different scale; and based on the multiple ninth features, respectively Each ninth feature is updated to obtain the corresponding tenth feature; each tenth feature is processed to obtain a ninth identification range; and a second identification range is determined based on the obtained plurality of ninth identification ranges. The principle of determining the second identification range is the same as the principle of determining the first identification range based on steps 301 to 304, and will not be further described here.
在一些实施例中,从第二图像上确定第二识别范围的方式可以为:对第二图像执行关键点检测,得到第二图像中的多个目标关键点;基于多个目标关键点与生物特征之间的相对位置关系及多个目标关键点在第二图像中的位置,从第二图像上确定第二识别范围。此种确定第二识别范围的过程的原理与前文中介绍的通过对第一图像执行关键点检测确定第一识别范围的过程的原理相同,此处不再加以赘述。In some embodiments, determining the second recognition range from the second image can include performing key point detection on the second image to obtain multiple target key points in the second image; and determining the second recognition range from the second image based on the relative positional relationship between the multiple target key points and the biometric features, as well as the positions of the multiple target key points in the second image. The principles of this process for determining the second recognition range are the same as those of determining the first recognition range by performing key point detection on the first image, as described above, and will not be further elaborated here.
需要说明的是,在上述图6所示的实施例的基础上,在通过目标检测模型来实现生物特征识别方法之前,还需要对目标检测模型进行训练。对目标检测模型的训练流程,如图8所示,该方法包括:图像采集、图像标注、图像预处理、模型构建、初始化模型权重、模型训练及模型参数调整。It should be noted that, based on the embodiment shown in FIG6 , before implementing the biometric feature recognition method using the target detection model, the target detection model must be trained. The target detection model training process is shown in FIG8 . The method includes: image acquisition, image annotation, image preprocessing, model construction, initialization of model weights, model training, and model parameter adjustment.
(1)图像采集和图像标注:采集到多个样本图像,并确定每个样本图像的样本标签,该样本标签指示样本图像中包含的生物特征的种类,从样本图像上确定样本识别范围,样本识别范围内的图像包含生物特征。(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.
在本申请实施例中,生物特征包含多个种类,例如,生物特征为左手的特征或右手的特征,则标签包括第一样本标签或第二样本标签,第一样本标签指示左手的生物特征,第二样本标签指示右手的生物特征。例如,样本图像如图9所示。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 biometric features of the left hand, and the second sample label indicates the biometric features of the right hand. For example, the sample image is shown in Figure 9.
样本图像包括正样本图像或负样本图像,正样本图像是通过对生物特征进行拍摄得到的图像,负样本图像是未包含生物特征的图像,或者,包含的生物特征不清晰的图像。The sample images include positive sample images or negative sample images. The positive sample images are images 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.
在一种可能实现方式中,在得到样本图像的情况下还会对样本图像进行清洗,对样本图像进行清洗的过程包括:过滤掉多个样本图像中重复的样本图像、包含的生物特征存在残缺的样本图像、清晰度过低的样本图像等。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.
在本申请实施例中,通过对样本图像进行清洗,以保证样本图像的质量,进而保证后续模型训练的质量。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.
(2)图像预处理:采取中值滤波的方式,对样本图像进行降噪,以消除样本图像中的噪声像素点;之后,采取分块的方式,将样本图像分成多个图像块,确定出每个图像块的类别,将属于目标类别的图像块构成区域图像,该区域图像包含生物特征;采用提取方向梯度直方图特征的方式,提取区域图像中,每个图像块的方向梯度直方图特征;将区域图像中多个图像块的方向梯度直方图特征首尾相连,组合成一个一维向量,将该一维向量作为样本图像的特征。(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.
在一种可能实现方式中,采取以下函数,确定图像块的方向梯度直方图特征:
In one possible implementation, the following function is used to determine the directional gradient histogram feature of the image block:
θ(x,y)∈[0,360°),或者,θ(x,y)∈[0,180°)θ(x,y)∈[0,360°), or θ(x,y)∈[0,180°)
其中,x用于表示图像块中像素点的水平坐标,y用于表示图像块中像素点的垂直坐标,Ix用于表示像素点水平方向上的梯度值,Iy用于表示像素点垂直方向上的梯度值,M(x,y)用于表示梯度的幅度值,θ(x,y)用于表示梯度的方向。梯度的幅度值和梯度的方向即为方向梯度直方图特征。Here, x represents the horizontal coordinate of a pixel in an image block, y represents the vertical coordinate of a pixel in an image block, Ix represents the horizontal gradient of the pixel, Iy represents the vertical gradient of the pixel, M(x,y) represents the magnitude of the gradient, and θ(x,y) represents the direction of the gradient. The magnitude and direction of the gradient are the features of the histogram of oriented gradients.
在本申请实施例中,以分辨率为60x60,采取Sobel(边缘检测)算法,按照上述函数,确定出图像块的方向梯度直方图特征。 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.
(3)模型构建及初始化模型权重:构建初始化的目标检测模型,并初始化目标检测模型的权重。(3) Model construction and initialization of model weights: Build an initialized target detection model and initialize the weights of the target detection model.
(4)模型训练及模型参数调整:通过目标检测模型,对样本图像的特征进行处理,得到预测识别范围;基于样本识别范围及预测识别范围,对目标检测模型的模型参数进行调整,以实现对目标检测模型的训练。(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.
在一种可能实现方式中,采取IOU(Intersection Of Union,交并比)、mAPIOU(mean Average Precision Intersection Of Union,平均精度交并比)的方式,基于样本识别范围及预测识别范围,确定损失值,该损失值指示样本识别范围与预测识别范围之间的差异,基于损失值,对目标检测模型进行训练。In one possible implementation, the IOU (Intersection Of Union) and MAPIOU (mean Average Precision Intersection Of Union) methods are adopted 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.
需要说明的是,按照上述实施例对目标检测模型训练完成后,能够将目标检测模型打包成SDK(Software Development Kit,软件开发工具包),如图10所示,对模型打包过程包括:选择推理器件选型,对目标检测模型进行模型转换,在终端侧部署,对模型进行深度优化,得到SDK集成。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), as shown in Figure 10. 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.
推理器件包括NPU(Neural network Processing Unit,神经网络处理器)或CPU(Central Processing Unit,中央处理器)。数据类型包括INT8(一种数据类型)或INT16(一种数据类型),终端侧部署方式包括硬件抽象层、平台抽象或模型解析,深度优化方式包括算子优化、调度优化或内存优化。例如,选取NPU作为推理器件,选取的数据类型为INT8和INT16,采取硬件抽象层部署,采取调度优化的方式,生成SDK。Inference devices include NPUs (Neural Network Processing Units) or CPUs (Central Processing Units). Data types include INT8 (a data type) or INT16 (a data type). Terminal-side deployment methods include hardware abstraction layers, platform abstraction, or model parsing. Deep optimization methods include operator optimization, scheduling optimization, or memory optimization. For example, select the NPU as the inference device, select INT8 and INT16 as the data types, deploy using the hardware abstraction layer, and use scheduling optimization to generate the SDK.
基于上述图2至图9所示的实施例,本申请实施例还提供了一种生物特征识别方法的流程图,如图11所示,该方法包括下述步骤1至步骤6:Based on the embodiments shown in FIG. 2 to FIG. 9 above, the present embodiment further provides a flow chart of a biometric feature recognition method, as shown in FIG. 11 . The method includes the following steps 1 to 6:
步骤1、响应于生物特征识别指令,基于默认曝光参数采集第1个图像。Step 1: In response to a biometric recognition instruction, capture the first image based on default exposure parameters.
步骤2、通过目标检测模型,对第1个图像进行检测,得到第1个识别范围,第1个识别范围内的图像包含生物特征。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.
步骤3、将第1个图像中的第1个识别范围内的像素点权重设定为255,将第1个图像中的其余像素点的权重设定为0;按照第1个图像中的像素点的像素值及像素点的权重,确定出第1个图像的亮度;由于第1个图像中的第1个识别范围以外的像素点的权重为0,则第1个图像的亮度即为第1个识别范围内的图像的亮度。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.
如图12所示,第1个图像中的第1个识别范围内的像素点的权重设定为255,其余位置的像素点的权重设定为0。As shown in FIG12 , the weights of the pixels within the first recognition range in the first image are set to 255, and the weights of the pixels at other positions are set to 0.
步骤4、判断第1个识别范围内的图像的亮度是否落入参考亮度范围。Step 4: Determine whether the brightness of the image within the first recognition range falls within the reference brightness range.
步骤5、在第1个识别范围内的图像的亮度落入参考亮度范围的情况下,对第1个识别范围内的图像进行生物特征识别。Step 5: When the brightness of the image within the first recognition range falls within the reference brightness range, perform biometric feature recognition on the image within the first recognition range.
另外,在第1个识别范围内的图像的亮度落入参考亮度范围的情况下,还能够确定基于默认曝光参数采集到的图像中的生物特征足够清晰,后续能够基于默认曝光参数采集多个图像,从每个图像上确定识别范围,进而对多个图像中的识别范围内的图像进行生物特征识别。In addition, when the brightness of the image within the first recognition range falls within the reference 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.
步骤6、在第1个识别范围内的图像的亮度未落入参考亮度范围的情况下,调整当前的曝光参数,利用调整得到的曝光参数采集下一个图像,进而按照上述过程,从下一个图像上确定下一个识别范围,判断下一个识别范围内的图像的亮度是否落入参考亮度范围,直至当前得到的图像中的识别范围内的图像的亮度落入参考亮度范围,对当前得到识别范围内的图像进行生物特征识别。Step 6. If the brightness of the image within the first recognition range does not fall within the reference 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 reference brightness range, until the brightness of the image within the recognition range in the currently obtained image falls within the reference brightness range, and perform biometric recognition on the image within the currently obtained recognition range.
另外,在当前得到的识别范围内的图像的亮度落入参考亮度范围的情况下,还能够确定基于当前的曝光参数采集到的图像中的生物特征足够清晰,后续能够基于当前的曝光参数采集多个图像,从每个图像上确定识别范围,进而对多个图像中的识别范围内的图像进行生物特征识别。 In addition, when the brightness of the image within the current recognition range falls within the reference 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.
需要说明的是,在上述图11所示的实施例的基础上,如图13所示,响应于生物特征识别指令进行生物特征识别的过程中,对于第1个图像以外的图像,采取光流法,能够利用前一个图像中的识别范围的位置,确定当前图像中的识别范围,此过程与上述步骤307-308同理,在此不再赘述。It should be noted that, based on the embodiment shown in FIG11 above, as shown in FIG13 , in the process of performing biometric recognition in response to a biometric recognition instruction, for images other than the first image, the optical flow method is adopted, and the position 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 steps 307-308 above and will not be repeated here.
基于上述图2至图13所示的实施例,本申请实施例还提供了一种生物特征识别方法的流程图,如图14所示,该方法包括:通过光学照相机中的图像传感器,对环境进行拍摄,得到第1个图像;通过图像处理模块,对第1个图像进行处理,通过特征提取器,获取处理后的第1个图像的特征;通过第一网络模型中的通道压缩层、平均池化层、最大池化层、全连接层等,对处理后的第1个图像的特征进行处理,得到自动曝光控制参数;获取第1个图像的多尺度直方图特征,通过第二网络模型中的卷积层、全连接层,结合自动曝光控制参数,确定图像传感器的曝光参数,基于该曝光参数对图像传感器的曝光参数进行调整;重复上述过程,直至基于当前图像传感器采集到的图像中的生物特征的清晰度足够。通过当前图像传感器,对环境进行拍摄,得到下一个图像,以得到第j个图像为例,j为大于1的整数;通过图像处理模块,对第j个图像进行处理;通过特征提取器,获取处理后的第j个图像的特征;通过目标检测模型,对处理后的第j个图像的特征进行生物特征检测,得到识别范围,第j个图像中的识别范围内的图像包含生物特征。Based on the embodiments shown in Figures 2 to 13 above, the embodiments of the present application also provide a flowchart of a biometric feature recognition method, as shown in Figure 14, the method includes: photographing the environment through the image sensor in the optical camera to obtain a 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, and adjusting the exposure parameters of the image sensor based on the exposure parameters; repeating the above process until the clarity of the biometric 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 a recognition range, and the image within the recognition range in the j-th image contains the biometric feature.
示例性地,图像处理模块为Software ISP(Software Image Signal Processing,图像信号处理软件)。Exemplarily, the image processing module is Software ISP (Software Image Signal Processing, image signal processing software).
在本申请实施例中,自动曝光是基于环境光线的亮度自动调整曝光参数的一种方式,以确保图像在不同光照条件下都能得到适当的曝光。在此基础上,引入基于目标检测模型和目标检测算法来提高测光算法的准确率,以保证得到的图像中生物特征足够清晰,进而保证生物特征识别的准确性。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.
本申请实施例提供的生物特征识别方法能够应用于多种场景下,例如,应用在支付场景下或打卡场景下。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.
以打卡场景为例,通过打卡设备检测到有生物特征在拍摄区域的情况下,基于默认曝光参数,对拍摄区域的生物特征进行采集,得到包含生物特征的图像;按照本申请实施例提供的方案,能够采集到清晰度足够高、且包含生物特征的图像,进而将采集到的图像与预先存储的图像进行对比,以确定与采集到的图像匹配的对象信息,确定该对象信息指示的对象完成打卡。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.
以支付场景为例,在对订单进行支付时,通过扫描设备检测到有生物特征在拍摄区域的情况下,基于默认曝光参数,对拍摄区域的生物特征进行采集,得到包含生物特征的图像;按照本申请实施例提供的方案,能够采集到清晰度足够高、且包含生物特征的图像,进而将采集到的图像与预先存储的图像进行对比,以确定与采集到的图像匹配的对象信息,按照订单待支付的资源数量,从该对象信息的账户中转移出该资源数量的资源。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.
图15是本申请实施例提供的一种生物特征识别装置的结构示意图,如图15所示,该装置包括:FIG15 is a schematic diagram of the structure of a biometric identification device provided in an embodiment of the present application. As shown in FIG15 , the device includes:
确定模块1501,用于从第一图像上确定第一识别范围,第一识别范围内的图像包含生物特征,第一图像基于第一曝光参数采集得到;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;
调整模块1502,用于在第一识别范围内的图像的亮度未落入参考亮度范围的情况下,调整第一曝光参数,得到第二曝光参数;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 the reference brightness range;
采集模块1503,用于基于第二曝光参数采集第二图像,第二图像包含生物特征;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;
确定模块1501,还用于从第二图像上确定第二识别范围,第二识别范围内的图像包含生物特征; The determination module 1501 is further configured to determine a second recognition range from the second image, wherein the image within the second recognition range contains the biometric feature;
识别模块1504,用于在第二识别范围内的图像的亮度落入参考亮度范围的情况下,识别第二识别范围内的图像包含的生物特征所属的对象。The recognition module 1504 is configured to recognize the object to which the biometric feature contained in the image within the second recognition range belongs when the brightness of the image within the second recognition range falls within the reference brightness range.
在一种可能实现方式中,确定模块1501,用于对第一图像的特征执行多次尺度变换,得到多个第一特征,多个第一特征的尺度不同;分别更新每个第一特征,得到每个第一特征对应的第二特征;处理每个第二特征,得到第四识别范围;基于得到的多个第四识别范围,确定第一识别范围。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; update each first feature separately to obtain a second feature corresponding to each first feature; process each second feature to obtain a fourth recognition range; and determine the first recognition range based on the obtained multiple fourth recognition ranges.
在另一种可能实现方式中,确定模块1501,用于对第一图像分块,得到多个图像块;对每个图像块分类,得到每个图像块所属的类别;基于多个图像块所属的类别,将属于目标类别的图像块构成区域图像,目标类别指示图像块包含生物特征;对区域图像的特征执行多次尺度变换,得到多个第一特征。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, form a regional image from the image blocks belonging to a target category, where 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.
在另一种可能实现方式中,确定模块1501,用于基于每个第四识别范围的置信度,将多个第四识别范围中的置信度最大的第四识别范围,确定为第一识别范围,每个第四识别范围的置信度指示每个第四识别范围内的图像包含生物特征的可能性。In another possible implementation, the determination module 1501 is used to determine the fourth recognition range with the highest confidence among multiple fourth recognition ranges as the first recognition range based on the confidence of each fourth recognition range, and the confidence of each fourth recognition range indicates the possibility that the image within each fourth recognition range contains biometric features.
在另一种可能实现方式中,如图16所示,装置还包括:In another possible implementation, as shown in FIG16 , the apparatus further includes:
提取模块1505,用于分别对第一图像及第二图像执行特征提取,得到第三特征及第四特征,第三特征指示第一图像,第四特征指示第二图像;An extraction module 1505 is 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;
处理模块1506,用于处理第三特征及第四特征,得到运动信息,运动信息指示相对于第一图像,第二图像中的生物特征所处位置的变化情况;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 position of the biometric feature in the second image relative to the first image;
更新模块1507,用于基于第三特征,更新运动信息,得到更新后的运动信息;An updating module 1507 is configured to update the motion information based on the third feature to obtain updated motion information;
处理模块1506,还用于处理第四特征及更新后的运动信息,得到第二识别范围。The processing module 1506 is further configured to process the fourth feature and the updated motion information to obtain a second recognition range.
在另一种可能实现方式中,确定模块1501,用于基于第一识别范围在第一图像中的位置,从第二图像上确定第三识别范围,第三识别范围在第二图像中的位置与第一识别范围在第一图像中的位置相同;In another possible implementation, the determining module 1501 is configured to determine a third recognition range from the second image based on a position of the first recognition range in the first image, where the position of the third recognition range in the second image is the same as the position of the first recognition range in the first image;
调整模块1502,用于调整第三识别范围在第二图像中的位置,得到第二识别范围。The adjustment module 1502 is configured to adjust the position of the third recognition range in the second image to obtain a second recognition range.
在另一种可能实现方式中,调整模块1502,用于对于第三识别范围内的每个像素点,确定每个像素点对应的概率,每个像素点对应的概率为以每个像素点为中心的参考识别范围内的图像包含生物特征的概率,参考识别范围的尺寸与第三识别范围的尺寸相同;基于第三识别范围内的各个像素点对应的概率,调整第三识别范围在第二图像中的位置,得到第二识别范围。In another possible implementation, the adjustment module 1502 is used to determine the probability corresponding to each pixel point within the third recognition range, where the probability corresponding to each pixel point is the probability that the image within the reference recognition range centered on each pixel point contains the biometric feature, and the size of the reference recognition range is the same as the size of the third recognition range; based on the probability corresponding to each pixel point within the third recognition range, the position of the third recognition range in the second image is adjusted to obtain the second recognition range.
在另一种可能实现方式中,调整模块1502,用于在第三识别范围内的各个像素点中,确定概率最大的目标像素点;将第三识别范围在第二图像中的位置调整到以目标像素点为中心的位置,得到第二识别范围。In another possible implementation, the adjustment module 1502 is used to determine the target pixel point with the highest probability among the pixel points within the third recognition range; and adjust the position of the third recognition range in the second image to a position centered on the target pixel point to obtain the second recognition range.
在另一种可能实现方式中,调整模块1502,用于基于第一关键点在第一图像中的位置及第二关键点在第二图像中的位置,确定调整距离及调整方向,第一关键点和第二关键点为生物特征的同一关键点;基于调整距离及调整方向,调整第三识别范围在第二图像中的位置,得到第二识别范围。In another possible implementation, the adjustment module 1502 is used to determine the adjustment distance and adjustment direction based on the position of the first key point in the first image and the position 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 adjustment distance and adjustment direction, the position of the third recognition range in the second image is adjusted to obtain the second recognition range.
在另一种可能实现方式中,确定模块1501,用于对第一图像执行关键点检测,得到第一图像中的多个目标关键点;基于多个目标关键点与生物特征之间的相对位置关系及多个目标关键点在第一图像中的位置,从第一图像上确定第一识别范围。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 positions of the multiple target key points in the first image, determine the first recognition range from the first image.
在另一种可能实现方式中,调整模块1502,还用于在第二识别范围内的图像的亮度未落入参考亮度范围的情况下,调整第二曝光参数,得到第三曝光参数;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 second recognition range does not fall within the reference brightness range;
采集模块1503,还用于基于第三曝光参数采集下一个图像;The acquisition module 1503 is further configured to acquire a next image based on the third exposure parameter;
识别模块1504,还用于基于下一个图像执行生物特征识别。The recognition module 1504 is further configured to perform biometric recognition based on the next image.
在另一种可能实现方式中,识别模块1504,还用于在第一识别范围内的图像的亮度落入参考亮度范围的情况下,识别第一识别范围内的图像包含的生物特征所属的对象。In another possible implementation, the recognition module 1504 is further configured to recognize the object to which the biometric feature contained in the image within the first recognition range belongs when the brightness of the image within the first recognition range falls within a reference brightness range.
在另一种可能实现方式中,调整模块1502,用于在第一识别范围内的图像的亮度小于参 考亮度范围中的最小值的情况下,增大第一曝光参数,得到第二曝光参数;在第一识别范围内的图像的亮度大于参考亮度范围中的最大值的情况下,减小第一曝光参数,得到第二曝光参数。In another possible implementation, the adjustment module 1502 is configured to adjust the brightness of the image within the first recognition range to be less than a reference value. When the brightness of the image within the first recognition range is greater than the maximum value in the reference brightness range, the first exposure parameter is reduced to obtain the second exposure parameter.
需要说明的是:上述实施例提供的生物特征识别装置,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将计算机设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的生物特征识别装置与生物特征识别方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。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.
本申请实施例还提供了一种计算机设备,该计算机设备包括处理器和存储器,存储器中存储有至少一条计算机程序,该至少一条计算机程序由处理器加载并执行,以使计算机设备实现上述实施例的生物特征识别方法所执行的操作。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 enable the computer device to implement the operations performed by the biometric recognition method of the above embodiment.
可选地,计算机设备提供为终端。图17示出了本申请一个示例性实施例提供的终端1700的结构框图。终端1700包括有:处理器1701和存储器1702。Optionally, the computer device is provided as a terminal. FIG17 shows a block diagram of a terminal 1700 provided in an exemplary embodiment of the present application. The terminal 1700 includes: a processor 1701 and a memory 1702.
处理器1701可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器1701可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1701也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1701可以集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1701还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。The processor 1701 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 1701 may be implemented in at least one hardware form selected from the group consisting of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and 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.
存储器1702可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器1702还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器1702中的非暂态的计算机可读存储介质用于存储至少一个计算机程序,该至少一个计算机程序用于被处理器1701所执行以实现本申请中方法实施例提供的生物特征识别方法。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.
在一些实施例中,终端1700还可选包括有:显示屏1705、摄像头组件1706和光学传感器1710。In some embodiments, the terminal 1700 may optionally further include: a display screen 1705 , a camera assembly 1706 , and an optical sensor 1710 .
显示屏1705用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏1705是触摸显示屏时,显示屏1705还具有采集在显示屏1705的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器1701进行处理。此时,显示屏1705还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏1705可以为一个,设置在终端1700的前面板;在另一些实施例中,显示屏1705可以为至少两个,分别设置在终端1700的不同表面或呈折叠设计;在另一些实施例中,显示屏1705可以是柔性显示屏,设置在终端1700的弯曲表面上或折叠面上。甚至,显示屏1705还可以设置成非矩形的不规则图形,也即异形屏。显示屏1705可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。Display screen 1705 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, or any combination thereof. When display screen 1705 is a touch screen display, it is also capable of collecting touch signals on or above the surface of display screen 1705. The touch signals may be input as control signals to processor 1701 for processing. In this case, display screen 1705 may also be used to provide virtual buttons and/or virtual keyboards, also known as soft buttons and/or soft keyboards. In some embodiments, there may be one display screen 1705, disposed on the front panel of terminal 1700; in other embodiments, there may be at least two display screens 1705, disposed on different surfaces of terminal 1700 or in a foldable design; in other embodiments, display screen 1705 may be a flexible display, disposed on a curved or foldable surface of terminal 1700. Display screen 1705 may even be configured as a non-rectangular irregular shape, i.e., 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).
摄像头组件1706用于采集图像或视频。可选地,摄像头组件1706包括前置摄像头和后置摄像头。前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件1706还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双 色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。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 set on the front panel of the terminal, and the rear camera is set 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 flash. Color temperature flash. Dual color temperature flash refers to a combination of warm light flash and cool light flash, which can be used to compensate for light at different color temperatures.
光学传感器1710用于采集环境光强度。在一个实施例中,处理器1701可以根据光学传感器1710采集的环境光强度,控制显示屏1705的显示亮度。具体地,当环境光强度较高时,调高显示屏1705的显示亮度;当环境光强度较低时,调低显示屏1705的显示亮度。在另一个实施例中,处理器1701还可以根据光学传感器1710采集的环境光强度,动态调整摄像头组件1706的拍摄参数。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.
本领域技术人员可以理解,图17中示出的结构并不构成对终端1700的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art will understand that the structure shown in FIG17 does not constitute a limitation on the terminal 1700 , and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
可选地,计算机设备提供为服务器。图18是本申请实施例提供的一种服务器的结构示意图,该服务器1800可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(Central Processing Units,CPU)1801和一个或一个以上的存储器1802,其中,存储器1802中存储有至少一条计算机程序,至少一条计算机程序由处理器1801加载并执行以实现上述各个方法实施例提供的生物特征识别方法。当然,该服务器还可以具有有线或无线网络接口、键盘及输入输出接口等部件,以便进行输入输出,该服务器还可以包括其他用于实现设备功能的部件,在此不做赘述。Optionally, the computer device is provided as a server. Figure 18 is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1800 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1801 and one or more memories 1802, wherein the memory 1802 stores at least one computer program, and the at least one computer program is loaded and executed by the processor 1801 to implement the biometric feature recognition method provided by each of the above method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.
本申请实施例还提供了一种非易失性计算机可读存储介质,该非易失性计算机可读存储介质中存储有至少一条计算机程序,该至少一条计算机程序由处理器加载并执行,以使计算机实现上述实施例的生物特征识别方法所执行的操作。An embodiment of the present application also provides a non-volatile 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 enable the computer to implement the operations performed by the biometric recognition method of the above embodiment.
本申请实施例还提供了一种计算机程序产品,包括计算机程序,计算机程序被处理器执行,以使计算机实现上述实施例的生物特征识别方法所执行的操作。An embodiment of the present application further provides a computer program product, including a computer program, which is executed by a processor to enable a computer to implement the operations performed by the biometric recognition method of the above embodiment.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。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 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.
以上所述仅为本申请实施例的可选实施例,并不用以限制本申请实施例,凡在本申请实施例的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。 The above description is only an optional embodiment of the embodiment of the present application and is not intended to limit the embodiment of the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the embodiment of the present application should be included in the scope of protection of this application.
Claims (17)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410263657.0A CN120612504A (en) | 2024-03-07 | 2024-03-07 | Biometric identification method, device, computer equipment and storage medium |
| CN202410263657.0 | 2024-03-07 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| WO2025185139A1 true WO2025185139A1 (en) | 2025-09-12 |
| WO2025185139A8 WO2025185139A8 (en) | 2025-10-02 |
Family
ID=96931215
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/121294 Pending WO2025185139A1 (en) | 2024-03-07 | 2024-09-26 | Biometric feature recognition method and apparatus, computer device, and storage medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN120612504A (en) |
| WO (1) | WO2025185139A1 (en) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104217217A (en) * | 2014-09-02 | 2014-12-17 | 武汉睿智视讯科技有限公司 | Vehicle logo detection method and system based on two-layer classification |
| US20180181803A1 (en) * | 2016-12-27 | 2018-06-28 | Shenzhen University | Pedestrian head identification method and system |
| CN108764325A (en) * | 2018-05-23 | 2018-11-06 | 腾讯科技(深圳)有限公司 | Image-recognizing method, device, computer equipment and storage medium |
| CN114640795A (en) * | 2022-03-22 | 2022-06-17 | 深圳市商汤科技有限公司 | Image processing method and apparatus, device, and medium |
| CN116052230A (en) * | 2022-12-30 | 2023-05-02 | 佳都科技集团股份有限公司 | Palm vein recognition method, device, equipment and storage medium |
| CN116580372A (en) * | 2023-05-12 | 2023-08-11 | 亿咖通(湖北)技术有限公司 | A target recognition method, device, recognition and storage medium |
-
2024
- 2024-03-07 CN CN202410263657.0A patent/CN120612504A/en active Pending
- 2024-09-26 WO PCT/CN2024/121294 patent/WO2025185139A1/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104217217A (en) * | 2014-09-02 | 2014-12-17 | 武汉睿智视讯科技有限公司 | Vehicle logo detection method and system based on two-layer classification |
| US20180181803A1 (en) * | 2016-12-27 | 2018-06-28 | Shenzhen University | Pedestrian head identification method and system |
| CN108764325A (en) * | 2018-05-23 | 2018-11-06 | 腾讯科技(深圳)有限公司 | Image-recognizing method, device, computer equipment and storage medium |
| CN114640795A (en) * | 2022-03-22 | 2022-06-17 | 深圳市商汤科技有限公司 | Image processing method and apparatus, device, and medium |
| CN116052230A (en) * | 2022-12-30 | 2023-05-02 | 佳都科技集团股份有限公司 | Palm vein recognition method, device, equipment and storage medium |
| CN116580372A (en) * | 2023-05-12 | 2023-08-11 | 亿咖通(湖北)技术有限公司 | A target recognition method, device, recognition and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN120612504A (en) | 2025-09-09 |
| WO2025185139A8 (en) | 2025-10-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11941918B2 (en) | Extracting information from images | |
| CN111989689B (en) | Method for identifying an object in an image and mobile device for executing the method | |
| CN109961009B (en) | Pedestrian detection method, system, device and storage medium based on deep learning | |
| EP3740897B1 (en) | License plate reader using optical character recognition on plural detected regions | |
| US20210082136A1 (en) | Extracting information from images | |
| CN111598065B (en) | Depth image acquisition method and living body recognition method, device, circuit and medium | |
| US8792722B2 (en) | Hand gesture detection | |
| JP6137916B2 (en) | Signal processing apparatus, signal processing method, and signal processing system | |
| WO2019218824A1 (en) | Method for acquiring motion track and device thereof, storage medium, and terminal | |
| WO2020134528A1 (en) | Target detection method and related product | |
| US20120027263A1 (en) | Hand gesture detection | |
| CN111626163B (en) | Human face living body detection method and device and computer equipment | |
| KR101896357B1 (en) | Method, device and program for detecting an object | |
| CN109871780B (en) | A face quality judging method and system, and a face recognition method and system | |
| US12283127B2 (en) | Method for obtaining data from an image of an object of a user that has a biometric characteristic of the user | |
| WO2020230244A1 (en) | Training method, training program, and training device | |
| CN115953744A (en) | A vehicle recognition and tracking method based on deep learning | |
| CN117011535A (en) | Feature point matching method and device, electronic equipment and storage medium | |
| CN117831082B (en) | Palm area detection method and device | |
| WO2025185139A1 (en) | Biometric feature recognition method and apparatus, computer device, and storage medium | |
| CN117132648B (en) | A visual positioning method, electronic device and computer-readable storage medium | |
| CN112347843B (en) | Method and related device for training wrinkle detection model | |
| JP2004199200A (en) | Pattern recognition device, imaging device, information processing system, pattern recognition method, recording medium, and program | |
| KR102681262B1 (en) | Method, system and non-transitory computer-readable recording medium for managing training of model for object detection | |
| CN120550406B (en) | Game interaction control method, game interaction control device, computer equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24928070 Country of ref document: EP Kind code of ref document: A1 |