Image processing method, image processing apparatus, electronic device, computer-readable storage medium and computer program product
By predicting the light-sensing parameters and calculating the color temperature error rate of the image, the light-sensing parameters are updated, which solves the color cast problem of the image under extreme color temperature environment and improves the accuracy and authenticity of the image color temperature.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-10-10
- Publication Date
- 2026-06-04
AI Technical Summary
Existing technologies cannot accurately perceive the color temperature of the light source in an image, resulting in color casts in images under high or low color temperature environments, thus reducing the realism of the image's color temperature.
By predicting the light-sensing parameters of the input image, the desired color temperature corresponding to the light-sensing parameters is determined, the color temperature error rate is calculated, and the light-sensing parameters are updated based on this to adjust the image color temperature, thereby improving the accuracy of the image color temperature.
In extreme color temperature environments, adjusting the light sensitivity parameters can effectively improve the accuracy of image color temperature, ensuring that white objects appear white under different lighting conditions and other colored objects appear in their true colors.
Smart Images

Figure CN2024123991_04062026_PF_FP_ABST
Abstract
Description
Image processing methods, image processing apparatus, electronic devices, computer-readable storage media, and computer program products
[0001] Cross-references to related applications
[0002] This application is based on and claims priority to Chinese Patent Application No. 2024102343527, filed on February 29, 2024, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to artificial intelligence technology, and more particularly to an image processing method, an image processing apparatus, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0004] With the rapid development of artificial intelligence technology, AI is playing an increasingly important role in image processing. The field of image processing includes the accurate capture, calibration and reproduction of image colors to ensure the accurate transmission of color information and the authenticity of visual effects. Currently, image processing cannot accurately estimate the color temperature of the light source of an image or perform color correction on the image. It faces challenges in high or low color temperature environments, especially under extreme color temperature conditions, such as color cast problems, which reduce the authenticity of image color temperature.
[0005] The relevant technologies lack effective solutions for accurately sensing color temperature and improving the accuracy of image color temperature in different color temperature scenarios.
[0006] Summary of the Invention
[0007] This application provides an image processing method, an image processing apparatus, 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 this application embodiment is implemented as follows:
[0009] This application provides an image processing method, which is executed by an electronic device, and the method includes:
[0010] The first light sensitivity parameter of the input image is obtained by predicting the light sensitivity parameter of the input image.
[0011] The desired color temperature corresponding to the light-sensing parameter is determined from the correspondence between the candidate light-sensing parameters and the candidate desired color temperature.
[0012] Determine the current color temperature of the input image, and based on the desired color temperature and the current color temperature, determine the color temperature error rate of the input image;
[0013] The first light-sensing parameter is updated based on the color temperature error rate to obtain the second light-sensing parameter;
[0014] The input image is adjusted using the second light-sensing parameter to obtain the adjusted input image.
[0015] This application provides an image processing apparatus, including:
[0016] A light-sensing prediction module is configured to predict light-sensing parameters of an input image to obtain the first light-sensing parameters of the input image.
[0017] The color temperature error rate acquisition module is configured to determine the desired color temperature corresponding to the light sensing parameter from the correspondence between the candidate light sensing parameter and the candidate desired 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 desired color temperature and the current color temperature.
[0018] The image update module is configured to update the first light-sensing parameter based on the color temperature error rate to obtain the second light-sensing parameter; and to adjust the input image using the second light-sensing parameter to obtain the adjusted input image.
[0019] This application provides an electronic device, including:
[0020] Memory is used to store executable instructions for a computer;
[0021] The processor, when executing computer-executable instructions stored in the memory, implements the image processing method provided in the embodiments of this application.
[0022] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the image processing method provided in this application when executed by a processor.
[0023] This application provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implement the image processing method provided in this application.
[0024] The embodiments of this application have the following beneficial effects:
[0025] The input image is subjected to light-sensing parameter prediction to obtain the first light-sensing parameter. From the correspondence between candidate light-sensing parameters and candidate desired color temperatures, the desired color temperature corresponding to the light-sensing parameter is determined. Based on the desired color temperature and the current color temperature, the color temperature error rate of the input image is determined. The first light-sensing parameter is updated based on the color temperature error rate to obtain the second light-sensing parameter. The input image is adjusted using the second light-sensing parameter to obtain the adjusted input image. In this way, by updating the first light-sensing parameter, the color temperature of the input image under some extreme color temperature environments can be adjusted, thereby improving the accuracy of the image color temperature. Attached Figure Description
[0026] Figure 1 is a schematic diagram of the image processing system architecture provided in an embodiment of this application;
[0027] Figure 2 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application;
[0028] Figure 3A is a first flowchart of the image processing method provided in an embodiment of this application;
[0029] Figure 3B is a second flowchart of the image processing method provided in an embodiment of this application;
[0030] Figure 3C is a schematic diagram of the third process of the image processing method provided in the embodiment of this application;
[0031] Figure 3D is a schematic diagram of the fourth process of the image processing method provided in the embodiments of this application;
[0032] Figure 3E is a schematic diagram of the fifth process of the image processing method provided in the embodiment of this application;
[0033] Figure 3F is a schematic diagram of the sixth process of the image processing method provided in the embodiment of this application;
[0034] Figure 3G is a schematic diagram of the seventh process of the image processing method provided in the embodiment of this application;
[0035] Figure 3H is a schematic diagram of the eighth process of the image processing method provided in the embodiment of this application;
[0036] Figure 3I is a schematic diagram of the ninth process of the image processing method provided in the embodiment of this application;
[0037] Figure 3J is a schematic diagram of the tenth flow of the image processing method provided in the embodiment of this application;
[0038] Figure 3K is a schematic diagram of the eleventh step of the image processing method provided in the embodiment of this application;
[0039] Figure 4 is a schematic diagram of the palm image correction process provided in an embodiment of this application;
[0040] Figure 5 is a schematic diagram of the camera acquisition device provided in an embodiment of this application;
[0041] Figure 6 is a schematic diagram of the palm print to be collected provided in an embodiment of this application;
[0042] Figure 7 is a schematic diagram of data augmentation provided in an embodiment of this application;
[0043] Figure 8 is a schematic diagram of the block division principle provided in an embodiment of this application;
[0044] Figure 9 is a schematic diagram of model construction provided in an embodiment of this application;
[0045] Figure 10 is a schematic diagram of the parameter update principle provided in an embodiment of this application;
[0046] Figure 11 is a schematic diagram of environmental color temperature perception prediction provided in an embodiment of this application.
[0047] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation
[0048] To make the objectives, 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 limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0049] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is 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" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0051] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0052] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0053] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.
[0054] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[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 difference caused by the ambient light temperature is balanced, so that white objects can be correctly presented as white under any lighting conditions.
[0056] 2) Color temperature, used to describe the color of a light source, that is, a black body will emit different colors of light when heated to different temperatures. The unit of color temperature is Kelvin (K).
[0057] 3) Color space, used to describe and represent the colors of an image. Different color spaces have different color ranges and application areas. Depending on the application scenario, the types of color spaces include: Red-Green-Blue (RGB) color space, Hue-Saturation-Luminosity (HSV) color space, Illuminance-Color (Lab) color space, and Color-Luminosity (YUV) color space.
[0058] 4) Mapping: Mapping the input data to a latent space, which typically has lower dimensions and can represent some implicit pattern of the original data.
[0059] 5) Remapping: Mapping the latent vectors back to the original data space to generate an output similar to the input data. The latent vectors are samples 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 true white or gray, rather than being affected by the color temperature of the ambient light and resulting in color cast.
[0061] In related technologies, color temperature adjustment is based on a camera module (Image Signal Processor, ISP), which cannot accurately perceive the ambient color temperature. Furthermore, it uses constant light-sensing parameters to cover all color temperature scenarios, resulting in color cast issues in some high or low color temperature conditions.
[0062] Based on the above analysis, the applicant found that the method of color correction of images by constant light-sensing parameters in related technologies cannot improve the accuracy of image color temperature. In view of the above problems, the embodiments of this application provide an image processing method, apparatus, electronic device, computer-readable storage medium and computer program product that can improve the accuracy of image color temperature.
[0063] The image processing method described in this 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 this application is not limited to a certain field.
[0064] The following describes exemplary applications of the electronic device provided in the embodiments of this application. The device provided in the embodiments of this application can be implemented as a terminal or as a server. The following will describe exemplary applications when the device is implemented as a server.
[0065] Referring to Figure 1, which is a schematic diagram of the image processing system architecture provided in an embodiment of this application, in order to support an image processing application, a terminal (exemplarily shown as terminal 400) connects to server 200 through network 300. Network 300 can be a wide area network or a local area network, or a combination of both.
[0066] Terminal 400 is used to send input data to server 200 via network 300. Server 200 is used to predict the light-sensing parameters of the input image to obtain the first light-sensing parameters of the input image. From the correspondence between candidate light-sensing parameters and candidate expected color temperatures, the expected color temperature corresponding to the light-sensing parameters is determined. The current color temperature of the input image is determined. Based on the expected color temperature and the current color temperature, the color temperature error rate of the input image is determined. The first light-sensing parameters are updated based on the color temperature error rate to obtain the second light-sensing parameters. The input image is adjusted using the second light-sensing parameters. The adjusted input image is returned to terminal 400. Terminal 400 displays the adjusted input image through graphical interface 410.
[0067] The following is an example of image processing performed by terminal 400.
[0068] In some embodiments, the terminal 400 can independently complete image processing tasks. For example, the terminal 400 is used to predict the light-sensing parameters of the input image to obtain the first light-sensing parameters of the input image, determine the expected color temperature corresponding to the light-sensing parameters from the correspondence between candidate light-sensing parameters and candidate expected color temperatures, 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-sensing parameters based on the color temperature error rate to obtain the second light-sensing parameters, adjust the input image through the second light-sensing parameters, and display the adjusted input image through the graphical interface 410.
[0069] In one implementation scenario, a server or terminal can predict the light-sensing parameters of a facial image to obtain the first light-sensing parameter of the facial image. From the correspondence between candidate light-sensing parameters and candidate expected color temperatures, the expected color temperature corresponding to the light-sensing parameter is determined, the current color temperature of the facial image is determined, and based on the expected color temperature and the current color temperature, the color temperature error rate of the facial image is determined. The first light-sensing parameter is updated based on the color temperature error rate to obtain the second light-sensing parameter. The facial image is then adjusted using the second light-sensing parameter to obtain the adjusted facial image.
[0070] In one implementation scenario, a server or terminal can predict the light-sensing parameters of a palm image to obtain the first light-sensing parameter of the palm image. From the correspondence between candidate light-sensing parameters and candidate expected color temperatures, the expected color temperature corresponding to the light-sensing parameter is determined, the current color temperature of the palm image is determined, and based on the expected color temperature and the current color temperature, the color temperature error rate of the palm image is determined. The first light-sensing parameter is updated based on the color temperature error rate to obtain the second light-sensing parameter. The palm image is then adjusted using the second light-sensing parameter to obtain the adjusted palm image.
[0071] In some embodiments, server 200 may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0072] Terminal 400 can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, smart voice interaction device, smart home appliance, vehicle terminal, aircraft, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment.
[0073] Referring to Figure 2, which is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, the electronic device 500 shown in Figure 2 can be the terminal 400 in Figure 1 or the server 200. 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 through a bus system 540. It is understood that the bus system 440 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all 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. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0075] User interface 530 includes one or more output devices 531 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. 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 image processing task is completed independently by the terminal 400, the server 200 provided in this application embodiment 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 storage, hard disk drives, optical disk drives, etc. The memory 550 may optionally include one or more storage devices physically located away from the processor 510.
[0078] The memory 550 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 550 described in this application embodiment is intended to include any suitable type of memory.
[0079] In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0080] Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0081] The network communication module 552 is used to reach other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0082] Presentation module 553 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 531 (e.g., a display screen, a speaker, etc.) associated with user interface 530;
[0083] In some embodiments, when the image processing task is performed independently by the terminal 400, the server 200 provided in this application embodiment may not include the presentation module 553.
[0084] The input processing module 554 is used to detect and translate one or more user inputs or interactions from one or more input devices 532; in some embodiments, when the image processing task is performed independently by the terminal 400, the server 200 provided in this application embodiment may not include the presentation module 553.
[0085] In some embodiments, the apparatus provided in this application can be implemented in software. FIG2 shows an image processing apparatus 555 stored in memory 550, which can be software in the form of programs and plug-ins, including the following software modules: light-sensing prediction module 5551, color temperature error rate acquisition module 5552, and image update module 5553. These modules are logically related, and therefore can be arbitrarily combined or further split according to the functions they implement. The functions of each module will be described below.
[0086] In other embodiments, the apparatus provided in this application can be implemented in hardware. For example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the image processing method provided in this application. For example, the processor in the form of a hardware decoding processor can 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 image processing examples below, those skilled in the art can apply the image processing methods provided in the embodiments of this application to image processing based on their understanding of the following text.
[0088] Referring to Figure 3A, which is a first flowchart of the image processing method provided in the embodiment of this application, the steps shown in Figure 3A will be described in conjunction with the image processing method provided in the embodiment of this application. The image processing method provided in the embodiment of this application can be implemented by the server or the terminal alone, or by the server and the terminal working together. The following description will take the implementation by the server and the terminal working together as an example.
[0089] In step 101, the light sensitivity parameters of the input image are predicted to obtain the first light sensitivity parameters 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 so that white objects appear white under different lighting conditions and other colored objects appear their true colors. Light sensitivity parameters characterize the gain of each channel of the input image. Light sensitivity parameter prediction is the process of mapping the input image and determining the light sensitivity parameters based on the mapping result. The light sensitivity parameters can be characterized as the reciprocal of the pixel values of the mapped result. Alternatively, the light sensitivity parameters can be obtained by a weighted sum of the reciprocals of the pixel values of the mapped result.
[0091] For example, the light sensitivity parameter is represented as a color gain of [1.2, 1, 1.5] in the red-green-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 (e.g., [R, G, B]) can be color corrected based on the light sensitivity parameter to obtain the corrected input image [1.2*R, 1*G, 1.5*B].
[0092] In some embodiments, referring to FIG3B, FIG3B is a second flowchart of the image processing method provided in the embodiments of this application. Step 101 shown in FIG3A can be implemented by steps 1011 to 1013 in FIG3B, 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 can be a Gaussian distribution. The latent space refers to a low-dimensional space where points can 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 these features are mapped based on the fully connected layers 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, which is also 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 conforming to or approximating a Gaussian distribution, also known as a normal distribution. By understanding and utilizing the Gaussian distribution characteristics of images, image analysis and processing can be performed more effectively.
[0096] In step 1012, latent space samples are sampled from the latent space and remapped to obtain the predicted 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. The latent space sample is then remapped based on the decoder to obtain the predicted features corresponding to the input image, wherein the predicted features have the same dimension as the input image.
[0099] In step 1013, the first light-sensing parameters of the input image are determined based on the predicted features corresponding to the input image.
[0100] In some embodiments, the light sensitivity parameters of the predicted features are determined as the first light sensitivity parameters 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, as shown in FIG3C. FIG3C is a schematic diagram of the third flow of the image processing method provided in the embodiment of this application. Step 1013 shown in FIG3B can be implemented by steps 10131A to 10133A in FIG3C, which will be described in detail below.
[0102] In step 10131A, a first probability distribution of the predicted feature in each color channel is determined. The first probability distribution is used to characterize the proportion of pixels with different pixel values in each color channel among the pixels of the predicted 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 values of the red channel of the input image are [[0, 1], [1, 2]]. 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 feature is [0.25, 0.5, 0.25].
[0105] In step 10132A, the pixel value with the highest 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 [0.25, 0.5, 0.25]. The pixel value with the highest probability is obtained as the value 1, and the value 1 is determined as the target pixel value.
[0107] In step 10133A, the reciprocal of the target pixel value is determined as the first light-sensing 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. 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 light sensitivity parameters of the image can be predicted and adjusted more accurately. Under complex lighting conditions, different color channels may be affected to varying degrees. Determining the first light sensitivity parameter for each color channel helps improve color reproduction, avoid color deviation, and enhance the accuracy of determining the light sensitivity parameters.
[0110] In some embodiments, referring to FIG3D, FIG3D is a fourth flowchart of the image processing method provided in the embodiments of this application. Step 1013 shown in FIG3B can be implemented by steps 10131B to 10134B in FIG3D, which will be described in detail below.
[0111] In step 10131B, the predicted features are mapped to obtain the second probability distribution of the input image.
[0112] The second probability distribution is used to characterize the weight of the third light sensitivity parameter for each color channel of the input image.
[0113] In some embodiments, the second probability distribution of the input image is the percentage of the third light sensitivity parameter for each color channel.
[0114] For example, the predicted features are mapped and encoded to obtain encoded predicted features. The encoded predicted features are then mapped based on a fully connected layer to obtain the weights of the light-sensing parameters as [0.3, 0.2, 0.5].
[0115] In step 10132B, the 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 (e.g., the red color channel) is selected from the color channels corresponding to the input image (e.g., the RGB channels of the input image in the RGB color space). 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-sensing parameter coefficient.
[0118] In some embodiments, the ratio of the value 1 to the target weight is determined as the light-sensing 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, whereby 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]. The coefficient of the third light sensitivity parameter 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] In this embodiment, latent space samples in the latent space are remapped, and the first light-sensing parameter of the input image is determined based on the predicted features obtained from the remapped space, so as to facilitate color temperature adjustment of the input image. The light-sensing parameter of the input image is determined by weighted summation of the light-sensing parameters corresponding to different color channels, thereby improving the accuracy of the light-sensing parameter determination.
[0122] Referring again to Figure 3A, in step 102, the desired color temperature corresponding to the light-sensing parameter is determined from the correspondence between the candidate light-sensing parameters and the candidate desired color temperature.
[0123] In some embodiments, the correspondence between candidate light-sensing parameters and candidate desired color temperatures may be linear or non-linear, depending on the characteristics of the lighting equipment and the application scenario. The correspondence between candidate light-sensing parameters and candidate desired color temperatures is pre-set, and there is a one-to-one correspondence between them. The desired color temperature is a pre-set color temperature based on the actual usage scenario, matching the needs of the actual application scenario. For example, in general lighting design, the desired color temperature can be close to that of natural light, such as 5000K to 6000K. Light in this color temperature range is close to the color temperature of midday sunlight, providing a clear visual effect. Images within this color temperature range can be used by convolutional neural network models for image processing to more accurately identify light.
[0124] In step 103, the current color temperature of the input image is determined, and the color temperature error rate of the input image is determined based on the expected color temperature and the current color temperature.
[0125] In some embodiments, the color temperature error rate can be the absolute difference or relative difference between the current color temperature and the desired color temperature. The absolute difference is the absolute value of the difference between the current color temperature and the desired color temperature, and the relative difference is the percentage of the absolute error between the current color temperature and the desired color temperature or the percentage of the mean square error between the current color temperature and the desired color temperature. The embodiments of this application do not limit the method for obtaining the color temperature error rate.
[0126] In some embodiments, referring to FIG3E, FIG3E is a fifth flowchart of the image processing method provided in the embodiments of this application. The determination of the current color temperature of the input image in step 103 of FIG3A can be achieved by 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 the 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 colors are described in digital form, including the composition, range, and representation of colors. Different color spaces are suitable for different application scenarios and devices. Types of color spaces include: RGB color space, Hue / Saturation / Luminance (HSV) color space, Illuminance / Colorimetry (Lab) color space, and Colorimetry / Luminance (YUV) color space.
[0129] The current color space and the target color space are different. The current color space is determined based on the camera used to capture the input photo in the actual application scenario. For example, if the input image is captured by a red-green-blue (RGB) camera, then 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 / Luminosity (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 Illuminance / Color (Lab) color space.
[0131] In step 1032A, color histogram statistics are performed on the converted input image to obtain the color histogram corresponding to the input image.
[0132] In some embodiments, a color histogram is used to characterize the proportion of pixels of each color or pixels in a color range in the total number of pixels in an input image.
[0133] For example, taking an input image converted from the current color space to the HSV color space as an example, the color values H in the color space are quantized, that is, continuous color values are divided into discrete intervals or "buckets". Each bucket represents a color range. During the statistical analysis, the color value of each pixel in the image is assigned to the corresponding bucket, and a color histogram is constructed based on the number of pixels in each bucket. The color range refers to the range of color values. The number of color ranges can be determined according to the actual application scenario. For example, each color component (red, green, blue) in the RGB color space can be divided into an equal number of intervals. Assuming there are 5 color ranges, each color channel is divided into 5 intervals. Colors are usually represented by 6-digit hexadecimal numbers, so the 5 color ranges can be represented as: #000000 (black) to #323232, #323232 to #646464, #646464 to #989898, #989898 to #CCCCCC, #CCCCCC to #FFFFFF (white).
[0134] Following the example above, the values of the tone channels of the converted input image are [[0, 1], [1, 2]]. The number of pixels with different pixel values is counted. The number of pixels with a value of 0 is 1, the number of pixels with a value of 1 is 2, and the number of pixels 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], which is the color histogram [0.25, 0.5, 0.25].
[0135] In step 1033A, the current color temperature corresponding to the peak of the color histogram is determined from the correspondence between the candidate peak and the candidate color temperature.
[0136] In some embodiments, the peak of the color histogram is the hue with the highest 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, we obtain the correspondence between hue and color temperature in the color histogram of the converted input image. For example, the color temperature corresponding to a hue of 0 is 3000K, and the color temperature corresponding to a hue of 30 is 3500K. We determine that the peak value of the color histogram is 30, that is, the hue with a value of 30. From the correspondence between hue and color temperature, we obtain that the current color temperature corresponding to the peak value of the color histogram is 3500K.
[0138] In some embodiments, referring to FIG3F, FIG3F is a sixth flowchart of the image processing method provided in the embodiments of this application. The determination of 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 achieved 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 desired color temperature is 3500K, the current color temperature is 3000K, and the difference between the desired color temperature and the current color temperature is determined to be 500K.
[0141] In step 1032B, the 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 to the current color temperature is determined as the color temperature error rate of the input image; the ratio of the square of the difference to the square of the current color temperature is determined as the color temperature error rate of the input image.
[0143] For example, if the current color temperature is 3000K, and the difference between the desired color temperature and the current color temperature is determined to be 500K, then the ratio of the difference to the current color temperature (0.6) is determined as the color temperature error rate of the input image. Alternatively, 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 this 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] Referring again to Figure 3A, in step 104, the first light-sensing parameter is updated based on the color temperature error rate to obtain the second light-sensing parameter.
[0146] For example, the second light-sensing parameter is used to adjust the color temperature of the input image. The process of updating the first light-sensing parameter based on the color temperature error rate is as follows: either the adjustment factor is determined by the color temperature error rate, and the product of the adjustment factor and the first light-sensing parameter is used as the second light-sensing parameter; or a corresponding color temperature learning rate is determined based on the color temperature error rate, and the first light-sensing parameter is updated according to the color temperature learning rate.
[0147] In some embodiments, referring to FIG3G, FIG3G is a seventh flowchart of the image processing method provided in the embodiments of this application. Step 104 shown in FIG3A can be implemented by steps 1041A to 1044A in FIG3G, 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 update learning rate of the input image is determined as 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 differs significantly from the desired color temperature. The current light sensitivity parameters of the current input image are adjusted by the first learning rate. Using a larger learning rate can increase the magnitude of the update of the current light sensitivity parameters of the current input image, thereby reducing the image color cast problem caused by the low 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 for 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 update learning rate of the input image is determined as the second learning rate.
[0152] In some embodiments, the second learning rate is less than the first learning rate. When the color temperature error rate is less than the color temperature threshold, the color temperature of the current input image is less 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 magnitude 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 for the input image is set to a smaller learning rate of 0.2.
[0154] In step 1043A, the current light sensitivity parameter corresponding to the current color temperature is determined from the correspondence between candidate color temperatures and candidate light sensitivity parameters.
[0155] For example, obtain the correspondence between candidate color temperatures and candidate light sensitivity parameters. For instance, when the light sensitivity parameter is 0.7, the corresponding color temperature is 3000K, and when the light sensitivity parameter is 0.8, the corresponding color temperature is 3500K. If the current color temperature is 3500K, determine that the current light sensitivity parameter corresponding to the current color temperature is 0.8.
[0156] In step 1044A, the first light-sensing parameter is updated based on the update learning rate of the input image and the current light-sensing parameter to obtain the second light-sensing parameter.
[0157] In some embodiments, the update learning rate of the input image is used to control the step size of the light sensing parameters update. The larger the update learning rate, the faster the light sensing parameters are updated, and the smaller the update learning rate, the slower the light sensing parameters are updated.
[0158] In some embodiments, referring to FIG3H, FIG3H is a schematic diagram of the eighth process of the image processing method provided in the embodiments of this application. Step 1044A shown in FIG3G can be implemented by steps 10441A to 10442A in FIG3H, which will be described in detail below.
[0159] In step 10441A, the ratio of the difference between the light-sensing parameter and the current light-sensing 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 parameters based on the amount of change in the light sensing parameters and preset parameters.
[0161] For example, the light sensor parameter is 1.2, the current light sensor parameter is 0.2, and the preset parameter is 100. The ratio of the difference between the light sensor parameter and the current light sensor parameter to the preset parameter is determined to be 0.01. 0.01 is set as the update step size to achieve more precise adjustment of the light sensor parameter.
[0162] In some embodiments, a preset parameter is determined as the update step size.
[0163] In step 10442A, the product of the update learning rate and the update step size is summed with the current light-sensing parameter to determine the second light-sensing parameter.
[0164] For example, the current light sensing parameter is 0.2, the update step size is 0.01, and the update learning rate is 0.6. The product of the update learning rate and the update step size, plus the sum of the current light sensing parameter, 0.206, is determined as the second light sensing parameter.
[0165] Through the embodiments of this application, the light sensing parameters are dynamically adjusted by adaptively updating the learning rate, thereby enabling the light sensing parameters to converge to the optimal solution more quickly, thus further improving the effect of light sensing parameter updating.
[0166] In some embodiments, referring to FIG3I, FIG3I is a ninth flowchart of the image processing method provided in the embodiments of this application. Step 104 shown in FIG3A can be implemented by steps 1041B to 1042B in 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 rate and the candidate adjustment factor.
[0168] Among them, the adjustment factor is directly proportional to the color temperature error rate.
[0169] In some embodiments, the correspondence between color temperature error rate and 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 sensitivity parameter.
[0170] In step 1042B, the product of the adjustment factor and the first photosensitivity parameter is determined as the second photosensitivity parameter.
[0171] In some embodiments, the adjustment factor is used to reduce the color temperature error rate of the adjusted input image obtained by adjusting the input image based on the second light-sensing 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, which is 0.672.
[0173] Through the embodiments of this application, the adjustment factor corresponding to the current color temperature error rate is determined based on the correspondence between candidate color temperature error rates and candidate adjustment factors, so as to reduce the color temperature error rate of the image after adjusting the input image based on the adjustment factor. The adjustment factor is determined by the correspondence between the color temperature error rate and the adjustment factor, and the product of the first light-sensing parameter and the adjustment factor is used as the second light-sensing parameter, which can improve the efficiency of calculating the second light-sensing parameter and save computing resources.
[0174] Referring again to Figure 3A, in step 105, the input image is adjusted using the second light-sensing parameter to obtain the 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 using a second light-sensing parameter.
[0176] In some embodiments, the following processing is performed for any domain, see FIG3J, FIG3J is a tenth flowchart of the image processing method provided in the embodiments of this application. Before step 105, steps 201 to 202 of FIG3J are performed.
[0177] In step 201, at least one neighboring image of the input image is acquired, and a second light-sensing parameter of each neighboring image is determined.
[0178] In some embodiments, neighboring images may be frames preceding and following the input image in a time series, or images from different perspectives within the same scene as the input image. This application does not limit the method of obtaining neighboring images.
[0179] In some embodiments, the second light-sensing parameters of each neighboring image are determined according to the method for obtaining the second light-sensing parameters of the input image.
[0180] In step 202, the second light sensitivity parameters of the input image and the second light sensitivity parameters of each neighboring image are weighted and averaged to obtain the target light sensitivity parameters.
[0181] For example, taking an 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 example above, when the second light-sensing parameter of the input image and the second light-sensing parameter of the neighboring image have different weights, the weight of the second light-sensing parameter of the input image is 0.4 and the weight of the second light-sensing parameter of the neighboring image is 0.6, the target light-sensing parameter [1.08, 0.88, 1.38] is obtained.
[0183] In some embodiments, the input image is adjusted using target light-sensing parameters to obtain an adjusted input image.
[0184] Following the above embodiments, the following processing is performed on 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, as shown in FIG3K. FIG3K is a schematic diagram of the eleventh flow of the image processing method provided in the embodiments of this application. Step 105 shown in FIG3A can be implemented by steps 1051 to 1052 in FIG3K, which will be described in detail below.
[0186] In step 1051, the product of the pixel and the second light-sensing parameter is determined as the adjusted pixel.
[0187] In some embodiments, the adjusted pixel is determined by multiplying the pixel value of a pixel in each color channel by the third light-sensing parameter corresponding to each color channel.
[0188] For example, the pixel value in the RGB color space is [10, 10, 20]. The third light sensitivity parameter corresponding to each color channel includes the third light sensitivity parameter 1.2 for the red color channel, the third light sensitivity parameter 1 for the green color channel, and the third light sensitivity parameter 1.5 for the blue color channel. The adjusted pixel values for each color channel of the pixel are 12, 10, and 15, respectively, resulting in the adjusted pixel [12, 10, 30].
[0189] In step 1052, each adjusted pixel is combined into an input image.
[0190] In some embodiments, the pixel combination order of the input image is equivalent to the order in which each pixel is adjusted.
[0191] Through the embodiments of this application, the light sensing parameters are continuously adjusted to cover the current color temperature scene, so as to avoid color cast problems in the input image under some high color temperature or low color temperature.
[0192] In some embodiments, the image processing method provided in this application can be implemented by a convolutional neural network. Before step 101, the following processing is performed: obtaining a set of sample images, training the convolutional neural network based on the set of sample images to obtain a trained convolutional neural network, calling the trained convolutional neural network to perform image processing based on a first verification image to obtain a second verification image, determining the red-green-blue gain (RGB gain) value based on the second verification image, and retraining the convolutional neural network when the RGB gain value is less than a preset gain value.
[0193] A convolutional neural network (CNN) consists of an image feature extraction layer, an encoder, and a decoder. The encoder and decoder together form a light sensitivity parameter prediction model. The image feature extraction layer can be constructed using a lightweight CNN to determine the region of interest (ROI) in the input image. The encoder determines the first light sensitivity parameter of the ROI, and the decoder determines the color temperature error rate and adjusts the first light sensitivity parameter to obtain the second light sensitivity parameter.
[0194] For example, the parameter optimization of a convolutional neural network can be achieved by maximizing the evidence lower bound (ELBO) of the marginal log-likelihood. This is done 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 in this application can be applied in the following scenarios:
[0196] 1. Payment via biometrics. Biometrics can be a face, palm, or iris. After the terminal device collects a first biometric image, it is processed using the image processing method provided in this application embodiment. 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 biometrics corresponding to the payment account. When it is determined that the biometrics in the second biometric image are authenticated, the payment operation is executed. By adjusting the color temperature of the first biometric image, accurate biometric data collection can be achieved even in environments with poor color temperature, improving payment efficiency.
[0197] 2. Access control via biometrics. Biometrics can be a face, palm, or iris. After the access control device acquires the first biometric image, it processes the first biometric image using the image processing method provided in this application embodiment, adjusting the color temperature of the first biometric image to obtain a second biometric image. The access control device compares the second biometric image with registered biometrics stored in the database. When it determines that the biometric in the second biometric image matches a registered biometric in the database, it grants access to the user. Application scenarios for access control include, but are not limited to, nighttime and dimly lit locations. By adjusting the color temperature of the first biometric image, accurate biometric acquisition is possible even in these extreme color temperature environments, improving the response efficiency of the access control device and making it easier to use.
[0198] In this embodiment, the light-sensing parameters of the input image are predicted to obtain the first light-sensing parameters of the input image. From the correspondence between candidate light-sensing parameters and candidate desired color temperatures, the desired color temperature corresponding to the light-sensing parameters is determined. Based on the desired color temperature and the current color temperature, the color temperature error rate of the input image is determined. The first light-sensing parameters are updated based on the color temperature error rate to obtain the second light-sensing parameters. The input image is adjusted using the second light-sensing parameters to obtain the adjusted input image. In this way, by updating the first light-sensing parameters, the color temperature of the input image under some extreme color temperature environments can be adjusted, thereby improving the accuracy of the image color temperature.
[0199] The following will describe an exemplary application of the image processing method provided in this application embodiment in a real-world application scenario.
[0200] In related technologies, palm-swiping devices all rely on a single camera module ISP for color temperature adjustment, which cannot accurately sense the ambient color temperature. Furthermore, they use a single white balance parameter (i.e., light-sensing parameter) to cover all color temperature scenarios, resulting in color cast issues in palm images under some high or low color temperatures, rendering palm swiping unusable.
[0201] To address the aforementioned issues, this application proposes an image processing method to improve the accuracy of palm brushing color temperature. This method improves the accuracy of color temperature during palm brushing by integrating a neural convolutional network and an ambient color temperature perception method based on a white balance algorithm.
[0202] Taking palm image correction as an example, see Figure 4. Figure 4 is a schematic diagram of the palm image correction process provided in the embodiment of this application. The process of palm image correction provided in the embodiment of this application will be explained below.
[0203] Figure 4 shows multiple modules used for palm print image correction according to the embodiments of this application, such as data collection module 101, data annotation module 102, data preprocessing module 103, model building module 104, weight initialization module 105, model training module 106, model evaluation module 107, hyperparameter adjustment module 108, and prediction and application module 109. Among them, data collection module 101, data annotation module 102, data preprocessing module 103, model building module 104, weight initialization module 105, model training module 106, and model evaluation module 107 are used to generate light-sensing parameters and generate white balance parameters through convolutional neural networks. Each module will be described in detail below.
[0204] 1) Regarding 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, the target hand gesture (e.g., left or right hand) is determined, and a certain number of palm images are collected. These images are then captured using a camera sensor. The camera sensor and the palm print to be captured are shown in Figures 5 and 6, respectively. Figure 5 is a schematic diagram of the camera sensor provided in this embodiment. The camera sensor includes the following components: 2 infrared lights 501, an RGB light guide ring 502, an infrared (IR) emission polarization zone 503, an infrared (IR) red-green-blue (RGB) camera 504, an infrared (IR) camera 505, and an infrared (IR) receiving polarization zone 506. These components enable the camera sensor to adapt to different environments. Figure 6 is a schematic diagram of the palm print to be captured provided in this embodiment. Figure 6 shows at least part of the palm print of a human hand.
[0207] Second, identify negative sample gestures (for example, if the target gesture is the left hand, the corresponding right hand is the negative sample gesture; or if the target gesture is the right hand, the corresponding left hand is the negative sample gesture), and collect the same number of hand images as the target gesture.
[0208] Third, the collected palm images of target gestures and negative sample gestures are cleaned using methods such as finding duplicate values, finding missing values, and finding outliers to remove invalid files. This application does not limit the data cleaning methods.
[0209] 2) Regarding 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) Regarding data preprocessing module 103
[0212] The data preprocessing module 103 is used to acquire, process and extract meaningful features and attributes from the palm images collected by the data collection module 101 using signal data processing technology, and input the extracted content into the model to train the model. The data preprocessing process is described in detail below.
[0213] First, the hand image is augmented using the Multi-Scale Retinex (MSR) algorithm to obtain an augmented hand image, thereby improving the visual effect of the image and enhancing the useful information in the image. See Figure 7, which is a schematic diagram of the data augmentation principle provided in the embodiment of this application.
[0214] For example, the original image 710 in the 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 components of red, green and blue 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. Based on the image 711 containing J, step 702 is performed to process the image using the multi-scale retina (MSR) algorithm, which replaces the Gaussian convolution operation with average filtering.
[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 better stability and robustness when processing images with different brightness ranges. Average filtering replaces Gaussian convolution, thereby improving the computational speed of the MSR image enhancement algorithm. Based on the MSR image enhancement algorithm, the original image is enhanced, taking into account information at different scales to more comprehensively enhance image quality and detail. Step 702 outputs an output image 712 containing J.
[0217] In step 703, a matrix containing multiple related parameters is received. After step 703, step 704 is performed based on the output image 712 containing J, and the red, green and blue three channels are obtained based on the relative multiple parameters in the matrix of related parameters to determine the output image 713.
[0218] Second, the palm images in the data collection module 101 are cleaned by median filtering. Specifically, the palm images are standardized and then the standardized data is binarized.
[0219] Third, the palm image from the first step is segmented into blocks using a block-segmentation mechanism. See Figure 8, which is a block-segmentation principle diagram provided in the embodiment of this application. As shown in Figure 8, the palm image is segmented into blocks with a certain window length 801 (adjustable, such as 5*5). The palm image contains the pixel value of each pixel. The palm image is divided into several blocks and corresponding labels. Here, the block-segmentation mechanism is trained using a network model.
[0220] To avoid the issue of a single hand coordinate label affecting the accuracy of the label after extracting features from an entire hand image (e.g., if a hand image contains different hand 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, and the input of the network model is the grayscale data value of the hand as the feature. Then, it passes through an attention layer and finally outputs the region of interest (ROI) of the hand.
[0221] With a resolution of 60x60, Histogram of Gradient (HOG) features are extracted (this feature is suitable for gesture detection). Here, the Sobel algorithm is used to extract the edge features of the palm image, as shown in formulas (1) and (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 concatenated end to end to form a large one-dimensional vector, which is the final image feature. This feature can be input into the regression algorithm for training.
[0224] 4) Regarding the model building module 104
[0225] The model building module 104 is used to select two convolutional networks, namely an inference network (i.e., an encoder) and a generator network (i.e., a decoder), to build the light-sensing parameter prediction model provided in this application embodiment. Referring to Figure 9, Figure 9 is a schematic diagram of the model building provided in this application embodiment. The generator network that matches the current application scenario is selected from multiple generator networks (automatic white balance generator network 902A, incandescent lamp white balance generator network (not shown in the figure), and shadow white balance generator network 903A). The generator network takes the latent vector z as input and outputs the parameter p(x|z) for the observation condition distribution. In addition, the unit Gaussian prior p(z) is used to model the latent vector z.
[0226] The generative network consists of a fully connected layer followed by four convolutional transpose layers (deconvolutional layers). The network architecture is as follows: the first layer is the input layer; the second layer is a fully connected layer using a Rectified Linear Unit (ReLU) activation function; the third layer is a resampling layer that reshapes the input features from the second layer to obtain updated feature dimensions (batch size, 7, 7, 32); the fourth layer is a deconvolutional layer using 64 convolutional kernels, each 3x3 in size, with a stride of 2, SAME padding, and ReLU activation; the fifth layer is also a deconvolutional layer using 32 convolutional kernels, each 3x3 in size, with a stride of 2. e) is 2, padding is SAME, and activation function is ReLU; the sixth layer is a deconvolution layer, using 16 convolution kernels, kernel size is 3x3, stride is 2, padding is appropriate (SAME), and activation function is ReLU; the seventh layer is a deconvolution layer, using 1 convolution kernel, kernel size is 3x3, stride is 1, padding is SAME, and 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 observations as input and outputs a set of parameters for the conditional distribution used in the latent representation. The Inference Network 901A consists of 3 convolutional layers and 1 fully connected layer. The network architecture of the Inference Network 901A is as follows: the first layer is the input layer; the second layer is a convolutional layer using 16 convolutional kernels (3x3 kernel size, stride 2, padding SAME, activation function ReLU); the third layer is a convolutional layer using 32 convolutional kernels (3x3 kernel size, stride 2, padding SAME, activation function ReLU); the fourth layer is a convolutional layer using 64 convolutional kernels (3x3 kernel size, stride 2, padding SAME, activation function ReLU); and the fifth layer is a fully connected layer.
[0228] 5) Regarding the initialization of the weight module 105
[0229] The initial weight module 105 is used to initialize the weights with random values less than the weight threshold in order to avoid output saturation caused by weight values greater than the weight threshold when the model starts training. The weight initialization methods include zero initialization (initializing all weights to zero) and random number initialization (initializing weights to random values less than the weight threshold, usually from a uniform distribution or a normal distribution). This application does not restrict the selection of the weight initialization method.
[0230] 6) Regarding the training model module 106
[0231] The training model module 106 is used to start training based on the model selected in the model building module 104, and based on the parameters and data required by the network model. Batch normalization is avoided during training because using mini-batch processing will lead to additional randomness, thereby exacerbating the instability of random sampling. The training process of the model 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 Equation (3).
[0234] The model is trained starting with an iterative dataset. During each iteration, images are fed into the inference network to obtain a set of mean and log-variance parameters approximating 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), and the reparameterized samples are fed into the generator network to obtain the log-odds (logit) of the observations in the generator distribution p(x|z), where logit represents the sample input to the last fully connected layer of the generator network. Maximizing the lower bound of evidence on the marginal log-likelihood is a method for approximating the marginal log-likelihood, which cannot be directly computed. The model parameters can be optimized by maximizing the lower bound of evidence on the marginal log-likelihood by alternately optimizing the parameters of the encoder and decoder so that the generator distribution p(x|z) is as close as possible to the posterior distribution q(z|x), thus making ELBO close to the true value of the marginal log-likelihood.
[0235] 7) Regarding the model evaluation module 107
[0236] The model evaluation module 107 is used to input the input image into the model for generating images trained by the training model module 106. It samples a set of latent vectors z from the unit Gaussian prior distribution p(z). The generation network converts the latent vectors into the logit of the observations to obtain the probability distribution p(x|z). The probability distribution p(x|z) is used as the red-green-blue gain (RGB gain) of the white balance parameter (light sensitivity parameter) corresponding to the input image.
[0237] 8) Regarding the hyperparameter adjustment module 108
[0238] The hyperparameter adjustment module 108 is used to update the white balance parameters of the image. See Figure 10, which is a schematic diagram of the parameter update principle provided in the embodiment of this application.
[0239] As shown in Figure 10, in step 901, the Auto White Balance Parameters (AWB) in the Image Signal Processor (ISP) of the camera are initialized. The white balance parameters are used to restore the white after imaging under ambient light of different color temperatures to the true white (usually the white observed by the human eye under natural sunlight ambient light) through a certain algorithm.
[0240] In step 902, the input image is subjected to block histogram color temperature statistics. The input image is then passed through the model evaluation module 107 to obtain white balance parameters. The input image is then input into the ambient color temperature perception and prediction module 1101. In the ambient color temperature perception and prediction 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 executed.
[0241] 9) Regarding the ambient color temperature perception and prediction module 1101
[0242] The ambient color temperature perception and prediction module 1101 is used to obtain the current color temperature of the image. Referring to Figure 11, Figure 11 is a schematic diagram of ambient color temperature perception and prediction provided in the embodiment of this application. Unlike the traditional gray world assumption and white point estimation, the ambient color temperature perception and prediction module 1101 estimates the color temperature 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 and prediction module 1101 is described in detail below.
[0243] Step 1101, color space conversion.
[0244] To convert an image from its original color space (usually RGB) to a color space more suitable for white balance processing, such as the coordinate (XYZ) color space or illuminance chromaticity (Lab) color space defined by the International Commission on Illumination (CIE), the method for converting an HSV color space image 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), i represents the integer value of H / 60. In the Hue, Saturation, and Brightness (HSV) color space, the hue (H) value typically ranges from 0° to 360°, and the saturation (S) and brightness (V) values typically range from 0 to 1. Based on hue (H), saturation (S), and brightness (V), intermediate variables are calculated to obtain the corresponding red (R), green (G), and blue (B) values for each color channel in the red-green-blue (RGB) color space, achieving mutual conversion between HSV and RGB color spaces. When the scene focuses on the color of the image, the image is converted to HSV space; when the scene focuses on the brightness of the image, the image is converted to Lab space.
[0256] Step 1102: Perform histogram color temperature statistics on the image.
[0257] Divide the image into 8x8 blocks and perform histogram color temperature statistics on the divided images to estimate the color temperature of the light source in the current scene (current color temperature).
[0258] Step 1103: Calculate the color temperature error rate for each channel.
[0259] Based on the current color temperature and the white balance parameters obtained by the model evaluation module 107 from the input image, the desired color temperature of the input image is determined according to the white balance parameters, and the color temperature error rate of each channel is calculated based on the current color temperature and the desired color temperature.
[0260] Referring again to Figure 10, the color temperature error rate of N frames is 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 a 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 an invariant mode, maintaining the current color temperature. When the frame color temperature error rate is greater than the first threshold, step 9042 is executed to determine the relationship between the image color temperature error rate and the first threshold. The relationship between the two thresholds is as follows: 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 slow mode, the corresponding color temperature parameters are adjusted, and the white balance parameter values corresponding to the slow white balance model are obtained. When the color temperature error rate of the image is lower than the second threshold, step 90422 is executed to determine the white balance model as fast mode, the corresponding color temperature parameters are adjusted, and the white balance parameter values corresponding to the fast white balance model are obtained. That is, the higher the color temperature error rate, the faster the white balance parameters are adjusted.
[0261] In step 905, the input image is updated based on the white balance parameter values in the corresponding white balance mode, and the error rate is recalculated on the updated input image to calculate the color temperature error rate of multiple frames and 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-frame images, where N is a positive integer greater than 1. The color temperature of the N-frame adjusted input images is re-adjusted until the frame color temperature error rate is determined to be less than the first threshold in the relationship between the frame color temperature error rate and the first threshold in step 906.
[0262] 10) Regarding 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 this application embodiment, thereby obtaining the adjusted input image and further improving the accuracy of the image color temperature.
[0264] In summary, the embodiments of this application improve the accuracy of estimating the current color temperature of the input image by performing histogram statistics on the input image, and continuously adjust the white balance parameters. The adjusted white balance parameters can adjust the color temperature of input data under extreme color temperature environments, covering multiple color temperature scenarios and improving the accuracy of image color temperature.
[0265] The following continues to describe an exemplary structure of the image processing apparatus 555 provided in the embodiments of this application as a software module. In some embodiments, as shown in FIG2, the software module stored in the image processing apparatus 555 in the memory 550 may include:
[0266] The light-sensing prediction module 5551 is configured to predict the light-sensing parameters of the input image to obtain the first light-sensing parameters of the input image.
[0267] The color temperature error rate acquisition module 5552 is configured to determine the desired color temperature corresponding to the light sensing parameters from the correspondence between candidate light sensing parameters and candidate desired color temperatures; determine the current color temperature of the input image; and determine the color temperature error rate of the input image based on the desired color temperature and the current color temperature.
[0268] The image update module 5553 is configured to update the first light-sensing parameter based on the color temperature error rate to obtain the second light-sensing parameter; and adjust the input image using the second light-sensing parameter to obtain the adjusted input image.
[0269] In some embodiments, the light-sensing prediction module 5551 is further configured to map the input image to obtain the 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 the 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 the first light-sensing parameter of the input image based on the prediction features corresponding to the input image.
[0270] In some embodiments, the light-sensing prediction module 5551 is further configured to perform the following processing for each color channel in the color space corresponding to the prediction feature: determining a first probability distribution of the prediction feature in each color channel, the first probability distribution being used to characterize the proportion of pixels with different pixel values in each color channel among the pixels of the prediction feature; determining the pixel value with the highest probability in the first probability distribution corresponding to each color channel as the target pixel value; and determining the reciprocal of the target pixel value as the first light-sensing parameter of the input image.
[0271] In some embodiments, the light-sensing 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-sensing parameter corresponding to each color channel of the input image; determine the target weight of the third light-sensing 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-sensing parameter coefficient; and perform the following processing for each color channel in the color space corresponding to the input image, determining the product of the light-sensing parameter coefficient and the weight of the third light-sensing parameter corresponding to each color channel as the first light-sensing 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 the converted input image; perform color histogram statistics on the converted input image to obtain the color histogram corresponding to the input image; and determine the current color temperature corresponding to the peak value of the color histogram from the correspondence between the candidate peak value and the candidate color temperature.
[0273] In some embodiments, the color temperature error rate acquisition module 5552 is further configured to acquire the 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 to the current color temperature as the color temperature error rate of the input image; or determining the ratio of the square of the difference 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 sensing parameter corresponding to the current color temperature from the correspondence between candidate color temperatures and candidate light sensing parameters; and update the first light sensing parameter based on the update learning rate of the input image and the current light sensing parameter to obtain the second light sensing parameter.
[0276] In some embodiments, the image update module 5553 is further configured to determine the update step size by the ratio of the difference between the light-sensing parameter and the current light-sensing parameter to a preset parameter; and to determine the second light-sensing parameter by summing the product of the update learning rate and the update step size with the current light-sensing parameter.
[0277] In some embodiments, the image update module 5553 is further configured to obtain the 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 to determine the product of the adjustment factor and the first light-sensing parameter as the second light-sensing parameter.
[0278] In some embodiments, the image update module 5553 is further configured to perform the following processing for each pixel of the input image: determining the product of the pixel and the second light-sensing parameter as the adjusted pixel; and combining each adjusted pixel into the input image.
[0279] In some embodiments, the image update module 5553 is further configured to acquire at least one neighboring image of the input image and determine a second light-sensing parameter for each neighboring image; and to perform a weighted average of the second light-sensing parameter of the input image and the second light-sensing parameter of each neighboring image to obtain the target light-sensing parameter.
[0280] In some embodiments, the image update module 5553 is further configured to adjust the input image using target light-sensing parameters to obtain an adjusted input image.
[0281] This application provides a computer program product, which includes computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the image processing method described in this application embodiment.
[0282] This application provides a computer-readable storage medium storing 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 in this application, such as 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 it may be a variety of devices including one or any combination of the above-mentioned memories.
[0284] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, 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 stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0285] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
[0286] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located in one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0287] In summary, by performing light-sensing parameter prediction on the input image through the embodiments of this application, a first light-sensing parameter of the input image is obtained. From the correspondence between candidate light-sensing parameters and candidate desired color temperatures, the desired color temperature corresponding to the light-sensing parameter is determined. Based on the desired color temperature and the current color temperature, the color temperature error rate of the input image is determined. The first light-sensing parameter is updated based on the color temperature error rate to obtain a second light-sensing parameter. The input image is then adjusted using the second light-sensing parameter to obtain an adjusted input image. Thus, by updating the first light-sensing parameter, the color temperature of the input image under some extreme color temperature environments can be adjusted, improving the accuracy of the image color temperature.
[0288] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. An image processing method, wherein, The method is performed by an electronic device, and the method includes: The first light sensitivity parameter of the input image is obtained by predicting the light sensitivity parameter of the input image. The desired color temperature corresponding to the first photosensitive parameter is determined from the correspondence between the candidate photosensitive parameters and the candidate desired color temperature. Determine the current color temperature of the input image, and based on the desired color temperature and the current color temperature, determine the color temperature error rate of the input image; The first light-sensing parameter is updated based on the color temperature error rate to obtain the second light-sensing parameter; The input image is adjusted using the second light-sensing parameter to obtain the adjusted input image.
2. The method of claim 1, wherein, The step of predicting the light-sensing parameters of the input image to obtain the first light-sensing parameters of the input image includes: The input image is mapped to obtain the probability distribution of the input image in the latent space; Sample latent space samples are extracted from the latent space and remapped to obtain the predicted features corresponding to the input image, wherein the latent space samples conform to the probability distribution of the input image in the latent space; Based on the predicted features corresponding to the input image, the first light sensitivity parameter of the input image is determined.
3. The method of claim 2, wherein, The step of determining the first light-sensing parameter of the input image based on the predicted features corresponding to the input image includes: For each color channel in the color space corresponding to the predicted feature, the following processing is performed: A first probability distribution of the predicted feature is determined in each color channel, wherein 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; The pixel value with the highest probability in the first probability distribution corresponding to each color channel is determined as the target pixel value; The reciprocal of the target pixel value is determined as the first light-sensing parameter of the input image.
4. The method of claim 2, wherein, The step of determining the first light-sensing parameter of the input image based on the predicted features corresponding to the input image includes: The predicted features are mapped 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 sensitivity parameter corresponding to each color channel of the input image; From the second probability distribution, determine the target weight of the third light-sensing parameter of the target color channel; The ratio of the preset parameter to the target weight is determined as the photosensitive parameter coefficient; For each color channel in the color space corresponding to the input image, the following processing is performed: The product of the light-sensing parameter coefficient and the weight of the third light-sensing parameter corresponding to each color channel is determined as the first light-sensing parameter of the input image.
5. The method according to any one of claims 1 to 4, wherein, Determining the current color temperature of the input image includes: The input image is converted from the current color space to the target color space to obtain the converted input image; Perform color histogram statistics on the converted input image to obtain the 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 value and the candidate color temperature.
6. The method according to any one of claims 1 to 5, wherein, Determining the color temperature error rate of the input image based on the desired color temperature and the current color temperature includes: Obtain the difference between the desired color temperature and the current color temperature; Based on the difference, the color temperature error rate of the input image is determined.
7. The method of claim 6, wherein, Determining the color temperature error rate of the input image based on the difference includes: The color temperature error rate of the input image is determined by one of the following methods: The ratio of the difference to the current color temperature is determined as the color temperature error rate of the input image; The ratio of the square of the difference to the square of the current color temperature is determined as the color temperature error rate of the input image.
8. The method according to any one of claims 1 to 7, wherein, The step of updating the first light-sensing parameter based on the color temperature error rate to obtain the second light-sensing parameter includes: When the color temperature error rate is greater than or equal to the color temperature threshold, the update learning rate of the input image is determined as the first learning rate. When the color temperature error rate is less than the color temperature threshold, the update learning rate of the input image is determined as the second learning rate; The current light sensitivity parameter corresponding to the current color temperature is determined from the correspondence between candidate color temperatures and candidate light sensitivity parameters. Based on the updated learning rate of the input image and the current light sensing parameters, the first light sensing parameters are updated to obtain the second light sensing parameters.
9. The method of claim 8, wherein, The step of updating the first light-sensing parameter based on the learning rate of the input image and the current light-sensing parameter to obtain the second light-sensing parameter includes: The ratio of the difference between the first light-sensing parameter and the current light-sensing parameter to a preset parameter is determined as the update step size; The product of the update learning rate and the update step size is summed with the current light-sensing parameter to determine the second light-sensing parameter.
10. The method according to any one of claims 1 to 7, wherein, The step of updating the first light-sensing parameter based on the color temperature error rate to obtain the second light-sensing parameter includes: From the correspondence between candidate color temperature error rates and candidate adjustment factors, the adjustment factor corresponding to the color temperature error rate is obtained, wherein the adjustment factor is proportional to the color temperature error rate; The product of the adjustment factor and the first photosensitivity parameter is determined as the second photosensitivity parameter.
11. The method according to any one of claims 1 to 10, wherein, The step of adjusting the input image using the second light-sensing parameter to obtain the adjusted input image includes: Perform the following processing on each pixel of the input image; The product of the pixel and the second light-sensing parameter is determined as the adjusted pixel; The adjusted pixels are combined to form 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-sensing parameter to obtain the adjusted input image, the method further includes: Acquire at least one neighboring image of the input image, and determine a second light-sensing parameter for each neighboring image; The target light sensitivity parameter is obtained by weighted averaging the second light sensitivity parameter of the input image and the second light sensitivity parameter of each neighboring image. The step of adjusting the input image using the second light-sensing parameter to obtain the adjusted input image includes: The input image is adjusted using the target light-sensing parameters to obtain the adjusted input image.
13. The method of any one of claims 1 to 12, wherein, The method is implemented by a convolutional neural network, which includes an encoder and a decoder. The encoder is used to predict the first light-sensing parameter, and the decoder is used to determine the color temperature error rate and adjust the first light-sensing parameter based on the color temperature error rate to obtain the second light-sensing parameter.
14. An image processing apparatus, the apparatus comprising: A light-sensing prediction module is configured to predict light-sensing parameters of an input image to obtain the first light-sensing parameters of the input image. The color temperature error rate acquisition module is configured to determine the desired color temperature corresponding to the light sensing parameter from the correspondence between the candidate light sensing parameter and the candidate desired 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 desired color temperature and the current color temperature. The image update module is configured to update the first light-sensing parameter based on the color temperature error rate to obtain the second light-sensing parameter; and to adjust the input image using the second light-sensing parameter to obtain the adjusted input image.
15. An electronic device, the electronic device comprising: Memory is used to store executable instructions for a computer; A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the image processing method according to any one of claims 1 to 13.
16. A computer-readable storage medium storing computer-executable instructions or a computer program that, when executed by a processor, implements 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 that, when executed by a processor, implements the image processing method of any one of claims 1 to 13.