Color correction apparatus, method, storage medium, and electronic device
Patent Information
- Application Number
- CN202610969201.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-08-18
AI Technical Summary
[0003]为了解决上述技术问题,本公开提供了一种色彩校正装置、方法、存储介质及电子设备,以解决全局自动白平衡方案导致的图像出现偏色的问题
[0010] The color correction device disclosed herein utilizes the physical parameters of the camera and the target light source to accurately identify the target region corresponding to the target light source in the original image. Furthermore, by combining the camera's physical parameters, the target light source's physical parameters, and the ideal spectrum of the target light source, it further ensures that the target correction matrix corresponding to the determined target region can accurately restore the true color of the target light source. Finally, when performing local color correction on the target region corresponding to the target light source in the original image using the target correction matrix, it can achieve physical-level color restoration of the color information within the target region. Compared to the global AWB correction scheme, this disclosure can accurately determine the target region corresponding to the target light source in the original image and, by using the target correction matrix to perform local color correction on the target region corresponding to the target light source in the original image, can accurately restore the true color of the target region where the target light source is located in the image, thereby achieving physical-level color restoration of the target region in the original image and avoiding color cast problems in the image.
Smart Images

Figure CN122601993A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to a color correction device, method, storage medium, and electronic device. Background Technology
[0002] In the field of image processing, raw RAW images acquired by image sensors need to be processed by an Image Signal Processor (ISP) to convert them into other image formats. During ISP processing, a global automatic white balance (AWB) scheme is typically used to correct color deviations caused by different ambient color temperatures. However, images processed using this global AWB correction scheme may still exhibit color cast issues. For example, the spectrum of self-emissive light sources does not change with ambient light; therefore, when using the global AWB correction scheme to correct images including areas with self-emissive light sources, it will cause color cast problems in those areas. Summary of the Invention
[0003] To address the aforementioned technical problems, this disclosure provides a color correction device, method, storage medium, and electronic device to resolve the color cast issue in images caused by global automatic white balance schemes.
[0004] A first aspect of this disclosure provides a color correction apparatus, comprising: an input circuit configured to determine an original image captured by a camera, physical parameters of the camera, physical parameters of a target light source, and a target spectrum corresponding to the target light source; a region determination circuit configured to determine a target region corresponding to the target light source in the original image based on the original image, the physical parameters of the camera, and the physical parameters of the target light source; a correction matrix calculation circuit configured to determine a target correction matrix corresponding to the target region based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source; and a color correction circuit configured to perform color correction on the target region in the original image based on the target correction matrix to obtain a corrected image.
[0005] A second aspect of this disclosure provides a color correction method, comprising: determining an original image captured by a camera, physical parameters of the camera, physical parameters corresponding to a target light source, and a target spectrum corresponding to the target light source; determining a target region corresponding to the target light source in the original image based on the original image, the physical parameters of the camera, and the physical parameters of the target light source; determining a target correction matrix corresponding to the target region based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source; and performing color correction on the target region in the original image based on the target correction matrix to obtain a corrected image.
[0006] A third aspect of this disclosure provides a color correction device, comprising: a data determination module configured to determine an original image captured by a camera, physical parameters of the camera, physical parameters corresponding to a target light source, and a target spectrum corresponding to the target light source; a region determination module configured to determine a target region corresponding to the target light source in the original image based on the original image, the physical parameters of the camera, and the physical parameters of the target light source; a correction matrix calculation module configured to determine a target correction matrix corresponding to the target region based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source; and a color correction module configured to perform color correction on the target region in the original image based on the target correction matrix to obtain a corrected image.
[0007] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the color correction method provided in the second aspect above.
[0008] A fifth aspect of this disclosure provides an electronic device comprising: a processor; a memory for storing processor-executable instructions; and a processor for reading executable instructions from the memory and executing the instructions to implement the color correction method provided in the second aspect above.
[0009] A sixth aspect of this disclosure provides a computer program product that, when instructions in the computer program product are executed by a processor, performs the color correction method provided in the second aspect described above.
[0010] The color correction device disclosed herein utilizes the physical parameters of the camera and the target light source to accurately identify the target region corresponding to the target light source in the original image. Furthermore, by combining the camera's physical parameters, the target light source's physical parameters, and the ideal spectrum of the target light source, it further ensures that the target correction matrix corresponding to the determined target region can accurately restore the true color of the target light source. Finally, when performing local color correction on the target region corresponding to the target light source in the original image using the target correction matrix, it can achieve physical-level color restoration of the color information within the target region. Compared to the global AWB correction scheme, this disclosure can accurately determine the target region corresponding to the target light source in the original image and, by using the target correction matrix to perform local color correction on the target region corresponding to the target light source in the original image, can accurately restore the true color of the target region where the target light source is located in the image, thereby achieving physical-level color restoration of the target region in the original image and avoiding color cast problems in the image. Attached Figure Description
[0011] Figure 1This is a schematic diagram of the structure of a color correction device provided in an exemplary embodiment of the present disclosure.
[0012] Figure 2 This is a schematic flowchart of a color correction method provided in an exemplary embodiment of this disclosure.
[0013] Figure 3 This is a flowchart illustrating a color correction method provided in another exemplary embodiment of this disclosure.
[0014] Figure 4 This is a schematic flowchart of a color correction method provided in yet another exemplary embodiment of this disclosure.
[0015] Figure 5 This is a schematic flowchart of a color correction method provided in yet another exemplary embodiment of this disclosure.
[0016] Figure 6 This is a schematic flowchart of a color correction method provided in yet another exemplary embodiment of this disclosure.
[0017] Figure 7 This is a schematic diagram of the structure of a color correction device provided in an embodiment of this disclosure.
[0018] Figure 8 This is a structural diagram of an electronic device provided in an exemplary embodiment of this disclosure.
[0019] Figure 9 This is a structural diagram of an image processing chip provided in an exemplary embodiment of the present disclosure. Detailed Implementation
[0020] To explain this disclosure, exemplary embodiments of the disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the disclosure, and not all of them. It should be understood that the disclosure is not limited to exemplary embodiments.
[0021] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0022] Application Overview In the field of image processing, camera imaging requires a complex process of conversion from light to electricity and then to digital signal conversion and signal processing. External light is projected onto the photosensitive surface of the image sensor through the camera's optical lens, and the red (R), green (G), and blue (B) three-channel signals are separated by the color filter array (CFA) on the surface of the image sensor.
[0023] When an image sensor acquires an image, it records the spectral energy distribution of light reflected from an object. Typically, in low color temperature environments, the light reflected from white paper is yellowish-red, so the R channel value in the raw image output by the image sensor will be much larger than the B channel value. In high color temperature environments, the light reflected from white paper is bluish, so the B channel value in the raw image output by the image sensor will be much larger than the R channel value. To correct color deviations caused by different ambient color temperatures, a global AWB (Auto Color Bypass) scheme can be used to correct the image during the ISP's conversion of the raw image (e.g., RAW image) to other image formats (e.g., RGB or YNR images), ensuring that the processed image accurately reproduces the true colors of the scene being captured.
[0024] For example, to correct color deviations, a global white balance gain (WB Gain) can be determined using the AWB algorithm based on ambient color temperature information. This white balance gain can include the red channel gain (R_Gain) and the blue channel gain (B_Gain). In a low color temperature environment, to correct a yellowish white object to white, a larger blue channel gain (B_Gain) can be applied to amplify the weak blue light signal, while a smaller red channel gain (R_Gain) is applied. Conversely, in a high color temperature environment, a larger red channel gain (R_Gain) can be applied to amplify the weak red light signal, while a smaller blue channel gain (B_Gain) is applied to correct a bluish white object to white.
[0025] However, when the raw image acquired by the image sensor includes areas with self-emissive light sources, the spectrum of these sources (such as traffic lights, vehicle lights, construction indicator lights, neon lights, signs, etc.) does not change with ambient light; that is, the RGB components of the self-emissive light source areas in the image remain constant at all color temperatures. Therefore, in low or high color temperature environments, using the aforementioned global AWB scheme can cause color casts in the self-emissive light source areas due to excessive gain in the blue or red channels.
[0026] For example, taking the green light in a traffic signal as a self-emissive light source, in a low color temperature environment, when the ISP processes the original image acquired by the image sensor, it uses a global AWB scheme to correct the original image. The blue channel gain B_Gain generated by AWB compensation is too large, which will cause the green light area in the image to turn into a blue light under the effect of the blue channel gain B_Gain. This makes the recognized signal light color inconsistent with the actual color, and thus affects the driving safety of the vehicle when performing perception processing based on this image with color deviation.
[0027] To address the issue of color cast in self-emissive light source regions of images caused by global AWB (Auto-Ambient Light) schemes during image correction, this disclosure provides a color correction device. A region determination circuit, based on the original image captured by the camera, the camera's physical parameters, and the target light source's physical parameters determined by the input circuit, can identify the target region corresponding to the target light source in the original image. A correction matrix calculation circuit, combining the camera's physical parameters, the target light source's physical parameters, and the target spectrum corresponding to the target light source, determines the target correction matrix corresponding to the target region. The color correction circuit uses the target correction matrix determined by the correction matrix calculation circuit to perform color correction on the target region in the original image. Because this color correction device can perform local color correction on the target region where the target light source is located in the original image, and the determined target correction matrix is based on the camera's physical parameters, the target light source's physical parameters, and the target light source's ideal spectrum, the target correction matrix can accurately restore the true color of the target light source. Furthermore, when using the target correction matrix to correct the target region in the original image, physical-level color restoration of the target region in the original image can be achieved, avoiding color cast problems.
[0028] Exemplary device Figure 1 This is a schematic diagram of a color correction device provided in an embodiment of the present disclosure. This color correction device can be a color correction device in an image signal processor, or a color correction device in a chip with image processing capabilities (such as an image processing chip). The present disclosure does not limit this to either. Figure 1 As shown, the color correction device 10 includes an input circuit 11, a region judgment circuit 12, a correction matrix calculation circuit 13, and a color correction circuit 14.
[0029] The input circuit 11 is configured to determine the original image acquired by the camera, the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source.
[0030] A raw image refers to the original digital signal image obtained by the camera converting light signals into electrical signals and then converting the electrical signals back into digital signals. A raw image can be a RAW image captured by the camera. Raw images have not undergone processing such as white balance, color correction, noise reduction, and sharpening by an image signal processor (ISP), thus retaining the most original photoelectric conversion data.
[0031] In some examples, each pixel in the original image includes data from a single channel (such as the R channel, G channel, or B channel). This original image can be converted into other image formats after image format conversion. These other image formats can be three-channel images, such as RGB images or YNR images. This disclosure does not limit the type of other image formats; the following embodiments use an RGB image as an example for illustrative purposes. Each pixel in this RGB image includes data from three channels: R, G, and B. Compared to an RGB image, the original image represents the most advanced and closest representation of the raw data in the imaging chain, closely resembling the physical photosensitivity process.
[0032] A camera consists of two core components: an optical lens and an image sensor. The optical lens collects and focuses light from the object being photographed, and through its internal lens group, precisely focuses the light onto the photosensitive surface of the image sensor. The image sensor receives the light signal focused by the optical lens and converts the received light signal into an electrical signal, thereby generating the original image.
[0033] A camera's physical parameters include parameters characterizing the camera's optical performance and parameters characterizing the image sensor's photoelectric performance. These physical parameters describe the camera's end-to-end physical imaging characteristics, from incident light to output RAW format digital signals (such as RAW images). Camera physical parameters may include parameters such as the spectral transmittance of the optical lens (also known as lens spectral transmittance), the spectral quantum efficiency of the image sensor (also known as sensor spectral quantum efficiency), system gain, and / or exposure time.
[0034] Lens spectral transmittance is an optical parameter of an optical lens, referring to the transmission ratio of incident light of different wavelengths (such as visible light in the 400-700nm range) through the lens. This parameter determines the spectral composition of the light signal reaching the image sensor. Lens spectral transmittance can be expressed as the ratio between the luminous flux passing through the optical lens and the incident luminous flux.
[0035] Quantum efficiency (QE) is a hardware parameter of an image sensor, referring to its photoelectric conversion efficiency for incident light of different wavelengths. It characterizes the ability of each color channel (such as the R, G, and B channels) on an image sensor to convert photons of a specific wavelength into photoelectrons. Quantum efficiency reflects the image sensor's photosensitivity to different light sources, and this parameter directly affects the proportion of values for each color channel in the RAW image acquired by the image sensor.
[0036] System gain characterizes the ratio from photogenerated electrons to the output linear digital signal of the image. Its core function is to establish the mapping relationship between the physical number of photoelectrons and the digital signal. System gain can include multiple gain components such as voltage conversion gain (electron to voltage conversion), analog signal gain, analog-to-digital conversion ratio, and digital signal gain. Digital signal gain includes white balance gain (WB gain), which can be determined by the AWB module in the ISP based on the ambient color temperature.
[0037] Exposure time is a parameter representing the duration of light exposure for an image sensor; it refers to the time interval from when light is received by the sensor's photosensitive surface to when exposure ceases. Exposure time controls the total amount of light entering the image sensor. A longer exposure time results in a greater number of photoelectrons accumulating, leading to a higher RAW signal value. Exposure time, along with system gain, is used to inversely convert the digital signal back into the physical number of photoelectrons.
[0038] The target light source can be a self-emissive light source, which refers to a light source that can actively radiate visible light and present visible color and brightness without relying on the reflection of external ambient light. The target light source may include traffic lights (such as red lights, yellow lights, and green lights), vehicle indicator lights, street lights, neon lights, luminous signs, construction indicator lights, and other self-emissive light sources. This disclosure does not limit the type and number of target light sources.
[0039] In some examples, at least one target light source can be predetermined, and the physical parameters of the at least one target light source can be written into the input circuit 11. This allows the region determination circuit 12 to determine the target region corresponding to each target light source in the original image based on the pre-written physical parameters of the at least one target light source. The target region corresponding to the target light source is the region to be corrected. The target light source in the original image may include one self-emissive light source or multiple self-emissive light sources. This disclosure does not limit the number or type of target light sources in the original image.
[0040] The physical parameters of a target light source are used to characterize its inherent luminescent physical properties that do not change with the environment. For example, the physical parameters of a target light source include its spectral information, luminous intensity, and radiant brightness. The spectral information of the target light source can be its actual spectrum, such as its spectral power distribution (SPD). SPD refers to the radiant power distribution of a light source at different wavelengths within the visible light band (400-700nm). It is an inherent optical property of the light source, does not change with the ambient color temperature, and directly determines the color and spectral characteristics of the light source's emission.
[0041] The target spectrum corresponding to the target light source refers to the ideal spectrum of the target light source. This ideal spectrum can be the standard spectral data of the target light source under ideal conditions. The target spectrum is used to provide a correction benchmark for subsequent color correction. By using the ideal spectrum, the imaging signal corresponding to the actual spectrum can be restored to the standard color true value, eliminating the color deviation caused by the actual spectrum.
[0042] For example, the physical parameters of the camera and the target light source can be pre-written into the input circuit 11, or they can be written into the input circuit 11 when the camera sensor captures the original image; this embodiment of the present disclosure does not limit this. For instance, when the image sensor captures the original image, it can send the exposure time and system gain at the time of capturing the original image to the input circuit 11. It should be noted that the exposure time and system gain corresponding to different frames of original images captured by the image sensor may be different; therefore, the region determination circuit 12 can determine the target region based on the camera physical parameters at the time of capturing the original image.
[0043] The region determination circuit 12 is configured to determine the target region corresponding to the target light source in the original image based on the original image, the camera's physical parameters, and the target light source's physical parameters.
[0044] The original image may include one or more target light sources. These multiple target light sources may be of the same type or different types, and this disclosure does not limit this. For example, the target light sources in the original image may include traffic lights, or both traffic lights and streetlights. It should be noted that regardless of whether the original image includes one or more target light sources, the target area corresponding to each target light source can be determined in the original image based on the physical parameters of each target light source and the physical parameters of the camera.
[0045] In some examples, the region determination circuit 12 is coupled to the input circuit 11. Based on the camera physical parameters and the physical parameters of the target light source from the input circuit 11, and combined with the pixel values of each pixel in the original image, the region determination circuit 12 filters out pixels in the original image that match the color and brightness of the target light source. Based on the region formed by the pixels that match the color and brightness of the target light source, the target region corresponding to the target light source in the original image can be determined.
[0046] For example, taking the target light source corresponding to the target area in the original image as including traffic lights and vehicle lights, the region determination circuit 12 can determine whether there are pixels in the original image whose color and brightness match those of the traffic lights, based on the pixel values of each pixel in the original image, the physical parameters of the camera, and the physical parameters of the traffic lights. If so, the region formed by the matching pixels can be determined as the target area corresponding to the traffic lights. Similarly, the region determination circuit 12 can also determine whether there are pixels in the original image whose color and brightness match those of the vehicle lights, based on the pixel values of each pixel in the original image, the physical parameters of the camera, and the physical parameters of the vehicle lights. If so, it indicates that there is a vehicle light as a target light source in the original image, and the region formed by the matching pixels can be determined as the target area corresponding to the vehicle lights.
[0047] In some examples, where the original image includes multiple target light sources, the region determination circuit 12 of this disclosure can determine whether there are target light sources to be corrected in the original image. If there are, the target regions corresponding to each target light source in the original image can be further determined.
[0048] The correction matrix calculation circuit 13 is configured to determine the target correction matrix corresponding to the target region based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source.
[0049] The correction matrix calculation circuit 13 is coupled to both the input circuit 11 and the region determination circuit 12. The correction matrix calculation circuit 13 receives the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source from the input circuit 11. The correction matrix calculation circuit 13 also receives the target region in the original image corresponding to the target light source, as determined by the region determination circuit 12. The correction matrix calculation circuit 13 is used to calculate the target correction matrix corresponding to the target region. This target correction matrix is used to compensate for and correct the color deviation in the target region caused by AWB, thereby ensuring that the color information of the target region can be accurately restored.
[0050] In some examples, when the original image includes multiple target light sources, the region determination circuit 12 can determine the target region corresponding to each target light source in the original image, and the correction matrix calculation circuit 13 can determine the target correction matrix corresponding to each target region. That is, the region determination circuit 12 can determine the corresponding target correction matrix for each target region to correct the color cast problem in that target region. The target correction matrices corresponding to different target regions may be different.
[0051] The color correction circuit 14 is configured to perform color correction on the target region in the original image based on the target correction matrix to obtain a corrected image.
[0052] The color correction circuit 14 is coupled to both the correction matrix calculation circuit 13 and the region determination circuit 12. The color correction circuit 14 receives the target region corresponding to the target light source in the original image, determined by the region determination circuit 12, and receives the target correction matrix corresponding to the target region, determined by the correction matrix calculation circuit 13. Based on the target correction matrix, the color correction circuit 14 performs color correction on the target region in the original image, thereby ensuring that the target region in the corrected image does not exhibit color cast.
[0053] The color correction device provided in this disclosure uses the physical parameters of the camera and the target light source to accurately identify the target area corresponding to the target light source in the original image. Furthermore, the correction matrix calculation circuit combines the physical parameters of the camera, the physical parameters of the target light source, and the ideal spectrum of the target light source to further ensure that the target correction matrix corresponding to the determined target area can accurately restore the true color of the target light source. Finally, when the color correction circuit performs local color correction on the target area corresponding to the target light source in the original image using the target correction matrix, it can achieve physical-level color restoration of the color information within the target area. Compared to the global AWB correction scheme, this disclosure can accurately locate the target area corresponding to the target light source in the original image and perform local color correction on the target area in the original image using the target correction matrix corresponding to the target area, accurately restoring the true color of the target light source, thereby achieving physical-level color restoration of the target area in the original image and avoiding color cast problems in the image.
[0054] In some embodiments, the region determination circuit 12 is further configured to: Based on the lens spectral transmittance and sensor spectral quantum efficiency in the camera's physical parameters, and the spectral information in the target light source's physical parameters, the proportional relationship of the target light source in the preset color channels is determined.
[0055] The region determination circuit 12 receives the lens spectral transmittance, sensor spectral quantum efficiency and target light source spectral information from the input circuit 11 to determine the proportional relationship of the target light source in the preset color channel.
[0056] To accurately determine the target region (e.g., a self-emissive light source region) corresponding to the target light source in the original image, the region determination circuit 12 can first determine the color determination logic (e.g., the color determination criterion is related to the proportional relationship of the target light source in the preset color channels) and brightness determination logic (e.g., the brightness determination criterion is related to the brightness information of the target light source) corresponding to the target light source. Then, based on the color determination logic of the target light source, it determines whether the pixels in the image conform to the color determination logic. For pixels that conform to the color determination criterion, it is necessary to further determine whether the pixel conforms to the brightness determination logic of the target light source. If a pixel conforms to both the color determination logic and the brightness determination logic, the region determination circuit 12 can determine that the pixel is a pixel within the target region, thereby enabling the determination of the target region where the self-emissive light source is located in the original image.
[0057] Since the spectral characteristics of the target light source are fixed, its color features are determined by its own physical properties and are not affected by ambient color temperature, global white balance (AWB) gain, exposure parameters, etc. However, the color of objects reflecting the environment changes with lighting conditions. Directly using pixel values to determine the target area (such as a self-emissive light source area) in an image can lead to misjudgments. Therefore, to accurately determine the target area in the original image, the color ratio of the target light source can be determined first. Because this color ratio is unaffected by external interference, the target area corresponding to the target light source can be accurately selected from the original image, avoiding misjudgments. In this embodiment, the color ratio of the target light source can be used as the basis for the color determination logic of the target light source.
[0058] For example, the color ratio of the target light source includes the ratio of the target light source in a preset color channel, which may include the R channel, G channel, and B channel. The ratio of the target light source in the preset color channel may include the ratio of any two of the R, G, and B channels. For example, the ratio of the target light source in the preset color channel may include the ratio of the R channel and the G channel (e.g., R / G), or it may include the ratio of the B channel and the G channel (e.g., B / G). This embodiment of the disclosure does not limit which two channels the ratio of the target light source in the preset color channel is specifically.
[0059] The color proportions of a target light source are directly related to its spectral power distribution (SPD), lens spectral transmittance, and image sensor photoelectric conversion efficiency. These three parameters correspond to the light emission, light transmission, and photoelectric conversion stages in the imaging chain, respectively, and together determine the color proportions of the target light source. Therefore, this disclosure can accurately determine the color proportions of the target light source based on its spectral information, lens spectral transmittance, and sensor spectral quantum efficiency.
[0060] For the same camera, lens spectral transmittance and sensor spectral quantum efficiency are fixed parameters, while the spectral power distribution of the target light source is determined by the target light source's own physical properties. Therefore, the color ratio relationship of different target light sources is related to the spectral power distribution of the target light source. When the spectral power distributions of different target light sources are different, the determined color ratio relationship will also differ. It should be noted that for the same camera and the same target light source, the region determination circuit 12 only needs to calculate the color ratio relationship of the target light source once. Subsequently, for other frames of original images acquired by the camera, the target region corresponding to the target light source in each frame of original images can be determined based on the initially determined color ratio relationship.
[0061] For example, when a color correction device corrects multiple frames of original images captured by the same camera at different times, since these multiple frames of original images were captured by the same camera, the lens spectral transmittance and the sensor spectral quantum efficiency are the same. When determining the target regions corresponding to the same target light source in multiple frames of original images, the region determination circuit 12 can calculate the color ratio relationship corresponding to the target light source once and store it in a preset storage space. Subsequently, the region determination circuit 12 can directly read the color ratio relationship corresponding to the target light source and determine the target region corresponding to the target light source in other frames of original images based on the color ratio relationship.
[0062] In some examples, the normalized signals of the target light source in each color channel can be obtained by forward modeling the imaging physical link. Then, the color proportions of the target light source can be determined based on these normalized signals. It's important to note that forward modeling of the imaging physical link refers to deriving and calculating the output signals of the image sensor in each color channel based on the physical parameters of the target light source, optical lens, and image sensor, following the imaging path of light source radiation-optical transmission-photoelectric conversion. The normalized signals of the target light source in each color channel obtained through forward modeling are only related to the physical properties of the camera and the light source and can be used as a benchmark for determining the color of the target light source.
[0063] For example, the normalized signal of the sensor in each color channel can be calculated using the following formula: Formula 1 in, Let be the normalized signal of the target light source in the i-th color channel. The wavelength of the target light source, The spectral power distribution of the target light source, For lens spectral transmittance, Let be the spectral quantum efficiency of the image sensor in the i-th color channel, where i is the R channel, G channel, or B channel.
[0064] Formula 1 calculates the normalized signals of the target light source in each color channel of the sensor by simulating the entire process of emission spectrum, optical transmission filtering, and photoelectric conversion of the target light source. Based on these normalized signals, the color ratio of the target light source, such as the R / G or B / G ratio, can then be calculated.
[0065] In some examples, the preset color channel ratios include R / G and B / G, which can be expressed by the following formulas: Formula 2 In determining the color ratio of the target light source, this disclosure is based on the inherent physical properties of the target light source, optical lens, and image sensor. Therefore, the determined color ratio is not affected by ambient color temperature, exposure parameters, and global white balance, and can be used as the physical basis for determining the color of the target light source.
[0066] The brightness information of the target light source is determined based on the lens spectral transmittance, sensor spectral quantum efficiency, spectral information, and the preset brightness coefficient corresponding to the target light source.
[0067] When determining the target area of a target light source in the original image, relying solely on the color ratio of the target light source is easily affected by reflected interference and noise, making it impossible to distinguish objects with similar spectral characteristics but different brightness. This leads to inaccurate identification of self-emissive light source areas. For example, under specific ambient light (such as dusk or under streetlights), the reflection spectrum of a red reflective road sign may have a similar color ratio to that of a red traffic light. If color judgment is relied upon alone, the red reflective road sign may be misidentified as a red traffic light, affecting the driving safety of autonomous vehicles that rely on this judgment result. To accurately determine the target area (i.e., the self-emissive light source area) in the image, this disclosure further combines brightness judgment logic with color judgment to accurately identify the target area in the original image whose color and brightness both match the self-emissive light source.
[0068] In some examples, similar to the method used to determine color determination logic, the brightness determination logic for the target light source can also obtain the brightness information of the target light source in each color channel by performing forward modeling of the imaging physical link. Specifically, the brightness information of the target light source in each color channel can be calculated using the following formula: Formula 3 in, The brightness information of the target light source in the i-th color channel. The wavelength of the target light source, The spectral power distribution of the target light source, For lens spectral transmittance, Let L be the spectral quantum efficiency of the image sensor in the i-th color channel, where i is the R, G, or B channel, and L be the preset brightness coefficient corresponding to the target light source. The preset brightness coefficient corresponding to the target light source can be a preset coefficient related to the luminous intensity of the target light source, and there can be one or more preset brightness coefficients. When there are multiple preset brightness coefficients, the theoretical brightness range of the target light source can be calculated by combining these multiple preset brightness coefficients with Formula 3.
[0069] Formula 3, by forward modeling the entire chain of the target light source's emission spectrum, optical transmission filtering, and photoelectric conversion process, can correlate the target light source's spectrum with its actual luminous intensity, obtaining the brightness information of the target light source in each color channel. Since this brightness information is determined only by the inherent physical properties of the target light source, optical lens, and image sensor, as well as the preset coefficients of the target light source, it is not affected by ambient color temperature, exposure parameters, system gain, or global white balance processing, and can serve as a reliable brightness judgment benchmark for distinguishing self-emitting targets from reflective interference objects.
[0070] Based on the ratio of the original image and the target light source in the preset color channels, as well as the brightness information of the target light source, the target area corresponding to the target light source in the original image is determined.
[0071] After determining the color ratio and brightness information of the target light source, the color determination logic and brightness determination logic of the target light source can be further determined based on these two parameters. Then, based on the pixel values of each pixel in the original image, the pixels that meet both the color determination criteria and the brightness determination criteria are determined in the original image. The area formed by these pixels is the target area corresponding to the target light source in the original image.
[0072] The color correction device disclosed herein can determine the color ratio and brightness information of the target light source by performing forward modeling of the imaging physical link. Based on this information, it can determine the color and brightness determination logic of the target light source, accurately identifying the target area in the original image whose color and brightness match the target light source. By combining the inherent color and brightness characteristics of the target light source to filter the target area, this disclosure effectively eliminates the influence of reflective interference, improves the accuracy of target area positioning, and thus obtains more accurate color correction results.
[0073] In some embodiments, the region determination circuit 12 is configured to determine the target region corresponding to the target light source in the original image based on the original image, the proportional relationship of the target light source in the preset color channel, and the brightness information of the target light source, including: performing interpolation processing on the original image to obtain an interpolated image; performing normalization processing on the pixel values of the pixels in the interpolated image based on the system gain and exposure time in the camera's physical parameters to obtain normalized pixel values of the pixels in the preset color channel; and determining the target region corresponding to the target light source in the original image based on the normalized pixel values of the pixels in the preset color channel, the proportional relationship of the target light source in the preset color channel, and the brightness information of the target light source.
[0074] For example, since the original image uses a Bayer filter array, each pixel only senses one color, so each pixel only has single-channel data and lacks complete R, G, and B channel data (i.e., each pixel in the original image only has data from one of the R, G, and B channels). However, color and brightness determination require data from all three channels (R, G, and B). Therefore, the original image needs to be interpolated to complete the R, G, and B channel data for each pixel, resulting in an interpolated image. This interpolated image is an RGB image, where each pixel has complete R, G, and B channel data. This disclosure does not limit the specific implementation of the interpolation process for the original image; any interpolation algorithm capable of interpolating the original image to obtain an RGB image is applicable to this disclosure, such as the demosaic algorithm.
[0075] After obtaining the complete interpolated image across the R, G, and B channels, to eliminate the influence of camera parameter variations (such as exposure time, system gain, and other imaging parameters) on pixel values during the shooting process, the pixel values in the interpolated image can be normalized based on the system gain and exposure time used when the original image was captured. This results in normalized pixel values for each pixel in a preset color channel. System gain includes analog signal gain and digital signal gain. Digital signal gain includes the white balance gain determined by the AWB module in the ISP based on the ambient color temperature.
[0076] This disclosure utilizes the system gain and exposure time of the camera when capturing the original image to normalize the interpolated image, thereby restoring the interpolated digital signal into a physical quantity that can characterize the true physical brightness of the object.
[0077] In some examples, the original image can be interpolated by the region determination circuit 12, or the original image can be interpolated by an interpolation circuit. The interpolation circuit can be integrated into the region determination circuit 12 or set separately outside the region determination circuit 12. This disclosure does not limit this.
[0078] For example, the region determination circuit 12 can normalize the pixel values of the interpolated image by dividing the RGB three-channel values of the interpolated image by the product of the exposure time and the system gain, based on the exposure time and system gain corresponding to the original image determined by the input circuit 11. After normalization, the influence of changes in system gain and exposure time can be eliminated, so that the normalized pixel value after normalization has a linear relationship with the photon flux incident on the surface of the image sensor, which can objectively reflect the true radiation intensity of the target. Since self-emitting light sources (such as traffic lights) usually have much higher radiation brightness than environmental reflective objects, and the brightness of reflective objects is limited by the ambient illuminance, this normalization process provides a unified, stable and robust judgment benchmark for subsequent target region determination based on brightness characteristics, effectively avoiding the impact of imaging parameter fluctuations on the accuracy of target region recognition.
[0079] To eliminate the influence of imaging parameters such as exposure time and system gain, the three-channel pixel values of each pixel in the interpolated image can be converted into normalized pixel values using the following formula: Formula 4 in, Let be the normalized pixel value of the pixel in the i-th color channel of the interpolated image. Let G be the original digital signal value of the pixel in the i-th color channel of the interpolated image, and let G be the system gain. This represents the exposure duration. After normalization, It is only related to the incident light energy, lens transmittance, and sensor spectral quantum efficiency, and is independent of camera imaging parameters (such as system gain and exposure time).
[0080] After normalizing the interpolated image to obtain the normalized pixel value of each pixel, the normalized pixel value of each pixel can be determined by combining the proportional relationship of the target light source in the preset color channel and the brightness information of the target light source.
[0081] In some embodiments, the region determination circuit 12 is configured to: determine the target region corresponding to the target light source in the original image based on the normalized pixel value of the pixel in the preset color channel, the proportional relationship of the target light source in the preset color channel, and the brightness information of the target light source, including: determining the color determination condition of the target light source based on the proportional relationship of the target light source in the preset color channel; and, in response to the normalized pixel value of the pixel in the preset color channel satisfying the color determination condition, determining the target region corresponding to the target light source in the image based on the normalized pixel value of the pixel satisfying the color determination condition in the preset color channel and the brightness information of the target light source.
[0082] After determining the proportional relationship of the target light source in the preset color channels, the color judgment condition corresponding to the target light source can be determined based on this color proportional relationship. This color judgment condition is the color judgment logic. It should be noted that the color proportional relationship determined by the region judgment circuit 12 is the theoretical color proportionality of the target light source. In order to determine the target region on the original image, the actual color proportion corresponding to each pixel can be calculated based on the normalized pixel value of each pixel in the preset color channels obtained after normalization processing; then, it is determined whether the actual color proportion corresponding to each pixel satisfies the color judgment condition. If it does, it is determined that the pixel on the original image conforms to the color judgment logic of the target light source.
[0083] Taking the ratio of the target light source in the preset color channels, including R / G and B / G, as an example, based on the normalized pixel values of each pixel in the three RGB channels obtained after normalization processing (such as... , , This allows for the calculation of the actual color proportion of each pixel, which includes... / and / .
[0084] For example, after determining the color ratio (such as R / G and B / G) of the target light source in a preset color channel, color judgment conditions for actual pixel matching can be constructed based on this color ratio relationship. Considering that the actual color ratio is difficult to perfectly match the theoretical color ratio due to various factors such as manufacturing tolerances of the light source, individual differences between the lens and sensor, and minor losses in the optical path during the actual imaging process, color judgment conditions with strong fault tolerance and high matching accuracy can be constructed through reasonable rules.
[0085] In some examples, a reasonable tolerance range can be preset based on the proportional relationship of the target light source in the preset color channels, and a numerical range can be constructed as the color determination condition of the target light source. When the actual color ratio of a pixel is within the range of this numerical range, it can be determined that the pixel meets the color determination condition of the target light source.
[0086] In other examples, the actual color ratio of each pixel can be calculated based on the normalized pixel value of each pixel in the preset color channel, and then the normalized deviation value between the actual color ratio and the theoretical color ratio can be calculated. This deviation value can be used as the color determination condition of the target light source.
[0087] In some other examples, an inequality can be constructed based on the proportional relationship of the target light source in the preset color channels. This inequality can be used as the color determination condition of the target light source. When the actual color ratio of a pixel satisfies the inequality, it can be determined that the pixel satisfies the color determination condition of the target light source.
[0088] The embodiments disclosed herein do not limit the specific method for determining color determination conditions. Any color determination conditions determined based on the proportional relationship of the target light source in the preset color channel are within the protection scope of this disclosure.
[0089] When the actual color ratio of a pixel meets the color determination criteria of the target light source, it can be determined that the color characteristics of that pixel are consistent with the target light source, and therefore, that pixel conforms to the color determination logic of the target light source. To avoid the influence of reflected interference and noise, and to improve the accuracy of target area determination, the brightness information of the target light source can be further combined to determine whether the brightness characteristics of pixels that meet the color determination criteria are consistent with the target light source. When the color and brightness characteristics of a pixel are consistent with the target light source, it can be determined that the pixel is a pixel within the target area, thus allowing the target area to be identified on the original image.
[0090] Because the brightness of pixels in a self-emissive light source region is not a single step value during imaging due to factors such as lens optical characteristics (vignetting, diffraction, halo), emission angle deviation, and distance changes, it exhibits a continuous attenuation distribution from the central high-brightness area to the edge halo area. If a binary judgment method with a fixed brightness threshold is used, the edge halo area will be directly identified as a non-target area, resulting in harsh correction banding artifacts at the edges of the target area during subsequent color correction. Therefore, this disclosure, when performing brightness judgment, can combine the brightness threshold curve to generate smooth and continuous weighting coefficients. This not only accurately completes the brightness screening of the self-emissive light source region but also simultaneously generates correction coefficients for subsequent color correction, thereby adapting to the physical imaging characteristics of the self-emissive target and avoiding subsequent edge correction banding.
[0091] In some embodiments, the region determination circuit 12 is configured to: determine the target region corresponding to the target light source in the image based on the normalized pixel value of the pixel satisfying the color determination condition in the preset color channel and the brightness information of the target light source, including: determining a weight coefficient curve based on the brightness information of the target light source and a preset brightness threshold curve; determining the weight coefficient corresponding to the pixel based on the normalized pixel value of the pixel satisfying the color determination condition in the preset color channel and the weight coefficient curve; determining the pixel as a pixel within the target region in response to the weight coefficient corresponding to the pixel being greater than a preset threshold; and determining the target region corresponding to the target light source in the original image based on the pixels within the target region.
[0092] The preset brightness threshold curve can be an S-shaped function or a piecewise linear function. Since the brightness information of the target light source includes the brightness values of the target light source in the R, G, and B color channels, when determining the weighting coefficient curve, the theoretical brightness range of the target light source can be determined based on the brightness values of the target light source in the R, G, and B color channels, and then the weighting coefficient curve can be obtained based on the theoretical brightness range and the preset brightness threshold curve.
[0093] Since the brightness of the target light source decreases continuously from the central high-brightness area to the peripheral halo area, the maximum brightness value can be determined based on the brightness values of the target light source in the R, G, and B color channels. Then, the theoretical brightness range corresponding to the target light source can be determined based on the maximum brightness value. It should be noted that the color channel corresponding to the maximum brightness value can be the R, G, or B channel, and the color channel corresponding to the maximum brightness value depends on the type of target light source. For example, taking a green traffic light as the target light source, the color channel corresponding to the maximum brightness value is the G channel.
[0094] For example, the target light source has the highest luminance value in the G channel among the R, G, and B color channels, and the preset luminance coefficient is L. min and L max For example, L can be used min Substituting into Formula 3, we obtain the lower limit L1 of the theoretical brightness range. max Substituting into Formula 3, we can calculate the upper limit L2 of the theoretical brightness range.
[0095] After determining the theoretical brightness range (L1, L2), the theoretical brightness range (L1, L2) can be combined with the preset brightness threshold curve distribution to obtain the weighting coefficient curve. Then, based on the normalized pixel values of each pixel in the three RGB color channels, the maximum normalized pixel value of each pixel is determined. Finally, the maximum normalized pixel value of each pixel is used to query the weighting coefficient curve to obtain the weighting coefficient corresponding to each pixel. The interval division and mapping logic of this weighting coefficient curve are related to the theoretical brightness range.
[0096] For non-target brightness regions with brightness lower than the lower limit of the theoretical brightness range (such as pixel points in regions of reflective objects, low noise, etc.), the weight coefficient Ratio = 0 can be obtained according to the weight coefficient curve, indicating that the pixel does not meet the brightness characteristics of the self-luminous light source and does not participate in subsequent correction.
[0097] For the target brightness range with brightness within the theoretical brightness range (such as pixel points within the self-luminous light source region), the weight coefficient Ratio = 1 can be obtained according to the weight coefficient curve, indicating that the pixel meets the brightness characteristics of the self-luminous light source and color correction is required.
[0098] For the transition range near the upper and lower limits of the theoretical brightness range (such as scenes of the edge halo of the target light source, lens vignetting, luminous angle deviation, etc.), a smooth gradient value of 0 < Ratio < 1 can be obtained according to the weight coefficient curve to achieve a continuous transition between the target region and the non-target region.
[0099] For pixel points that meet the color determination conditions, the weight coefficient corresponding to the pixel point can be further obtained by querying the weight coefficient curve based on the maximum normalized pixel value of the pixel point in the three RGB color channels. When the weight coefficient is greater than the preset threshold, it can be determined that the pixel point is a pixel point within the target region. That is, the region composed of pixel points on the original image that meet both the color determination conditions and the brightness determination conditions is the target region.
[0100] The preset threshold can be set according to actual needs, and the present disclosure does not limit the specific value of the preset threshold. For example, the preset threshold can be set to 0, or can be set to 0.1 or other values. It should be noted that the value of the preset threshold has a certain impact on the determination of the target region, so the preset threshold can be reasonably set in combination with actual needs to facilitate the determination of the target region that needs color correction. The following embodiments are exemplarily described with the preset threshold being 0.
[0101] For example, taking the target light source as a green traffic light and the preset threshold as 0, after determining the pixel points that meet the color determination conditions on the original image, since the normalized pixel value of the G channel is the largest among the pixel points that meet the color determination conditions, the weight coefficient curve can be queried based on the normalized pixel value of each pixel point in the G channel to obtain the weight coefficient corresponding to each pixel point. In order to ensure that there is no easy break in the subsequent correction of the self-luminous light source, the pixel points with a weight coefficient greater than 0 can be determined as the pixel points within the target region, so that the halo region of the self-luminous light source can also be corrected subsequently, ensuring that the correction intensity smoothly transitions with the brightness and eliminating edge artifacts at the physical level.
[0102] This disclosure, based on color determination, determines the weight coefficient of each pixel using a weight coefficient curve and uses this weight coefficient as the brightness determination logic. It combines the inherent brightness characteristics of the target light source to construct a robust brightness determination standard unaffected by imaging parameters, effectively filtering out reflection interference and abnormal noise with similar spectral characteristics. This accurately identifies the target area that satisfies both color and brightness determination logic. Furthermore, through a continuously transitioning weight coefficient generation scheme, this disclosure can identify pixels in the halo region at the edge of the target area as pixels within the target area. Therefore, during color correction, pixels in the halo region can be corrected, avoiding harsh correction discontinuity artifacts at the edges of the target area. This also simplifies the ISP front-end processing flow, reduces hardware implementation complexity, provides reliable weight support for subsequent color correction, and ensures the naturalness and continuity of the color correction effect.
[0103] In some embodiments, the correction matrix calculation circuit 13 is specifically configured to determine the target correction matrix corresponding to the target region based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source. This includes: determining the brightness information of the target light source based on the lens spectral transmittance and sensor spectral quantum efficiency, the spectral information of the target light source, and the preset brightness coefficient corresponding to the target light source; determining an initial correction matrix based on the target spectrum corresponding to the target light source and the brightness information of the target light source; and determining the target correction matrix corresponding to the pixels in the target region based on the initial correction matrix, the identity matrix, and the weight coefficients corresponding to the pixels in the target region.
[0104] It should be noted that the implementation method of the correction matrix calculation circuit 13 in determining the brightness information of the target light source can refer to the specific implementation method of the region judgment circuit 12 in determining the brightness information of the target light source, and will not be repeated here. In some examples, the correction matrix calculation circuit 13 can also directly use the brightness information of the target light source determined by the region judgment circuit 12 to determine the target correction matrix.
[0105] When determining the target correction matrix for the target area, a photoelectric response model can be constructed based on the ideal spectrum of the target light source (i.e., the target spectrum) and the brightness information of the target light source, and the initial correction matrix can be calculated. (Also known as the inverse correction matrix) This allows for physical-level color reproduction of the target area, independent of global AWB.
[0106] In some examples, a physical model can be used to calculate the deviation between the theoretically expected true RGB values and the actual output values of the target light source under the current ambient color temperature and corresponding global white balance gain, thereby generating an initial correction matrix for the target region. Initial correction matrix The purpose is to reversely eliminate the erroneous gain compensation of global AWB for self-emissive light sources, and restore the true spectral characteristics of self-emissive light sources from a physical level, rather than relying on empirical color mapping. This makes the correction results unaffected by ambient color temperature and exposure parameters, and more robust.
[0107] This disclosure embodiment regarding the initial correction matrix The size is not limited; the following embodiments use an initial correction matrix. The size is Taking this as an example, the initial correction matrix is only related to physical parameters such as the target light source, camera optical system, image sensor, and global white balance gain. Therefore, it can accurately restore the spectral characteristics of a self-emissive light source that are distorted by global AWB.
[0108] In some embodiments, the initial correction matrix can be used directly. The target region in the original image is corrected. In other embodiments, considering that the brightness of a self-emissive light source exhibits a continuous distribution from the center to the edge, in order to avoid artifacts or abrupt changes in the boundary region of the self-emissive light source, an initial correction matrix is determined. Then, by combining the weight coefficients corresponding to each pixel in the target area, the target correction matrix corresponding to each pixel can be determined.
[0109] In some examples, the target correction matrix It can be determined by the following formula: Formula 5 in, This is the initial correction matrix. For the target correction matrix, These are the weight coefficients corresponding to each pixel in the target region. This is the identity matrix. The target correction matrix for each pixel in the target region can be calculated using Formula 5.
[0110] The weighting coefficients corresponding to different pixels in the target region may be different. When the weighting coefficients corresponding to different pixels in the target region are different, the target correction matrices corresponding to different pixels in the target region will also be different. This disclosure can determine the target correction matrix for correcting the color of each pixel in the target region. Since the brightness of the target region changes continuously, the weighting coefficients that change continuously from 0 to 1 can be obtained based on the weighting coefficient curve, thereby generating a corresponding target correction matrix for each pixel. Therefore, during subsequent correction, this target correction matrix can ensure that the intensity of color correction transitions smoothly with brightness, eliminating edge artifacts from a physical level and ensuring that the image is not distorted.
[0111] This disclosure embodiment applies to the identity matrix. The size of the identity matrix is not limited. Size and initial correction matrix They can be the same size, for example, the identity matrix. The size can be .
[0112] When the weight coefficients corresponding to the pixels are small, if only the initial correction matrix is used... Calculate the target correction matrix using weighting coefficients. This calculation will fail because it lacks unit correction. The involvement of [the target] leads to the target correction matrix. If the value is too small, the brightness of the pixels will be reduced to too low during subsequent pixel correction, resulting in image distortion. Therefore, this disclosure determines the target correction matrix... When combined with the initial correction matrix Weighting coefficients and unit corrections They worked together to determine this to ensure that the color-corrected image would not be distorted.
[0113] This disclosure constructs a dedicated inverse correction matrix (i.e., initial correction matrix) for a self-emissive light source based on a physical model. ), and generate the target correction matrix by combining the weighting coefficients. On the one hand, it can achieve accurate reverse correction of global white balance color shift, restore the true physical color of self-emissive light source, and solve the problem of color shift in self-emissive light source area caused by global AWB correction in traditional ISP processing; on the other hand, through continuous and smooth correction intensity transition, it avoids correction boundary artifacts and global image distortion, and improves the accuracy and robustness of self-emissive light source recognition.
[0114] In some embodiments, the color correction circuit 14 is configured to: perform color correction on a target region in the original image based on a target correction matrix to obtain a corrected image, including: determining a correction coefficient corresponding to a pixel in a target correction matrix based on the target color channel corresponding to a pixel in the target region of the original image; performing color correction on the pixel value of the pixel in the interpolated image based on the correction coefficient corresponding to the pixel to obtain a corrected pixel value of the pixel in the target color channel; and obtaining a corrected image based on the corrected pixel value of the pixel in the target region in the target color channel.
[0115] After the correction matrix calculation circuit 13 determines the target correction matrix corresponding to each pixel in the target area, the color correction circuit 14 can perform color correction on each pixel according to the target correction matrix corresponding to each pixel.
[0116] When correcting the original image, since the original image is a RAW image and each pixel corresponds to only a single color channel, to ensure that the corrected image is still a RAW data domain image, it is necessary to first determine the target color channel of each pixel in the target region in the original image. Then, based on the target color channel in the target correction matrix, the correction coefficient corresponding to the target color channel is determined, and then the pixel is color corrected using the correction coefficient to ensure that the color channels of each pixel in the corrected image are consistent with those of the original image. When using the correction coefficient to perform color correction on the pixels, the complete R, G, and B channel pixel values of each pixel in the interpolated image can be read first. These pixel values are the original interpolated signals without normalization processing, preserving the original dynamic range of the pixels. Then, the complete R, G, and B channel pixel values of the pixels in the interpolated image are corrected based on the correction coefficient.
[0117] For example, in the target correction matrix corresponding to the pixel point When determining the correction coefficients corresponding to a pixel, the target color channel can be determined based on the Bayer color channel attributes of the current pixel; in the target correction matrix The column vector corresponding to the target color channel is selected as the correction coefficient for the pixel. Finally, the correction coefficient is multiplied by the R, G, and B channel pixel values of the pixel in the interpolated image to obtain the corrected pixel value of the pixel in the target color channel.
[0118] In the target correction matrix Selecting the column vector corresponding to the target color channel as the correction coefficient for that pixel can include: when the target color channel of the pixel is the R channel, it can be selected from the target correction matrix. The first column vector is selected as the correction coefficient for that pixel; when the target color channel of the pixel is the G channel, the correction coefficient can be selected from the target correction matrix. The second column vector is selected as the correction coefficient for that pixel; when the target color channel of the pixel is the B channel, it can be selected in the target correction matrix. The third column vector is selected as the correction coefficient for that pixel.
[0119] For example, with the target correction matrix for Taking a matrix as an example, the target correction matrix This can be expressed using the following formula: Formula 6 The pixels in the target region can be classified into three types based on their corresponding target color channels: the first pixel, the second pixel, and the third pixel. Specifically, the first pixel's color channel in the original image is the R channel, meaning its target color channel is the R channel; the second pixel's color channel in the original image is the G channel, meaning its target color channel is the G channel; and the third pixel's color channel in the original image is the B channel, meaning its target color channel is the B channel.
[0120] The following sections explain how to correct the first, second, and third pixels.
[0121] For the first pixel in the target region, the target correction matrix corresponding to that first pixel can be used. Select the first column element [m] 00 m 10 m 20 [m] is used as the correction coefficient corresponding to the first pixel; the R, G, and B channel pixel values corresponding to the first pixel in the interpolated image are read; then the correction coefficient [m] corresponding to the first pixel is used as the correction coefficient corresponding to the first pixel. 00 m 10 m 20 The first pixel's corrected pixel value in the R channel is obtained by performing a dot product operation with the R, G, and B channel pixel values: .
[0122] For the second pixel in the target region, the target correction matrix corresponding to that second pixel can be used. Select the second column element [m] 01 m 11 m 21 [m] is used as the correction coefficient corresponding to the second pixel; the R, G, and B channel pixel values corresponding to the second pixel in the interpolated image are read; then the correction coefficient [m] corresponding to the second pixel is used as the correction coefficient. 01 m 11 m 21 The second pixel's corrected pixel value in the G channel is obtained by performing a dot product operation with the R, G, and B channel pixel values: .
[0123] For the third pixel in the target region, the target correction matrix corresponding to that third pixel can be used. Select the third column element [m] 02 m 12 m 22 [m] is used as the correction coefficient corresponding to the third pixel; the R, G, and B channel pixel values corresponding to the third pixel in the interpolated image are read; then the correction coefficient [m] corresponding to the third pixel is used as the correction coefficient. 02m 12 m 22 The third pixel is then multiplied by the R, G, and B channel pixel values to obtain the corrected pixel value in the B channel. .
[0124] After obtaining the corrected pixel values of each pixel in the target area, the corrected pixel values can be... , or The corresponding coordinate position is written to the original image (such as the original RAW) to overwrite the pixel value at that coordinate position in the original image. Since the embodiments of this disclosure perform physical-level color correction directly in the RAW data domain without changing the image's Bayer arrangement format, bit depth, or data structure, the corrected image can be seamlessly compatible with subsequent ISP processing without additional format conversion or data preprocessing steps.
[0125] The color correction device provided in this disclosure, when performing color correction on the target region corresponding to the target light source in the original image, achieves physical-level inverse correction of the target region by performing pixel reconstruction and writing operations in the RAW data domain. This accurately restores the true physical color of the target light source without changing the image format or bit depth, ensuring seamless compatibility with subsequent ISP processing. Furthermore, this disclosure only corrects pixels within the target region, avoiding global image distortion and correction boundary artifacts. While ensuring the accuracy of target region recognition corresponding to the target light source, it does not affect the recognition effect of background reflection targets, thus improving the overall robustness of the autonomous driving perception system.
[0126] Exemplary methods Figure 2 This is a schematic flowchart of a color correction method provided in an exemplary embodiment of this disclosure. This embodiment can be applied to electronic devices, such as... Figure 2 As shown, it includes the following steps: Step 201: Determine the original image captured by the camera, the physical parameters of the camera, the physical parameters corresponding to the target light source, and the target spectrum corresponding to the target light source.
[0127] Step 201 can be executed by the input circuit 11. The specific implementation of step 201 can be found in the relevant content of the input circuit 11 in the foregoing embodiment, and will not be repeated here.
[0128] Step 202: Based on the original image, the camera's physical parameters, and the target light source's physical parameters, determine the target region corresponding to the target light source in the original image.
[0129] Step 202 can be executed by the region determination circuit 12. The specific implementation of step 202 can be found in the relevant content of the region determination circuit 12 in the foregoing embodiment, and will not be repeated here.
[0130] Step 203: Based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source, determine the target correction matrix corresponding to the target region.
[0131] Step 203 can be executed by the correction matrix calculation circuit 13. The specific implementation of step 203 can be found in the relevant content of the correction matrix calculation circuit 13 in the foregoing embodiment, and will not be repeated here.
[0132] Step 204: Perform color correction on the target region in the original image based on the target correction matrix to obtain the corrected image.
[0133] Step 204 can be executed by the color correction circuit 14. The specific implementation of step 204 can be found in the relevant content of the color correction circuit 14 in the foregoing embodiment, and will not be repeated here.
[0134] The color correction method provided in this disclosure utilizes the physical parameters of the camera and the target light source to accurately identify the target region corresponding to the target light source in the original image. Furthermore, by combining the camera's physical parameters, the target light source's physical parameters, and the ideal spectrum of the target light source, it further ensures that the target correction matrix corresponding to the determined target region can accurately restore the true color of the target light source. Finally, when performing local color correction on the target region corresponding to the target light source in the original image using the target correction matrix, it can achieve physical-level color restoration of the color information within the target region. Compared to the global AWB correction scheme, this disclosure can accurately determine the target region corresponding to the target light source in the original image, and by combining the target correction matrix to perform local color correction on the target region corresponding to the target light source in the original image, it can accurately restore the true color of the target light source, thereby achieving physical-level color restoration of the target region in the original image and avoiding color cast problems in the image.
[0135] Figure 3 This is a schematic flowchart of a color correction method provided in another exemplary embodiment of this disclosure, such as... Figure 3 As shown above, in the above Figure 2 Based on the illustrated embodiment, step 202 may include the following steps: Step 2021: Based on the lens spectral transmittance and sensor spectral quantum efficiency in the camera's physical parameters, and the spectral information in the physical parameters of the target light source, determine the proportional relationship of the target light source in the preset color channels.
[0136] Step 2022: Determine the brightness information of the target light source based on the lens spectral transmittance, sensor spectral quantum efficiency, spectral information, and the preset brightness coefficient corresponding to the target light source.
[0137] Step 2023: Based on the original image, the proportional relationship of the target light source in the preset color channels, and the brightness information of the target light source, determine the target area corresponding to the target light source in the original image.
[0138] The specific implementation methods of steps 2021-2023 can be found in the relevant content of the region judgment circuit 12 in the aforementioned embodiment, and will not be repeated here.
[0139] Figure 4 This is a flowchart illustrating a color correction method provided in yet another exemplary embodiment of this disclosure, as shown below. Figure 4 As shown above, in the above Figure 3 Based on the illustrated embodiment, step 2023 may include the following steps: Step 20231: Perform interpolation on the original image to obtain the interpolated image.
[0140] Step 20232: Based on the system gain and exposure time in the camera's physical parameters, normalize the pixel values of the pixels in the interpolated image to obtain the normalized pixel values of the pixels in the preset color channel.
[0141] Step 20233: Based on the normalized pixel values of pixels in the preset color channels, the proportional relationship of the target light source in the preset color channels, and the brightness information of the target light source, determine the target area corresponding to the target light source in the original image.
[0142] In some examples, step 20233 includes: determining the color determination conditions of the target light source based on the proportional relationship of the target light source in the preset color channels; and, in response to the normalized pixel value of a pixel in the preset color channel satisfying the color determination conditions, determining the target area corresponding to the target light source in the image based on the normalized pixel value of the pixel that satisfies the color determination conditions in the preset color channels and the brightness information of the target light source.
[0143] In some examples, the target region corresponding to the target light source in the image is determined based on the normalized pixel value of the pixel in the preset color channel that meets the color determination condition and the brightness information of the target light source. This includes: determining a weighting coefficient curve based on the brightness information of the target light source and a preset brightness threshold curve; determining the weighting coefficient corresponding to the pixel based on the normalized pixel value of the pixel in the preset color channel and the weighting coefficient curve; determining the pixel as a pixel in the target region in response to the weighting coefficient corresponding to the pixel being greater than a preset threshold; and determining the target region corresponding to the target light source in the original image based on the pixels in the target region.
[0144] The specific implementation methods of steps 20231-20233 can be found in the relevant content of the region judgment circuit 12 in the aforementioned embodiment, and will not be repeated here.
[0145] Figure 5 This is a flowchart illustrating a color correction method provided in yet another exemplary embodiment of this disclosure, as shown below. Figure 5 As shown above, in the above Figure 2 Based on the illustrated embodiment, step 203 may include the following steps: Step 2031: Determine the brightness information of the target light source based on the lens spectral transmittance and sensor spectral quantum efficiency in the camera's physical parameters, the spectral information in the target light source's physical parameters, and the preset brightness coefficient corresponding to the target light source.
[0146] Step 2032: Determine the initial correction matrix based on the target spectrum and brightness information of the target light source.
[0147] Step 2033: Based on the initial correction matrix, the identity matrix, and the weight coefficients corresponding to the pixels in the target region, determine the target correction matrix corresponding to the pixels in the target region.
[0148] The specific implementation methods of steps 2031-2033 above can be found in the relevant content of the correction matrix calculation circuit 13 in the foregoing embodiment, and will not be repeated here.
[0149] Figure 6 This is a flowchart illustrating a color correction method provided in yet another exemplary embodiment of this disclosure, as shown below. Figure 6 As shown above, in the above Figure 2 Based on the illustrated embodiment, step 204 may include the following steps: Step 2041: Based on the target color channel corresponding to the pixel in the target region of the original image, determine the correction coefficient corresponding to the pixel in the target correction matrix corresponding to the pixel.
[0150] Step 2042: Based on the correction coefficients corresponding to the pixels, perform color correction on the pixel values of the pixels in the interpolated image to obtain the corrected pixel values of the pixels in the target color channel.
[0151] Step 2043: Obtain the corrected image based on the corrected pixel values of the pixels in the target color channel within the target area.
[0152] The specific implementation of steps 2041-2043 can be found in the relevant content of the color correction circuit 14 in the foregoing embodiment, and will not be repeated here.
[0153] The color correction method provided in this disclosure can construct a dedicated inverse correction matrix for self-emissive light sources based on a physical model, and generate a target correction matrix by combining weighting coefficients. On the one hand, it can achieve accurate inverse correction of global white balance color shift, restoring the true physical color of the self-emissive light source and solving the problem of color cast in the self-emissive light source area caused by global AWB correction in traditional ISP processing. On the other hand, through continuous and smooth correction intensity transition, it avoids correction boundary artifacts and global image distortion, improves the accuracy and robustness of self-emissive light source recognition, and ensures that the image is not distorted. In addition, the color correction of this disclosure is performed on pixel reconstruction and writing operations in the RAW data domain. While accurately restoring the true physical color of the target light source, it does not change the image format and bit depth, and can be seamlessly compatible with subsequent ISP processing.
[0154] Figure 7 This is a schematic diagram of the structure of a color correction device provided in an embodiment of the present disclosure. The color correction device 70 includes a data determination module 71, a region judgment module 72, a correction matrix calculation module 73, and a color correction module 74.
[0155] The data determination module 71 is configured to determine the original image acquired by the camera, the physical parameters of the camera, the physical parameters corresponding to the target light source, and the target spectrum corresponding to the target light source.
[0156] The region determination module 72 is configured to determine the target region corresponding to the target light source in the original image based on the original image, the camera's physical parameters, and the target light source's physical parameters.
[0157] The correction matrix calculation module 73 is configured to determine the target correction matrix corresponding to the target region based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source.
[0158] The color correction module 74 is configured to perform color correction on the target region in the original image based on the target correction matrix to obtain a corrected image.
[0159] In some embodiments, the region determination module 72 is further configured to: determine the proportional relationship of the target light source in a preset color channel based on the lens spectral transmittance and sensor spectral quantum efficiency in the physical parameters of the camera, and the spectral information in the physical parameters of the target light source; determine the brightness information of the target light source based on the lens spectral transmittance, sensor spectral quantum efficiency, spectral information, and a preset brightness coefficient corresponding to the target light source; and determine the target region corresponding to the target light source in the original image based on the original image, the proportional relationship of the target light source in the preset color channel, and the brightness information of the target light source.
[0160] In some embodiments, the region determination module 72 is further configured to: perform interpolation processing on the original image to obtain an interpolated image; perform normalization processing on the pixel values of the pixels in the interpolated image based on the system gain and exposure time in the camera's physical parameters to obtain normalized pixel values of the pixels in a preset color channel; and determine the target region corresponding to the target light source in the original image based on the normalized pixel values of the pixels in the preset color channel, the proportional relationship of the target light source in the preset color channel, and the brightness information of the target light source.
[0161] In some embodiments, the region determination module 72 is further configured to: determine the color determination conditions of the target light source based on the proportional relationship of the target light source in the preset color channel; and, in response to the normalized pixel value of a pixel in the preset color channel satisfying the color determination conditions, determine the target region corresponding to the target light source in the image based on the normalized pixel value of the pixel that satisfies the color determination conditions in the preset color channel and the brightness information of the target light source.
[0162] In some embodiments, the region determination module 72 is further configured to: determine a weighting coefficient curve based on the brightness information of the target light source and a preset brightness threshold curve; determine the weighting coefficient corresponding to a pixel based on the normalized pixel value of the pixel in a preset color channel and the weighting coefficient curve; determine the pixel as a pixel in the target region in response to the weighting coefficient corresponding to the pixel being greater than a preset threshold; and determine the target region corresponding to the target light source in the original image based on the pixels in the target region.
[0163] In some embodiments, the correction matrix calculation module 73 is further configured to: determine the brightness information of the target light source based on the lens spectral transmittance and sensor spectral quantum efficiency in the physical parameters of the camera, the spectral information in the physical parameters of the target light source, and the preset brightness coefficient corresponding to the target light source; determine an initial correction matrix based on the target spectrum and the brightness information of the target light source; and determine the target correction matrix corresponding to the pixels in the target region based on the initial correction matrix, the identity matrix, and the weight coefficients corresponding to the pixels in the target region.
[0164] In some embodiments, the color correction module 74 is further configured to: determine the correction coefficient corresponding to the pixel in the target correction matrix corresponding to the pixel based on the target color channel corresponding to the pixel in the target region of the original image; perform color correction on the pixel value of the pixel in the interpolated image based on the correction coefficient corresponding to the pixel to obtain the corrected pixel value of the pixel in the target color channel; and obtain the corrected image based on the corrected pixel value of the pixel in the target region in the target color channel.
[0165] The color correction device provided in this disclosure utilizes the physical parameters of the camera and the physical parameters of the target light source to accurately identify the target area corresponding to the target light source in the original image. Furthermore, by combining the physical parameters of the camera, the physical parameters of the target light source, and the ideal spectrum of the target light source, it further ensures that the target correction matrix corresponding to the determined target area can accurately restore the true color of the target light source. Finally, when performing local color correction on the target area corresponding to the target light source in the original image using the target correction matrix, it can achieve physical-level color restoration of the color information within the target area. Compared to the global AWB correction scheme, this disclosure can accurately determine the target area corresponding to the target light source in the original image and perform local color correction on the target area corresponding to the target light source in the original image using the target correction matrix, accurately restoring the true color of the target light source, thereby achieving physical-level color restoration of the target area in the original image and avoiding color cast problems in the image.
[0166] Exemplary electronic devices Figure 8 This is a structural diagram of an electronic device provided in an embodiment of the present disclosure. The electronic device 80 includes at least one processor 81 and a memory 82.
[0167] The processor 81 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 80 to perform desired functions.
[0168] The memory 82 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 81 may execute one or more computer program instructions to implement the color correction methods and / or other desired functions of the various embodiments of this disclosure described above.
[0169] In one example, the electronic device 80 may also include an input device 83 and an output device 84, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0170] The input device 83 may also include, for example, a keyboard, a mouse, etc.
[0171] The output device 84 can output various information to the outside, including, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0172] Of course, for the sake of simplicity, Figure 8 Only some of the components of the electronic device 80 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 80 may include any other suitable components depending on the specific application.
[0173] Figure 9 This is a schematic diagram of the structure of an image processing chip provided in an embodiment of the present disclosure, such as... Figure 9 As shown, the image processing chip 90 includes a color correction device 91 and a memory 92.
[0174] The color correction device 91 can perform color correction on the original image captured by the camera. The specific implementation of the color correction device 91 in correcting the original image can be found in the corresponding content of the foregoing embodiments. This color correction device 91 can be the same as the color correction device 10 in the foregoing embodiments.
[0175] The memory 92 is used to store data during the color correction process performed by the color correction device 91. For example, the memory 92 is used to store data such as the original image, the corrected image, the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source.
[0176] After acquiring the original image captured by the camera, the image processing chip 90 can perform color correction processing on the original image through the color correction device 91 in the image processing chip 90 to obtain a corrected image. The image data corresponding to the corrected image can be stored in the memory 92 for subsequent retrieval or further processing.
[0177] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of this disclosure may also provide a computer program product, including computer program instructions that, when executed by a processor, cause the processor to perform the steps of the color correction methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.
[0178] Computer program products can be written in any combination of one or more programming languages to perform the operations of embodiments of this disclosure. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0179] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the color correction methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.
[0180] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, but is not limited to, systems, apparatuses, or devices that are electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0181] The basic principles of this disclosure have been described above with reference to specific embodiments. However, the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0182] Various modifications and variations can be made to this disclosure without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.
Claims
1. A color correction device, comprising: The input circuit is configured to determine the original image captured by the camera, the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source; The region determination circuit is configured to determine the target region corresponding to the target light source in the original image based on the original image, the physical parameters of the camera, and the physical parameters of the target light source. The correction matrix calculation circuit is configured to determine the target correction matrix corresponding to the target region based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source. A color correction circuit is configured to perform color correction on the target region in the original image based on the target correction matrix to obtain a corrected image.
2. The apparatus of claim 1, wherein, The region determination circuit is further configured as follows: Based on the lens spectral transmittance and sensor spectral quantum efficiency in the physical parameters of the camera, and the spectral information in the physical parameters of the target light source, the proportional relationship of the target light source in the preset color channel is determined. The brightness information of the target light source is determined based on the lens spectral transmittance, the sensor spectral quantum efficiency, the spectral information, and the preset brightness coefficient corresponding to the target light source. Based on the original image, the proportional relationship of the target light source in the preset color channel, and the brightness information of the target light source, the target area corresponding to the target light source in the original image is determined.
3. The apparatus according to claim 2, wherein, The region determination circuit is further configured as follows: The original image is interpolated to obtain an interpolated image; Based on the system gain and exposure time in the camera's physical parameters, the pixel values of the pixels in the interpolated image are normalized to obtain the normalized pixel values of the pixels in the preset color channel. Based on the normalized pixel value of the pixel in the preset color channel, the proportional relationship of the target light source in the preset color channel, and the brightness information of the target light source, the target area corresponding to the target light source in the original image is determined.
4. The apparatus according to claim 3, wherein, The region determination circuit is further configured as follows: Based on the proportional relationship of the target light source in the preset color channels, the color determination conditions of the target light source are determined; In response to the normalized pixel value of the pixel in the preset color channel satisfying the color determination condition, the target region corresponding to the target light source in the image is determined based on the normalized pixel value of the pixel satisfying the color determination condition in the preset color channel and the brightness information of the target light source.
5. The apparatus according to claim 4, wherein, The region determination circuit is further configured as follows: Based on the brightness information of the target light source and the preset brightness threshold curve, a weighting coefficient curve is determined; Based on the normalized pixel value of the pixel in the preset color channel and the weight coefficient curve, the weight coefficient corresponding to the pixel is determined. In response to the fact that the weight coefficient corresponding to the pixel is greater than a preset threshold, the pixel is determined to be a pixel within the target area; Based on the pixels within the target area, the target area corresponding to the target light source in the original image is determined.
6. The apparatus according to any one of claims 1-5, wherein, The correction matrix calculation circuit is further configured as follows: The brightness information of the target light source is determined based on the lens spectral transmittance and sensor spectral quantum efficiency in the physical parameters of the camera, the spectral information in the physical parameters of the target light source, and the preset brightness coefficient corresponding to the target light source. Based on the target spectrum corresponding to the target light source and the brightness information of the target light source, an initial correction matrix is determined; Based on the initial correction matrix, the identity matrix, and the weight coefficients corresponding to the pixels in the target region, the target correction matrix corresponding to the pixels in the target region is determined.
7. The apparatus according to any one of claims 1-5, wherein, The color correction circuit is further configured as follows: Based on the target color channel corresponding to the pixel in the target region of the original image, the correction coefficient corresponding to the pixel is determined in the target correction matrix corresponding to the pixel; Based on the correction coefficients corresponding to the pixel, the pixel value of the pixel in the interpolated image is color corrected to obtain the corrected pixel value of the pixel in the target color channel; The corrected image is obtained based on the corrected pixel values of the pixels in the target area in the target color channel.
8. A color correction method, comprising: The original image captured by the camera, the physical parameters of the camera, the physical parameters corresponding to the target light source, and the target spectrum corresponding to the target light source are determined. Based on the original image, the physical parameters of the camera, and the physical parameters of the target light source, the target region corresponding to the target light source in the original image is determined; Based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source, the target correction matrix corresponding to the target region is determined; The target region in the original image is color-corrected based on the target correction matrix to obtain a corrected image.
9. A color correction device, comprising: The data determination module is configured to determine the original image captured by the camera, the physical parameters of the camera, the physical parameters corresponding to the target light source, and the target spectrum corresponding to the target light source; The region determination module is configured to determine the target region corresponding to the target light source in the original image based on the original image, the physical parameters of the camera, and the physical parameters of the target light source. The correction matrix calculation module is configured to determine the target correction matrix corresponding to the target region based on the physical parameters of the camera, the physical parameters of the target light source, and the target spectrum corresponding to the target light source. The color correction module is configured to perform color correction on the target region in the original image based on the target correction matrix to obtain a corrected image.
10. A computer-readable storage medium storing a computer program for performing the color correction method of claim 8.
11. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the color correction method of claim 8.