Identity recognition method and apparatus, and computer device and storage medium

By extracting the color features of the target image and identifying the environment categories, and obtaining the matching identity recognition algorithm, the problem of unstable image quality in different lighting environments is solved, and the accuracy of identity recognition is improved.

WO2025066515A1PCT designated stage expired Publication Date: 2025-04-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/108347
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-28
Filing Date
2024-07-30
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

The existing identity recognition technology has unstable image quality in different lighting environments, affecting the accuracy of identity recognition.

Method used

By extracting the color features of the target image, identifying the target environment category corresponding to the image, and obtaining a matching identity recognition algorithm based on the environment category, and identifying the target image.

Benefits of technology

Improve the accuracy of identity recognition and enhance the recognition ability in different ambient light scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024108347_03042025_PF_FP_ABST
    Figure CN2024108347_03042025_PF_FP_ABST
Patent Text Reader

Abstract

An identity recognition method, which is executed by means of a computer device. The method comprises: acquiring a target image, wherein the target image includes an image, which is formed by means of at least a portion of an object to be recognized (302); extracting a color feature of the target image (304); on the basis of the color feature of the target image, identifying a target environment category corresponding to the target image, wherein different environment categories are used for representing different ambient light scenes (306); and on the basis of the target environment category, acquiring a target identity recognition algorithm which matches the target image, and on the basis of the target identity recognition algorithm, performing identity recognition on the target image, so as to obtain an identity recognition result of said object, wherein different environment categories correspond to different identity recognition algorithms (308).
Need to check novelty before this filing date? Find Prior Art

Description

Identity identification method, device, computer equipment and storage medium

[0001] Related applications

[0002] This application claims priority to Chinese patent application number 2023112799495, filed on September 28, 2023, entitled “Image Recognition Processing Method, Device, Computer Equipment and Storage Medium,” the entire text of which is incorporated herein by reference. Technical Field

[0003] The present application relates to the field of computer technology, and in particular to an identity recognition method, apparatus, computer equipment, storage medium, and computer program product. Background Art

[0004] With the development of computer technology, identity recognition technology has been widely used. Identity recognition mainly uses complex algorithms and models to identify images (such as face images, iris images, palm images, etc.) to determine the biological object corresponding to the image.

[0005] In related technologies, the accuracy of identity recognition relies on the quality of the images captured by the image acquisition device. However, image quality, in turn, depends on the ambient lighting conditions. Backlighting or light interference can cause images to be too dark or too bright, leading to loss of detail in bright or dark areas, thus compromising image quality and, consequently, identity recognition accuracy.

[0006] Summary of the Invention

[0007] Based on this, it is necessary to provide an identity recognition method, device, computer equipment, computer-readable storage medium and computer program product that can improve the accuracy of identity recognition in response to the above technical problems.

[0008] In one aspect, the present application provides an identity recognition method, the method comprising:

[0009] Acquire a target image, wherein the target image includes an image formed by at least a portion of the object to be identified;

[0010] Extracting color features of the target image;

[0011] Based on the color features of the target image, identifying the target environment category corresponding to the target image, where different environment categories are used to represent different ambient light scenes; and

[0012] A target identity recognition algorithm matching the target image is obtained based on the target environment category, and the target image is identified according to the target identity recognition algorithm to obtain an identity recognition result of the object to be identified, wherein different environment categories correspond to different identity recognition algorithms.

[0013] On the other hand, the present application also provides an identity recognition device, comprising:

[0014] an acquisition module, configured to acquire a target image, wherein the target image includes an image formed by at least a portion of the object to be identified;

[0015] An environment recognition module is used to extract the color features of the target image; based on the color features of the target image, identify the target environment category corresponding to the target image, where different environment categories are used to represent different ambient light scenes; and

[0016] An identity recognition module is used to obtain a target identity recognition algorithm that matches the target image based on the target environment category, perform identity recognition on the target image according to the target identity recognition algorithm, and obtain an identity recognition result of the object to be identified, wherein different environment categories correspond to different identity recognition algorithms.

[0017] On the other hand, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned identity recognition method when executing the computer program.

[0018] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned identity recognition method are implemented.

[0019] On the other hand, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the above-mentioned identity recognition method are implemented.

[0020] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.

[0022] FIG1 is a diagram illustrating an application environment of an identity recognition method according to an embodiment;

[0023] FIG2 is a schematic diagram of an application of an identity recognition method according to an embodiment;

[0024] FIG3 is a schematic diagram of a flow chart of an identity recognition method in one embodiment;

[0025] FIG4 is a schematic diagram of RGB channel combination colors in one embodiment;

[0026] FIG5 is a schematic diagram of an RGB coordinate system in one embodiment;

[0027] FIG6 is a schematic diagram of obtaining an image classification model in one embodiment;

[0028] FIG7 is a schematic diagram of image brightness distribution in one embodiment;

[0029] FIG8 is a schematic diagram of image brightness distribution in another embodiment;

[0030] FIG9 is a schematic diagram of image brightness distribution in yet another embodiment;

[0031] FIG10 is a schematic diagram of establishing a correspondence between image acquisition devices and environment categories in one embodiment;

[0032] FIG11 is a schematic diagram of an identity recognition system according to an embodiment;

[0033] FIG12 is a schematic diagram of an image acquisition scene in one embodiment;

[0034] FIG13 is a structural block diagram of an identity recognition device in one embodiment;

[0035] FIG14 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0037] The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.

[0038] The identity recognition method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.

[0039] Specifically, the terminal 102 and the server 104 can each independently execute the identification method, or they can jointly execute the identification method. For example, the terminal 102 can include a built-in image acquisition device. When performing identification on an object to be identified, the terminal 102 can call upon the image acquisition device to capture a target image. The terminal 102 can locally execute the identification method, i.e., the terminal 102 locally identifies the target environment category corresponding to the target image, obtains a target identification algorithm that matches the target image based on the target environment category, and then performs identification on the target image using the target identification algorithm to obtain an identification result for the object to be identified.

[0040] In one embodiment, as shown in FIG2 , the terminal 102 may also send the captured target image to the server 104. The server 104 identifies the target environment category corresponding to the target image, obtains a target identity recognition algorithm that matches the target image based on the target environment category, and uses the target identity recognition algorithm to perform identity recognition on the target image to obtain an identity recognition result of the object to be recognized. The server 104 may also return the identity recognition result of the object to be recognized to the terminal 102.

[0041] It should be noted that the terminal 102 may specifically be a business processing device. When the identity recognition method is applied to an access control system, the terminal 102 may specifically be an access control device; when the identity recognition method is applied to a payment system, the terminal 102 may specifically be an offline payment device, etc. It is understood that when the identity recognition method is applied to different business systems requiring identity recognition, the terminal 102 may specifically be the corresponding business processing device.

[0042] In one embodiment, as shown in FIG3 , an identity recognition method is provided. The method is described by taking a computer device as an example. The computer device may be the terminal 102 or the server 104 in FIG1 . The identity recognition method may include the following steps:

[0043] Step 302: Acquire a target image, where the target image includes an image formed by at least a portion of the object to be identified.

[0044] The object to be identified can be the target object for identity recognition, specifically the target object that triggers the identity recognition event. For example, in a payment scenario, the object to be identified can be the user who currently triggers the payment; in an attendance recording scenario, the object to be identified can be the user who currently triggers the attendance registration.

[0045] The target image can be an image of an object to be identified, captured for identification purposes. The target image can include an image formed by at least a portion of the object to be identified. Specifically, the at least a portion of the object to be identified can be the entire object to be identified or a portion of the object to be identified. For example, the entire object to be identified can be the entire person, while a portion of the object to be identified can be the person's hand, face, or eyes. The image formed by at least a portion of the object to be identified can be an image formed by mapping at least a portion of the object to be identified onto the target image.

[0046] Specifically, when the identity recognition method of the present application is executed locally by a terminal, that is, when the computer device is a terminal, the terminal may have a built-in or external image acquisition device. Among them, the image acquisition device may be a 3D (3 Dimensions, three-dimensional) camera such as a 3D structured light camera, which may include a depth camera and an infrared camera, etc. When the identity of the object to be identified is to be identified, for example, when the object to be identified triggers the terminal to perform identity recognition, the terminal may call the image acquisition device to capture the target image, and the target image includes an image formed by at least a part of the object to be identified, for example, the target image may include a palm image or facial image corresponding to the object to be identified, etc. When the identity recognition method is specifically executed by a server, that is, when the computer device is a server, the server may obtain the target image corresponding to the object to be identified transmitted by the terminal.

[0047] Step 304: extract color features of the target image.

[0048] Step 306 : Identify the target environment category corresponding to the target image based on the color features of the target image. Different environment categories are used to represent different ambient light scenes.

[0049] Among them, different environment categories are used to represent different ambient light scenes. Ambient light scenes can be scenes of ambient light intensity, light color, etc. The environment categories can be pre-set categories based on the different light intensity and light color in the environment. Different environment categories may correspond to different light intensities, light colors, or both. For example, environment categories may include white light categories, dark light categories, and stray light categories.

[0050] The color features of the target image are used to represent at least the ambient chromaticity information of the ambient lighting scene corresponding to the target image. Images captured under different lighting environments may display different effects, resulting in different image color features. Different color features can reflect different ambient lighting scenes, specifically, they can represent specific information about light intensity and color in different ambient lighting scenes.

[0051] For example, images captured in scenes with weak ambient light (i.e., light intensity less than the minimum value required for normal image capture) have poor overall brightness or luminance and are dark in tone; images captured in scenes with strong ambient light (i.e., light intensity greater than the maximum value required for normal image capture) have high overall brightness or luminance; images captured in scenes with normal ambient light intensity (i.e., light intensity within the range required for normal image capture) and white light have high overall brightness or luminance and are neutral in tone; and images captured in lighting environments with various colors (such as red, orange, yellow, green, cyan, blue, purple, etc.) will also have different tones and luminances.

[0052] The target environment category is determined based on the color features of the ambient light scene corresponding to the target image. These color features are used to characterize at least the ambient chromaticity information of the ambient light scene. This ambient chromaticity information can include specific information about the intensity and color of the ambient light. The ambient light scene corresponding to the target image is also the ambient light scene of the environment in which the target image was captured. The color features of the ambient light scene are used to reflect the ambient chromaticity information of the environment in which the target image was captured. In other words, different color features can reflect different ambient light scenes and represent different environment categories.

[0053] Since images captured under different lighting environments may present different effects, i.e., different color features of the images, the corresponding target environment category can be identified in real time based on the target image. Specifically, the target environment category corresponding to the target image can be identified in real time based on the color features of the target image. The color features can be the red, green, and blue (RGB) features of the target image, or the hue, brightness, and saturation (HIS) color features, or the hue, saturation, and value (HSV) color features, etc.

[0054] Furthermore, since the deployment scenario of the terminal (including the image acquisition device) as a business processing device is relatively fixed, and when the terminal is deployed in a certain scenario, the environmental category corresponding to the scenario is also relatively fixed, that is, the environmental category of the acquisition environment of the image acquisition device can also be determined. Therefore, the target environmental category corresponding to the target image can also be determined based on the environmental category of the environment in which the image acquisition device is located. For example, after the image acquisition device is deployed, the corresponding environmental category can be determined by detecting the ambient light scene of the environment in which the image acquisition device is located, and the environmental category can be used as the environmental category corresponding to the images subsequently acquired by the image acquisition device.

[0055] The target environment category corresponding to the target image may be identified locally by the terminal, or the target environment category corresponding to the target image transmitted by the terminal may be identified by the server.

[0056] Using the same identification algorithm for all images with different color features can affect identification accuracy and reduce the success rate. Therefore, this embodiment extracts the color features of the target image and, through subsequent steps, determines the target environment category corresponding to the target image. This allows the target identification algorithm corresponding to the target environment category to be used for identification of the target image, thereby improving identification accuracy.

[0057] Specifically, the color features of the target image may be RGB features, HIS color features, or HSV color features of the target image. Color features may be represented by vectors, histograms, or the like. For example, if the color features are RGB features, the computer device may obtain the RGB values ​​of pixels in the target image and, based on the distribution of the RGB values ​​of the pixels, obtain a corresponding histogram, thereby obtaining the color features of the target image.

[0058] Because the different color features presented by an image can reflect different ambient light scenes and represent different environmental categories, a computer device can identify the target environment category corresponding to the target image based on the color features of the target image. For example, a correspondence between color features and environmental categories can be pre-set, and then, based on the color features of the target image, the environmental category corresponding to the color features can be obtained, and the environmental category matching the color features can be determined as the target environment category corresponding to the target image. A machine learning model can also be used to classify the environmental category of the target image based on the color features of the target image, thereby obtaining the target environment category corresponding to the target image.

[0059] In this embodiment, the target environment category corresponding to the target image is identified by extracting the color features of the target image and based on the color features of the target image. Because different ambient light scenes may have different specific color features, the imaging quality and imaging effects in different ambient light scenes may also vary. Therefore, by extracting the color features of the target image to determine the target environment category corresponding to the target image, the target image acquisition environment category can be determined in real time, thereby improving the accuracy of the determination of the target image acquisition environment category. Furthermore, the target image can be identified using a target identity recognition algorithm corresponding to the target environment category determined in real time, which can further improve the accuracy of identity recognition.

[0060] Step 308 : obtaining a target identity recognition algorithm that matches the target image based on the target environment category, performing identity recognition on the target image according to the target identity recognition algorithm, and obtaining an identity recognition result of the object to be recognized.

[0061] Different environmental categories correspond to different identity recognition algorithms. Using these algorithms to differentiate images in different environmental categories helps improve recognition accuracy. The target identity recognition algorithm is an algorithm that corresponds to the target environmental category. Since the target environmental category is determined based on target identity recognition, and the target image is the captured image of the object to be recognized, using the target identity recognition algorithm to perform identity recognition on the target image can yield the identity recognition result for the object to be recognized.

[0062] Specifically, identity recognition can be the process of authenticating the identity of the object to be identified, and the identity recognition algorithm is the specific strategy adopted in the process of authenticating the identity of the object to be identified. The identity recognition result is used to represent the result of whether the identity authentication of the object to be identified is passed or not. For example, in the payment scenario, the computer device uses the target identity recognition algorithm to match the target image with the user image of the payment authorization user. If the match is successful, it can be determined that the object to be identified is the payment authorization user, and the identity recognition result of the identity authentication of the object to be identified is passed; if the match is unsuccessful, it can be determined that the object to be identified is not the payment authorization user, and the identity recognition result of the identity authentication of the object to be identified is failed.

[0063] It is understood that the process of identifying the target image can be performed locally on the terminal or remotely via a server, and this embodiment does not limit this. It is understood that when the process of identifying the target image is performed remotely via a server, the server can also return the identification result of the object to be identified to the terminal device, so that the object to be identified can understand its own identification result in real time through the terminal device, thereby improving the user experience.

[0064] In the above-described identity recognition method, a target image containing an image of at least a portion of the object to be recognized is acquired, and the target environment category corresponding to the target image is identified. Based on the target environment category, a target identity recognition algorithm matching the target image is obtained. The target image is then identified using the target identity recognition algorithm to obtain an identification result for the object to be recognized. Different environment categories represent different ambient light scenes, and different identity recognition algorithms are associated with different environment categories. It is understood that different ambient light scenes may have different specific color characteristics, resulting in different imaging quality and effects under different ambient light scenes. Using different identity recognition algorithms for images captured under different ambient light scenes can help improve image recognition accuracy. Therefore, by identifying the target environment category corresponding to the target image and using the target identity recognition algorithm corresponding to the target environment category to identify the target image, the recognition accuracy of the target image can be improved. Furthermore, because the target image contains an image of at least a portion of the object to be recognized, the accuracy of identifying the object to be recognized can be improved.

[0065] In one embodiment, extracting color features of a target image includes:

[0066] Obtain the RGB values ​​of the pixels of the target image; determine the hue information of the target image according to the distribution of the RGB values ​​of the pixels of the target image; convert the RGB values ​​of the pixels of the target image into the brightness values ​​of the target image; construct the color feature vector of the target image according to the brightness value and the hue information of the target image, and obtain the color features of the target image.

[0067] The pixel RGB value refers to the RGB value of each pixel in the image. Typically, each pixel uses three bytes to represent the color value, representing the values ​​of the components of the three primary colors: red, green, and blue. These three primary colors together create all true color effects. The three components R, G, and B are often referred to as three independent color channels, with each channel value ranging from [0, 255]. Combinations of different values ​​across the three channels can represent different colors, as shown in Figure 4. For example, RGB(255, 0, 0) represents red, RGB(0, 255, 0) represents green, RGB(0, 0, 255) represents blue, RGB(255, 255, 0) represents yellow, RGB(255, 0, 255) represents purple, RGB(0, 255, 255) represents cyan, RGB(255, 255, 255) represents white, and RGB(0, 0, 0) represents black.

[0068] Hue information refers to the relative brightness and darkness of an image, which is expressed as corresponding color information on a color image. In this embodiment, the hue information of the target image is used to characterize the overall color of the target image, such as white tones, dark tones, and mixed tones. Generally, when a certain color occupies the largest number of pixels in an image, that color can be used as the hue information of the image. Since the RGB value of each pixel can represent the corresponding color, the hue information of the target image can be determined based on the distribution of the RGB values ​​of the pixels of the target image. For example, the color of the pixel with the largest RGB value distribution can be determined as the hue information of the target image.

[0069] Luminance refers to the degree of lightness or darkness of a color, a visual experience determined by light intensity. Generally speaking, stronger light appears brighter and has a higher luminance; weaker light appears darker and has a lower luminance. A luminance of 0 represents pure black (the darkest color possible). The luminance value of each pixel can usually be calculated based on the corresponding RGB value.

[0070] Specifically, RGB brightness conversion can be calculated using the following formula:

[0071] Among them, R, G, and B correspond to the components of the three color channels of the pixel respectively, and L represents the brightness of the corresponding pixel, with a value range of 0 to 1.

[0072] After obtaining the brightness of each pixel in the target image through the above conversion, the overall brightness value of the target image can be calculated based on statistics. For example, the brightness of each pixel in the target image can be averaged, and the average value can be used as the overall brightness value of the target image. Alternatively, the brightness of each pixel in the target image can be sorted and the median value can be determined, and the median value can be used as the overall brightness value of the target image.

[0073] Constructing a color feature vector of the target image can specifically combine the brightness value of the target image and the hue information of the target image to obtain a color feature vector, which can be used as the color feature of the target image.

[0074] In this embodiment, the computer device can obtain the RGB values ​​of the pixels of the target image and determine the hue information of the target image based on the distribution of the RGB values ​​of the pixels of the target image. The computer device can also convert the RGB values ​​of the pixels of the target image into the brightness values ​​of the target image and construct a color feature vector of the target image based on the brightness values ​​and the hue information of the target image to obtain the color features of the target image. Since this embodiment is based on a target image acquired in real time, and by obtaining the RGB values ​​of the pixels of the target image and then determining the hue information of the target image based on the distribution of the RGB values ​​of the pixels of the target image, it is possible to obtain relatively accurate hue information; the brightness values ​​of the target image are determined by the RGB values ​​of the pixels of the target image, and then the brightness values ​​of the target image and the hue information of the target image are combined to obtain the constructed color feature vector of the target image, that is, the color features of the target image, which can reflect the ambient light scene of the acquisition environment corresponding to the target image in real time, and then determine the corresponding target environment category based on the color features of the target image, thereby achieving real-time determination of the acquisition environment category of the target image and improving the accuracy of determining the acquisition environment category of the target image.

[0075] In one embodiment, determining the hue information of the target image based on the RGB value distribution of pixels of the target image includes:

[0076] The RGB values ​​of the pixels of the target image are mapped to the RGB coordinate system; the target color space with the most pixels is determined in the RGB coordinate system through the color space of the preset hue and the RGB values ​​of the pixels of the target image; the hue corresponding to the target color space is determined as the hue information of the target image.

[0077] The RGB coordinate system is a three-dimensional coordinate system built with the R, G, and B channels as coordinate axes. The three coordinate axes represent the values ​​of the R, G, and B channels, respectively. The value ranges of the R, G, and B channels are 0-255. Therefore, each true color value belongs to any point in this three-dimensional cube space. Figure 5 is a schematic diagram of the RGB coordinate system. This three-dimensional cube space is the range of the RGB coordinate system. From the RGB coordinate system, we can see that pure black is at the coordinate origin, while pure white is at the diagonal point of the origin. The color values ​​on the diagonal line between pure black and pure white are also grayscale values. Discrete points in other spaces directly represent corresponding colors. Therefore, the RGB values ​​of the pixels of the target image can be mapped to the RGB coordinate system, that is, the RGB values ​​of all the pixels of the target image are filled into this three-dimensional cube space.

[0078] A color space, also known as a "color gamut," represents a color using one-, two-, three-, or four-dimensional spatial coordinates. The range of colors defined by these coordinates is the color space. A color space of a preset hue represents the range of spatial coordinates that represent the color corresponding to the preset hue. In this embodiment, there can be multiple color spaces of preset hues, each representing a different hue or color. The target color space is the color space ultimately determined to have the most pixels. Specifically, after the RGB values ​​of all pixels of the target image are filled into the three-dimensional cube space described above, the color spaces of each preset hue can be moved starting from a vertex of the RGB coordinate system, and the number of pixels falling within each preset hue color space can be counted. By moving the color spaces of each preset hue and traversing the RGB coordinate system, the color space with the most pixels is obtained, namely, the target color space. The hue corresponding to the target color space can then be determined as the hue information of the target image. It is understood that the hue corresponding to the target color space can be the preset hue corresponding to that color space.

[0079] In this embodiment, the computer device maps the RGB values ​​of the pixels of the target image to the RGB coordinate system, and determines the target color space with the most pixels in the RGB coordinate system through the color space of the preset hue and the RGB values ​​of the pixels of the target image, and determines the hue corresponding to the target color space as the hue information of the target image, thereby realizing fast and accurate determination of the hue information of the target image.

[0080] In one embodiment, the color features of the target image may include the brightness value of the target image and the hue information of the target image. Based on the color features of the target image, identifying the target environment category corresponding to the target image may include:

[0081] If the brightness value of the target image is less than a preset first threshold value, and the hue information of the target image matches the preset first hue, the target environment category corresponding to the target image is determined to be a dark light category, wherein the first hue is used to characterize the hue information corresponding to the dark light category image; if the brightness value of the target image is greater than a preset second threshold value, and the hue information of the target image matches the preset second hue, the target environment category corresponding to the target image is determined to be a white light category, wherein the second threshold value is greater than or equal to the first threshold value, and the second hue is used to characterize the hue information corresponding to the white light category image; if the hue information of the target image does not match the preset first hue, and does not match the preset second hue, the target environment category corresponding to the target image is determined to be a stray light category.

[0082] The dark light category, the white light category, and the stray light category may be pre-set environment categories. It is understandable that in actual applications, more categories or fewer categories may be set.

[0083] The first hue is based on the color space of the hue corresponding to the image captured in the dark light environment, that is, the hue information. The color space of the hue can be set based on experience or obtained based on experiments. For example, it can be determined based on the distribution of hues of images captured in the dark light environment. The dark light environment can be an environment with weak light intensity, for example, an environment where the light intensity is less than the minimum intensity required for normal image capture. The first threshold can also be determined based on the distribution of brightness values ​​of images captured in the dark light environment, or it can be a pre-set empirical value. For example, the first threshold can be the median of the brightness range, or any value less than the median. When the brightness range is 0 to 1, the first threshold can be a value less than or equal to 0.5.

[0084] Specifically, when the computer device determines that the brightness value of the target image is less than a preset first threshold and the hue information of the target image matches the preset first hue, it can be determined that the target environment category corresponding to the target image is a dark light category.

[0085] Similarly, the second hue is based on the color space of the hue corresponding to the image captured in the white light category environment, that is, the hue information. The color space of the hue can also be set based on experience, or obtained based on experiments. For example, it can be determined based on the distribution of hues of images captured in the white light category environment. The white light category environment can be an environment where the light intensity is normal (that is, the light intensity is within the range that can normally capture images) and the ambient light is white light. The second threshold can also be determined based on the distribution of the brightness value of the image captured in the white light category environment, or it can be a pre-set empirical value. The second threshold is generally greater than or equal to the first threshold. For example, the second threshold can also be the median of the brightness range, or any value greater than the median. When the brightness range is 0 to 1, the second threshold can be a value greater than or equal to 0.5.

[0086] Specifically, when the computer device determines that the brightness value of the target image is greater than a preset second threshold and the hue information of the target image matches the preset second hue, it can be determined that the target environment category corresponding to the target image is a white light category.

[0087] The stray light category is a lighting environment category with various colors (such as red, orange, yellow, green, cyan, blue, purple, etc.). In this embodiment, the stray light environment can also be all other environments except the above-mentioned white light environment and dark light environment.

[0088] Specifically, when the computer device determines that the hue information of the target image does not match the preset first hue and does not match the preset second hue, it can be determined that the target environment category corresponding to the target image is the stray light category.

[0089] In the above embodiment, the computer device determines the target environment category corresponding to the target image based on the target image's brightness value and hue information. Specifically, when the target image's brightness value is less than a preset first threshold and the target image's hue information matches the preset first hue, the target environment category corresponding to the target image is determined to be a dark light category. When the target image's brightness value is greater than a preset second threshold and the target image's hue information matches the preset second hue, the target environment category corresponding to the target image is determined to be a white light category. When the target image's hue information does not match the preset first hue and does not match the preset second hue, the target environment category corresponding to the target image is determined to be a stray light category. The computer device accurately determines the target environment category corresponding to the target image by analyzing the relationship between the target image's brightness value and hue information, the preset first and second hues, and the first and second thresholds of the brightness value.

[0090] In one embodiment, after determining that the target environment category corresponding to the target image is the stray light category, the method may further include: determining a color category that matches the hue information based on the hue information of the target image, wherein the color category includes any one of a red category, an orange category, a yellow category, a green category, a cyan category, a blue category, and a purple category; and determining the color category as a subcategory under the target environment category corresponding to the target image.

[0091] Since the stray light category refers to environments with various colors of light (such as red, orange, yellow, green, cyan, blue, and purple), and the color characteristics of images presented in different lighting environments are also different, the stray light category can be further subdivided into different color subcategories.

[0092] Specifically, in this embodiment, when the computer device determines that the target environment category corresponding to the target image is the stray light category, it can also determine the corresponding color category based on the hue information of the target image, and use the color category as a subcategory under the target environment category corresponding to the target image, thereby further subdividing subcategories of different colors under the stray light category, and then matching the corresponding target identity recognition algorithm based on each subcategory to further improve the recognition accuracy of the image under the stray light category.

[0093] In one embodiment, identifying the target environment category corresponding to the target image based on the color features of the target image may further include:

[0094] The color features of the target image are input into a pre-acquired image classification model to obtain the target environment category corresponding to the target image output by the image classification model, wherein the image classification model is trained based on the color features of the sample image and the environment category label. Different environment category labels are used to represent different ambient light scenes, and the color features of the sample image are at least used to represent the ambient chromaticity information of the ambient light scene corresponding to the sample image.

[0095] The image classification model can classify target images with different color features into different environmental categories. The image classification model can be a model predefined by the computer device, or a model obtained by the computer device based on machine learning, or a model obtained based on deep learning.

[0096] In one scenario, the image classification model can be a model predefined or learned by the server. The server can also update the image classification model and distribute the updated image classification model to the terminal. The terminal can then receive the image classification model from the server and predict the target environment category corresponding to the target image based on the image classification model, thereby improving the efficiency of identifying the target environment category corresponding to the target image.

[0097] In one embodiment, as shown in FIG6 , a method for obtaining an image classification model includes:

[0098] Step 602: Acquire a sample image set, which includes multiple sample images and environmental category labels of the sample images. The environmental category labels are determined based on the ambient light scene in which the device capturing the sample images is located. The environmental category labels include white light category labels, dark light category labels, and stray light category labels.

[0099] The sample image set includes multiple sample images, each of which has a corresponding environment category label. The environment category label is determined based on the ambient light scene of the image acquisition device used to capture the sample image, and represents the actual environment category of the sample image. The ambient light scene can include scenes of light intensity, light color, etc. Specifically, the environment category labels may include white light category labels, dark light category labels, and stray light category labels.

[0100] In one embodiment, under the stray light category label, subcategory labels of different colors may be further subdivided, such as a red subcategory label, an orange subcategory label, a yellow subcategory label, a green subcategory label, a cyan subcategory label, a blue subcategory label, and a purple subcategory label.

[0101] Step 604: extract color features of the sample image.

[0102] The color features of the sample image are at least used to characterize the environmental chromaticity information corresponding to the sample image. It is understood that the color features of the sample image have the same meaning as the color features of the target image and are extracted in the same way, so this embodiment will not elaborate on this.

[0103] Step 606 : Based on the color features of each sample image, call the initial classification model to classify each sample image to obtain a predicted environment category for each sample image.

[0104] Among them, the initial classification model can be implemented using a support vector machine (SVM), a random forest, or a deep learning model (such as a convolutional neural network).

[0105] The predicted environment category is the classification result obtained after the sample image is classified by the initial classification model. In this embodiment, the computer device can use the color features of the sample image as input to the initial classification model to obtain the predicted environment category of the sample image output by the initial classification model.

[0106] Step 608 : Training the initial classification model according to the environmental category label and the predicted environmental category of each sample image to obtain an image classification model.

[0107] Training refers to the process of adjusting model parameters by learning from a large amount of data, enabling the model to accurately predict unknown data. Since the environmental category label is the label of the actual environmental category of the sample image, and the predicted environmental category is the classification result obtained after the sample image is classified by the initial classification model, the model loss can be determined based on the environmental category label of the sample image and the predicted environmental category. The model parameters of the initial classification model can then be adjusted based on the model loss until the convergence criteria are met, thus obtaining an image classification model.

[0108] In this embodiment, a sample image set is obtained, the color features of the sample images are extracted, and an initial classification model is invoked to classify each sample image based on the color features of each sample image. This classifies each sample image into a predicted environmental category. The initial classification model is then trained based on the environmental category label and predicted environmental category of each sample image to obtain an image classification model. Because the image classification model is trained based on the color features of the sample images and the environmental category labels, the trained image classification model is capable of learning the color features of images in various environmental categories and accurately classifying the environmental category of a target image based on its color features, thereby improving the efficiency of identifying the environmental category corresponding to the target image.

[0109] Furthermore, after the initial classification model is trained based on the environmental category label and predicted environmental category of each sample image, the accuracy, precision, recall, and other indicators of the trained model can be evaluated using a test dataset to determine the performance of the model. That is, after adjusting the model parameters of the initial classification model based on the model loss and satisfying the convergence conditions, the accuracy, precision, recall, and other indicators of the trained model that meets the convergence conditions can be evaluated using a test dataset to determine the performance of the model. If the performance of the model meets the requirements, training is stopped to obtain an image classification model. If the performance of the model does not meet the requirements, the training process shown in Figure 6 above is continued until the performance of the model meets the requirements, at which point training is stopped to improve the reliability of the model.

[0110] In one embodiment, the target image is acquired by a corresponding image acquisition device; after extracting the color features of the target image, the method further includes:

[0111] Based on the color characteristics of the target image, determine whether the target image has ambient light interference; when it is determined that the target image has ambient light interference, return the application adjustment parameters for the target ambient light interference to the image acquisition device corresponding to the target image, so as to instruct the target image acquisition device to adjust the parameters according to the application adjustment parameters, wherein the application adjustment parameters include at least one of a shutter speed parameter, a sensitivity parameter, an exposure time parameter, a white balance parameter and a filter parameter; then obtain the target image captured again by the image acquisition device after adjusting the application adjustment parameters, and extract the color characteristics of the target image captured again.

[0112] Ambient light interference refers to the disturbing effects of ambient light. Ambient light interference in a target image occurs when the disturbing effects of ambient light cause image quality impairment. Specifically, ambient light interference includes, but is not limited to, interference with light intensity and light color.

[0113] Application adjustment parameters are used to adjust the configuration parameters of the target image acquisition device. For example, you can adjust the shutter speed, ISO sensitivity, exposure time, color temperature for white balance, and filter color.

[0114] Ambient light interference can affect image quality, and when it is severe, it can severely degrade image quality, leading to an inability to accurately identify the environment category corresponding to the image. Image quality can typically be assessed based on the image's color features. Based on this, after extracting the color features of a target image, a computer device can determine whether the target image has ambient light interference based on the color features of the target image. If the target image is determined to have ambient light interference, the computer device can return application adjustment parameters specific to the target ambient light interference to the image acquisition device corresponding to the target image, allowing the target image acquisition device to adjust parameters based on the application adjustment parameters, thereby reducing or eliminating the ambient light interference and improving the image quality of subsequently captured images. Furthermore, the computer device can acquire a target image captured again by the image acquisition device after adjusting the application adjustment parameters, and identify the target environment category corresponding to the target image based on the color features of the recaptured target image. Based on the target environment category, a target identification algorithm matching the recaptured target image is then acquired, and identification is performed on the recaptured target image using the target identification algorithm to obtain an identification result for the object to be identified, thereby avoiding situations where identification failures are caused by image quality issues.

[0115] Specifically, determining whether the target image has ambient light interference based on the color characteristics of the target image may further include:

[0116] According to the color characteristics of the target image, the brightness information and color noise of the target image are obtained, wherein the brightness information includes the overall brightness parameter of the target image or the brightness distribution of pixels in the target image; if the overall brightness parameter of the target image is less than a preset brightness threshold, it is determined that the target image has ambient light interference; or, if the brightness distribution of pixels in the target image does not belong to the target distribution, it is determined that the target image has ambient light interference; or, if the color noise of the target image is greater than or equal to a preset color noise threshold, it is determined that the target image has ambient light interference.

[0117] The overall brightness parameter of the target image can be the overall brightness value of the target image, which can be obtained based on the brightness statistics of each pixel in the target image. The brightness of an image is generally related to the amount of light reflected by the color of the object's surface. The more light reflected from the surface of a colored object, the higher the brightness. Typically, the brightness value of each pixel can be obtained by converting the corresponding RGB value of the pixel.

[0118] Specifically, the RGB brightness conversion can be calculated using the following formula: b = 0.299 × R + 0.587 × G + 0.114 × B

[0119] Among them, R, G, and B correspond to the components of the three color channels of the pixel respectively, and b represents the brightness of the corresponding pixel, with a value range of 0 to 255.

[0120] After obtaining the brightness of each pixel in the target image through the above conversion, the overall brightness value of the target image can be calculated based on statistics. For example, the brightness of each pixel in the target image can be averaged, and the average value can be used as the overall brightness value of the target image. Alternatively, the brightness of each pixel in the target image can be sorted and the median value can be determined, and the median value can be used as the overall brightness value of the target image.

[0121] In one embodiment, the identity recognition method further includes: determining whether ambient light interference exists in the ambient image based on the color characteristics of the ambient image, where the ambient image is captured by a corresponding image capture device; when it is determined that ambient light interference exists in the ambient image, returning application adjustment parameters for the ambient light interference to the image capture device corresponding to the ambient image, instructing the image capture device to adjust parameters according to the application adjustment parameters; obtaining an ambient image captured again by the image capture device after adjusting the application adjustment parameters, and extracting color characteristics of the recaptured ambient image. In this embodiment, when ambient light interference is determined to exist, adjusting the image capture device to recapture the ambient image can obtain a higher quality ambient image, thereby ensuring the accuracy of the final identity recognition result and avoiding waste of resources due to identity recognition failure.

[0122] In one embodiment, determining whether there is ambient light interference in the ambient image is based on the color characteristics of the ambient image, including: obtaining brightness information and color noise of the ambient image based on the color characteristics of the ambient image, the brightness information including the overall brightness parameter of the ambient image or the brightness distribution of pixels in the ambient image; when the overall brightness parameter of the ambient image is less than a preset brightness threshold, the brightness distribution of pixels in the ambient image does not belong to the target distribution, or the color noise of the ambient image is greater than or equal to a preset color noise threshold, it is determined that there is ambient light interference in the ambient image.

[0123] In one scenario, when the overall brightness parameter of the target image is less than a preset brightness threshold, it can be determined that the target image is subject to ambient light interference. The preset brightness threshold can be determined based on the minimum brightness that needs to be achieved when the image quality meets the requirements. That is, when the overall brightness of the target image is less than the minimum brightness, it can be determined that the target image is subject to ambient light interference. In other words, it can be determined that the acquisition environment corresponding to the target image has a problem of insufficient light, and therefore, the application adjustment parameters for adjusting the ambient light can be returned to the image acquisition device corresponding to the target image. For example, a parameter for reducing the shutter speed can be returned to the image acquisition device corresponding to the target image, a parameter for increasing the sensitivity can be returned to the image acquisition device corresponding to the target image, and a parameter for extending the exposure time can be returned to the image acquisition device corresponding to the target image, etc., so as to compensate for the ambient light and solve the problem of insufficient ambient light.

[0124] The brightness distribution of pixels in the target image can be obtained based on the brightness statistics of each pixel in the target image. Specifically, by statistically analyzing the brightness of each pixel in the target image, a brightness distribution histogram as shown in Figure 7 can be obtained. The horizontal axis (X) represents the brightness range of 0 to 255, and the vertical axis (Y) represents the number of pixels in the target image at a certain brightness. When there are more pixels at a certain brightness level, the corresponding peak value is higher.

[0125] The target distribution can specifically be a normal distribution, also known as a normal distribution. That is, under normal conditions, most objects will conform to this distribution pattern. Typically, a brightness histogram can be used to determine whether an image is overexposed or underexposed. Generally speaking, when a brightness histogram exhibits a normal distribution (as shown in Figure 7), it indicates that there is no overexposure or underexposure, meaning that the exposure is normal. At this point, it can be determined that the target image is free of ambient light interference, and therefore, there is no need to adjust the application parameters of the image acquisition device corresponding to the target image.

[0126] When the pixels of the brightness histogram are mainly concentrated on the left side, as shown in Figure 8, it means that the corresponding image has an underexposure problem, that is, the image is too dark. At this time, it can be determined that the target image has ambient light interference. Therefore, the application adjustment parameters for adjusting the ambient light can be returned to the image acquisition device corresponding to the target image. For example, the parameters for reducing the shutter speed can be returned to the image acquisition device corresponding to the target image, the parameters for increasing the sensitivity can be returned to the image acquisition device corresponding to the target image, and the parameters for extending the exposure time can be returned to the image acquisition device corresponding to the target image, so as to compensate for the ambient light and solve the problem of underexposure of the image.

[0127] When the pixels of the brightness histogram are mainly concentrated on the right side, as shown in Figure 9, it means that the corresponding image has an overexposure problem, that is, the image is too bright. At this time, it can be determined that the target image has ambient light interference. Therefore, the application adjustment parameters for adjusting the ambient light can be returned to the image acquisition device corresponding to the target image. For example, the parameters for increasing the shutter speed can be returned to the image acquisition device corresponding to the target image, the parameters for reducing the sensitivity can be returned to the image acquisition device corresponding to the target image, and the parameters for shortening the exposure time can be returned to the image acquisition device corresponding to the target image, etc., so as to reduce the ambient light and solve the problem of image overexposure.

[0128] Color noise in a target image refers to noise in the image caused by light interference in the acquisition environment corresponding to the target image. Color noise can be determined based on the RGB value of the hue in the target image. Specifically, the RGB value of the hue can be determined based on the RGB values ​​of all pixels in the color space corresponding to the hue. For example, the RGB value of the hue can be the mean or median of the RGB values ​​of all pixels in the color space corresponding to the hue.

[0129] The color noise threshold can be a pre-set RGB threshold of the corresponding hue. Therefore, when the RGB value of a certain hue in the target image is greater than or equal to the RGB threshold of the hue, it means that the chromaticity of the hue in the target image is too heavy, so that it can be determined that the target image has ambient light interference. Therefore, the application adjustment parameters for the target ambient light interference can be returned to the image acquisition device corresponding to the target image. Specifically, a suitable filter can be selected based on the specific color of the hue with too heavy chromaticity in the target image to filter out unnecessary light. For example, when the hue with too heavy chromaticity in the target image is blue, a yellow filter can be used to filter out the blue light in the environment, thereby improving the quality of subsequent captured images.

[0130] In one scenario, in order to truly restore the color of the scene, the color temperature of the image acquisition device can be adjusted according to the light at the shooting scene, that is, the white balance adjustment. When the color temperature of the scene is lower than the color temperature set by the program in the machine, the captured image will be reddish; and when the color temperature of the scene is higher than the color temperature set by the program, the captured image will be bluish. Therefore, in this embodiment, the white balance evaluation parameter of the target image can be obtained according to the color characteristics of the target image, wherein the white balance evaluation parameter represents the relationship between the ambient color temperature of the environment in which the image acquisition device is located and the built-in color temperature of the image acquisition device. For example, when it is determined that the overall hue of the target image is bluish according to the color characteristics of the target image, it means that the built-in color temperature of the corresponding target image acquisition device is too small. Therefore, it can be determined that the target image has ambient light interference, and the application adjustment parameter for increasing the built-in color temperature can be returned to the image acquisition device corresponding to the target image to achieve white balance. When the overall hue of the target image is determined to be reddish based on its color characteristics, it means that the built-in color temperature of the corresponding target image acquisition device is too high. Therefore, it can also be determined that there is ambient light interference in the target image, and the application adjustment parameters for reducing the built-in color temperature can be returned to the image acquisition device corresponding to the target image to achieve white balance.

[0131] In one embodiment, the target image is acquired by a target image acquisition device, and the target image carries a device identifier of the target image acquisition device. The device identifier may be a mark that distinguishes different devices, and may specifically be a device identification code. Identifying the target environment category corresponding to the target image may also include:

[0132] Based on a pre-established matching relationship between the device identification of the image acquisition device and the environment category, an environment category matching the device identification of the target image acquisition device is determined, and the environment category matching the device identification of the target image acquisition device is determined as the target environment category corresponding to the target image. The matching relationship between the device identification of the image acquisition device and the environment category is established based on the environment category determined based on the color characteristics of the ambient light scene in the environment in which the image acquisition device is located, and the matching relationship between the device identification and the environment category is established.

[0133] Because the deployment scenarios of image acquisition devices are relatively fixed, and the environmental category corresponding to each scenario is also relatively fixed, once an image acquisition device is deployed, a correspondence can be established between the device identifier of the image acquisition device and the environmental category of its deployment scenario. Subsequently, images captured by the image acquisition device can be processed according to the environmental category corresponding to the image acquisition device, thereby improving the efficiency of identifying the target environmental category corresponding to the target image.

[0134] In one embodiment, the matching relationship between the device identification of the image acquisition device and the environment category can be established by the following method:

[0135] Acquire an environmental image captured by an image acquisition device; extract color features of the environmental image, wherein the color features of the environmental image are used to at least characterize environmental chromaticity information of an ambient light scene corresponding to the environmental image; determine the environmental category corresponding to the environmental image based on the color features of the environmental image; and establish a matching relationship between the environmental category corresponding to the environmental image and the device identification of the image acquisition device.

[0136] The environmental image captured by the image acquisition device may be an environmental image captured by the image acquisition device during initialization. Initialization may be the startup logic when the terminal is first started after deployment. Alternatively, initialization may be the startup logic when the terminal is powered on again after being powered off. For example, when the terminal is first started after deployment, the image acquisition device may be called to capture the environmental image. The environmental category of the environment in which the image acquisition device is located can thus be determined based on the captured environmental image.

[0137] The environmental image captured by the image capture device may also be an environmental image captured when the ambient light scene of the environment in which the image capture device is located changes. For example, the image capture device may monitor the light intensity of the environment, or a light sensor may monitor the light intensity or other environmental information of the environment. Therefore, when a change in the ambient light scene of the environment in which the image capture device is located is detected, the image capture device may be triggered to capture a corresponding environmental image, thereby re-determining the environmental category of the environment in which the image capture device is located based on the captured environmental image.

[0138] Specifically, to ensure the accuracy of environmental image classification, multiple environmental images may be included. For example, when an image acquisition device captures environmental images, it may capture multiple (e.g., five) environmental images, and after each capture of an environmental image, it may wait a certain period of time before capturing the next environmental image, thereby improving the accuracy of environmental image classification.

[0139] It is understood that the color features of the environmental image have the same meaning as the color features of the target image, and are extracted in the same manner. Furthermore, determining the environmental category corresponding to the environmental image is similar to the method for determining the environmental category corresponding to the target image. For example, the environmental category corresponding to the environmental image can be determined based on the color features of the environmental image, such as brightness and hue information, or based on a pre-acquired image classification model. This will not be further elaborated in this embodiment.

[0140] In this embodiment, establishing a matching relationship between the device identification of the image acquisition device and the environment category can be performed locally on the terminal. For example, when the terminal detects a change in the ambient light scene, it can call the image acquisition device to capture an environment image. Alternatively, during initialization, the terminal can call the image acquisition device to capture an environment image, and then extract color features of the environment image. Based on the color features of the environment image, the environment category corresponding to the environment image is determined. A matching relationship is then established between the environment category corresponding to the environment image and the device identification of the image acquisition device. Subsequently, images captured by the image acquisition device will be processed according to the corresponding environment category.

[0141] In one embodiment, as shown in FIG10 , establishing a matching relationship between the device identification of the image acquisition device and the environment category can also be performed on the server. When the terminal detects a change in the ambient light scene or during initialization, it can call the image acquisition device to capture an environment image. The terminal sends the captured environment image to the server, which extracts the color features of the environment image and, based on the color features of the environment image, determines the environment category corresponding to the environment image and establishes a matching relationship between the environment category corresponding to the environment image and the device identification of the image acquisition device. The server can also return the determined environment category corresponding to the environment image to the terminal. Subsequent images captured by the image acquisition device will be processed according to the corresponding environment category.

[0142] Furthermore, in the process of establishing a matching relationship between the device identification of the image acquisition device and the environmental category, it is also possible to determine whether there is ambient light interference in the environmental image based on the color characteristics of the environmental image, and when it is determined that there is ambient light interference in the environmental image, return the application adjustment parameters for the ambient light interference to the image acquisition device corresponding to the environmental image, so that the image acquisition device can adjust the parameters according to the application adjustment parameters, and then obtain the environmental image captured again by the image acquisition device after adjusting the application adjustment parameters, and extract the color characteristics of the environmental image captured again, so as to determine the environmental category of the image acquisition device based on the color characteristics of the environmental image captured again, thereby improving the accuracy of identifying the environmental category of the image acquisition device and avoiding recognition errors caused by ambient light interference.

[0143] It can be understood that the process of determining whether there is ambient light interference in the ambient image based on the color characteristics of the ambient image is similar to the above-mentioned process of determining whether there is ambient light interference in the target image based on the color characteristics of the target image, and this embodiment will not elaborate on this.

[0144] In one scenario, the target image may include an infrared image and a color image. Specifically, the infrared image may be an infrared image obtained by the infrared sensor of an image acquisition device, which is a pan-infrared image. Specifically, the color image may be a color image obtained by the color sensor of the image acquisition device, which is a natural light image. It is understood that the infrared image and color image of the target image are images obtained by capturing the same object to be identified.

[0145] In one embodiment, obtaining a target identity recognition algorithm that matches a target image based on the target environment category, performing identity recognition on the target image according to the target identity recognition algorithm, and obtaining an identity recognition result of the object to be recognized may include:

[0146] If the target environment category is the white light category, a first recognition is performed on the color image to obtain a first recognition result, and a second recognition is performed on the infrared light image to obtain a second recognition result; the first recognition result and the second recognition result are equally weighted to obtain an identity recognition result of the object to be identified.

[0147] Among them, the first recognition can be the process of identifying the color image of the target image with the images stored in the color image database. The color image database can be a database that stores the color images of all authorized users. For example, for the payment scenario, the color image database may store the color images of users who have authorized payment through images. For another example, for the attendance record scenario, the color image database may store the color images of users who have registered to record attendance through images. The first recognition result is the result obtained after identifying the color image of the target image with the images stored in the color image database. For example, it can be the similarity score between the color image of the target image and a target color image in the color image database. Specifically, the target color image can be the image in the color image database that has the highest similarity to the color image of the target image.

[0148] The second recognition may be a process of identifying the infrared image of the target image with the images stored in the infrared image database. Similarly, the infrared image database may be a database that stores infrared images of all authorized users. For example, for payment scenarios, the infrared image database may store infrared images of users who have been authorized to pay through images. For another example, for attendance record scenarios, the infrared image database may store infrared images of users who have registered to record attendance through images. The second recognition result is the result obtained after identifying the infrared image of the target image with the images stored in the infrared image database. For example, it may be a similarity score between the infrared image of the target image and a target infrared image in the infrared image database. It is understandable that the target infrared image and the target color image represent images of the same user.

[0149] Weighted processing involves multiplying each recognition result by a weighting factor and then adding them together. The sum of these weighting factors should be 1. Equal weighting refers to weighting in which the weighting factors are equal. Specifically, the first and second recognition results are equally weighted to obtain the identification result for the object to be identified. This means that the weighting factors for both the first and second recognition results are 0.5.

[0150] Because both infrared and color images have good image quality in white light scenarios, a dual-factor equal-weighted approach can be used for identification. This involves equally weighting the first recognition result based on the infrared image and the second recognition result based on the color image to obtain the final identification result for the object to be identified. This ensures both security and accuracy.

[0151] In one embodiment, obtaining a target identity recognition algorithm that matches a target image based on the target environment category, performing identity recognition on the target image according to the target identity recognition algorithm, and obtaining an identity recognition result of the object to be recognized may further include:

[0152] If the target environment category is a stray light category, obtain the brightness of the color image; determine the first recognition weight of the color image and the second recognition weight of the infrared light image based on the brightness of the color image; perform a first recognition based on the color image to obtain a first recognition result, and perform a second recognition based on the infrared light image to obtain a second recognition result; obtain the identity recognition result of the object to be identified based on the first recognition result and the first recognition weight of the color image, and the second recognition result and the second recognition weight of the infrared light image.

[0153] The brightness of a color image can be calculated and statistically analyzed based on the RGB values ​​of each pixel in the color image. In scenes with stray light, low light intensity can lead to unclear color images. Infrared images are self-luminous and unaffected by ambient light. Therefore, in this case, the recognition weight of infrared images can be increased, while that of color images can be decreased.

[0154] Furthermore, since the brightness of the resulting color image decreases as the ambient light intensity decreases, the image quality deteriorates. Based on this, the first recognition weight for the color image and the second recognition weight for the infrared image can be determined based on the brightness of the color image. Specifically, by setting a minimum brightness threshold and presetting the corresponding recognition weights for the color image and infrared image at this minimum brightness threshold, the first recognition weight for the color image and the second recognition weight for the infrared image can be determined based on the relationship between the color image brightness and the minimum brightness threshold. For example, if the minimum brightness threshold is L1, the recognition weight for the color image is preset to be 0.1, and the recognition weight for the infrared image is preset to be 0.9 at this minimum brightness threshold. When the brightness of the color image is less than or equal to the minimum brightness threshold L1, the first recognition weight for the color image of the target image can be determined to be 0.1, and the second recognition weight for the infrared image can be determined to be 0.9. If the brightness of the color image is greater than the minimum brightness threshold L1, the first recognition weight for the color image can be gradually increased based on the difference between the two values, while the second recognition weight for the infrared image can be correspondingly decreased. For example, the brightness step size can be set to 50 as a level, and the corresponding weight step size can be set to 0.1 as a level. Then, the difference between the brightness of the color image and the minimum brightness threshold L1 can be calculated, and the relationship with the multiple of the step size 50 is that when the multiple is 1, the first recognition weight of the color image is increased by 1×0.1, and the second recognition weight of the infrared image is reduced by 1×0.1. When the multiple is 2, the first recognition weight of the color image is increased by 2×0.1, and the second recognition weight of the infrared image is reduced by 2×0.1. It can be understood that the second recognition weight of the infrared image shall not be less than 0.5. That is to say, when the first recognition weight of the color image is increased to 0.5, no matter how high its brightness is, its corresponding recognition weight will not be increased, thereby ensuring the accuracy of recognition.

[0155] In one embodiment, obtaining a target identity recognition algorithm that matches a target image based on the target environment category, performing identity recognition on the target image according to the target identity recognition algorithm, and obtaining an identity recognition result of the object to be recognized may further include:

[0156] If the target environment category is the dark light category, identity recognition is performed on the infrared light image to obtain the identity recognition result of the object to be identified.

[0157] Because the brightness of the resulting color image decreases and the image quality deteriorates when the ambient light intensity is low, when the target image is determined to be in a low-light environment, identification can be performed solely on the infrared image to obtain the identification result of the object to be identified. Since the color image is not referenced in this case, identification interference caused by poor color image quality can be avoided.

[0158] In one embodiment, taking the above method applied to a resource transfer scenario as an example, when a terminal receives a resource transfer request, it can call an image acquisition device to acquire a target image of the resource object to be transferred, identify the target environment category corresponding to the target image, obtain a target identity recognition algorithm that matches the target image based on the target environment category, and perform identity recognition on the target image according to the target identity recognition algorithm, thereby obtaining an identity recognition result of the object to be recognized. Since different environment categories correspond to different identity recognition algorithms, the accuracy of identity recognition can be improved. When the identity recognition result indicates that the identity recognition of the resource object to be transferred is successful, the terminal can also perform a resource transfer operation based on the resource transfer request, thereby improving the efficiency of resource transfer.

[0159] Specifically, if the resource transfer scenario is face-swiping payment, the image acquisition device can be used to capture the face image of the resource object to be transferred (i.e., the object to be identified). If the resource transfer scenario is palm-swiping payment, the image acquisition device can be used to capture the palm image of the resource object to be transferred (i.e., the object to be identified).

[0160] In one embodiment, the above method is applied to the identity recognition system shown in Figure 11 as an example, wherein the terminal can be a merchant payment terminal, a palm print payment terminal (such as a palm swiping device), or other IoT payment devices, which can be deployed in various supermarkets and convenience stores. The terminal can have a built-in image acquisition device (such as a 3D camera), and can also have an application for payment (such as an AA payment application) installed in the terminal. The server can be a back-end service that provides back-end service support for the IoT payment device, which can specifically provide ambient light recognition and classification services, terminal device management services, identity recognition services, and payment services.

[0161] Due to the varying deployment environments of different terminals (for example, Terminal A and Terminal B could be palmprint payment terminals deployed in different environments), or due to differences in terminal hardware and software configurations, the quality of the images they capture can also vary. Consequently, some terminals may capture images with high clarity, others with low clarity, some with too dark a resolution, and others with too bright a resolution. If the backend service applies the same identity recognition strategy to all images of varying quality, this will compromise recognition accuracy and reduce the success rate.

[0162] Based on this, in this embodiment, when the terminal (terminal A or terminal B) is first activated after landing in the merchant store, the initialization logic will be executed. When the terminal is initialized, the terminal will perform an ambient light self-detection acquisition, that is, call the 3D camera to acquire the current environmental image and send the environmental image to the back-end service. After receiving the terminal's environmental image, the back-end service can call the ambient light recognition and classification service to identify the environmental category of the environmental image. For example, the ambient light recognition and classification service can extract the color features of the environmental image and determine the corresponding environmental category based on the extracted color features; or it can input the collected environmental image into the image classification model based on a pre-set image classification model to obtain the environmental category corresponding to the collected environmental image output by the model, thereby improving the recognition speed of the environmental category of the environmental image. On the one hand, the back-end service can manage it in the terminal device management service based on the identified environmental category, such as recording the corresponding relationship between the environmental category and the corresponding terminal. On the other hand, the back-end service can also return the recognition result of the environmental category to the corresponding terminal, so that the corresponding terminal can record the environmental category in the result page module.

[0163] In specific applications, for example, in the scenario of self-service payment at a supermarket using a palm print payment terminal, users can add items to their shopping list by scanning a QR code at the supermarket's payment terminal, without bringing their phone or wallet. Payment is then triggered through the operating interface provided by the payment terminal, which then uses a 3D camera to capture the user's target image (e.g., a palm image, typically including an infrared image and a color image). The capture process is shown in Figure 12. The payment terminal can send the captured target image to a backend service, which can then determine the environment category of the terminal that captured the target image based on the correspondence between the terminal and the environment category recorded in the terminal device management service. The backend service can then use a processing strategy corresponding to the environment category to identify the target image. For example, if the environment category is white light, a two-factor equal-weighted approach (i.e., the captured infrared image and the color image have equal recognition weights) can be used to identify the target image to obtain the user's identity. If the ambient light category is determined to be stray light, a dual-factor weighting approach (i.e., the recognition weights of the captured infrared image and color image can be adjusted) can be used to identify the target image to obtain the user's identity recognition result. If the ambient light category is determined to be low light, a single-factor approach (i.e., only using the captured infrared image) can be used to identify the target image to obtain the user's identity recognition result.

[0164] If the identification result indicates that the user's identity has been successfully verified, the server can deduct the amount to be paid from the user's account and pay the merchant. Furthermore, the server can return a payment details page to the payment terminal to display the payment details to the user. This allows users to make secure payments simply by scanning their face or palm.

[0165] It is understandable that when a 3D camera captures the user's target image, it usually captures multiple images. The payment terminal can select the best one (for example, the one with the best image quality and the most complete feature area) from the multiple captured target images and send it to the backend service.

[0166] Furthermore, to enhance payment security, the payment terminal's payment application can include a liveness detection service, which detects whether a live object exists within a target image. Therefore, the payment terminal can first perform a liveness detection on the target image using the liveness detection service, and only send the data to the backend service if a live object is confirmed within the target image.

[0167] In the above embodiment, the environmental category of the image acquisition device is determined based on the environmental image captured during initialization. Consequently, all images captured by the image acquisition device are processed for identity recognition according to the corresponding environmental category, thereby improving the system's processing speed. In actual applications, the target environmental category can also be determined based on the target image captured during payment, thereby ensuring the accuracy of target image classification. Identity recognition can then be performed on the target image based on the target environmental category, further improving recognition accuracy.

[0168] In the above embodiment, when determining the target environment category based on the target image collected when the user pays, the payment terminal can transmit the collected target image of the user to the back-end service, and the back-end service extracts the color features of the target image through the ambient light recognition and classification service, and determines the corresponding environment category based on the extracted color features; the ambient light recognition and classification service of the back-end service can also be based on a pre-set image classification model, and input the target image into the image classification model to obtain the target environment category corresponding to the target image output by the model, thereby improving the recognition speed of the environment category of the image.

[0169] In the above embodiment, extracting the color features of an image (such as a target image or an environmental image) may specifically include: obtaining the RGB values ​​of the image pixels; determining the hue information of the image based on the distribution of the RGB values ​​of the image pixels; converting the RGB values ​​of the image pixels into the brightness values ​​of the image; constructing a color feature vector of the image based on the brightness values ​​and the hue information of the image to obtain the color features of the image. Determining the hue information of the image based on the distribution of the RGB values ​​of the image pixels may specifically include: mapping the RGB values ​​of the image pixels into an RGB coordinate system; determining the target color space with the most pixels in the RGB coordinate system by using a preset hue color space and the RGB values ​​of the image pixels; and determining the hue corresponding to the target color space as the hue information of the image. This allows the color features of the image obtained based on the hue information to better express the corresponding ambient light scene.

[0170] In one embodiment, the above method is applied to access control as an example, wherein the terminal can be an access control terminal (such as a palm-scanning control terminal or a face-scanning control terminal), which can be deployed at the entrances and exits of various office buildings and factories. The access control terminal can have a built-in image acquisition device (such as a 3D camera). In this embodiment, the access control terminal can jointly execute the above identity recognition method with the corresponding server to implement access control, or the access control terminal can execute the above identity recognition method alone to implement access control.

[0171] The quality of images captured by access control terminals varies under different ambient lighting conditions. Access control terminals are typically deployed at various entrances and exits, making them susceptible to natural lighting effects. For example, clear skies with strong ultraviolet rays can result in overly bright images, while rainy skies or at night can result in dark images. Applying the same identity recognition strategy to all images of varying quality can compromise recognition accuracy, reduce recognition success rates, and ultimately lead to congestion at entrances and exits.

[0172] Based on this, in this embodiment, an access control terminal alone executing the above-mentioned identity recognition method to implement access control is used as an example. Specifically, in a specific application, a user can use the access control terminal to capture a target image (such as a facial image or a palm image) of the user without carrying an access card, and identify the target environment category of the target image. Then, the target image can be identified using a processing strategy corresponding to the target environment category. For example, if the white light category is determined as the environment category, a two-factor equal weight method (i.e., the recognition weights of the collected infrared light image and the color image are equal) can be used to identify the target image to obtain the user's identity recognition result. If the stray light category is determined as the environment category, a two-factor weighted method (i.e., the recognition weights of the collected infrared light image and the color image can be adjusted) can be used to identify the target image to obtain the user's identity recognition result. If the dark light category is determined as the environment category, a single factor method (i.e., only the collected infrared light image) can be used to identify the target image to obtain the user's identity recognition result.

[0173] If the identification result indicates that the user's identity is successfully identified, the access control terminal can open the door and let the user pass based on the successful identification result. If the identification result indicates that the user's identity is unsuccessful, the access control terminal will not open the door and let the user pass. In this way, users can achieve barrier-free access by simply scanning their face or palm.

[0174] In the above embodiment, identifying the target environment category of the target image can be specifically performed by extracting the color features of the target image and determining the corresponding environment category based on the extracted color features. Extracting the color features of the target image can specifically include: obtaining the RGB values ​​of the pixels of the target image; determining the hue information of the target image based on the distribution of the RGB values ​​of the pixels of the target image; converting the RGB values ​​of the pixels of the target image into the brightness values ​​of the target image; constructing a color feature vector of the target image based on the brightness values ​​of the target image and the hue information of the target image to obtain the color features of the target image. Specifically, determining the hue information of the target image based on the distribution of the RGB values ​​of the pixels of the target image can specifically include: mapping the RGB values ​​of the pixels of the target image into an RGB coordinate system; determining the target color space with the most pixels in the RGB coordinate system by using a preset hue color space and the RGB values ​​of the pixels of the target image; and determining the hue corresponding to the target color space as the hue information of the target image. This allows the color features of the target image obtained based on the hue information to better express the corresponding ambient light scene.

[0175] In the above embodiment, the access control terminal can also input the target image into the image classification model based on a preset image classification model, thereby obtaining the target environment category corresponding to the target image output by the model, thereby improving the recognition speed of the environment category of the target image.

[0176] It can be understood that after the access control terminal is deployed in a certain scene, the changes in its ambient light scene are relatively regular and will not change in real time. Therefore, in order to improve the recognition efficiency of the target environment category of the target image, a corresponding relationship between the access control terminal and the current environment category can also be established in advance. For example, when the access control terminal detects that the current ambient light scene has changed, it can collect the corresponding environment image and determine the corresponding current environment category based on the currently collected environment image. After collecting the user's target image, the target image can be processed according to the determined current environment category. Therefore, there is no need to identify the target environment category of the target image in real time, which is beneficial to reduce the amount of calculation of the access control terminal and improve the processing speed of the access control terminal.

[0177] In the above embodiment, the current environment category is determined based on the currently captured environment image. Specifically, the color features of the currently captured environment image can be extracted and the corresponding environment category determined based on the extracted color features. Alternatively, the currently captured environment image can be input into a pre-set image classification model to obtain the current environment category corresponding to the currently captured environment image as output by the model, thereby improving the recognition speed of the environment category of the currently captured environment image.

[0178] In the above embodiment, it is also possible to determine whether the corresponding image is subject to ambient light interference based on the color characteristics of the target image or the environmental image. For example, based on the color characteristics of the image, brightness information and color noise of the image can be obtained, wherein the brightness information includes the overall brightness parameter of the image or the brightness distribution of pixels in the image. If the overall brightness parameter of the image is less than a preset brightness threshold, it can be determined that the image is subject to ambient light interference. Alternatively, if the brightness distribution of pixels in the image does not fall within the target distribution, it can be determined that the image is subject to ambient light interference. Alternatively, if the color noise of the image is greater than or equal to a preset color noise threshold, it can be determined that the image is subject to ambient light interference. When it is determined that the image is subject to ambient light interference, an application adjustment parameter for the ambient light interference can be returned to the corresponding image acquisition device to instruct the image acquisition device to adjust parameters according to the application adjustment parameter, wherein the application adjustment parameter includes at least one of a shutter speed parameter, a sensitivity parameter, an exposure time parameter, a white balance parameter, and a filter parameter. Then, an image captured by the image acquisition device after adjusting the application adjustment parameter is obtained, color characteristics of the recaptured image are extracted, and the corresponding environmental category is determined based on the color characteristics of the recaptured image, thereby improving the accuracy of environmental category recognition and avoiding recognition errors caused by ambient light interference.

[0179] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0180] Based on the same inventive concept, the present application also provides an identity recognition device for implementing the aforementioned identity recognition method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more of the following identity recognition device embodiments can be found in the above-mentioned limitations of the identity recognition method and will not be further elaborated here.

[0181] In one embodiment, as shown in FIG13 , an identity recognition device is provided, including: an acquisition module 1402 , an environment recognition module 1404 , and an identity recognition module 1406 , wherein:

[0182] An acquisition module 1402 is configured to acquire a target image, wherein the target image includes an image formed by at least a portion of the object to be identified;

[0183] The environment recognition module 1404 is used to extract the color features of the target image; based on the color features of the target image, identify the target environment category corresponding to the target image, and different environment categories are used to represent different ambient light scenes.

[0184] The identity recognition module 1406 is used to obtain a target identity recognition algorithm that matches the target image based on the target environment category, perform identity recognition on the target image according to the target identity recognition algorithm, and obtain an identity recognition result of the object to be recognized, where different environment categories correspond to different identity recognition algorithms.

[0185] In one embodiment, the color features of the target image are at least used to characterize the ambient chromaticity information, and the environment recognition module is specifically further used to: input the color features of the target image into a pre-acquired image classification model to obtain the target environment category corresponding to the target image output by the image classification model. The image classification model is trained based on the color features of the sample image and the environmental category labels. Different environmental category labels are used to characterize different ambient light scenes. The color features of the sample image are at least used to characterize the ambient chromaticity information of the ambient light scene corresponding to the sample image.

[0186] In one embodiment, the environment recognition module is further specifically used to: obtain the RGB values ​​of the pixels of the target image; determine the hue information of the target image based on the distribution of the RGB values ​​of the pixels of the target image; convert the RGB values ​​of the pixels of the target image into the brightness values ​​of the target image; construct a color feature vector of the target image based on the brightness value of the target image and the hue information of the target image to obtain the color features of the target image.

[0187] In one embodiment, the environment recognition module is specifically used to: map the RGB values ​​of the pixels of the target image to the RGB coordinate system; determine the target color space with the most pixels in the RGB coordinate system through the color space of the preset hue and the RGB values ​​of the pixels of the target image; and determine the hue corresponding to the target color space as the hue information of the target image.

[0188] In one embodiment, the color features of the target image include the brightness value of the target image and the hue information of the target image; the environment recognition module is specifically further used to: if the brightness value of the target image is less than a preset first threshold and the hue information of the target image matches the preset first hue, determine that the target environment category corresponding to the target image is a dark light category, and the first hue is used to represent the hue information corresponding to the dark light category image.

[0189] In one embodiment, the color features of the target image include the brightness value of the target image and the hue information of the target image; the environment recognition module is specifically further used to: if the brightness value of the target image is greater than a preset second threshold and the hue information of the target image matches the preset second hue, determine that the target environment category corresponding to the target image is a white light category, the second threshold is greater than or equal to the first threshold, and the second hue is used to characterize the hue information corresponding to the white light category image.

[0190] In one embodiment, the color features of the target image include the brightness value of the target image and the hue information of the target image; the environment recognition module is specifically used to: if the hue information of the target image does not match the preset first hue and does not match the preset second hue, determine that the target environment category corresponding to the target image is a stray light category.

[0191] In one embodiment, the environment recognition module is further configured to: after determining that the target environment category corresponding to the target image is the stray light category, determine a color category that matches the hue information based on the hue information of the target image; and determine the color category as a subcategory of the target environment category corresponding to the target image. The color category may include any one of a red category, an orange category, a yellow category, a green category, a cyan category, a blue category, and a purple category.

[0192] In one embodiment, the target image carries the device identification of the target image acquisition device, and the target image is acquired by the target image acquisition device; the environment recognition module is further used to: determine the environment category that matches the device identification of the target image acquisition device based on a pre-established matching relationship between the device identification of the image acquisition device and the environment category, and determine the environment category that matches the device identification of the target image acquisition device as the target environment category corresponding to the target image. The matching relationship between the device identification of the image acquisition device and the environment category is an environment category determined based on the color characteristics of the ambient light scene in the environment where the image acquisition device is located, and a matching relationship between the device identification and the environment category is established.

[0193] In one embodiment, the environment recognition module is further configured to: obtain an environment image captured by an image acquisition device, the image acquisition device having a corresponding device identifier; extract color features of the environment image; input the color features of the environment image into a pre-acquired image classification model to obtain an environment category corresponding to the environment image output by the image classification model; and establish a matching relationship between the environment category corresponding to the environment image and the device identifier of the image acquisition device. The color features of the environment image are used to at least characterize the ambient chromaticity information of the ambient light scene corresponding to the environment image.

[0194] In one embodiment, the acquisition module is further configured to: acquire an environmental image acquired when the image acquisition device is initialized; or acquire an environmental image acquired when an ambient light scene in the environment where the image acquisition device is located changes.

[0195] In one embodiment, the identity recognition device also includes an interference adjustment module, which is used to: determine whether there is ambient light interference in the ambient image based on the color characteristics of the ambient image, and the ambient image is acquired by a corresponding image acquisition device; when it is determined that there is ambient light interference in the ambient image, return application adjustment parameters for the ambient light interference to the image acquisition device corresponding to the ambient image to instruct the image acquisition device to adjust parameters according to the application adjustment parameters; wherein the application adjustment parameters include at least one of shutter speed parameters, sensitivity parameters, exposure time parameters, white balance parameters and filter parameters.

[0196] The acquisition module 1402 is further configured to acquire an environment image captured again by the image capture device after the application adjustment parameters are adjusted, and extract color features of the environment image captured again.

[0197] In one embodiment, the interference adjustment module is further used to: obtain brightness information and color noise of the environmental image based on the color characteristics of the environmental image, the brightness information includes the overall brightness parameter of the environmental image or the brightness distribution of pixels in the environmental image; when the overall brightness parameter of the environmental image is less than a preset brightness threshold, the brightness distribution of pixels in the environmental image does not belong to the target distribution, or the color noise of the environmental image is greater than or equal to the preset color noise threshold, it is determined that the environmental image has ambient light interference.

[0198] In one embodiment, the identity recognition device also includes an interference adjustment module, which is used to: determine whether the target image has ambient light interference based on the color characteristics of the target image, and the target image is acquired by a corresponding image acquisition device; when it is determined that the target image has ambient light interference, return application adjustment parameters for the ambient light interference to the image acquisition device corresponding to the target image to instruct the image acquisition device to adjust parameters according to the application adjustment parameters; wherein the application adjustment parameters include at least one of shutter speed parameters, sensitivity parameters, exposure time parameters, white balance parameters and filter parameters.

[0199] The acquisition module 1402 is further configured to acquire a target image captured again by the image capture device after the application adjustment parameters are adjusted, and extract color features of the target image captured again.

[0200] In one embodiment, the interference adjustment module is further used to: obtain brightness information and color noise of the target image based on the color characteristics of the target image, where the brightness information of the target image includes the overall brightness parameter of the target image or the brightness distribution of pixels in the target image; when the overall brightness parameter of the target image is less than a preset brightness threshold, the brightness distribution of pixels in the target image does not belong to the target distribution, or the color noise of the target image is greater than or equal to a preset color noise threshold, it is determined that the target image has ambient light interference.

[0201] In one embodiment, the environment recognition module is also used to: obtain a sample image set, wherein the sample image set includes multiple sample images and environment category labels of the sample images, the environment category labels are determined based on the ambient light scene in which the acquisition device of the sample image is located, and the environment category labels include white light category labels, dark light category labels, and stray light category labels; extract color features of the sample images, and the color features of the sample images are at least used to characterize the environmental chromaticity information corresponding to the sample images; based on the color features of each sample image, call the initial classification model to classify each sample image to obtain a predicted environment category for each sample image; train the initial classification model based on the environment category label and predicted environment category of each sample image to obtain an image classification model.

[0202] In one embodiment, the target image includes an infrared light image and a color image; the identity recognition module is also used to: if the target environment category is a white light category, perform a first recognition on the color image to obtain a first recognition result, and perform a second recognition on the infrared light image to obtain a second recognition result; perform equal weighting processing on the first recognition result and the second recognition result to obtain an identity recognition result of the object to be identified.

[0203] In one embodiment, the target image includes an infrared light image and a color image; the identity recognition module is also used to: obtain the brightness of the color image if the target environment category is a stray light category; determine the first recognition weight of the color image and the second recognition weight of the infrared light image according to the brightness of the color image; perform a first recognition based on the color image to obtain a first recognition result, and perform a second recognition based on the infrared light image to obtain a second recognition result; obtain the identity recognition result of the object to be identified based on the first recognition result and the first recognition weight of the color image, and the second recognition result and the second recognition weight of the infrared light image.

[0204] In one embodiment, the target image includes an infrared light image; the identity recognition module is further configured to: if the target environment category is a dark light category, perform identity recognition on the infrared light image to obtain an identity recognition result of the object to be recognized.

[0205] In one embodiment, when the device is applied to a server, the acquisition module is also used to: acquire a target image sent by a terminal device, where the target image is collected by the terminal device; the device also includes an identification result return module, which is used to return the identity identification result of the object to be identified to the terminal device after obtaining the identity identification result of the object to be identified.

[0206] In one embodiment, when the device is applied to a resource transfer scenario; the acquisition module is also used to: obtain a resource transfer request, call an image acquisition device to acquire a target image of the resource object to be transferred, and the target image includes a palm image of the resource object to be transferred; the device also includes a resource transfer module, which is used to: when the identity recognition result indicates that the identity recognition of the resource object to be transferred is successful, perform a resource transfer operation based on the resource transfer request.

[0207] Each module in the above-mentioned identity recognition device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0208] In one embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be shown in Figure 14. The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, memory, and I / O interface are connected via a system bus, and the communication interface is connected to the system bus via the I / O interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data related to environment categories and data related to identity recognition algorithms. The I / O interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an identity recognition method.

[0209] Those skilled in the art will understand that the structure shown in FIG14 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0210] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0211] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0212] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0213] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data 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 relevant countries and regions.

[0214] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0215] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0216] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. An identity recognition method, executed by a computer device, comprising: Acquire a target image, wherein the target image includes an image formed by at least a portion of the object to be identified; Extracting color features of the target image; Based on the color features of the target image, identifying the target environment category corresponding to the target image, where different environment categories are used to represent different ambient light scenes; and A target identity recognition algorithm matching the target image is obtained based on the target environment category, and the target image is identified according to the target identity recognition algorithm to obtain an identity recognition result of the object to be identified, wherein different environment categories correspond to different identity recognition algorithms.

2. According to the method of claim 1, the color feature of the target image is at least used to characterize the environmental chromaticity information, and the step of identifying the target environment category corresponding to the target image based on the color feature of the target image comprises: The color features of the target image are input into a pre-acquired image classification model to obtain a target environment category corresponding to the target image output by the image classification model. The image classification model is trained based on the color features of the sample image and the environment category labels. Different environment category labels are used to characterize different ambient light scenes. The color features of the sample image are at least used to characterize the ambient chromaticity information of the ambient light scene corresponding to the sample image.

3. The method according to claim 1 or 2, wherein extracting the color features of the target image comprises: Obtaining the RGB value of a pixel of the target image; Determining the hue information of the target image according to the RGB value distribution of the pixel points of the target image; Convert the RGB value of the pixel point of the target image to the brightness value of the target image; According to the brightness value of the target image and the hue information of the target image, a color feature vector of the target image is constructed to obtain the color feature of the target image.

4. The method according to claim 3, wherein determining the hue information of the target image according to the RGB value distribution of the pixels of the target image comprises: Mapping the RGB values ​​of the pixels of the target image to the RGB coordinate system; Determine a target color space with the most pixels in the RGB coordinate system by using a color space of a preset hue and RGB values ​​of pixels of the target image; The hue corresponding to the target color space is determined as the hue information of the target image.

5. The method according to any one of claims 1 to 4, wherein the color feature of the target image comprises a brightness value of the target image and hue information of the target image; and the step of identifying the target environment category corresponding to the target image based on the color feature of the target image comprises: If the brightness value of the target image is less than a preset first threshold, and the hue information of the target image matches the preset first hue, it is determined that the target environment category corresponding to the target image is a dark light category, and the first hue is used to characterize the hue information corresponding to the dark light category image.

6. The method according to any one of claims 1 to 5, wherein the color feature of the target image comprises a brightness value of the target image and hue information of the target image; and the step of identifying the target environment category corresponding to the target image based on the color feature of the target image comprises: If the brightness value of the target image is greater than a preset second threshold, and the hue information of the target image matches the preset second hue, it is determined that the target environment category corresponding to the target image is a white light category, the second threshold is greater than or equal to the first threshold, and the second hue is used to characterize the hue information corresponding to the white light category image.

7. The method according to any one of claims 1 to 6, wherein the color feature of the target image comprises a brightness value of the target image and hue information of the target image; and the step of identifying the target environment category corresponding to the target image based on the color feature of the target image comprises: If the hue information of the target image does not match the preset first hue and does not match the preset second hue, it is determined that the target environment category corresponding to the target image is a stray light category.

8. The method according to claim 7, after determining that the target environment category corresponding to the target image is a stray light category, the method further comprises: According to the hue information of the target image, determining a color category matching the hue information; The color category is determined as a subcategory under a target environment category corresponding to the target image.

9. The method according to any one of claims 1 to 8, wherein the target image carries a device identification of a target image acquisition device, and the target image is acquired by the target image acquisition device; and the step of identifying the target environment category corresponding to the target image comprises: Based on a pre-established matching relationship between a device identification of an image acquisition device and an environment category, an environment category matching the device identification of the target image acquisition device is determined, and the environment category matching the device identification of the target image acquisition device is determined as the target environment category corresponding to the target image. The matching relationship between the device identification of the image acquisition device and the environment category is an environment category determined based on color characteristics of the ambient light scene in the environment where the image acquisition device is located, and a matching relationship between the device identification and the environment category is established.

10. The method according to claim 9, further comprising: Acquire an environment image acquired by an image acquisition device, wherein the image acquisition device has a corresponding device identification; Extracting color features of the environment image; Inputting the color features of the environment image into a pre-acquired image classification model to obtain an environment category corresponding to the environment image output by the image classification model; A matching relationship is established between the environment category corresponding to the environment image and the device identification of the image acquisition device.

11. The method according to claim 10, further comprising: Determining whether the environmental image has ambient light interference according to the color characteristics of the environmental image, wherein the environmental image is acquired by a corresponding image acquisition device; When it is determined that the environmental image has ambient light interference, returning application adjustment parameters for the ambient light interference to the image acquisition device corresponding to the environmental image, so as to instruct the image acquisition device to adjust parameters according to the application adjustment parameters; The environment image captured again by the image capture device after adjusting the application adjustment parameters is acquired, and the color features of the environment image captured again are extracted.

12. The method according to claim 11, wherein determining whether the environmental image has ambient light interference according to the color characteristics of the environmental image comprises: Acquire brightness information and color noise of the environment image according to the color characteristics of the environment image, wherein the brightness information includes an overall brightness parameter of the environment image or brightness distribution of pixels in the environment image; When the overall brightness parameter of the environmental image is less than a preset brightness threshold, the brightness distribution of pixels in the environmental image does not belong to the target distribution, or the color noise of the environmental image is greater than or equal to a preset color noise threshold, it is determined that the environmental image has ambient light interference.

13. The method according to any one of claims 1 to 12, further comprising: Determining whether the target image has ambient light interference according to the color characteristics of the target image, wherein the target image is acquired by a corresponding image acquisition device; When it is determined that the target image has ambient light interference, returning application adjustment parameters for the ambient light interference to the image acquisition device corresponding to the target image, so as to instruct the image acquisition device to adjust parameters according to the application adjustment parameters; A target image captured again by the image capture device after adjusting the application adjustment parameters is obtained, and a color feature of the target image captured again is extracted.

14. The method according to claim 13, wherein determining whether the target image has ambient light interference according to the color feature of the target image comprises: Acquire brightness information and color noise of the target image according to the color characteristics of the target image, wherein the brightness information of the target image includes an overall brightness parameter of the target image or brightness distribution of pixels in the target image; When the overall brightness parameter of the target image is less than a preset brightness threshold, the brightness distribution of the pixels in the target image does not belong to the target distribution, or the color noise of the target image is greater than or equal to any of the preset color noise thresholds. If one of the above is true, it is determined that the target image is interfered by ambient light.

15. The method according to any one of claims 1 to 14, further comprising: Acquire a sample image set, the sample image set comprising a plurality of sample images and environment category labels of the sample images, the environment category labels being determined according to an ambient light scene where a device collecting the sample images is located, the environment category labels comprising a white light category label, a dark light category label, and a stray light category label; Extracting color features of the sample image; According to the color features of each of the sample images, calling the initial classification model to classify each of the sample images to obtain a predicted environment category of each of the sample images; The initial classification model is trained according to the environmental category label of each sample image and the predicted environmental category to obtain the image classification model.

16. The method according to any one of claims 1 to 15, wherein the target image comprises an infrared image and a color image; the acquiring a target identity recognition algorithm matching the target image based on the target environment category, performing identity recognition on the target image according to the target identity recognition algorithm, and obtaining an identity recognition result of the object to be recognized comprises: If the target environment category is a white light category, performing a first recognition on the color image to obtain a first recognition result, and performing a second recognition on the infrared light image to obtain a second recognition result; The first recognition result and the second recognition result are equally weighted to obtain an identity recognition result of the object to be recognized.

17. The method according to any one of claims 1 to 16, wherein the target image comprises an infrared image and a color image; and the step of acquiring a target identity recognition algorithm matching the target image based on the target environment category, and performing identity recognition on the target image according to the target identity recognition algorithm to obtain an identity recognition result of the object to be recognized comprises: If the target environment category is a stray light category, obtaining the brightness of the color image; Determining a first recognition weight of the color image and a second recognition weight of the infrared light image according to the brightness of the color image; Performing a first recognition based on the color image to obtain a first recognition result, and performing a second recognition based on the infrared light image to obtain a second recognition result; An identity recognition result of the object to be recognized is obtained according to the first recognition result and the first recognition weight of the color image, and the second recognition result and the second recognition weight of the infrared light image.

18. The method according to any one of claims 1 to 17, wherein the target image comprises an infrared image; the step of acquiring a target identity recognition algorithm matching the target image based on the target environment category, and performing identity recognition on the target image according to the target identity recognition algorithm to obtain an identity recognition result of the object to be recognized comprises: If the target environment category is a dark light category, Perform identity recognition on the infrared light image to obtain an identity recognition result of the object to be recognized.

19. The method according to any one of claims 1 to 18, wherein the identity recognition method is applied to a resource transfer scenario; The acquiring of the target image comprises: Obtain a resource transfer request, and call an image acquisition device to acquire a target image of the resource object to be transferred, wherein the target image includes a palm image of the resource object to be transferred; The method further comprises: When the identity identification result indicates that the identity identification of the resource object to be transferred is successful, a resource transfer operation is performed based on the resource transfer request.

20. An identity recognition device, comprising: An acquisition module, used for acquiring a target image, wherein the target image includes an image formed by at least a part of the object to be identified; An environment recognition module, used for extracting color features of the target image; Based on the color features of the target image, identifying the target environment category corresponding to the target image, where different environment categories are used to represent different ambient light scenes; and The identity recognition module is used to obtain a target identity recognition algorithm that matches the target image based on the target environment category, perform identity recognition on the target image according to the target identity recognition algorithm, and obtain an identity recognition result of the object to be recognized, wherein different environment categories correspond to different identity recognition algorithms.

21. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 19 when executing the computer program.

22. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 19.

23. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 19.

Citation Information

Patent Citations

  • Identity card authenticity recognition method, device and device, and storage medium

    CN111046899A

  • Object color recognition method and device, electronic equipment and storage medium

    CN111476849A

  • Image acquisition detection method and device, electronic equipment and storage medium

    CN112752031A

  • Target identification method and device, computer equipment and storage medium

    CN115620253A

  • Image recognition processing method and device, computer equipment and storage medium

    CN117558025A