Image processing method, image processing apparatus, electronic device, computer-readable storage medium and computer program product

By predicting the light sensing parameter and calculating the color temperature error rate of the image, and updating the light sensing parameters to adjust the image, the color casting problem caused by inaccurate color temperature perception in the prior art is solved, and the accuracy of the image color temperature is improved.

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

Patent Information

Application Number
PCT/CN2024/123991
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-29
Filing Date
2024-10-10
Publication Date
2025-09-04

AI Technical Summary

Technical Problem

The prior art cannot accurately sense the color temperature of the light source of the image, resulting in color casting problems in images under high or low color temperature environments, reducing the authenticity of the image color temperature.

Method used

By predicting the light sensing parameter of the input image, determining the desired color temperature corresponding to the light sensing parameter, calculating the color temperature error rate, and updating the light sensing parameter based on the error rate, and image adjustment is performed to improve the color temperature accuracy.

Benefits of technology

In extreme color temperature environments, adjusting the image by updating the light sensing parameters can improve the accuracy of the image color temperature and reduce color deviation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024123991_04092025_PF_FP_ABST
    Figure CN2024123991_04092025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are an image processing method, an image processing apparatus, an electronic device, a computer-readable storage medium and a computer program product. The method comprises: performing illumination perception parameter prediction on an input image, and obtaining a first illumination perception parameter of the input image; from a correspondence between candidate illumination perception parameters and candidate expected color temperatures, determining an expected color temperature corresponding to the illumination perception parameter; determining the current color temperature of the input image, and determining a color temperature error rate of the input image on the basis of the expected color temperature and the current color temperature; updating the first illumination perception parameter on the basis of the color temperature error rate, and obtaining a second illumination perception parameter; and adjusting the input image by means of the second illumination perception parameter, and obtaining an adjusted input image.
Need to check novelty before this filing date? Find Prior Art

Description

Image processing method, image processing device, electronic device, computer-readable storage medium, and computer program product

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on and claims the priority of Chinese patent application with application number 2024102343527 and application date of February 29, 2024. The entire content of the Chinese patent application is hereby incorporated into this application by reference. Technical Field

[0003] The present application relates to artificial intelligence technology, and in particular to an image processing method, an image processing device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0004] With the rapid development of artificial intelligence technology, artificial intelligence plays an increasingly important role in image processing. The field of image processing includes the precise capture, calibration, and reproduction of image colors to ensure the accurate transmission of color information and the authenticity of visual effects. In current image processing, it is impossible to accurately estimate the color temperature of the image light source and perform color correction on the image. In high or low color temperature environments, especially under extreme color temperature conditions, challenges such as color cast problems are faced, which reduces the authenticity of image color temperature.

[0005] The related art lacks an effective solution for accurately perceiving color temperature and improving the accuracy of image color temperature in different color temperature scenes.

[0006] Summary of the Invention

[0007] Embodiments of the present application provide an image processing method, an image processing device, an electronic device, a computer-readable storage medium, and a computer program product, which can improve the accuracy of image color temperature.

[0008] The technical solution of the embodiment of the present application is implemented as follows:

[0009] An embodiment of the present application provides an image processing method, which is performed by an electronic device and includes:

[0010] Predicting light sensitivity parameters of an input image to obtain a first light sensitivity parameter of the input image;

[0011] Determining the desired color temperature corresponding to the candidate light sensitivity parameters from the corresponding relationship between the candidate light sensitivity parameters and the candidate desired color temperatures;

[0012] determining a current color temperature of the input image, and determining a color temperature error rate of the input image based on the expected color temperature and the current color temperature;

[0013] updating the first light sensitivity parameter based on the color temperature error rate to obtain a second light sensitivity parameter;

[0014] The input image is adjusted using the second light sensitivity parameter to obtain an adjusted input image.

[0015] An embodiment of the present application provides an image processing device, including:

[0016] a light sensitivity prediction module, configured to predict light sensitivity parameters of an input image to obtain a first light sensitivity parameter of the input image;

[0017] a color temperature error rate acquisition module configured to determine an expected color temperature corresponding to the light sensitivity parameter from a correspondence between the candidate light sensitivity parameter and the candidate expected color temperature; determine a current color temperature of the input image, and determine a color temperature error rate of the input image based on the expected color temperature and the current color temperature;

[0018] The image update module is configured to update the first light sensitivity parameter based on the color temperature error rate to obtain a second light sensitivity parameter; and adjust the input image according to the second light sensitivity parameter to obtain an adjusted input image.

[0019] An embodiment of the present application provides an electronic device, including:

[0020] a memory for storing computer-executable instructions;

[0021] The processor is used to implement the image processing method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.

[0022] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the image processing method provided in the embodiment of the present application when executed by a processor.

[0023] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions. When the computer program or computer-executable instructions are executed by a processor, the image processing method provided in the embodiment of the present application is implemented.

[0024] The embodiments of the present application have the following beneficial effects:

[0025] The light sensitivity parameters of the input image are predicted to obtain the first light sensitivity parameters of the input image. The expected color temperature corresponding to the light sensitivity parameters is determined from the correspondence between the candidate light sensitivity parameters and the candidate expected color temperatures. The color temperature error rate of the input image is determined based on the expected color temperature and the current color temperature. The first light sensitivity parameter is updated based on the color temperature error rate to obtain the second light sensitivity parameter. The input image is adjusted according to the second light sensitivity parameter to obtain the adjusted input image. In this way, by updating the first light sensitivity parameter, the color temperature of the input image in some extreme color temperature environments can be adjusted to improve the accuracy of the image color temperature. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] FIG1 is a schematic diagram of the structure of an image processing system architecture provided by an embodiment of the present application;

[0027] FIG2 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0028] FIG3A is a schematic diagram of a first flow chart of an image processing method provided in an embodiment of the present application;

[0029] FIG3B is a schematic diagram of a second flow chart of the image processing method provided in an embodiment of the present application;

[0030] FIG3C is a schematic diagram of a third flow chart of the image processing method provided in an embodiment of the present application;

[0031] FIG3D is a schematic diagram of a fourth flow chart of the image processing method provided in an embodiment of the present application;

[0032] FIG3E is a schematic diagram of a fifth flow chart of the image processing method provided in an embodiment of the present application;

[0033] FIG3F is a sixth flow chart of the image processing method provided in an embodiment of the present application;

[0034] FIG3G is a seventh flow chart of the image processing method provided in an embodiment of the present application;

[0035] FIG3H is a schematic diagram of an eighth flow chart of the image processing method provided in an embodiment of the present application;

[0036] FIG3I is a ninth flow chart of the image processing method provided in an embodiment of the present application;

[0037] FIG3J is a schematic diagram of the tenth flow chart of the image processing method provided in an embodiment of the present application;

[0038] FIG3K is a schematic diagram of an eleventh flow chart of the image processing method provided in an embodiment of the present application;

[0039] FIG4 is a schematic diagram of a palm image correction process according to an embodiment of the present application;

[0040] FIG5 is a schematic diagram of a camera collector provided in an embodiment of the present application;

[0041] FIG6 is a schematic diagram of palm prints to be collected according to an embodiment of the present application;

[0042] FIG7 is a diagram showing a data enhancement principle according to an embodiment of the present application;

[0043] FIG8 is a block schematic diagram provided in an embodiment of the present application;

[0044] FIG9 is a schematic diagram of a model construction provided in an embodiment of the present application;

[0045] FIG10 is a diagram showing a parameter update principle according to an embodiment of the present application;

[0046] FIG11 is a schematic diagram of ambient color temperature perception estimation provided by an embodiment of the present application.

[0047] It should be pointed out that the above-mentioned "first" and "second" are only used to distinguish different solutions, and do not represent the degree of distinction between the advantages and disadvantages of the solutions or the priority in the implementation process. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0049] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0050] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0051] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and 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 processing circuits or memories) 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 part of an overall module or unit that includes the function of the module or unit.

[0052] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant national laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.

[0053] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0054] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0055] 1) Light sensitivity parameters are used to adjust the color temperature of the image. By adjusting the color temperature of the image, the color differences caused by the ambient light temperature are balanced, so that white objects can be correctly presented as white regardless of the lighting conditions.

[0056] 2) Color temperature, which is used to describe the color of the light source. That is, when a black body is heated to different temperatures, it will emit light of different colors. The unit of color temperature is Kelvin (K).

[0057] 3) Color space: This is used to describe and represent the colors of an image. Different color spaces have different color ranges and applications. Depending on the application scenario, color spaces include: Red-Green-Blue (RGB), Hue-Saturation-Valence (HSV), Illuminance-Chroma (Lab), and Color-Valence (YUV).

[0058] 4) Mapping: Mapping the input data to a latent space, which usually has a lower dimension and can represent some implicit pattern of the original data.

[0059] 5) Remapping: Mapping the latent vector back to the original data space to generate an output similar to the input data. The latent vector is a sample obtained by sampling in the latent space.

[0060] 6) White balance is a concept in photography and image processing. The main function of white balance is to ensure that white or gray objects in photos taken under different light sources can appear truly white or gray, rather than being affected by the color temperature of the ambient light and having color cast.

[0061] In related technologies, color temperature adjustment is performed based on a camera module (Image Signal Processor, ISP), which cannot accurately perceive the ambient color temperature and uses constant light sensing parameters to cover all color temperature scenes, resulting in color cast problems at some high or low color temperatures.

[0062] Based on the above analysis, the applicant found that the related art method of color correction of images through constant light parameters cannot improve the accuracy of image color temperature. To address the above problem, the embodiments of the present application provide an image processing method, device, electronic device, computer-readable storage medium and computer program product, which can improve the accuracy of image color temperature.

[0063] The image processing method described in the embodiments of the present application can be applied to various fields, such as palm color temperature correction, facial color temperature correction, and professional photography. That is, the image processing method in the embodiments of the present application is not limited to a certain field.

[0064] The following describes an exemplary application of the electronic device provided in the embodiment of the present application. The device provided in the embodiment of the present application can be implemented as a terminal or a server. The following describes an exemplary application when the device is implemented as a server.

[0065] Refer to Figure 1, which is a schematic diagram of the image processing system architecture provided in an embodiment of the present application. In order to support an image processing application, a terminal (terminal 400 is shown as an example) is connected to a server 200 via a network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0066] Terminal 400 is used to send input data to server 200 through network 300. Server 200 is used to predict light sensitivity parameters of the input image to obtain a first light sensitivity parameter of the input image, determine the expected color temperature corresponding to the light sensitivity parameter from the correspondence between the candidate light sensitivity parameters and the candidate expected color temperature, determine the current color temperature of the input image, and determine the color temperature error rate of the input image based on the expected color temperature and the current color temperature, update the first light sensitivity parameter based on the color temperature error rate to obtain a second light sensitivity parameter, adjust the input image according to the second light sensitivity parameter, and return the adjusted input image to terminal 400. Terminal 400 displays the adjusted input image through a graphical interface 410.

[0067] Next, an example of image processing performed by terminal 400 will be described.

[0068] In some embodiments, the terminal 400 can independently complete image processing tasks. For example, the terminal 400 is used to predict the light sensitivity parameters of the input image, obtain the first light sensitivity parameter of the input image, determine the expected color temperature corresponding to the light sensitivity parameter from the correspondence between the candidate light sensitivity parameters and the candidate expected color temperature, determine the current color temperature of the input image, and determine the color temperature error rate of the input image based on the expected color temperature and the current color temperature, update the first light sensitivity parameter based on the color temperature error rate, obtain the second light sensitivity parameter, adjust the input image according to the second light sensitivity parameter, and display the adjusted input image through the graphical interface 410.

[0069] In one implementation scenario, the server or terminal can predict the light sensitivity parameters of the facial image to obtain the first light sensitivity parameter of the facial image, determine the expected color temperature corresponding to the light sensitivity parameter from the correspondence between the candidate light sensitivity parameters and the candidate expected color temperature, determine the current color temperature of the facial image, and determine the color temperature error rate of the facial image based on the expected color temperature and the current color temperature, update the first light sensitivity parameter based on the color temperature error rate to obtain the second light sensitivity parameter, adjust the facial image according to the second light sensitivity parameter, and obtain the adjusted facial image.

[0070] In one implementation scenario, the server or terminal can predict the light sensitivity parameters of a palm image to obtain a first light sensitivity parameter of the palm image, determine the expected color temperature corresponding to the light sensitivity parameter from the correspondence between the candidate light sensitivity parameters and the candidate expected color temperature, determine the current color temperature of the palm image, and determine the color temperature error rate of the palm image based on the expected color temperature and the current color temperature, update the first light sensitivity parameter based on the color temperature error rate to obtain a second light sensitivity parameter, adjust the palm image according to the second light sensitivity parameter, and obtain an adjusted palm image.

[0071] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0072] The terminal 400 may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, intelligent voice interaction device, smart home appliance, vehicle-mounted terminal, aircraft, etc., but is not limited thereto. The terminal and the server may be connected directly or indirectly via wired or wireless communication, which is not limited in the embodiments of the present application.

[0073] Referring to Figure 2, Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 500 shown in Figure 2 can be the terminal 400 or the server 200 in Figure 1. The electronic device 500 includes: at least one processor 510, a memory 550, and at least one network interface 520. The various components in the server 200 are coupled together via a bus system 540. It can be understood that the bus system 440 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus system 540 in Figure 2.

[0074] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0075] The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls;

[0076] In some embodiments, when the terminal 400 independently completes the image processing task, the server 200 provided in the embodiment of the present application does not include the user interface 530 .

[0077] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, a hard drive, an optical drive, etc. The memory 550 may optionally include one or more storage devices physically located away from the processor 510.

[0078] The memory 550 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.

[0079] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0080] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0081] A network communication module 552 for reaching other computing devices via one or more (wired or wireless) network interfaces 520 , exemplary network interfaces 520 including Bluetooth, Wireless LAN (WiFi), and Universal Serial Bus (USB);

[0082] a presentation module 553 for enabling presentation of information via one or more output devices 531 (e.g., a display screen, a speaker, etc.) associated with the user interface 530 (e.g., a user interface for operating peripheral devices and displaying content and information);

[0083] In some embodiments, when the image processing task is completed independently by the terminal 400, the server 200 provided in the embodiment of the present application may not include the presentation module 553.

[0084] The input processing module 554 is used to detect one or more user inputs or interactions from one of the one or more input devices 532 and translate the detected inputs or interactions; in some embodiments, when the embodiment independently completes the image processing task by the terminal 400, the server 200 provided in the embodiment of the present application may not include the presentation module 553.

[0085] In some embodiments, the apparatus provided in the embodiments of the present application can be implemented using software. FIG2 shows an image processing apparatus 555 stored in a memory 550. This apparatus can be software in the form of a program or plug-in, and includes the following software modules: a light perception prediction module 5551, a color temperature error rate acquisition module 5552, and an image update module 5553. These modules are logical and can be arbitrarily combined or further separated according to the functions implemented. The functions of each module will be described below.

[0086] In other embodiments, the apparatus provided in the embodiments of the present application may be implemented in hardware. As an example, the apparatus provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the image processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor may be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0087] It should be noted that in the following image processing examples, those skilled in the art may apply the image processing method provided in the embodiments of the present application to image processing based on their understanding of the following.

[0088] Refer to Figure 3A, which is a first flow chart of the image processing method provided in an embodiment of the present application. It will be explained in conjunction with the steps shown in Figure 3A. The image processing method provided in an embodiment of the present application can be implemented by a server or a terminal alone, or by a server and a terminal in collaboration. The following will be explained using the collaborative implementation of the server and the terminal as an example.

[0089] In step 101, light sensitivity parameters of an input image are predicted to obtain a first light sensitivity parameter of the input image.

[0090] In some embodiments, depending on the actual application scenario, the input image can be an image containing arbitrary content related to the application scenario. Light sensitivity parameters are used to adjust the color balance of the image, ensuring that white objects appear white under different lighting conditions and that objects of other colors appear their true colors. Light sensitivity parameters are used to characterize the gain of each channel of the input image. Light sensitivity parameter prediction involves mapping the input image and determining the light sensitivity parameters based on the mapping result. The light sensitivity parameters can be represented as the reciprocal of the pixel values ​​of the mapping result. Alternatively, the light sensitivity parameters are obtained by taking a weighted sum of the reciprocal pixel values ​​of the mapping result.

[0091] For example, the light sensitivity parameter is expressed as a color gain of [1.2, 1, 1.5] in the red, green, and blue (RGB) color space, where 1.2 is the color gain of the input image in the red channel, 1 is the color gain of the input image in the green channel, and 1.5 is the color gain of the input image in the blue channel. The input image (for example, [R, G, B]) can be color corrected based on the light sensitivity parameter to obtain the adjusted input image [1.2*R, 1*G, 1.5*B].

[0092] In some embodiments, referring to FIG. 3B , FIG. 3B is a second flow chart of the image processing method provided in an embodiment of the present application. Step 101 shown in FIG. 3A can be implemented through steps 1011 to 1013 of FIG. 3B , which will be described in detail below.

[0093] In step 1011, the input image is mapped to obtain the probability distribution of the input image in the latent space.

[0094] In some embodiments, the probability distribution of the input image in the latent space may be a Gaussian distribution. The latent space refers to a low-dimensional space, and a point in the latent space may represent a compressed representation of the original high-dimensional image data (such as an RGB image).

[0095] In some embodiments, the input image is encoded to obtain encoded features, and the encoded features are mapped based on the fully connected layer of the encoder to obtain the mean and variance of the input image in the latent space, thereby obtaining the Gaussian distribution of the input image in the latent space, that is, the probability distribution of the input image in the latent space. The Gaussian distribution of an image refers to the distribution characteristics of the image pixel intensity values ​​that conform to or approximate a Gaussian distribution (also known as a normal distribution). By understanding and utilizing the Gaussian distribution characteristics of an image, image analysis and processing can be more efficient.

[0096] In step 1012, latent space samples are sampled from the latent space, and the latent space samples are remapped to obtain prediction features corresponding to the input image.

[0097] Among them, the latent space samples conform to the probability distribution of the input image in the latent space.

[0098] In some embodiments, a noise vector is randomly sampled from a standard normal distribution, and then transformed using the mean and variance of the input image in the latent space to obtain a latent space sample, and the latent space sample is remapped based on the decoder to obtain a predicted feature corresponding to the input image, wherein the predicted feature has the same dimension as the input image.

[0099] In step 1013 , a first light sensitivity parameter of the input image is determined based on the predicted feature corresponding to the input image.

[0100] In some embodiments, the light sensitivity parameter of the predicted feature is determined as the first light sensitivity parameter of the input image.

[0101] In some embodiments, the following processing is performed for each color channel in the color space corresponding to the predicted feature, see Figure 3C, Figure 3C is a third flow chart of the image processing method provided in an embodiment of the present application, and step 1013 shown in Figure 3B can be implemented through steps 10131A to 10133A of Figure 3C, which are described in detail below.

[0102] In step 10131A, a first probability distribution of the prediction feature in each color channel is determined, where the first probability distribution is used to characterize the proportion of pixels with different pixel values ​​in each color channel in the pixels of the prediction feature.

[0103] In some embodiments, the proportion of pixels with different pixel values ​​in all pixels of the predicted feature is determined in each color channel to obtain a first probability distribution corresponding to each color channel.

[0104] For example, taking the red (R) color channel of the input image as an example, the value of the red channel of the input image is [[0, 1], [1, 2]], and the number of pixels with different pixel values ​​is counted. The number of pixel values ​​with a value of 0 is 1, the number of pixel values ​​with a value of 1 is 2, and the number of pixel values ​​with a value of 2 is 1. The proportion of pixels with different pixel values ​​in the pixels of the predicted features is [0.25, 0.5, 0.25].

[0105] In step 10132A, the pixel value with the maximum probability in the first probability distribution corresponding to each color channel is determined as the target pixel value.

[0106] For example, taking the red color channel of the input image as an example, the first probability distribution of the red color channel is obtained as [0.25, 0.5, 0.25], the pixel value with the maximum probability is obtained as 1, and the value 1 is determined as the target pixel value.

[0107] In step 10133A, the inverse of the target pixel value is determined as the first light sensitivity parameter of the input image.

[0108] For example, taking the red color channel of the input image as an example, the target pixel value of the red color channel is 0.8, and the reciprocal of the target pixel value 1.25 is determined as the third light sensitivity parameter of the input image in the red color channel.

[0109] In this embodiment, by mapping the input image to a Gaussian distribution space, the image's light sensitivity parameters can be more accurately predicted and adjusted. Under complex lighting conditions, different color channels may be affected to varying degrees. Determining the first light sensitivity parameters for each color channel helps improve color reproduction, avoid color deviation, and increase the accuracy of determining light sensitivity parameters.

[0110] In some embodiments, referring to FIG3D , FIG3D is a fourth flow chart of the image processing method provided in an embodiment of the present application. Step 1013 shown in FIG3B can be implemented through steps 10131B to 10134B of FIG3D , which will be described in detail below.

[0111] In step 10131B, the predicted features are mapped to obtain a second probability distribution of the input image.

[0112] The second probability distribution is used to represent the weight of the third light sensitivity parameter corresponding to each color channel of the input image.

[0113] In some embodiments, the second probability distribution of the input image is a proportion of the third light sensitivity parameter of each color channel.

[0114] For example, the predicted features are mapped, the predicted features are encoded to obtain encoded predicted features, and the encoded predicted features are mapped based on the fully connected layer to obtain the weights of the light perception parameters as [0.3, 0.2, 0.5].

[0115] In step 10132B, a target weight of the third light sensitivity parameter of the target color channel is determined from the second probability distribution.

[0116] In some embodiments, a preset target color channel (eg, a red color channel) is selected from color channels corresponding to the input image (eg, RGB channels of the input image in an RGB color space), where the target color channel is one of the color channels corresponding to the input image.

[0117] In step 10133B, the ratio of the preset parameter to the target weight is determined as the light sensitivity parameter coefficient.

[0118] In some embodiments, the ratio of the value 1 to the target weight is determined as the light sensitivity parameter coefficient.

[0119] In some embodiments, the following processing is performed for each color channel in the color space corresponding to the input image, see step 10134B, and the product of the light sensitivity parameter coefficient and the weight of the third light sensitivity parameter corresponding to each color channel is determined as the first light sensitivity parameter of the input image.

[0120] For example, the weight of the third light sensitivity parameter corresponding to each color channel is [0.3, 0.2, 0.5], and the third light sensitivity parameter coefficient when the target color channel is the blue color channel is 2. The light sensitivity parameter coefficient is multiplied by the weight of the third light sensitivity parameter corresponding to each color channel to obtain the first light sensitivity parameter of the input image [0.6, 0.4, 1].

[0121] Through the embodiments of the present application, latent space samples in the latent space are remapped, and the first light sensitivity parameter of the input image is determined based on the predicted features obtained by the remapping, so as to facilitate color temperature adjustment of the input image. The light sensitivity parameter of the input image is determined by weighted summing the light sensitivity parameters corresponding to different color channels, thereby improving the accuracy of the light sensitivity parameter determination.

[0122] Continuing to refer to FIG. 3A , in step 102 , the desired color temperature corresponding to the light perception parameter is determined from the correspondence between the candidate light perception parameters and the candidate desired color temperatures.

[0123] In some embodiments, the correspondence between the candidate light parameters and the candidate expected color temperatures may be linear or nonlinear, depending on the characteristics of the lighting equipment and the application scenario. The correspondence between the candidate light parameters and the candidate expected color temperatures is pre-set, and in the correspondence, the candidate light parameters and the candidate expected color temperatures are one-to-one corresponding. The expected color temperature is a color temperature pre-set according to the actual usage scenario, and the expected color temperature matches the requirements of the actual application scenario. For example: for lighting design in a general environment, the expected color temperature may be a color temperature close to natural light, such as 5000K to 6000K. The light in this color temperature range is close to the color temperature of midday sunlight and can provide clear visual effects. Images in this color temperature range can be more accurately recognized by the convolutional neural network model used for image processing.

[0124] In step 103 , the current color temperature of the input image is determined, and based on the expected color temperature and the current color temperature, the color temperature error rate of the input image is determined.

[0125] In some embodiments, the color temperature error rate can be the absolute difference or relative difference between the current color temperature and the expected color temperature. The absolute difference is the absolute value of the difference between the current color temperature and the expected color temperature, and the relative difference is the percentage of the absolute error between the current color temperature and the expected color temperature or the percentage of the mean square error between the current color temperature and the expected color temperature. The embodiment of the present application does not limit the method for obtaining the color temperature error rate.

[0126] In some embodiments, referring to FIG3E , which is a fifth flow chart of the image processing method provided in an embodiment of the present application, determining the current color temperature of the input image in step 103 of FIG3A can be implemented through steps 1031A to 1033A of FIG3E .

[0127] In step 1031A, the input image is converted from the current color space to the target color space to obtain a converted input image.

[0128] In some embodiments, the color space of an image refers to a mathematical model or coordinate system used to represent and store color information in an image. A color space defines how color is described digitally, including its composition, range, and representation. Different color spaces are suitable for different application scenarios and devices. Types of color spaces include: RGB color space, hue-saturation-value (HSV) color space, luminance-chromaticity (Lab) color space, and chromaticity-luminance (YUV) color space.

[0129] The current color space and the target color space are different. The current color space is determined by the camera used to capture the input image in the actual application scenario. For example, if the input image is captured by a red, green, and blue (RGB) camera, the current color space of the input image is the RGB color space. The target color space can be different depending on the application scenario.

[0130] For example, when the application scenario focuses more on the color of the input image, the input image is converted from the current color space to the hue-saturation-value (HSV) color space. When the application scenario focuses more on the brightness of the input image, the input image is converted from the current color space to the luminance-chromaticity (Lab) color space.

[0131] In step 1032A, color histogram statistics are performed on the converted input image to obtain a color histogram corresponding to the input image.

[0132] In some embodiments, the color histogram is used to represent the proportion of pixels of each color or pixels in a color range in the total number of pixels in the input image.

[0133] For example, consider an input image converted from its current color space to the HSV color space. The color values ​​H in the color space are quantized, dividing the continuous color values ​​into discrete intervals or "buckets." Each bucket represents a color range. During statistical analysis, the color value of each pixel in the image is assigned to a corresponding bucket. A color histogram is constructed based on the number of pixels in each bucket. A color range refers to the range of color values. The number of color ranges can be determined based on the application scenario. For example, each color component (red, green, and blue) in the RGB color space is divided into an equal number of intervals. Assuming there are five color ranges, each color channel is divided into five intervals. Colors are typically represented using 6-digit hexadecimal numbers. These five color ranges can be represented as: #000000 (black) to #323232, #323232 to #646464, #646464 to #989898, #989898 to #CCCCCC, and #CCCCCC to #FFFFFF (white).

[0134] Continuing with the above example, the value of the hue channel of the converted input image is [[0, 1], [1, 2]], and the number of pixels with different pixel values ​​is counted. The number of pixel values ​​with a value of 0 is 1, the number of pixel values ​​with a value of 1 is 2, and the number of pixel values ​​with a value of 2 is 1. The proportion of pixels with different pixel values ​​in the pixels of the converted input image is [0.25, 0.5, 0.25], that is, the color histogram is [0.25, 0.5, 0.25].

[0135] In step 1033A, the current color temperature corresponding to the peak value of the color histogram is determined from the correspondence between the candidate peak values ​​and the candidate color temperatures.

[0136] In some embodiments, the peak of the color histogram is the hue with the largest pixel proportion in the converted input image.

[0137] For example, taking the input image after converting it from the current color space to the HSV color space as an example, the correspondence between the hue and the color temperature of the color histogram of the converted input image is obtained. For example, when the hue is 0, the corresponding color temperature is 3000K, and when the hue is 30, the corresponding color temperature is 3500K. It is determined that the peak value of the color histogram is 30, that is, the hue has a value of 30. From the correspondence between hue and color temperature, it is obtained that the current color temperature corresponding to the peak value of the color histogram is 3500K.

[0138] In some embodiments, referring to FIG3F , which is a sixth flow chart of an image processing method provided in an embodiment of the present application, determining the color temperature error rate of the input image based on the desired color temperature and the current color temperature in step 103 of FIG3A can be implemented through steps 1031B to 1032B of FIG3F .

[0139] In step 1031B, the difference between the desired color temperature and the current color temperature is obtained.

[0140] For example, the expected color temperature is 3500K, the current color temperature is 3000K, and the difference between the expected color temperature and the current color temperature is determined to be 500K.

[0141] In step 1032B, a color temperature error rate of the input image is determined based on the difference.

[0142] In some embodiments, the color temperature error rate of the input image is determined by one of the following methods: the ratio of the difference value to the current color temperature is determined as the color temperature error rate of the input image; and the ratio of the square of the difference value to the square of the current color temperature is determined as the color temperature error rate of the input image.

[0143] For example, the current color temperature is 3000K, the difference between the expected color temperature and the current color temperature is determined to be 500K, and the ratio of the difference to the current color temperature, 0.6, is determined as the color temperature error rate of the input image, or the ratio of the square of the difference to the square of the current color temperature, 0.36, is determined as the color temperature error rate of the input image.

[0144] Through the embodiments of the present application, histogram statistics are performed on the image to obtain the current color temperature of the image, which can accurately perceive the ambient color temperature.

[0145] Continuing to refer to FIG. 3A , in step 104 , the first light perception parameter is updated based on the color temperature error rate to obtain a second light perception parameter.

[0146] For example, the second light sensitivity parameter is used to adjust the color temperature of the input image. The process of updating the first light sensitivity parameter based on the color temperature error rate is to determine an adjustment factor based on the color temperature error rate and use the product of the adjustment factor and the first light sensitivity parameter as the second light sensitivity parameter, or to determine a corresponding color temperature learning rate based on the color temperature error rate and update the first light sensitivity parameter based on the color temperature learning rate.

[0147] In some embodiments, referring to FIG. 3G , FIG. 3G is a seventh flow chart of the image processing method provided in an embodiment of the present application. Step 104 shown in FIG. 3A can be implemented through steps 1041A to 1044A of FIG. 3G , which will be described in detail below.

[0148] In step 1041A, when the color temperature error rate is greater than or equal to the color temperature threshold, the updated learning rate of the input image is determined to be the first learning rate.

[0149] In some embodiments, when the color temperature error rate is greater than or equal to the color temperature threshold, the color temperature of the current input image is significantly different from the expected color temperature. The current light sensitivity parameters of the current input image are adjusted through the first learning rate. Using a larger learning rate can increase the amplitude of the update of the current light sensitivity parameters of the current input image, thereby reducing the image color cast problem caused by the lower light sensitivity parameters.

[0150] For example, the color temperature error rate is 0.6 and the color temperature threshold is 0.5. Since the color temperature error rate is greater than the color temperature threshold, the update learning rate of the input image is determined to be a larger learning rate of 0.6.

[0151] In step 1042A, when the color temperature error rate is less than the color temperature threshold, the updated learning rate of the input image is determined to be the second learning rate.

[0152] In some embodiments, the second learning rate is smaller than the first learning rate. When the color temperature error rate is smaller than the color temperature threshold, the color temperature of the current input image is slightly different from the expected color temperature. The current light sensitivity parameters of the current input image are adjusted by the second learning rate. Using a smaller learning rate can reduce the amplitude of the update of the current light sensitivity parameters of the current input image.

[0153] For example, the color temperature error rate is 0.3, and the color temperature threshold is 0.5. Since the color temperature error rate is less than the color temperature threshold, the update learning rate of the input image is determined to be a smaller learning rate of 0.2.

[0154] In step 1043A, the current light perception parameter corresponding to the current color temperature is determined from the correspondence between the candidate color temperatures and the candidate light perception parameters.

[0155] For example, the correspondence between the candidate color temperature and the candidate light sensitivity parameter is obtained. For example, when the light sensitivity parameter is 0.7, the corresponding color temperature is 3000K, when the light sensitivity parameter is 0.8, the corresponding color temperature is 3500K, and the current color temperature is 3500K. It is determined that the current light sensitivity parameter corresponding to the current color temperature is 0.8.

[0156] In step 1044A, based on the updated learning rate of the input image and the current light sensitivity parameter, the first light sensitivity parameter is updated to obtain the second light sensitivity parameter.

[0157] In some embodiments, the update learning rate of the input image is used to control the step size of the light sensitivity parameter update. The larger the update learning rate, the faster the light sensitivity parameter is updated, and the smaller the update learning rate, the slower the light sensitivity parameter is updated.

[0158] In some embodiments, referring to FIG. 3H , FIG. 3H is an eighth flow chart of the image processing method provided in an embodiment of the present application. Step 1044A shown in FIG. 3G can be implemented through steps 10441A to 10442A of FIG. 3H , which will be described in detail below.

[0159] In step 10441A, the ratio of the difference between the light sensitivity parameter and the current light sensitivity parameter to the preset parameter is determined as the update step size.

[0160] In some embodiments, the update step size is used to dynamically adjust the light sensing parameter according to the change in the light sensing parameter and a preset parameter.

[0161] For example, the light sensitivity parameter is 1.2, the current light sensitivity parameter is 0.2, the preset parameter is 100, and the ratio of the difference between the light sensitivity parameter and the current light sensitivity parameter to the preset parameter is determined to be 0.01. 0.01 is determined as the update step size to achieve more precise adjustment of the light sensitivity parameter.

[0162] In some embodiments, a preset parameter is determined as the update step size.

[0163] In step 10442A, the product of the updated learning rate and the updated step size and the sum of the current light sensitivity parameter are determined as the second light sensitivity parameter.

[0164] For example, the current light sensitivity parameter is 0.2, the update step size is 0.01, and the update learning rate is 0.6. The sum of the product of the update learning rate and the update step size and the current light sensitivity parameter, 0.206, is determined as the second light sensitivity parameter.

[0165] Through the embodiments of the present application, the light sensing parameters are dynamically adjusted by adaptively updating the learning rate, so that the light sensing parameters converge to the optimal solution more quickly, thereby further improving the effect of light sensing parameter updating.

[0166] In some embodiments, referring to FIG3I , FIG3I is a ninth flow chart of the image processing method provided in an embodiment of the present application. Step 104 shown in FIG3A can be implemented through steps 1041B to 1042B of FIG3I , which will be described in detail below.

[0167] In step 1041B, the adjustment factor corresponding to the color temperature error rate is obtained from the correspondence between the candidate color temperature error rates and the candidate adjustment factors.

[0168] Among them, the adjustment factor is proportional to the color temperature error rate.

[0169] In some embodiments, the correspondence between the color temperature error rate and the adjustment factor is obtained. For example, when the color temperature error rate is 0.1, the corresponding adjustment factor is 1.10, and when the color temperature error rate is 0.2, the corresponding adjustment factor is 1.2. When the color temperature error rate increases, the adjustment factor is increased to correct the light perception parameters.

[0170] In step 1042B, the product of the adjustment factor and the first light sensitivity parameter is determined as the second light sensitivity parameter.

[0171] In some embodiments, the adjustment factor is used to reduce a color temperature error rate of an input image obtained by adjusting the input image based on the second light sensitivity parameter.

[0172] For example, if the current light sensitivity parameter is 0.6 and the adjustment factor is 1.12, then the second light sensitivity parameter is 0.6 multiplied by 1.12, that is, 0.672.

[0173] Through the embodiments of the present application, based on the correspondence between the candidate color temperature error rates and the candidate adjustment factors, the adjustment factor corresponding to the current color temperature error rate is determined to reduce the color temperature error rate of the image after the input image is adjusted based on the adjustment factor. The adjustment factor is determined through the correspondence between the color temperature error rate and the adjustment factor, and the product of the first light sensitivity parameter and the adjustment factor is used as the second light sensitivity parameter. This can improve the efficiency of calculating the second light sensitivity parameter and save computing resources.

[0174] Continuing to refer to FIG. 3A , in step 105 , the input image is adjusted using the second light sensitivity parameter to obtain an adjusted input image.

[0175] For example, the process of adjusting the input image refers to the process of adjusting the pixel values ​​of the pixels in the input image by using the second light sensitivity parameter.

[0176] In some embodiments, the following processing is performed for any domain, see Figure 3J, which is a tenth flow chart of the image processing method provided in an embodiment of the present application. Before step 105, steps 201 to 202 of Figure 3J are executed.

[0177] In step 201 , at least one neighbor image of an input image is acquired, and a second light sensitivity parameter of each neighbor image is determined.

[0178] In some embodiments, the neighbor image may be the previous and next frame images of the input image in a time series, or an image from a different perspective of the same scene as the input image. The embodiment of the present application does not limit the method for obtaining the neighbor image.

[0179] In some embodiments, the second light sensitivity parameter of each neighbor image is determined according to a method for acquiring the second light sensitivity parameter of the input image.

[0180] In step 202 , a weighted average is performed on the second light sensitivity parameter of the input image and the second light sensitivity parameter of each neighboring image to obtain a target light sensitivity parameter.

[0181] For example, taking the input image in the RGB color space as an example, the second light sensitivity parameter of the input image is [1.2, 1, 1.5], and the second light sensitivity parameter of the neighboring image is [1, 0.8, 1.3]. When the second light sensitivity parameter of the input image and the second light sensitivity parameter of the neighboring image have the same weight, that is, the weight of the second light sensitivity parameter of the input image and the weight of the second light sensitivity parameter of the neighboring image are both 0.5, the target light sensitivity parameter is [1.1, 0.9, 1.4].

[0182] Continuing with the above example, when the second light sensitivity parameter of the input image and the second light sensitivity parameter of the neighboring image have different weights, the weight of the second light sensitivity parameter of the input image is 0.4, and the weight of the second light sensitivity parameter of the neighboring image is 0.6, the target light sensitivity parameters are [1.08, 0.88, 1.38].

[0183] In some embodiments, the input image is adjusted using the target light sensitivity parameter to obtain an adjusted input image.

[0184] Following the above embodiment, the following processing is performed for each pixel of the input image, the product of the pixel and the target light sensitivity parameter is determined as the adjusted pixel, and each adjusted pixel is combined into the input image.

[0185] In some embodiments, the following processing is performed for each pixel of the input image, see Figure 3K, which is the eleventh flow chart of the image processing method provided in an embodiment of the present application. Step 105 shown in Figure 3A can be implemented through steps 1051 to 1052 of Figure 3K, which are described in detail below.

[0186] In step 1051 , the product of the pixel and the second light sensitivity parameter is determined as the adjusted pixel.

[0187] In some embodiments, the adjusted pixel is determined by multiplying the pixel value of each color channel by the third light sensitivity parameter corresponding to each color channel.

[0188] For example, the value of the pixel in the RGB color space is [10, 10, 20], and the third light sensitivity parameter corresponding to each color channel includes the third light sensitivity parameter of the red color channel 1.2, the third light sensitivity parameter of the green color channel 1, and the third light sensitivity parameter of the blue color channel 1.5. The adjusted pixel values ​​of each color channel of the pixel are 12, 10, and 15 respectively, and the adjusted pixel is [12, 10, 30].

[0189] In step 1052, each adjusted pixel is combined into an input image.

[0190] In some embodiments, the order in which pixels of the input image are combined is equivalent to the order in which each pixel is adjusted.

[0191] Through the embodiments of the present application, the light sensitivity parameters are continuously adjusted to cover the current color temperature scene, thereby avoiding color cast problems in the input image at some high color temperatures or low color temperatures.

[0192] In some embodiments, the image processing method provided in the embodiments of the present application can be implemented by a convolutional neural network. Before step 101, the following processing is performed: a sample image set is obtained, a convolutional neural network is trained based on the sample image set to obtain a trained convolutional neural network, the trained convolutional neural network is called to perform image processing based on a first verification image to obtain a second verification image, a red, green, and blue gain (RGB gain) value is determined based on the second verification image, and when the red, blue, and green gain value is less than a preset gain value, the convolutional neural network is retrained.

[0193] The convolutional neural network includes an image feature extraction layer, an encoder, and a decoder, which together form a light perception parameter prediction model. The image feature extraction layer can be composed of a lightweight convolutional neural network, which is used to determine the region of interest (ROI) in the input image. The encoder is used to determine the first light perception parameter of the ROI, and the decoder is used to determine the color temperature error rate and adjust the first light perception parameter to obtain the second light perception parameter.

[0194] For example, the parameter optimization method of a convolutional neural network can be to maximize the evidence lower bound (ELBO) of the marginal log-likelihood, by alternately optimizing the parameters of the encoder and decoder so that the generated distribution p(x|z) can be as close as possible to the posterior distribution q(z|x), thereby making the ELBO close to the true value of the marginal log-likelihood.

[0195] In some embodiments, the image processing method provided by the embodiments of the present application can be applied in the following scenarios:

[0196] 1. Make payments through biometrics. The biometrics can be a face, palm, or iris. After the terminal device captures the first biometric image, the first biometric image is processed using the image processing method provided in the embodiment of the present application, and the color temperature of the first biometric image is adjusted to obtain a second biometric image. The terminal device compares the second biometric image with the authenticated biometric corresponding to the payment account, and executes the payment operation when it determines that the biometric in the second biometric image is an authenticated biometric. By adjusting the color temperature of the first biometric image, users can accurately capture biometrics even in environments with poor color temperature, thereby improving payment efficiency.

[0197] 2. Use biometrics to scan the access control. The biometrics can be a face, palm, or iris. After the access control device collects the first biometric image, the first biometric image is processed by the image processing method provided in the embodiment of the present application, and the color temperature of the first biometric image is adjusted to obtain a second biometric image. The access control device compares the second biometric image with the registered biometrics stored in the database. When it is determined that the biometrics in the second biometric image are registered biometrics in the database, the user is released. The application scenarios of access control include but are not limited to night and dim places. By adjusting the color temperature of the first biometric image, the biometrics can be accurately collected even in the above-mentioned extreme color temperature environments, thereby improving the response efficiency of the access control device and facilitating use.

[0198] In an embodiment of the present application, light sensitivity parameters are predicted for an input image to obtain a first light sensitivity parameter of the input image. From the correspondence between the candidate light sensitivity parameters and the candidate expected color temperatures, the expected color temperature corresponding to the light sensitivity parameters is determined. Based on the expected color temperature and the current color temperature, the color temperature error rate of the input image is determined. Based on the color temperature error rate, the first light sensitivity parameter is updated to obtain a second light sensitivity parameter. The input image is adjusted using the second light sensitivity parameter to obtain an adjusted input image. In this way, by updating the first light sensitivity parameter, the color temperature of input images in some extreme color temperature environments can be adjusted to improve the accuracy of the image color temperature.

[0199] Below, an exemplary application of the image processing method provided in an embodiment of the present application in a practical application scenario will be described.

[0200] In related technologies, palm-scanning devices all adjust color temperature based on a camera module ISP, which cannot accurately perceive the ambient color temperature and uses a set of white balance parameters (i.e., light sensitivity parameters) to cover all color temperature scenes. As a result, the palm image will have color cast problems at some high or low color temperatures, making palm-scanning unusable.

[0201] In order to solve the above problems, an embodiment of the present application proposes an image processing method for improving the accuracy of the color temperature when brushing the palm. By integrating the neural convolution network and the ambient color temperature perception method on the basis of the white balance algorithm, the color temperature accuracy when brushing the palm is improved.

[0202] Taking palm brushing image correction as an example, refer to Figure 4, which is a schematic diagram of the palm brushing image correction process provided by an embodiment of the present application. The palm brushing image correction process provided by an embodiment of the present application is explained below.

[0203] In Figure 4, Figure 4 includes multiple modules for performing palm brush image correction in an embodiment of the present application, such as a data collection module 101, a data annotation module 102, a data preprocessing module 103, a model building module 104, an initialization weight module 105, a training model module 106, a model evaluation module 107, a hyperparameter adjustment module 108 and a prediction and application module 109, wherein the data collection module 101, the data annotation module 102, the data preprocessing module 103, the model building module 104, the initialization weight module 105, the training model module 106 and the model evaluation module 107 are used to generate light perception parameters and generate white balance parameters through a convolutional neural network. Each module is described in detail below.

[0204] 1) About Data Collection Module 101

[0205] The data collection module 101 is used to collect data. The data collection process is described in detail below.

[0206] First, determine the target gesture (such as the left hand or the right hand), collect a certain number of palm images, and use the camera collector to collect the palm prints to obtain palm images. The camera collector and the palm prints to be collected are respectively shown in Figures 5 and 6. Figure 5 is a schematic diagram of the camera collector provided in an embodiment of the present application; the camera collector includes the following components: 2*infrared lights 501, RGB light guide ring 502, infrared (IR) emission polarization zone 503, infrared (IR) red, green and blue (RGB) camera 504, infrared (IR) camera 505, infrared (IR) receiving polarization zone 506. Through the above components, the camera collector can be adapted to different environments. Figure 6 is a schematic diagram of the palm prints to be collected provided in an embodiment of the present application. Figure 6 shows at least part of the palm prints of a human palm.

[0207] Second, determine the negative sample gestures (for example, when the target gesture is the left hand, the corresponding right hand is the negative sample gesture; or when the target gesture is the right hand, the corresponding left hand is the negative sample gesture) and collect the same number of palm images as the target gesture.

[0208] Third, the collected palm images of the target gesture and the negative sample gesture are cleaned by using methods such as finding duplicate values, finding missing values, and finding outliers to remove invalid files. The embodiment of the present application does not limit the method of data cleaning.

[0209] 2) About Data Annotation Module 102

[0210] The data annotation module 102 is used to annotate the collected palm images to obtain annotated palm images.

[0211] 3) About the data preprocessing module 103

[0212] The data preprocessing module 103 is used to use signal data processing technology to obtain, process and extract meaningful features and attributes from the palm images collected by the data collection module 101, and input the extracted content into the model to train the model. The data preprocessing process is described in detail below.

[0213] First, a multi-scale retina (MSR) algorithm is used to perform data enhancement on the palm image to obtain an enhanced palm image, so as to improve the visual effect of the image and enhance the useful information in the image. See Figure 7, which is a data enhancement principle diagram provided in an embodiment of the present application.

[0214] For example, an original image 710 in a red, green, and blue (RGB) color space is obtained, and step 701 is performed based on the original image 710 to record the maximum value of the three red, green, and blue components in the original image as J.

[0215] That is, the maximum pixel value in the red, green and blue color channels of the original image is recorded, step 701 outputs an image 711 containing J, and step 702 is performed based on the image 711 containing J, and the image is processed by a multi-scale retinal (MSR) algorithm that uses average filtering instead of Gaussian convolution operation.

[0216] The maximum pixel value in the red, green, and blue color channels is used to normalize the image in the MSR image enhancement algorithm, ensuring greater stability and robustness when processing images with varying brightness ranges. Average filtering replaces Gaussian convolution, thereby increasing the computational speed of the MSR image enhancement algorithm. The MSR image enhancement algorithm is used to enhance the original image while simultaneously considering information at different scales, thereby more comprehensively enhancing the image quality and details. Step 702 outputs an output image 712 containing J.

[0217] In step 703 , a matrix including multiple correlation parameters is received. After step 703 , step 704 is performed based on the output image 712 including J, and red, green and blue channels are obtained based on the relative multiple parameters in the matrix of correlation parameters to determine the output image 713 .

[0218] Second, the palm image in the data collection module 101 is cleaned by median filtering. The specific method is to standardize the palm image and perform binarization processing on the standardized data.

[0219] Third, the palm image in the first step is divided into blocks and segments, see Figure 8, which is a block principle diagram provided in an embodiment of the present application. As shown in Figure 8, the palm image is divided into blocks with a certain window length 801 (adjustable, such as 5*5). The palm image contains the pixel value of each pixel, and the palm image is divided into several blocks and corresponding labels. Here, the block mechanism is trained using a network model.

[0220] To avoid the situation where a palm coordinate label affects label accuracy after extracting features from an entire palm image, for example, when a palm image contains different gestures, a voting mechanism is introduced. After training a network model, the input image is divided into weighted blocks. The network model here uses a lightweight convolutional network. The network model inputs the palm grayscale data value as a feature, and then passes it through an attention layer to finally output the palm region of interest (ROI).

[0221] With a resolution of 60x60, the Histogram of Directed Gradients (HOG) feature is extracted (this feature is more suitable for gesture detection). Here, the Sobel algorithm is used to extract the edge features of the palm image, as shown in formula (1) and formula (2).

[0222] Among them, I x and I y Represents the gradient values ​​in the horizontal and vertical directions, M(x, y) represents the magnitude of the gradient, and θ(x, y) represents the direction of the gradient.

[0223] Fourth, the HOG features extracted from each block are connected end to end and combined into a large one-dimensional vector. This is the final image feature, which can be input into the regression algorithm for training.

[0224] 4) About the model building module 104

[0225] The model construction module 104 is used to select two convolutional networks, namely the inference network (i.e., encoder) and the generation network (i.e., decoder), to construct the light perception parameter prediction model provided in the embodiment of the present application. See Figure 9, which is a schematic diagram of the model construction provided in the embodiment of the present application. A generation network that matches the current application scenario is selected from multiple generation networks (automatic white balance generation network 902A, incandescent white balance generation network (not shown in the figure), and shadow white balance generation network 903A). The generation network takes the latent vector z as input and outputs parameters p(x|z) for observing the conditional distribution. In addition, the latent vector z is modeled using a unit Gaussian prior p(z).

[0226] The generative network includes a fully connected layer followed by four convolutional transpose layers (deconvolution layers). The network architecture of the generative network is as follows: the first layer is the input layer; the second layer is the fully connected layer, and the activation function uses the rectified linear unit (ReLU); the third layer is the resampling layer, which reshapes the input features of the second layer (resharp) to obtain updated feature dimensions (batch_size, 7, 7, 32); the fourth layer is the deconvolution layer, which uses 64 convolution kernels with a convolution kernel size of 3x3, a stride of 2, padding of SAME, and an activation function of ReLU; the fifth layer is the deconvolution layer, which uses 32 convolution kernels with a convolution kernel size of 3x3, a stride of 2, padding of SAME, and an activation function of ReLU. e) is 2, padding is SAME, and the activation function is ReLU; the sixth layer is a deconvolution layer, using 16 convolution kernels, the convolution kernel size is 3x3, the stride is 2, the padding is the appropriate padding mode (SAME), and the activation function is ReLU; the seventh layer is a deconvolution layer, using 1 convolution kernel, the convolution kernel size is 3x3, the stride is 1, the padding is SAME, and the activation function is the linear function f(x).

[0227] The inference network 901A is used to obtain the posterior distribution q(z|x), which takes the observation value as input and outputs a set of parameters for the conditional distribution of the potential representation. The inference network 901A includes 3 convolutional layers + 1 fully connected network layer. The network architecture of the inference network 901A is as follows: the first layer is the input layer; the second layer is the convolutional layer, using 16 convolution kernels, the convolution kernel size is 3x3, the stride is 2, the padding is SAME, and the activation function is ReLU; the third layer is the convolutional layer, using 32 convolution kernels, the convolution kernel size is 3x3, the stride is 2, the padding is SAME, and the activation function is ReLU; the fourth layer is the convolutional layer, using 64 convolution kernels, the convolution kernel size is 3x3, the stride is 2, the padding is SAME, and the activation function is ReLU; the fifth layer is the fully connected layer.

[0228] 5) About initializing weight module 105

[0229] The weight initialization module 105 is used to initialize the weights with a random value less than the weight threshold to avoid output saturation caused by weight values ​​greater than the weight threshold when the model starts training. The methods for initializing the weights include zero initialization (initializing all weights to zero) and random number initialization (initializing the weights to a random value less than the weight threshold, usually from a uniform distribution or a normal distribution) and other weight initialization methods. This application does not limit the selection of the method for initializing the weights.

[0230] 6) About the training model module 106

[0231] The training model module 106 is used to start training based on the model selected in the model construction module 104 and the parameters and data required to meet the network model. Batch normalization is avoided during training because the use of small batch processing will cause additional randomness, thereby exacerbating the instability of random sampling. The model training process is described in detail below.

[0232] First, define the model's loss function and optimizer.

[0233] Second, training is performed by maximizing the Evidence Lower Bound (ELBO) of the marginal log-likelihood, as shown in formula (3).

[0234] The model is trained starting with an iterative dataset. During each iteration, images are passed to the inference network to obtain a set of mean and log-variance parameters that approximate the posterior q(z|x). The mean and variance are used to reduce oscillations. A reparameterization technique is applied to sample from q(z|x). The reparameterized samples are passed to the generator network to obtain the log-odds (logit) of the observed value of the generative distribution p(x|z), where the logit represents the sample input to the last fully connected layer of the generator network. Maximizing the evidence lower bound on the marginal log-likelihood is a method for approximating marginal log-likelihoods that cannot be directly calculated. Maximizing the evidence lower bound on the marginal log-likelihood can be used to optimize model parameters. By alternately optimizing the encoder and decoder parameters to make the generated distribution p(x|z) as close as possible to the posterior distribution q(z|x), the ELBO is then approximated to the true value of the marginal log-likelihood.

[0235] 7) About Model Evaluation Module 107

[0236] The model evaluation module 107 is used to input the input image into the model for generating pictures that has been trained by the training model module 106, sample a set of latent vectors z from the unit Gaussian prior distribution p(z), and generate a network to convert the latent vectors into the logit of the observed values ​​to obtain the probability distribution p(x|z), and use the probability distribution p(x|z) as the red, green, and blue gain (RGB gain) of the white balance parameter (light sensitivity parameter) corresponding to the input picture.

[0237] 8) About Hyperparameter Adjustment Module 108

[0238] The hyperparameter adjustment module 108 is used to update the white balance parameters of the image. See FIG10 , which is a diagram showing the parameter update principle according to an embodiment of the present application.

[0239] As shown in FIG10 , in step 901, the automatic white balance parameters (AWB) in the image signal processor (ISP) in the camera are initialized. The white balance parameters are used to restore the white image formed under ambient light of different color temperatures to true white (usually the white observed by the human eye under natural daylight) through a certain algorithm.

[0240] In step 902, the input image is subjected to block histogram color temperature statistics, the input image is passed through the model evaluation module 107 to obtain white balance parameters, and the input image is input into the ambient color temperature perception estimation module 1101. In the ambient color temperature perception estimation module 1101, the block histogram color temperature statistics of the input image in step 902 and the color temperature error rate of each channel in step 903 are obtained.

[0241] 9) Regarding the ambient color temperature perception estimation module 1101

[0242] The ambient color temperature perception estimation module 1101 is used to obtain the current color temperature of the image. See Figure 11, which is a schematic diagram of the ambient color temperature perception estimation provided by an embodiment of the present application. Unlike the traditional grayscale world assumption and white point estimation, the ambient color temperature perception estimation module 1101 performs color temperature estimation based on color constancy, by simulating the color constancy characteristics of the human visual system, that is, maintaining stable perception of color under different lighting conditions. The process of the ambient color temperature perception estimation module 1101 is described in detail below.

[0243] Step 1101: color space conversion.

[0244] Convert the image from its original color space (usually RGB) to a color space that is more suitable for white balance processing, such as the coordinate (XYZ) color space or the illuminance chromaticity (Lab) color space developed by the International Commission on Illumination (CIE). The method for converting an image in the HSV color space to the RGB color space is shown in the following formula (4).

[0245] f=(H / 60)-I

[0246] a=V*(1-S)

[0247] b=V*(1-S*f)

[0248] c=V*(1-S*(1-f))

[0249] R=V, G=c, B=a; ifi=0

[0250] R=b, G=V, B=a; ifi=1

[0251] R=a, G=V, B=c; ifi=2

[0252] R=a, G=b, B=V; ifi=3

[0253] R=c, G=a, B=V; ifi=4

[0254] R=V, G=a, B=b; ifi=5 (4)

[0255] Where i = get the integer of (H / 60), where i represents the rounded value of H / 60. In the hue-saturation-value (HSV) color space, hue (H) typically ranges from 0° to 360°, while saturation (S) and value (V) typically range from 0 to 1. Intermediate variables are calculated based on hue (H), saturation (S), and value (V), and the corresponding values ​​for each color channel in the red-green-blue (RGB) color space (red (R), green (G), and blue (B)) are obtained, enabling conversion from HSV color space to RGB color space. When the scene focuses on the image's color, the image is converted to HSV space. When the scene focuses on the image's brightness, the image is converted to Lab space.

[0256] Step 1102: Perform histogram color temperature statistics on the image.

[0257] The image is divided into 8*8 blocks, and the histogram color temperature statistics of the divided images are performed to estimate the color temperature of the light source of the current scene (current color temperature).

[0258] Step 1103: Count the color temperature error rate of each channel.

[0259] Based on the current color temperature and the white balance parameters of the input image obtained by the model evaluation module 107, the expected color temperature of the input image is determined according to the white balance parameters, and the color temperature error rate of each channel is counted based on the current color temperature and the expected color temperature.

[0260] Continuing with FIG10 , the color temperature error rates of N frames are determined as the frame color temperature error rate, where N is an integer greater than 1. The color temperature error rates of the N frames are weighted and summed to obtain the frame color temperature error rate. In step 904, the relationship between the frame color temperature error rate and the first threshold is determined. When the frame color temperature error rate is less than the first threshold, step 9041 is executed to determine the white balance model as the unchanged mode and maintain the current color temperature. When the frame color temperature error rate is greater than the first threshold, step 9042 is executed to determine whether the color temperature error rate of the image is greater than the first threshold. The relationship between the two thresholds is that when the color temperature error rate of the image is higher than the second threshold, step 90421 is executed to determine the white balance model as the slow mode, the corresponding color temperature parameters are adjusted, and the white balance parameter value corresponding to the white balance model in the slow mode is obtained. When the color temperature error rate of the image is less than the second threshold, step 90422 is executed to determine the white balance model as the fast mode, the corresponding color temperature parameters are adjusted, and the white balance parameter value corresponding to the white balance model in the fast mode is obtained. That is, when the color temperature error rate is larger, the white balance parameters are adjusted faster.

[0261] In step 905, the input image is updated based on the white balance parameter value in the white balance corresponding mode, and the error rate statistics are re-performed on the updated input image, and the color temperature error rates of multiple frame images are calculated to obtain the frame color temperature error rate. In step 906, the relationship between the frame color temperature error rate and the first threshold is determined. When the frame color temperature error rate is still greater than or equal to the first threshold, the N-frame statistics in step 907 are executed to determine the adjusted N frames of images, where N is a positive integer greater than 1. The color temperature of the N adjusted input images is re-adjusted until the frame color temperature error rate is determined to be less than the first threshold in the determination of the relationship between the frame color temperature error rate and the first threshold in step 906.

[0262] 10) About Application Module 109

[0263] The application module 109 is used to adjust the color temperature of the input data using the palm image correction method provided in the embodiment of the present application to obtain an adjusted input image, thereby further improving the accuracy of the image color temperature.

[0264] In summary, the embodiment of the present application performs histogram statistics on the input image to obtain the current color temperature corresponding to the input image, thereby improving the accuracy of estimating the current color temperature of the image, and continuously adjusting the white balance parameters. The adjusted white balance parameters can adjust the color temperature of the input data in extreme color temperature environments, covering a variety of color temperature scenarios, and improving the accuracy of the image color temperature.

[0265] The following further describes an exemplary structure of the image processing device 555 provided in an embodiment of the present application implemented as a software module. In some embodiments, as shown in FIG2 , the software modules stored in the image processing device 555 in the memory 550 may include:

[0266] The light sensitivity prediction module 5551 is configured to predict light sensitivity parameters of the input image to obtain a first light sensitivity parameter of the input image.

[0267] The color temperature error rate acquisition module 5552 is configured to determine the expected color temperature corresponding to the light sensitivity parameter from the correspondence between the candidate light sensitivity parameter and the candidate expected color temperature; determine the current color temperature of the input image, and determine the color temperature error rate of the input image based on the expected color temperature and the current color temperature.

[0268] The image updating module 5553 is configured to update the first light sensitivity parameter based on the color temperature error rate to obtain the second light sensitivity parameter; and adjust the input image according to the second light sensitivity parameter to obtain the adjusted input image.

[0269] In some embodiments, the light perception prediction module 5551 is further configured to map the input image to obtain a probability distribution of the input image in the latent space; sample latent space samples from the latent space, and remap the latent space samples to obtain prediction features corresponding to the input image, wherein the latent space samples conform to the probability distribution of the input image in the latent space; and determine a first light perception parameter of the input image based on the prediction features corresponding to the input image.

[0270] In some embodiments, the light perception prediction module 5551 is further configured to perform the following processing for each color channel in the color space corresponding to the predicted feature, determine the first probability distribution of the predicted feature in each color channel, the first probability distribution is used to characterize the proportion of pixels with different pixel values ​​in each color channel in the pixels of the predicted feature; determine the pixel value with the maximum probability in the first probability distribution corresponding to each color channel as the target pixel value; and determine the inverse of the target pixel value as the first light perception parameter of the input image.

[0271] In some embodiments, the light perception prediction module 5551 is further configured to map the predicted features to obtain a second probability distribution of the input image, wherein the second probability distribution is used to characterize the weight of the third light perception parameter corresponding to each color channel of the input image; determine the target weight of the third light perception parameter of the target color channel from the second probability distribution; determine the ratio of the preset parameter to the target weight as the light perception parameter coefficient; perform the following processing for each color channel in the color space corresponding to the input image, and determine the product of the light perception parameter coefficient and the weight of the third light perception parameter corresponding to each color channel as the first light perception parameter of the input image.

[0272] In some embodiments, the color temperature error rate acquisition module 5552 is further configured to convert the input image from the current color space to the target color space to obtain a converted input image; perform color histogram statistics on the converted input image to obtain a color histogram corresponding to the input image; and determine the current color temperature corresponding to the peak of the color histogram from the correspondence between the candidate peaks and the candidate color temperatures.

[0273] In some embodiments, the color temperature error rate acquisition module 5552 is further configured to obtain a difference between the desired color temperature and the current color temperature; and determine the color temperature error rate of the input image based on the difference.

[0274] In some embodiments, the color temperature error rate acquisition module 5552 is further configured to determine the color temperature error rate of the input image by one of the following methods: determining the ratio of the difference value to the current color temperature as the color temperature error rate of the input image; and determining the ratio of the square of the difference value to the square of the current color temperature as the color temperature error rate of the input image.

[0275] In some embodiments, the image update module 5553 is further configured to determine the update learning rate of the input image as a first learning rate when the color temperature error rate is greater than or equal to the color temperature threshold; determine the update learning rate of the input image as a second learning rate when the color temperature error rate is less than the color temperature threshold; determine the current light perception parameter corresponding to the current color temperature from the correspondence between the candidate color temperatures and the candidate light perception parameters; update the first light perception parameter based on the update learning rate of the input image and the current light perception parameter to obtain the second light perception parameter.

[0276] In some embodiments, the image update module 5553 is further configured to determine the ratio of the difference between the light sensitivity parameter and the current light sensitivity parameter to the preset parameter as the update step size; and determine the sum of the product of the update learning rate and the update step size and the current light sensitivity parameter as the second light sensitivity parameter.

[0277] In some embodiments, the image update module 5553 is further configured to obtain an adjustment factor corresponding to the color temperature error rate from the correspondence between the candidate color temperature error rate and the candidate adjustment factor, wherein the adjustment factor is proportional to the color temperature error rate; and determine the product of the adjustment factor and the first light perception parameter as the second light perception parameter.

[0278] In some embodiments, the image update module 5553 is further configured to perform the following processing on each pixel of the input image: determine the product of the pixel and the second light sensitivity parameter as the adjusted pixel; and combine each adjusted pixel into the input image.

[0279] In some embodiments, the image update module 5553 is further configured to obtain at least one neighbor image of the input image and determine the second light sensitivity parameters of each neighbor image; and perform weighted averaging on the second light sensitivity parameters of the input image and the second light sensitivity parameters of each neighbor image to obtain the target light sensitivity parameters.

[0280] In some embodiments, the image update module 5553 is further configured to adjust the input image using the target light sensitivity parameter to obtain an adjusted input image.

[0281] An embodiment of the present application provides a computer program product, which includes computer-executable instructions. The computer-executable instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device performs the image processing method described above in the embodiment of the present application.

[0282] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, which stores computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the image processing method provided by an embodiment of the present application, for example, the image processing method shown in Figures 3A to 3K.

[0283] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0284] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0285] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, e.g., in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0286] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.

[0287] To summarize, through the embodiment of the present application, the light sensitivity parameters of the input image are predicted to obtain the first light sensitivity parameters of the input image, and the expected color temperature corresponding to the light sensitivity parameters is determined from the correspondence between the candidate light sensitivity parameters and the candidate expected color temperature, and the color temperature error rate of the input image is determined based on the expected color temperature and the current color temperature, and the first light sensitivity parameter is updated based on the color temperature error rate to obtain the second light sensitivity parameter, and the input image is adjusted according to the second light sensitivity parameter to obtain the adjusted input image. In this way, by updating the first light sensitivity parameter, the color temperature of the input image in some extreme color temperature environments can be adjusted to improve the accuracy of the image color temperature.

[0288] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.

Claims

1. An image processing method, wherein: The method is performed by an electronic device, and includes: Predicting light sensitivity parameters of an input image to obtain a first light sensitivity parameter of the input image; Determining the expected color temperature corresponding to the first light sensitivity parameter from the correspondence between the candidate light sensitivity parameters and the candidate expected color temperatures; determining a current color temperature of the input image, and determining a color temperature error rate of the input image based on the expected color temperature and the current color temperature; updating the first light sensitivity parameter based on the color temperature error rate to obtain a second light sensitivity parameter; The input image is adjusted using the second light sensitivity parameter to obtain an adjusted input image.

2. The method according to claim 1, wherein The step of predicting the light sensitivity parameter of the input image to obtain the first light sensitivity parameter of the input image includes: Mapping the input image to obtain a probability distribution of the input image in a latent space; Sampling latent space samples from the latent space and remapping the latent space samples to obtain prediction features corresponding to the input image, wherein the latent space samples conform to the probability distribution of the input image in the latent space; A first light sensitivity parameter of the input image is determined based on the predicted feature corresponding to the input image.

3. The method according to claim 2, wherein: The determining the first light sensitivity parameter of the input image based on the predicted feature corresponding to the input image includes: The following processing is performed for each color channel in the color space corresponding to the predicted feature: Determine a first probability distribution of the prediction feature in each color channel, where the first probability distribution is used to represent a proportion of pixels of different pixel values ​​in each color channel among the pixels of the prediction feature; Determine the pixel value with the maximum probability in the first probability distribution corresponding to each color channel as the target pixel value; The reciprocal of the target pixel value is determined as the first light sensitivity parameter of the input image.

4. The method according to claim 2, wherein: The determining the first light sensitivity parameter of the input image based on the predicted feature corresponding to the input image includes: Mapping the predicted features to obtain a second probability distribution of the input image, wherein the second probability distribution is used to represent a weight of the third light sensitivity parameter of the input image corresponding to each color channel; determining a target weight of a third light sensitivity parameter of a target color channel from the second probability distribution; Determining the ratio of the preset parameter to the target weight as a light sensitivity parameter coefficient; The following processing is performed for each color channel in the color space corresponding to the input image: The product of the light sensitivity parameter coefficient and the weight of the third light sensitivity parameter corresponding to each color channel is determined as the first light sensitivity parameter of the input image.

5. The method according to any one of claims 1 to 4, wherein: The determining the current color temperature of the input image includes: Converting the input image from the current color space to the target color space to obtain a converted input image; Performing color histogram statistics on the converted input image to obtain a color histogram corresponding to the input image; The current color temperature corresponding to the peak value of the color histogram is determined from the correspondence between the candidate peak values ​​and the candidate color temperatures.

6. The method according to any one of claims 1 to 5, wherein: The determining, based on the expected color temperature and the current color temperature, a color temperature error rate of the input image includes: Obtaining a difference between the desired color temperature and the current color temperature; Based on the difference, a color temperature error rate of the input image is determined.

7. The method according to claim 6, wherein: The determining, based on the difference, a color temperature error rate of the input image includes: Determine the color temperature error rate of the input image by one of the following methods: determining a ratio of the difference to the current color temperature as a color temperature error rate of the input image; A ratio of the square of the difference to the square of the current color temperature is determined as a color temperature error rate of the input image.

8. The method according to any one of claims 1 to 7, wherein: The updating of the first light sensitivity parameter based on the color temperature error rate to obtain the second light sensitivity parameter includes: When the color temperature error rate is greater than or equal to a color temperature threshold, determining the updated learning rate of the input image as a first learning rate; When the color temperature error rate is less than the color temperature threshold, determining the updated learning rate of the input image as a second learning rate; Determining the current light sensitivity parameter corresponding to the current color temperature from the correspondence between the candidate color temperatures and the candidate light sensitivity parameters; Based on the updated learning rate of the input image and the current light sensitivity parameter, the first light sensitivity parameter is updated to obtain a second light sensitivity parameter.

9. The method according to claim 8, wherein The updating of the first light sensitivity parameter based on the updated learning rate of the input image and the current light sensitivity parameter to obtain the second light sensitivity parameter includes: determining a ratio of a difference between the first light sensing parameter and the current light sensing parameter to a preset parameter as an update step length; The sum of the product of the updated learning rate and the updated step size and the current light sensitivity parameter is determined as the second light sensitivity parameter.

10. The method according to any one of claims 1 to 7, wherein: The updating of the first light sensitivity parameter based on the color temperature error rate to obtain the second light sensitivity parameter includes: Obtaining an adjustment factor corresponding to the color temperature error rate from a correspondence between candidate color temperature error rates and candidate adjustment factors, wherein the adjustment factor is proportional to the color temperature error rate; The product of the adjustment factor and the first light sensitivity parameter is determined as the second light sensitivity parameter.

11. The method according to any one of claims 1 to 10, wherein: The adjusting the input image by using the second light sensitivity parameter to obtain an adjusted input image includes: Perform the following processing on each pixel of the input image: determining a product of the pixel and the second light sensitivity parameter as an adjusted pixel; The adjusted pixels are combined into the input image.

12. The method according to any one of claims 1 to 11, wherein: Before adjusting the input image using the second light sensitivity parameter to obtain the adjusted input image, the method further includes: Acquire at least one neighbor image of the input image, and determine a second light sensitivity parameter of each neighbor image; performing a weighted average on the second light sensitivity parameter of the input image and the second light sensitivity parameter of each of the neighboring images to obtain a target light sensitivity parameter; The adjusting the input image by using the second light sensitivity parameter to obtain an adjusted input image includes: The input image is adjusted according to the target light sensitivity parameter to obtain an adjusted input image.

13. The method according to any one of claims 1 to 12, wherein: The method is implemented through a convolutional neural network, which includes an encoder and a decoder. The encoder is used to predict the first light perception parameter, and the decoder is used to determine the color temperature error rate, and adjust the first light perception parameter based on the color temperature error rate to obtain the second light perception parameter.

14. An image processing device, comprising: a light sensitivity prediction module, configured to predict light sensitivity parameters of an input image to obtain a first light sensitivity parameter of the input image; a color temperature error rate acquisition module configured to determine an expected color temperature corresponding to the light sensitivity parameter from a correspondence between the candidate light sensitivity parameter and the candidate expected color temperature; determine a current color temperature of the input image, and determine a color temperature error rate of the input image based on the expected color temperature and the current color temperature; The image update module is configured to update the first light sensitivity parameter based on the color temperature error rate to obtain a second light sensitivity parameter; and adjust the input image according to the second light sensitivity parameter to obtain an adjusted input image.

15. An electronic device, comprising: a memory for storing computer-executable instructions; A processor, configured to implement the image processing method according to any one of claims 1 to 13 when executing the computer-executable instructions or computer program stored in the memory.

16. A computer-readable storage medium storing computer-executable instructions or a computer program, wherein the computer-executable instructions or the computer program, when executed by a processor, implement the image processing method according to any one of claims 1 to 13.

17. A computer program product, comprising computer executable instructions or a computer program, wherein the computer executable instructions or the computer program, when executed by a processor, implements the image processing method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment, computer readable storage medium and computer program product

    CN120563385A

  • Image processing method and apparatus, computer readable storage medium and computer device

    CN108063891A

  • White balance implementation method and device, equipment and storage medium

    CN112770097A

  • Image processing method, terminal and storage medium

    CN113452980A

  • Light sensation calibration method and device, terminal equipment and medium

    CN115931120A