Ambient light compensation method and device, biological information acquisition equipment and storage medium

By building a lamp group in the biological information acquisition device, ambient light color and color offset values ​​are analyzed in real time, compensating the compensation light color and brightness parameters, and directly compensating the ambient light, the problem of poor color harmony effect caused by ambient light changes is solved, and the accuracy and recognition efficiency of the acquisition image are improved.

CN120259612APending Publication Date: 2025-07-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410026033.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-03
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

When the ambient light changes in existing biological information acquisition equipment, the color tone of the image color adjustment model becomes worse, resulting in a deviation from the target color of the collected image, affecting the recognition accuracy.

Method used

By building a light group in the biological information acquisition device, we detect the shooting of environmental images when the object is approaching, analyze the color information to determine the original light color and color offset, calculate the compensated light color and brightness adjustment parameters, and directly compensate the ambient light to avoid relying on the training model.

Benefits of technology

It improves the accuracy and efficiency of ambient light compensation, reduces dependence on model training, saves costs, and ensures that the image background color is close to the target color, improving the accuracy of biometric information recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259612A_ABST
    Figure CN120259612A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of photoelectronics, in particular to an ambient light compensation method and device, biological information acquisition equipment and a storage medium, and aims to improve the accuracy of ambient light compensation. The method comprises the steps that when the distance between an object and a distance sensor is smaller than a preset threshold value, an environment image is shot; based on color information in the environment image, determining an original light color and a color cast value of the current environment light; based on the original light color and a preset target light color of target ambient light, determining a compensation light color corresponding to the current ambient light; determining a light brightness adjustment parameter based on the compensation light color and the color cast value; and performing light compensation on the current ambient light by adopting the compensation light color based on the light brightness adjustment parameter. Since the ambient light is directly compensated instead of adjusting the bottom color of the image, a model does not need to be trained, and various different ambient lights can be accurately compensated.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the continuous development of technology, payment methods are also constantly changing. Nowadays, electronic payment has gradually entered the public's vision. People can complete transactions safely and quickly through methods such as mobile phone scanning code, Near Field Communication (NFC), face brushing, fingerprint brushing, palmprint brushing, etc. Among them, the payment methods of face brushing, fingerprint brushing, and palmprint brushing do not require remembering passwords and do not require the payer to use devices such as cards or mobile phones. One can complete the transaction simply by providing face, fingerprint, or palmprint information in front of the corresponding biometric information collection device.

[0003] In related technologies, biometric information collection devices usually use image sensors to collect images of faces, fingerprints, or palm prints. After that, in order to avoid the influence of ambient light on the collection results, it is often necessary to use a pre-trained image color adjustment model to perform color adjustment on the collected images to adjust the background color of the collected images from the ambient color to the target color. For example, it is adjusted to white. However, the image color adjustment model is usually trained based on the color of a fixed ambient light, and it only has good color adjustment ability for the collected images obtained under this fixed ambient light. If the ambient light changes, its color adjustment effect will become worse, and the adjustment result of the model for the original background color of the image will deviate from the target color.

[0004] In summary, how to improve the adjustment effect for ambient light is an urgent problem to be solved. Summary of the Invention

[0005] Embodiments of the present application provide a method, device, biometric information collection device, and storage medium for compensating ambient light to improve the accuracy of ambient light compensation.

[0006] A method for compensating ambient light provided by embodiments of the present application includes:

[0007] When the distance between the object and the distance sensor is less than a preset threshold, capture an ambient image;

[0008] Based on the color information in the ambient image, determine the original light color and color deviation value of the current ambient light, where the color deviation value represents the color distribution state of the original light color in the color gamut;

[0009] Based on the original light color and the target light color of the preset target ambient light, determine the compensation light color corresponding to the current ambient light;

[0010] Based on the compensation light color and the color deviation value, determine the light brightness adjustment parameter;

[0011] Based on the light brightness adjustment parameter, use the compensation light color to perform light compensation on the current ambient light.

[0012] An ambient light compensation device provided by an embodiment of the present application includes:

[0013] A shooting unit, configured to shoot an environmental image when the distance between an object and a distance sensor is less than a preset threshold;

[0014] A first determination unit, configured to determine the original light color and color deviation value of the current ambient light based on the color information in the environmental image, where the color deviation value represents the color distribution state of the original light color in the color gamut;

[0015] A second determination unit, configured to determine the compensation light color corresponding to the current ambient light based on the original light color and the target light color of a preset target ambient light;

[0016] A third determination unit, configured to determine a light brightness adjustment parameter based on the compensation light color and the color deviation value;

[0017] A compensation unit, configured to perform light compensation on the current ambient light using the compensation light color based on the light brightness adjustment parameter.

[0018] Optionally, the first determination unit is specifically configured to determine the original light color of the current ambient light in the following manner:

[0019] Divide the environmental image into multiple image regions;

[0020] Based on the color channel information of each pixel in each image region respectively, determine the local color temperature value corresponding to the corresponding image region;

[0021] Based on the local color temperature values corresponding to each image region, determine the overall color temperature value corresponding to the environmental image;

[0022] Determine the original light color of the current ambient light based on the overall color temperature value.

[0023] Optionally, the first determination unit is specifically configured to determine the color deviation value of the current ambient light in the following manner:

[0024] Divide the environmental image into multiple image regions;

[0025] Based on the difference between the color channel information corresponding to each pixel in each image region respectively, determine the local color deviation value corresponding to the corresponding image region;

[0026] Based on the local color deviation values corresponding to each image region, determine the overall color deviation value corresponding to the environmental image;

[0027] Determine the overall color deviation value as the color deviation value of the current ambient light.

[0028] Optionally, the second determination unit is specifically configured to:

[0029] Determine a compensation color temperature value based on the difference between the overall color temperature value corresponding to the original light color and the target color temperature value corresponding to the target light color of the preset target ambient light;

[0030] Determine a compensation light color corresponding to the current ambient light based on the compensation color temperature value.

[0031] Optionally, the third determination unit is specifically configured to:

[0032] Obtain a supplementary light ratio based on the overall deviation between each local color deviation value and the maximum local color deviation value;

[0033] Determine the light brightness adjustment parameter based on the supplementary light ratio and the compensation color temperature value corresponding to the compensation light color; the compensation color temperature value is determined based on the overall color temperature value corresponding to the original light color and the target color temperature value corresponding to the target light color of the preset target ambient light.

[0034] Optionally, the first determination unit is further configured to:

[0035] Based on the color channel information of each pixel in the environmental image, determine at least one of the pixel color temperature value and the pixel color deviation value corresponding to the corresponding pixel;

[0036] Based on at least one of the pixel color temperature value and the pre-divided color temperature value intervals, and the pixel color deviation value and the pre-divided color deviation value intervals, aggregate the pixels belonging to the same interval into a pixel group;

[0037] Based on the number of pixels in each pixel group and the color classification corresponding to each pixel group, determine the reference light color of the current ambient light;

[0038] The second determination unit is further configured to:

[0039] Determine a compensation light color corresponding to the current ambient light based on the reference light color, the original light color, and the target light color of the preset target ambient light.

[0040] Optionally, the device further includes:

[0041] An adjustment unit, configured to periodically detect the ambient light and obtain the corresponding light brightness adjustment parameter and compensation light color;

[0042] Adjust the light brightness adjustment parameter and the compensation light color based on the difference between the original light color of the currently detected ambient light and the original light color of the previously detected ambient light.

[0043] A biological information collection device provided by an embodiment of the present application includes a processor and a memory. Among them, the memory stores a computer program. When the computer program is executed by the processor, the processor executes the steps of any one of the above ambient light compensation methods.

[0044] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program runs on a biological information collection device, the computer program is used to make the biological information collection device execute the steps of any one of the above ambient light compensation methods.

[0045] An embodiment of the present application provides a computer program product. The computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium. When the processor of a biological information collection device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the biological information collection device executes the steps of any one of the above ambient light compensation methods.

[0046] The beneficial effects of the present application are as follows:

[0047] An embodiment of the present application provides a method, device, biological information collection device and storage medium for compensating ambient light. Since the biological information collection device proposed in the present application is built-in with at least one lamp group and can emit lights of different colors, it is possible to analyze the color information in the image by obtaining the surrounding environment image when an object is detected approaching, so as to determine the original light color of the current ambient light. Further, according to the original light color and the target light color, the compensation light color that the lamp group needs to emit is determined, so as to realize the adjustment of the ambient light. Compared with the method of directly adjusting the color of the collected image through a model, the method proposed in the present application does not need to spend a lot of manpower and material resources to adjust the model parameters, saving costs.

[0048] Furthermore, the method proposed in the present application is not limited by the training samples during the training process of the model, that is, it will not only have a good adjustment effect on one kind of ambient light limited by the training samples, and there will be a deviation in the adjustment when the ambient light changes. Instead, it can accurately determine the corresponding compensation light for all colors of the environment, improving the color harmony effect.

[0049] In addition, this application not only needs to determine the light color of the compensation light, but also further determines the brightness of the compensation light. Compensating the current ambient light from both aspects of light color and brightness can make the compensation result more accurate. Assuming the target light color is white, under the adjustment of the compensation light to the current ambient light, the background color of the captured image is closer to white.

[0050] Other features and advantages of this application will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing this application. The objectives and other advantages of this application can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings. Brief Description of the Drawings

[0051] The drawings described herein are used to provide a further understanding of this application, and constitute a part of this application. The schematic embodiments and descriptions of this application are used to explain this application, and do not constitute an improper limitation to this application. In the drawings:

[0052] Figure 1 It is a logical schematic diagram of the training and application process of an image color adjustment model in a related technology provided by an embodiment of this application;

[0053] Figure 2 It is a schematic diagram of the application scenario of a method for compensating ambient light provided by an embodiment of this application;

[0054] Figure 3 It is the overall flowchart of a method for compensating ambient light provided by an embodiment of this application;

[0055] Figure 4 It is a schematic diagram of an environment image captured provided by an embodiment of this application;

[0056] Figure 5 It is a top view of a lighting compensation module provided by an embodiment of this application;

[0057] Figure 6 It is a schematic diagram of the structure of a semiconductor light-emitting diode provided by an embodiment of this application;

[0058] Figure 7 It is a schematic diagram of the three primary colors provided by an embodiment of this application;

[0059] Figure 8 It is a schematic diagram of the compensation of ambient light provided by an embodiment of this application;

[0060] Figure 9 It is the overall flowchart of another method for compensating ambient light provided by an embodiment of this application;

[0061] Figure 10Schematic diagram of the composition structure of an ambient light compensation device provided by an embodiment of the present application;

[0062] Figure 11 Schematic diagram of a hardware composition structure of a biological information acquisition device provided by an embodiment of the present application. Specific implementation manners

[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some, but not all, of the embodiments of the technical solutions of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments recorded in this application document without creative efforts shall fall within the scope of protection of the technical solutions of the present application.

[0064] Some concepts involved in the embodiments of the present application are introduced below.

[0065] Light color: The color of light. In the present application, it is mainly divided into the original light color, the target light color, and the compensation light color. Among them, the original light color is the original color of the current ambient light, the target light color is the ideal light color that needs to be achieved set in advance based on requirements, and the compensation light color is the color of the compensation light, and the compensation light is used to compensate (or adjust) the current ambient light.

[0066] Color information: Refers to color channel information. The color channel information in the environmental image can be the specific values of the three channels of red, green, and blue (English: Red Green Blue, RGB), or the values of hue, saturation, and value (English: Hue, Saturation, Value, HSV), etc.

[0067] The design concept of the embodiments of the present application is briefly introduced below:

[0068] With the continuous development of technology, biological information acquisition devices have gradually come into the public eye due to their convenience. Biological information acquisition devices can collect human faces, fingerprints, or palm prints through image sensors and extract the features therein to achieve the identification of human identities. In addition, since the ambient light is often not in an ideal state (the ideal state depends on the actual situation and can be white for example), and in order to accurately extract the features of human faces, fingerprints, or palm prints, the image often needs to be processed to make the background color of the image close to the target background color.

[0069] In the related art, a trained image color adjustment model is usually used to perform color blending on the collected image to adjust the background color of the collected image from the ambient color to the target color, such as Figure 1As shown in the figure, it is a logical schematic diagram of the training and application process of an image color adjustment model in a related technology provided by an embodiment of the present application. In the early stage, environmental light samples are collected to train and test the image color adjustment model, and the model parameters are adjusted. After that, the trained model is put into application. The model adjusts the background color of the captured image with biological information, such as a palmprint image, a face image, etc., to the target color to obtain the target image. However, in this method, the sample is usually an environmental light sample of a single fixed color, and the trained model only has good color harmonization ability for the captured images obtained under this fixed environmental light. If the environmental light changes, its color harmonization effect will become worse, and the adjustment result of the model for the original background color of the image will deviate from the target color.

[0070] Based on this, an embodiment of the present application provides a method, a device, a biological information collection device, and a storage medium for compensating environmental light. Since the biological information collection device proposed in the present application is built-in with at least one lamp group that can emit lights of different colors, environmental light can be directly compensated instead of adjusting the color of the captured image. Specifically, when the present application detects that an object is approaching, it obtains the surrounding environmental image, analyzes the color information in the image to determine the original light color of the current environmental light, and further determines the compensation light color that the lamp group needs to emit according to the original light color and the target light color, so as to realize the adjustment of the environmental light; compared with the method of directly adjusting the color of the captured image through the model, the method proposed in the present application does not need to spend a lot of manpower and material resources to adjust the model parameters, saving costs.

[0071] Furthermore, the method proposed in the present application is not limited by the training samples in the training process of the model, that is, it will not only have a good adjustment effect on a kind of environmental light limited by the training samples. When the environmental light changes and the adjustment is biased, but can accurately determine the corresponding compensation light for all colors of the environment, improving the color harmonization effect.

[0072] In addition, the present application not only needs to determine the light color of the compensation light, but also further determines the brightness of the compensation light, compensating the current environmental light from both the light color and the brightness aspects, which can make the compensation result more accurate. Assuming that the target light color is white, under the adjustment of the compensation light to the current environmental light, the background color of the captured image is closer to white.

[0073] The following describes the preferred embodiments of the present application with reference to the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. And without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[0074] As Figure 2As shown, it is a schematic diagram of the application scenario of the embodiment of the present application. The application scenario diagram includes two biometric collection devices 210 and a collection object 220.

[0075] In the embodiment of the present application, the biometric collection device 210 includes, but is not limited to, a face recognition device, a palm brushing device, a fingerprint recognition device, etc., and can collect biometric information of the collection object 220; the biometric collection device 210 is equipped with a processor that can collect biometric information and perform ambient light compensation.

[0076] It should be noted that the ambient light compensation method in each embodiment of the present application can be executed by an electronic device, that is, this method can be executed independently by the biometric collection device 210. When the biometric collection device 210 is the execution subject, when it detects that the distance between the object and the distance sensor is less than a preset threshold, the biometric collection device 210 captures an ambient image to determine the original light color and color deviation value of the current ambient light based on the color information in the ambient image. Then, the biometric collection device 210 determines the compensation light color of the compensation light corresponding to the current ambient light based on the original light color and the target light color of the preset target ambient light; further, the biometric collection device 210 determines the light brightness of the compensation light according to the compensation light color and the color deviation value, and finally compensates the current ambient light according to the compensation light.

[0077] It should be noted that Figure 2 The illustration above is just an example. In fact, the number of biometric collection devices 210 and the number of collection objects are not limited and are not specifically defined in the embodiment of the present application.

[0078] In addition, the embodiment of the present application can be applied to various scenarios, including not only biometric information collection scenarios, but also, but not limited to, scenarios such as cloud technology, artificial intelligence, intelligent transportation, and assisted driving.

[0079] Next, in combination with the application scenario described above, refer to the accompanying drawings to describe the ambient light compensation method provided by the exemplary embodiment of the present application. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principle of the present application, and the embodiments of the present application are not limited in this regard.

[0080] Refer to Figure 3 As shown, it is a flowchart of the implementation of an ambient light compensation method provided by the embodiment of the present application. The specific implementation process of this method is as follows:

[0081] S301: When the distance between the object and the distance sensor is less than a preset threshold, the biometric information collection device captures an ambient image.

[0082] Among the above, different biometric information collection devices can respectively collect different information such as fingerprints, palm prints, and faces. The collected information can be used for identity verification, payment, work attendance checking, etc. In the following, this application will mainly take the palm-sweeping device for collecting palm prints as an example for illustration. However, the method proposed in this application is not only applicable to the palm-sweeping device, but also applicable to other eligible biometric information collection devices.

[0083] In the embodiment of this application, the biometric information collection device includes a distance sensor. When the distance sensor senses that the distance between it and an object reaches a predetermined range, that is, less than a preset threshold, it can trigger a signal to trigger the camera module in the biometric information collection device to capture an environmental image.

[0084] Among the above, the distance sensor can be an infrared distance sensor such as GP2Y0A21YK0F. This sensor can detect the distance through infrared rays and collect the data of the object from the distance sensor. Or it can also be an ultrasonic distance sensor, etc.; the camera module can be a camera, etc., and this application does not make specific limitations.

[0085] The preset threshold can be set relatively large, that is, when the palm is far from the palm-sweeping device, the shooting is triggered to capture as much environmental information as possible, so as to prevent most of the environmental information from being covered when the palm is too close to the camera module.

[0086] It should be noted that the setting of the above preset threshold is only for illustration, and it can be adjusted according to specific situations during actual setting. This application does not make specific limitations.

[0087] Taking a specific scenario as an example, assume that there is a palm-sweeping device in a certain shopping mall, which is used to determine the identity of the palm-sweeping object by recognizing the palm print and further complete the payment function. When the distance sensor detects that an object approaches and reaches the preset threshold, the camera module captures the surrounding environment to obtain an environmental image.

[0088] Taking an actual scenario as an example, as Figure 4 shown, it is a schematic diagram of capturing an environmental image provided by the embodiment of this application. Assume that there is a palm-sweeping device A in a certain shopping mall currently, and a certain collection object B conducts palm-sweeping payment through the palm-sweeping device A. The distance sensor built in the palm-sweeping device A is responsible for ranging. When it detects that an object (the palm of the collection object B) approaches and the distance gradually decreases to the preset threshold, the distance sensor sends a signal, and after receiving the signal, the camera module captures an environmental image.

[0089] S302: The biometric information collection device determines the original light color and color deviation value of the current ambient light based on the color information in the environmental image.

[0090] In the above, the color information refers to color channel information, such as the RGB color channel values, HSV values, etc. of each pixel in the environmental image. To better adapt to the changes in local colors in the environmental image, the processor of the biological information acquisition device can divide the environmental image into multiple image regions and calculate the original light color region by region. For example, it can be divided into 8×8 regions, or 16×16 regions, etc., which can be determined according to the specific situation. After that, the biological information acquisition device respectively determines the local color temperature value corresponding to the corresponding image region based on the color channel information of each pixel in each image region; and determines the overall color temperature value corresponding to the environmental image based on the local color temperature values corresponding to each image region; finally, determines the original light color of the current environmental light based on the overall color temperature value.

[0091] Specifically, taking the RGB color channel values as an example, for a certain region in the environmental image, obtain the RGB color channel values corresponding to each pixel respectively to calculate the average value of the red color channels of all pixels in this region The average value of the green color channels And the average value of the blue color channels The RGB color channel values of each pixel can be implemented through methods such as getPixel() of the Bitmap class; the calculation formula for the local color temperature value of this region is as follows:

[0092]

[0093] After that, the average value can be taken for the local color temperature values of all regions to obtain the overall color temperature value corresponding to the environmental image, that is, the original light color of the current environmental light.

[0094] In addition, RGB can also be converted to luminance, red-green, yellow-blue (Lab), and the local color temperature value can be calculated based on the luminance value, which is not specifically limited in this application.

[0095] In the above, after dividing the environmental image into multiple image regions, calculating the original light color region by region and then taking the average value can make the obtained original light color more accurate.

[0096] Similar to the color temperature value, in order to make the obtained color deviation value more accurate, it is also necessary to divide regions when obtaining the color deviation value. The color deviation value represents the color distribution state of the original light color in the color gamut, and can also be called color deviation. The processor of the biological information acquisition device divides the environmental image into multiple image regions; and respectively determines the local color deviation value corresponding to the corresponding image region based on the difference between the color channel information corresponding to each pixel in each image region; after that, determines the overall color deviation value corresponding to the environmental image based on the local color deviation values corresponding to each image region; and determines the overall color deviation value as the color deviation value of the current environmental light.

[0097] Specifically, still taking the RGB color channel values as an example, for a certain area in the environmental image, calculate the average value of the red color channels of all pixels in this area The average value of the green color channels And the average value of the blue color channels The calculation formula for the local color deviation value of this area is as follows:

[0098]

[0099] After that, the average value of the local color deviation values of all areas can be taken to obtain the overall color deviation value corresponding to the environmental image, that is, the color deviation value of the current ambient light

[0100] In addition, in addition to determining the original light color of the current ambient light through the color temperature value, the reference light color can also be determined based on the method of pixel color statistics. The reference light color can also reflect the color of the current ambient light to a certain extent. An optional implementation manner is that the bio-information acquisition device respectively determines at least one of the pixel color temperature value and the pixel color deviation value corresponding to the corresponding pixel based on the color channel information of each pixel in the environmental image; based on the pixel color temperature value and the pre-divided color temperature value intervals, and at least one of the pixel color deviation value and the pre-divided color deviation value intervals, aggregate the pixels belonging to the same interval into a pixel group; based on the number of pixels in each pixel group and the color classification corresponding to each pixel group, determine the reference light color of the current ambient light

[0101] Taking the color temperature value as an example, the bio-information acquisition device obtains the pixel color temperature values corresponding to each pixel in the environmental image; based on the pixel color temperature value and the pre-divided color temperature value intervals, aggregate the pixels belonging to the same interval into a pixel group; for example, it can be divided into three groups: red, green, and blue, and each group corresponds to a color temperature value interval. After that, calculate the number of pixels in each group, and take the color corresponding to the group with the largest number of pixels as the reference light color corresponding to the current ambient light. For example, if the number of pixels in the red group accounts for 50% or more of the total number of pixels, it can be determined that the red color is used as the reference light color, and the reference light color can also reflect the color of the current ambient light

[0102] It is also possible to directly use functions in the image processing library, such as CV.cvtColor(), to convert the image from the RGB color space to the HSV color space, extract the color information in the current environmental image based on the HSV values, and then use functions in the image processing library, such as CV.countNonZero(), to calculate the number of pixels in each color interval in the image. For example, it is divided into three color intervals: red, green, and blue, and further determine the proportion of the number of pixels in each interval

[0103] The reference light color is mainly determined by statistical proportion. Due to its relatively large range, the accuracy of the reference light color is lower compared to the method of directly determining the original light color through the color temperature value. However, it can be used as a reference and comparison to ensure that the difference between the original light color determined by the color temperature and the reference light color is within a certain range. It can also adjust the original light color obtained through the color temperature to a certain extent based on the reference light color to make the compensation accuracy higher.

[0104] It should be noted that the above color grouping situation is only an example in this application. The specific grouping can be adjusted according to actual needs, and this application does not make specific limitations.

[0105] Continuing with the assumption in S301, after the palm-sweeping device A captures the environmental image, it divides the environmental image into regions according to the length and width dimensions of the environmental image. Suppose it is divided into 64 regions of 8×8. For each region, based on the average value of the red color channel of each pixel therein the average value of the green color channel and the average value of the blue color channel the local color temperature value and local color deviation value of the corresponding region are obtained. The average value of the 64 local color temperature values is taken to obtain the overall color temperature value, and the average value of the 64 local color deviation values is taken to obtain the overall color deviation value.

[0106] S303: The biometric information collection device determines the compensation light color corresponding to the current ambient light based on the original light color and the target light color of the pre-set target ambient light.

[0107] The above target light color is an ideal light color preset based on specific requirements. Generally, images taken under the target light color of the set target ambient light can extract biometric information more accurately. However, due to external environmental influences, such as the presence of warm-colored lights around, or insufficient light and dimness in the room, etc., there is a difference between the original light color of the current ambient light and the ideal light color. Therefore, it is necessary to adjust the current ambient light through the compensation light, that is, to perform compensation, so that the original light color of the current ambient light plus the compensation light color of the compensation light can reach the target light color of the target ambient light.

[0108] An optional implementation manner is that the processor of the biometric information collection device determines the compensation color temperature value based on the difference between the overall color temperature value corresponding to the original light color and the target color temperature value corresponding to the target light color of the pre-set target ambient light; and determines the compensation light color corresponding to the current ambient light based on the compensation color temperature value.

[0109] Specifically, the specific calculation formula for the compensation color temperature value is as follows: Compensation color temperature value = Overall color temperature value - Target color temperature value. The target color temperature value represents the white balance color temperature expected to be achieved.

[0110] After that, the corresponding compensation light color is determined according to the compensated color temperature value, that is, the compensation light color of the compensation light.

[0111] In the biological information collection device proposed in this application, there is a light compensation module, such as Figure 5 shown, which is a top view of a light compensation module provided by an embodiment of this application. There is at least one lamp group in the light compensation module. As shown in the figure, there are 8 lamp groups. Each lamp group is internally provided with multiple semiconductor light-emitting diodes (English: Light Emitting Diode, LED), including at least one red LED, at least one green LED, and at least one blue LED. Different colors of compensation light can be obtained by adjusting the proportion of the luminous quantity of LEDs of different colors. That is, after obtaining the compensation light color of the compensation light, the luminous quantity of LEDs of different colors can be controlled to make the light compensation module emit the compensation light of the compensation light color.

[0112] In addition to the method of having a total of eight lamp groups above, with each lamp group containing multiple LEDs, 8 LED lamp beads can also be directly placed. Each lamp bead has two pins and is encapsulated with transparent resin. Each LED lamp bead is encapsulated with 3 chips for realizing color change, such as color change among red, green, and blue. There is a semiconductor element for controlling color change built-in, and it can directly realize the alternating color change among red, green, and blue when powered on, or the color change can be further controlled by the semiconductor element.

[0113] Such as Figure 6 shown, which is a structural schematic diagram of a semiconductor light-emitting diode provided by an embodiment of this application. The semiconductor light-emitting diode, that is, LED, is a light-emitting device made of semiconductor materials that directly converts electrical energy into light energy and converts electrical signals into optical signals. It mainly consists of a gold wire bonding part, a circular epoxy resin lens, positive and negative pins, a reflective cap, and an LED chip.

[0114] In addition, as mentioned in S402, the original light color obtained through the color temperature can be adjusted to a certain extent based on the reference light color of the current ambient light to make the compensation accuracy higher. That is, the biological information collection device can determine the compensation light color corresponding to the current ambient light based on the reference light color, the original light color, and the target light color of the preset target ambient light. In addition, a reference compensation color can be determined through the reference light color, and the reference compensation color is used as a comparison for the obtained compensation light color, and the obtained compensation light color is adjusted to a certain extent based on the reference compensation color.

[0115] The principle of obtaining the reference compensation color is to add or subtract lights of different colors to obtain white light, which can be divided into the following two situations:

[0116] Situation 1: Additive color mixing of the three primary colors, that is, based on the principle of additive color mixing of the three primary colors, such as Figure 7The following is a schematic diagram of the three primary colors provided by the embodiment of the present application. Since only black and white images can be displayed, each color is marked in the figure in text form. The three primary colors are red, green, and blue. The one-to-one mixing of red and green is yellow, the one-to-one mixing of red and blue is magenta, the one-to-one mixing of blue and green is cyan, and the one-to-one-to-one mixing of red, green, and blue is white. That is, by adding the three primary color lights of red, green, and blue, white light can be obtained. According to the reference light color of the current ambient light obtained previously, the ratio of the three colors of red, green, and blue LED lights required is calculated, and based on this, the corresponding LEDs are controlled to emit light; by superimposing the light of the three colors and the current ambient light, the target light color can be obtained.

[0117] Case 2: Subtractive mixing of complementary colors. That is, based on the principle of subtractive mixing of complementary colors, by subtracting the light of complementary colors, white light can be obtained. Taking blue and yellow as an example, blue and yellow are complementary colors. According to the reference light color of the current ambient light obtained previously, the ratio of the required blue LEDs and yellow LEDs is calculated, and based on this, the corresponding LEDs are controlled to emit light; by subtracting the light of blue and yellow, the target light color can be obtained.

[0118] Continuing with the assumption in S302, after obtaining the overall color temperature value and overall color deviation value of the current ambient light, the processor of the palm-sweeping device A subtracts the overall color temperature value from the target color temperature value corresponding to the target light color of the pre-set target ambient light to obtain the compensation color temperature value of the compensation light, and the compensation light color corresponding to the current ambient light can be determined based on the compensation color temperature value.

[0119] S304: The biometric information collection device determines the light brightness adjustment parameter based on the compensation light color and the color deviation value.

[0120] S305: The biometric information collection device uses the compensation light color to perform light compensation on the current ambient light based on the light brightness adjustment parameter.

[0121] In order to make the effect of supplementary light more natural and improve the accuracy of ambient light compensation, the present application not only needs to determine the compensation light color of the compensation light, but can also further determine the brightness of the compensation light according to the local color deviation values of each region in the ambient image.

[0122] An optional implementation manner is that the processor of the biometric information collection device obtains the supplementary light ratio based on the overall deviation between each local color deviation value and the maximum local color deviation value; and determines the light brightness adjustment parameter based on the supplementary light ratio and the compensation color temperature value corresponding to the compensation light color; the compensation color temperature value is determined based on the overall color temperature value corresponding to the original light color and the target color temperature value corresponding to the target light color of the pre-set target ambient light.

[0123] In the above, for a certain area in the environmental image, based on the quotient of its local color deviation value and the maximum local color deviation value among all areas, the local deviation between the local color deviation value of this area and the maximum local color deviation value is determined. Then, the mean value of the local deviations corresponding to each obtained area is taken to obtain the overall deviation. Finally, the overall deviation is used as the fill light ratio.

[0124] Furthermore, the fill light ratio can be multiplied by the compensation color temperature value to obtain a light brightness adjustment parameter. The compensation light color is used to determine the color of the compensation light, and the light brightness adjustment parameter is used to determine the brightness of the compensation light, that is, the luminous brightness of the LED in the biological information collection device. Specifically, the duty cycle of the pulse width modulation signal can be determined through the light brightness adjustment parameter to adjust the current or voltage parameter, and further realize the adjustment of the brightness of the LED.

[0125] Finally, the processor of the biological information collection device controls the number of lights emitted by LEDs of different colors, and controls the luminous brightness (i.e., luminous intensity) of the LEDs according to the light brightness adjustment parameter, so that the light compensation module emits compensation light.

[0126] In addition, the scheme introduced above is mainly that before the acquisition object approaches the biological information collection device and before information acquisition, the sensor sends a signal to make the camera module capture the environmental image, thereby triggering the compensation process, and using the compensation light to adjust the current environmental light; in addition, a period can be preset, so that the biological information collection device periodically detects the environmental light, and obtains the corresponding light brightness adjustment parameter and compensation light color; finally, based on the difference between the original light color of the currently detected environmental light and the original light color of the previously detected environmental light, the light brightness adjustment parameter and the compensation light color are adjusted. When the preset period is short enough, it is possible to detect the environmental light, and once it is found that the original light color of the current environmental light changes, the compensation light is adjusted to achieve adaptive compensation.

[0127] Continuing with the assumption in S303, after the palm brushing device A obtains the compensation light color of the compensation light, that is, the compensation color temperature value, it further determines the brightness of the compensation light according to the color deviation value; the palm brushing device A takes the mean value of the quotient of the local color deviation value of each area and the maximum local color deviation value among all areas as the fill light ratio, and multiplies the fill light ratio by the compensation color temperature value to obtain a light brightness adjustment parameter. The light brightness adjustment parameter can be used to adjust the current or voltage of the lamp group to achieve the adjustment of the brightness of the LED; finally, the processor of the palm brushing device A controls the number of lights emitted by LEDs of different colors, and controls the luminous brightness (i.e., luminous intensity) of the LEDs according to the light brightness adjustment parameter, so that the light compensation module emits compensation light. After the compensation light compensates the current environmental light, the background color of the picture taken by the palm brushing device A again is white.

[0128] As Figure 8As shown in the figure, it is a schematic diagram of the compensation of ambient light provided by the embodiment of the present application. Due to the influence of external stray light, there are often differences between the original light color of the ambient light and the target light color. When it is detected that the palm is approaching, the biometric information collection device controls the light compensation module to emit compensation light that can adjust the current ambient light according to the original light color of the current ambient light (stray light). The original light color of the current ambient light is superimposed on the compensation light color of the compensation light to accurately obtain the target light color, reducing the interference received by the biometric information collection device when performing biometric information recognition.

[0129] In summary, through the method proposed in the present application, the palm-sweeping background color (i.e., the target light color) can be uniformly set. Assuming it is set to white, before the collection object sweeps the palm and the palm approaches the device, when the distance sensor in the device detects that an object is approaching and the distance is less than the preset threshold, the camera module quickly captures the ambient image; the processor analyzes the current ambient light in the image and combines the color neutralization strategy to adjust the light emission color and brightness of the lamp group to compensate for the current ambient light, so that the background color of the captured image is white, reducing the image interference factor and further improving the palm-sweeping recognition accuracy.

[0130] Next, the flowchart of another ambient light compensation method of the present application will be introduced. An optional implementation method is that S301 to S305 can be implemented according to the flowchart as Figure 9 shown, including the following steps:

[0131] S901: When the biometric information collection device detects that the distance between the object and the distance sensor is less than the preset threshold, it captures the ambient image.

[0132] The distance sensor in the biometric information collection device sends a signal to the processor, and after receiving the signal, the processor controls the camera module to capture the ambient image.

[0133] S902: The biometric information collection device divides the ambient image into N regions based on the length and width dimensions of the ambient image.

[0134] S903: The biometric information collection device determines the local color temperature value corresponding to each region according to the color channel information of the pixels included in each region respectively.

[0135] Specifically, the biometric information collection device respectively obtains the average value of the red color channel of the pixels in each region the average value of the green color channel and the average value of the blue color channel and further takes the mean value as the local color temperature value of the corresponding region.

[0136] S904: The bioinformatics acquisition device determines the local color deviation values corresponding to each region respectively according to the color channel information of the pixels included in each region.

[0137] Similarly, the local color deviation value of a region is based on the average value of the red color channels of the pixels in that region the average value of the green color channels and the average value of the blue color channels obtained.

[0138] S905: The bioinformatics acquisition device takes the mean value of the local color temperature values corresponding to each region as the overall color temperature value, and takes the mean value of the local color deviation values corresponding to each region as the overall color deviation value.

[0139] S906: The bioinformatics acquisition device determines the compensation color temperature value based on the difference between the overall color temperature value and the target color temperature value corresponding to the target ambient light color preset in advance.

[0140] S907: The bioinformatics acquisition device obtains the fill light ratio based on the overall deviation between each local color deviation value and the maximum local color deviation value.

[0141] For a certain region in the environmental image, based on the quotient of its local color deviation value and the maximum local color deviation value among all regions, determine the local deviation between the local color deviation value of this region and the maximum local color deviation value. Then, take the mean value of the obtained local deviations corresponding to each region to obtain the overall deviation. Finally, take the overall deviation as the fill light ratio.

[0142] S908: The bioinformatics acquisition device determines the light brightness adjustment parameter based on the fill light ratio and the compensation color temperature value corresponding to the compensation light color.

[0143] Multiply the fill light ratio by the compensation color temperature value to obtain the light brightness adjustment parameter.

[0144] S909: The bioinformatics acquisition device performs light compensation on the current ambient light using the compensation light color based on the light brightness adjustment parameter.

[0145] Based on the same inventive concept, the embodiment of the present application also provides a compensation device for ambient light. As Figure 10 shown, it is a schematic structural diagram of the compensation device for ambient light, and may include:

[0146] The shooting unit 1001 is used to shoot an environmental image when the distance between the object and the distance sensor is less than a preset threshold;

[0147] The first determination unit 1002 is configured to determine the original light color and the color deviation value of the current ambient light based on the color information in the ambient image, where the color deviation value represents the color distribution state of the original light color in the color gamut;

[0148] The second determination unit 1003 is configured to determine the compensation light color corresponding to the current ambient light based on the original light color and the target light color of a preset target ambient light;

[0149] The third determination unit 1004 is configured to determine the light brightness adjustment parameter based on the compensation light color and the color deviation value;

[0150] The compensation unit 1005 is configured to perform light compensation on the current ambient light by using the compensation light color based on the light brightness adjustment parameter.

[0151] Optionally, the first determination unit 1002 is specifically configured to determine the original light color of the current ambient light in the following manner:

[0152] Divide the ambient image into multiple image regions;

[0153] Based on the color channel information of each pixel in each image region, determine the local color temperature value corresponding to the corresponding image region;

[0154] Based on the local color temperature values corresponding to the respective image regions, determine the overall color temperature value corresponding to the ambient image;

[0155] Determine the original light color of the current ambient light based on the overall color temperature value.

[0156] Optionally, the first determination unit 1002 is specifically configured to determine the color deviation value of the current ambient light in the following manner:

[0157] Divide the ambient image into multiple image regions;

[0158] Based on the difference between the color channel information corresponding to each pixel in each image region, determine the local color deviation value corresponding to the corresponding image region;

[0159] Based on the local color deviation values corresponding to the respective image regions, determine the overall color deviation value corresponding to the ambient image;

[0160] Determine the overall color deviation value as the color deviation value of the current ambient light.

[0161] Optionally, the second determination unit 1003 is specifically configured to:

[0162] Determine a compensation color temperature value based on the difference between the overall color temperature value corresponding to the original light color and the target color temperature value corresponding to the target light color of the pre-set target ambient light;

[0163] Determine a compensation light color corresponding to the current ambient light based on the compensation color temperature value.

[0164] Optionally, the third determination unit 1004 is specifically configured to:

[0165] Obtain a supplementary light ratio based on the overall deviation between each local color deviation value and the maximum local color deviation value;

[0166] Determine the light brightness adjustment parameter based on the supplementary light ratio and the compensation color temperature value corresponding to the compensation light color; the compensation color temperature value is determined based on the overall color temperature value corresponding to the original light color and the target color temperature value corresponding to the target light color of the pre-set target ambient light.

[0167] Optionally, the first determination unit 1002 is further configured to:

[0168] Based on the color channel information of each pixel in the environmental image, determine at least one of the pixel color temperature value and the pixel color deviation value corresponding to the corresponding pixel;

[0169] Based on at least one of the pixel color temperature value and the pre-divided color temperature value intervals, and the pixel color deviation value and the pre-divided color deviation value intervals, aggregate the pixels belonging to the same interval into a pixel group;

[0170] Based on the number of pixels in each pixel group and the color classification corresponding to each pixel group, determine the reference light color of the current ambient light;

[0171] The second determination unit 1003 is further configured to:

[0172] Based on the reference light color, the original light color, and the target light color of the pre-set target ambient light, determine a compensation light color corresponding to the current ambient light.

[0173] Optionally, the device further includes:

[0174] An adjustment unit 1006, configured to periodically detect the ambient light and obtain the corresponding light brightness adjustment parameter and compensation light color;

[0175] Based on the difference between the original light color of the currently detected ambient light and the original light color of the previously detected ambient light, adjust the light brightness adjustment parameter and the compensation light color.

[0176] For the convenience of description, the above parts are divided into various modules (or units) according to their functions and described separately. Of course, when implementing the present application, the functions of the various modules (or units) can be implemented in the same or multiple software or hardware.

[0177] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of that module or unit.

[0178] After introducing the ambient light compensation method and device of the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application will be introduced.

[0179] Those skilled in the art can understand that various aspects of the present application can be implemented as a system, a method, or a program product. Therefore, various aspects of the present application can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to as "circuit", "module", or "system" here.

[0180] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiments of the present application. In one embodiment, the electronic device can be a biometric information collection device such as a palm-sweeping device, a fingerprint recognition device, a face recognition device, etc., or other devices with biometric information collection functions. In this embodiment, the structure of the electronic device can be as Figure 11 shown, including components such as a distance sensor 1101, a camera module 1102, a light compensation module 1103, a processor 1104, a memory 1105, a display unit 1106, an audio circuit 1107, etc.

[0181] The distance sensor 1101 is used for ranging. Once it detects that an object is approaching and the distance is less than a preset threshold, it sends a signal to the processor 1104. After receiving the signal, the processor 1104 controls the camera module 1102 to capture an environmental image.

[0182] The imaging module 1102 can be a camera, etc. The camera can be one or multiple. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 1104 to convert it into a digital image signal.

[0183] The light compensation module 1103 is used to emit the required compensation light. Specifically, the processor 1104 determines the light emission ratio of the red, blue, and green LED lights in the light compensation module 1103 according to the compensation color temperature value of the obtained compensation light and the light brightness adjustment parameter, and adjusts the current or voltage according to the light brightness adjustment parameter to control the brightness of the LED lights, so as to make the light compensation module 1103 emit compensation light.

[0184] The memory 1105 can be used to store software programs and data. The processor 1104 executes various functions and data processing of the biometric information collection device 210 by running the software programs or data stored in the memory 1105. The memory 1105 can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0185] For some biometric information collection devices, there are also a display unit 1106 and an audio circuit 1107, such as a face-scanning device, a voice recognition device, etc. The display unit 1106 can be used to display the information input by the object or the information provided to the object, as well as the graphical object interface (GUI) of various menus of the biometric information collection device 210. Specifically, the display unit 1106 can include a display screen 11061 arranged on the front of the biometric information collection device 210. Among them, the display screen 11061 can be configured in the form of a liquid crystal display, a light-emitting diode, etc. The display unit 1106 can be used to display the training interface of the classification model in the embodiments of the present application, etc.

[0186] The display unit 1106 can also be used to receive the input digital or character information, and generate a signal input related to the object setting and function control of the biometric information collection device 210. Specifically, the display unit 1106 can include a touch screen 11062 arranged on the front of the biometric information collection device 210, which can collect the touch operations of the object on or near it, such as clicking buttons, dragging scroll boxes, etc.

[0187] Among them, the touch screen 11062 can be covered on the display screen 11061, or the touch screen 11062 and the display screen 11061 can be integrated to implement the input and output functions of the biometric information collection device 210. After integration, it can be abbreviated as a touch display screen. In this application, the display unit 1106 can display application programs and corresponding operation steps.

[0188] The audio circuit 1107, the speaker 11071, and the microphone 11072 can provide an audio interface between the object and the biometric information collection device 210. The audio circuit 1107 can transmit the electrical signal converted from the received audio data to the speaker 11071, and the speaker 11071 converts it into a sound signal for output. The biometric information collection device 210 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 11072 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1107 and then converted into audio data, and then the audio data is output, or the audio data is output to the memory 1105 for further processing.

[0189] The processor 1104 is the control center of the biometric information collection device 210, connecting various parts of the entire biometric information collection device 210 through various interfaces and lines. By running or executing the programs stored in the memory 1105, and calling the data stored in the memory 1105, it executes various functions of the biometric information collection device and processes data. In some embodiments, the processor 1104 may include one or more processing units; the processor 1104 can also integrate an application processor and a baseband processor. Among them, the application processor mainly processes the operating system, object interfaces, and application programs, etc., and the baseband processor mainly processes wireless communication. It can be understood that the above baseband processor may not be integrated into the processor 1104. In this application, the processor 1104 can run the operating system, application programs, object interface display, and touch response, as well as the training method of the classification model of the embodiments of this application. In addition, the processor 1104 is coupled to the display unit 1106.

[0190] In some possible implementation manners, various aspects of the ambient light compensation method provided in this application can also be implemented in the form of a program product, which includes a computer program. When the program product runs on an electronic device, the computer program is used to cause the electronic device to execute the steps in the ambient light compensation method according to various exemplary embodiments of this application described above in this specification. For example, the electronic device can execute the steps as shown in Figure 3 shown in.

[0191] The program product may employ any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0192] The program product of the embodiments of the present application may employ a portable compact disc read-only memory (CD-ROM) and include a computer program, and may be run on an electronic device. However, the program product of the present application is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0193] The readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a readable computer program. Such a propagated data signal may take many forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0194] The computer program contained on the readable medium may be transmitted by any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0195] The computer program for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The computer program may be executed entirely on the target electronic device, partially on the target electronic device, executed as a stand-alone software package, partially on the target electronic device and partially on a remote electronic device, or entirely on the remote electronic device or server. In the case of a remote electronic device, the remote electronic device may be connected to the target electronic device through any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external electronic device (e.g., connected through the Internet using an Internet service provider).

[0196] It should be noted that although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.

[0197] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution.

[0198] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) that contain computer-usable computer programs.

[0199] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0200] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0201] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable apparatus provide steps for realizing the functions specified in one process or a plurality of processes and / or blocks Figure 1 one process or a plurality of processes and / or blocks Figure 1 steps for realizing the functions specified in one block or a plurality of blocks.

[0202] Although the preferred embodiments of the present application have been described, additional changes and modifications can be made to these embodiments by those skilled in the art once they learn of the basic inventive concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications that fall within the scope of the present application.

[0203] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. A method for compensating ambient light, characterized in that Applied to a bioinformatics collection device, the method includes: When the distance between an object and a distance sensor is less than a preset threshold, capture an environmental image; Based on the color information in the environmental image, determine the original light color of the current ambient light and the color deviation value, where the color deviation value characterizes the color distribution state of the original light color in the color gamut; Based on the original light color and the target light color of a preset target ambient light, determine the compensation light color corresponding to the current ambient light; Based on the compensation light color and the color deviation value, determine the light brightness adjustment parameter; Based on the light brightness adjustment parameter, use the compensation light color to perform light compensation on the current ambient light.

2. The method according to claim 1, wherein, The original light color of the current ambient light is determined by the following method: Divide the environmental image into multiple image regions; Based on the color channel information of each pixel in each image region respectively, determine the local color temperature value corresponding to the corresponding image region; Based on the local color temperature values corresponding to each image region, determine the overall color temperature value corresponding to the environmental image; Based on the overall color temperature value, determine the original light color of the current ambient light.

3. The method according to claim 1, wherein The color deviation value of the current ambient light is determined by the following method: Divide the environmental image into multiple image regions; Based on the difference between the color channel information corresponding to each pixel in each image region respectively, determine the local color deviation value corresponding to the corresponding image region; Based on the local color deviation values corresponding to each image region, determine the overall color deviation value corresponding to the environmental image; Determine the overall color deviation value as the color deviation value of the current ambient light.

4. The method according to claim 2, wherein The determining the compensation light color corresponding to the current ambient light based on the original light color and the target light color of a preset target ambient light includes: Based on the difference between the overall color temperature value corresponding to the original light color and the target color temperature value corresponding to the target light color of a preset target ambient light, determine the compensation color temperature value; Based on the compensation color temperature value, determine the compensation light color corresponding to the current ambient light.

5. The method according to claim 3, characterized in that The determining the light brightness adjustment parameter based on the compensation light color and the color deviation value includes: Based on the overall deviation between each local color deviation value and the maximum local color deviation value, obtain the light supplement ratio; Based on the light supplement ratio and the compensation color temperature value corresponding to the compensation light color, determine the light brightness adjustment parameter; the compensation color temperature value is determined based on the overall color temperature value corresponding to the original light color and the target color temperature value corresponding to the target light color of a preset target ambient light.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Based on the color channel information of each pixel in the environmental image respectively, determine at least one of the pixel color temperature value and the pixel color deviation value corresponding to the corresponding pixel; Based on at least one of the pixel color temperature value and the pre-divided color temperature value intervals, and the pixel color deviation value and the pre-divided color deviation value intervals, aggregate the pixels belonging to the same interval into a pixel group; Based on the number of pixels in each pixel group and the color classification corresponding to each pixel group, determine the reference light color of the current ambient light; Determining a compensation light color corresponding to the current ambient light based on the original light color and a target light color of a preset target ambient light includes: Determining a compensation light color corresponding to the current ambient light based on the reference light color, the original light color, and a target light color of a preset target ambient light.

7. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Periodically detecting the ambient light and obtaining corresponding light brightness adjustment parameters and a compensation light color; Adjusting the light brightness adjustment parameters and the compensation light color based on a difference between the original light color of the currently detected ambient light and the original light color of the previously detected ambient light.

8. An ambient light compensation device, characterized in that, It includes: A photographing unit configured to photograph an ambient image when a distance between an object and a distance sensor is less than a preset threshold; A first determining unit configured to determine an original light color and a color deviation value of the current ambient light based on color information in the ambient image, the color deviation value characterizing a color distribution state of the original light color in a color gamut; A second determining unit configured to determine a compensation light color corresponding to the current ambient light based on the original light color and a target light color of a preset target ambient light; A third determining unit configured to determine a light brightness adjustment parameter based on the compensation light color and the color deviation value; A compensation unit configured to perform light compensation on the current ambient light using the compensation light color based on the light brightness adjustment parameter.

9. A biological information acquisition device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It includes a computer program, and when the computer program runs on a biometric information acquisition device, the computer program is used to cause the biometric information acquisition device to execute the steps of the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that, It includes a computer program stored in a computer-readable storage medium; when a processor of a biometric information acquisition device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the biometric information acquisition device to execute the steps of the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Intelligent compensation method for light emitting of lamp, intelligent compensation lamp and cooperative illumination system

    CN121692502A

  • Image redness correction method and device, medium and product

    CN122453679A