Image optimization method and device, computer equipment and storage medium
By acquiring and analyzing the light sensing data and spectral data of the target image, and determining the optimization strategy of the light sensing and color temperature parameters, the problem of poor image optimization in the prior art is solved, and higher quality image optimization is achieved.
Patent Information
- Application Number
- CN202311125123.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2025-03-04
AI Technical Summary
The prior art only performs a single light sensing process or a single color temperature process in image optimization processing, resulting in lower image quality and poor optimization effect.
By acquiring the light sensing data and spectral data of the target image, the light sensing value of the target light sensing value, the light sensing value of the background area and the non-background area, and the average color temperature. Based on these data, an image compensation strategy is determined, and the light sensing parameters and color temperature parameters are optimized to obtain an optimized image.
Improve the optimization effect of the image, improve the image quality, and achieve more accurate light sensitivity and color temperature compensation.
Smart Images

Figure CN119562015A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image technology, and in particular to an image optimization method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the development of technology, users have higher and higher requirements for the shooting function of terminals. Therefore, the terminal needs to optimize the images shot by the terminal.
[0003] In the related art, only a single light processing or a single color temperature processing is performed on the image, the optimization processing method is relatively simple, and the optimization effect of the image optimization processing is poor, resulting in low image quality. Summary of the invention
[0004] Based on this, it is necessary to provide an image optimization method, device, computer equipment, computer-readable storage medium and computer program product that can improve the image optimization effect in response to the above technical problems.
[0005] In a first aspect, the present application provides an image optimization method. The method comprises:
[0006] Acquire light sensing data and spectral data of the target image;
[0007] Determine, based on the light sensitivity data of the target image, a target light sensitivity value of the target image, a first light sensitivity value corresponding to a background area of the target image, and a second light sensitivity value corresponding to a non-background area of the target image, and determine, based on the spectral data of the target image, a color temperature average of the target image;
[0008] A target image compensation strategy is determined according to the first light sensitivity value and the second light sensitivity value, and based on the target light sensitivity value, the color temperature mean value and the target image compensation strategy, the light sensitivity parameters and color temperature parameters of the target image are optimized to obtain an optimized image.
[0009] In one embodiment, determining a target light sensitivity value of the target image based on the light sensitivity data of the target image includes:
[0010] The light sensitivity value of each pixel of the target image is obtained, the average of the light sensitivity values of the pixel points is calculated, and the average is determined as the target light sensitivity value.
[0011] In one embodiment, determining a target light sensitivity value of the target image based on the light sensitivity data of the target image includes:
[0012] Based on the light perception data of the target image, calculating the light perception fluctuation value corresponding to the target image;
[0013] When the light sensitivity fluctuation value is greater than or equal to a preset light sensitivity fluctuation threshold, the light sensitivity values of multiple frames of images corresponding to the target image are averaged, and the obtained average is determined as the target light sensitivity value of the target image.
[0014] In one embodiment, the method further comprises:
[0015] When the light sensitivity fluctuation value is less than a preset light sensitivity fluctuation threshold, the light sensitivity value of each pixel of the target image is obtained, the average of the light sensitivity values of each pixel is calculated, and the average is determined to be the target light sensitivity value.
[0016] In one of the embodiments, the spectral data includes color temperature data of at least one channel;
[0017] The step of determining the color temperature mean of the target image based on the spectral data of the target image comprises:
[0018] Based on the spectral data of the target image, color temperature detection is performed to obtain color temperature data of each channel corresponding to the target image;
[0019] A weighted calculation is performed on the color temperature data of each channel corresponding to the target image to obtain a color temperature mean value of the target image.
[0020] In one embodiment, determining a target image compensation strategy according to the first light sensitivity value and the second light sensitivity value, and optimizing the light sensitivity parameters and color temperature parameters of the target image based on the target light sensitivity value, the color temperature mean value and the target image compensation strategy to obtain an optimized image includes:
[0021] Calculating a light sensitivity difference between the first light sensitivity value and the second light sensitivity value;
[0022] If the light sensitivity difference is greater than or equal to a preset brightness difference threshold, then based on the optimization algorithm corresponding to the target image, the first light sensitivity value, the second light sensitivity value and the color temperature average, the light sensitivity optimization value of the target image is calculated, and based on the color temperature average, the color temperature optimization value is determined, and the optimization algorithm corresponding to the target image is determined based on the light sensitivity curve corresponding to the target image;
[0023] The light sensitivity parameters of the target image are optimized based on the light sensitivity optimization value, and the color temperature parameters of the target image are optimized based on the color temperature optimization value to obtain an optimized image.
[0024] In one embodiment, the calculating the light sensitivity optimization value of the target image based on the optimization algorithm corresponding to the target image, the first light sensitivity value, the second light sensitivity value, and the color temperature average value includes:
[0025] Calculating a brightness adjustment parameter based on the first light sensitivity value and the second light sensitivity value;
[0026] Calculating a color temperature adjustment parameter based on the color temperature average value and the target reference value;
[0027] The light perception optimization value is obtained based on the brightness adjustment parameter and the color temperature adjustment parameter.
[0028] In one embodiment, determining the color temperature optimization value based on the color temperature average value includes:
[0029] Determine the color temperature average as the color temperature optimization value; or,
[0030] The target light source type corresponding to the color temperature average value is determined, and based on a preset correspondence between the light source type and the color temperature optimization value, the color temperature optimization value corresponding to the target light source type is determined.
[0031] In one embodiment, the method further comprises:
[0032] If the brightness difference is less than a preset brightness difference threshold, the light sensitivity parameter of the target image is configured as the target light sensitivity value, and the color temperature parameter of the target image is configured as the color temperature average, and the configured target image is determined to be an optimized image.
[0033] In a second aspect, the present application also provides an image optimization device. The device comprises:
[0034] A first acquisition module, used to acquire light sensing data and spectral data of a target image;
[0035] a first determination module, configured to determine, based on the light sensitivity data of the target image, a target light sensitivity value of the target image, a first light sensitivity value corresponding to a background area of the target image, and a second light sensitivity value corresponding to a non-background area of the target image, and to determine, based on the spectral data of the target image, a color temperature average of the target image;
[0036] The second determination module is used to determine a target image compensation strategy according to the first light sensitivity value and the second light sensitivity value, and optimize the light sensitivity parameters and color temperature parameters of the target image based on the target light sensitivity value, the color temperature mean and the target image compensation strategy to obtain an optimized image.
[0037] In one embodiment, the first determining module is specifically configured to:
[0038] The light sensitivity value of each pixel of the target image is obtained, the average of the light sensitivity values of the pixel points is calculated, and the average is determined as the target light sensitivity value.
[0039] In one embodiment, the first determining module is specifically configured to:
[0040] Based on the light perception data of the target image, calculating the light perception fluctuation value corresponding to the target image;
[0041] When the light sensitivity fluctuation value is greater than or equal to a preset light sensitivity fluctuation threshold, the light sensitivity values of multiple frames of images corresponding to the target image are averaged, and the obtained average is determined as the target light sensitivity value of the target image.
[0042] In one embodiment, the device further comprises:
[0043] The second acquisition module is used to obtain the light sensitivity value of each pixel point of the target image when the light sensitivity fluctuation value is less than a preset light sensitivity fluctuation threshold, calculate the average of the light sensitivity values of each pixel point, and determine the average as the target light sensitivity value.
[0044] In one embodiment, the spectral data includes color temperature data of at least one channel; and the first determination module is specifically configured to:
[0045] Based on the spectral data of the target image, color temperature detection is performed to obtain color temperature data of each channel corresponding to the target image;
[0046] A weighted calculation is performed on the color temperature data of each channel corresponding to the target image to obtain a color temperature mean value of the target image.
[0047] In one embodiment, the second determination module is specifically used to: calculate the light sensitivity difference between the first light sensitivity value and the second light sensitivity value;
[0048] If the light sensitivity difference is greater than or equal to a preset brightness difference threshold, then based on the optimization algorithm corresponding to the target image, the first light sensitivity value, the second light sensitivity value and the color temperature average, the light sensitivity optimization value of the target image is calculated, and based on the color temperature average, the color temperature optimization value is determined, and the optimization algorithm corresponding to the target image is determined based on the light sensitivity curve corresponding to the target image;
[0049] The light sensitivity parameters of the target image are optimized based on the light sensitivity optimization value, and the color temperature parameters of the target image are optimized based on the color temperature optimization value to obtain an optimized image.
[0050] In one embodiment, the second determination module is specifically configured to: calculate a brightness adjustment parameter based on the first light sensitivity value and the second light sensitivity value;
[0051] Calculating a color temperature adjustment parameter based on the color temperature average value and the target reference value;
[0052] The light perception optimization value is obtained based on the brightness adjustment parameter and the color temperature adjustment parameter.
[0053] In one embodiment, the second determining module is specifically configured to:
[0054] Determine the color temperature average as the color temperature optimization value; or,
[0055] The target light source type corresponding to the color temperature average value is determined, and based on a preset correspondence between the light source type and the color temperature optimization value, the color temperature optimization value corresponding to the target light source type is determined.
[0056] In one embodiment, the device further comprises:
[0057] A configuration module is used to configure the light sensitivity parameter of the target image to the target light sensitivity value if the brightness difference is less than a preset brightness difference threshold, and configure the color temperature parameter of the target image to the color temperature average, and determine that the configured target image is an optimized image.
[0058] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0059] Acquire light sensing data and spectral data of the target image;
[0060] Determine, based on the light sensitivity data of the target image, a target light sensitivity value of the target image, a first light sensitivity value corresponding to a background area of the target image, and a second light sensitivity value corresponding to a non-background area of the target image, and determine, based on the spectral data of the target image, a color temperature average of the target image;
[0061] A target image compensation strategy is determined according to the first light sensitivity value and the second light sensitivity value, and based on the target light sensitivity value, the color temperature mean value and the target image compensation strategy, the light sensitivity parameters and color temperature parameters of the target image are optimized to obtain an optimized image.
[0062] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0063] Acquire light sensing data and spectral data of the target image;
[0064] Determine, based on the light sensitivity data of the target image, a target light sensitivity value of the target image, a first light sensitivity value corresponding to a background area of the target image, and a second light sensitivity value corresponding to a non-background area of the target image, and determine, based on the spectral data of the target image, a color temperature average of the target image;
[0065] A target image compensation strategy is determined according to the first light sensitivity value and the second light sensitivity value, and based on the target light sensitivity value, the color temperature mean value and the target image compensation strategy, the light sensitivity parameters and color temperature parameters of the target image are optimized to obtain an optimized image.
[0066] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0067] Acquire light sensing data and spectral data of the target image;
[0068] Determine, based on the light sensitivity data of the target image, a target light sensitivity value of the target image, a first light sensitivity value corresponding to a background area of the target image, and a second light sensitivity value corresponding to a non-background area of the target image, and determine, based on the spectral data of the target image, a color temperature average of the target image;
[0069] A target image compensation strategy is determined according to the first light sensitivity value and the second light sensitivity value, and based on the target light sensitivity value, the color temperature mean value and the target image compensation strategy, the light sensitivity parameters and color temperature parameters of the target image are optimized to obtain an optimized image.
[0070] The above-mentioned image optimization method, device, computer equipment, storage medium and computer program product, the method includes: obtaining light sensitivity data and spectral data of the target image; based on the light sensitivity data of the target image, determining the target light sensitivity value of the target image, the first light sensitivity value corresponding to the background area of the target image, and the second light sensitivity value corresponding to the non-background area of the target image, and based on the spectral data of the target image, determining the color temperature average of the target image; according to the first light sensitivity value and the second light sensitivity value, determining the target image compensation strategy, and based on the target light sensitivity value, the color temperature average and the target image compensation strategy, optimizing the light sensitivity parameters and color temperature parameters of the target image to obtain an optimized image. By adopting this method, the light sensitivity parameters and color temperature parameters of the target image can be optimized and compensated based on the obtained light sensitivity data, spectral data and image compensation strategy of the target image, so that light sensitivity compensation and color temperature compensation can be achieved, and the image optimization effect and image quality can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1A diagram showing an application environment of an image optimization method in one embodiment;
[0072] Figure 2 is a schematic flow chart of an image optimization method in one embodiment;
[0073] Figure 3 A schematic diagram of a flow chart of a step of calculating a target light sensitivity value in one embodiment;
[0074] Figure 4 A schematic diagram of a flow chart of a step of calculating a color temperature average in one embodiment;
[0075] Figure 5 A schematic diagram of a flow chart for determining an optimized image step in one embodiment;
[0076] Figure 6 A schematic diagram of a flow chart of a step of determining a light sensitivity optimization value in one embodiment;
[0077] Figure 7 A schematic diagram of a flow chart of a step of determining a color temperature optimization value in one embodiment;
[0078] Figure 8 is a flow chart of an image optimization method in another embodiment;
[0079] Fig. 9 is a schematic diagram of a process of performing a light sensing detection step in an embodiment;
[0080] Fig.10 is a schematic diagram of a light sensitivity curve in one embodiment;
[0081] Fig.11 is a schematic diagram of a process for performing a color temperature detection step in an embodiment;
[0082] Fig.12 A schematic diagram of a flow chart of image optimization processing steps in one embodiment;
[0083] Fig.13 is a structural block diagram of an image optimization device in one embodiment;
[0084] Fig.14 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0085] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0086] The image optimization method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 can be a terminal including an image acquisition device 104. The terminal 102 obtains a target image by performing a shooting operation through the image acquisition device 104, and optimizes the light sensitivity parameters and color temperature parameters of the target image based on the target light sensitivity value, the color temperature mean value and the target image compensation strategy to obtain an optimized image. In an example, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The image acquisition device 104 can be a shooting module, such as a device such as a camera.
[0087] In one embodiment, Figure 2 As shown, an image optimization method is provided. This embodiment takes the method applied to a terminal as an example. The terminal may be a terminal including an image acquisition device. In this embodiment, the image optimization method includes the following steps:
[0088] Step 202, obtaining light sensing data and spectral data of the target image.
[0089] Among them, the target image can be an image captured by an image acquisition device on the terminal, or an image to be optimized; the target image can be a single-frame image, or a plurality of frames of images captured continuously, etc.; the image acquisition device can be a camera module on the terminal; in one example, the terminal can capture the target image through the camera module on the terminal in response to the user's image acquisition instruction; the light sensing data can be data captured by a light sensing sensor on the terminal, for example, the brightness value corresponding to each pixel point contained in the target image; the spectral data can be spectral graph data captured by a spectral sensor on the terminal, for example, the color temperature data corresponding to each channel contained in the target image, etc.
[0090] Specifically, the terminal can respond to a trigger operation of the terminal by a user using the terminal to perform image acquisition through an image acquisition device on the terminal to obtain a target image. Accordingly, the terminal can also obtain the brightness value corresponding to each pixel point contained in the target image and the spectral data of the target image through a light sensor and a spectral sensor configured by the terminal during the process of acquiring the target image.
[0091] Step 204, based on the light sensitivity data of the target image, determine the target light sensitivity value of the target image, the first light sensitivity value corresponding to the background area of the target image, and the second light sensitivity value corresponding to the non-background area of the target image, and based on the spectral data of the target image, determine the color temperature average of the target image.
[0092] Among them, the target light sensitivity value of the target image can be a light sensitivity value used to compensate and optimize the light sensitivity parameters of the image, can be a light sensitivity mean value, or a light sensitivity value determined based on the light sensitivity mean value, the color temperature mean value and the image compensation strategy, etc.; the target image can include a background area and a non-background area; the background area can be a non-subject area of the image, and the non-background area can be a subject area of the image, for example, when the image contains a face, the non-background area can be a face area, and the background area can be a non-face area, for example, when the image does not contain a face, the non-background area can be a focus center area, etc.
[0093] Specifically, the terminal can perform calculations based on the acquired light sensitivity data to determine the target light sensitivity value corresponding to the target image. The terminal can also determine the light sensitivity value of each pixel contained in the background area and the light sensitivity value of each pixel contained in the non-background area based on the light sensitivity value of each pixel corresponding to the target image contained in the light sensitivity data. Based on this, the terminal can calculate the first light sensitivity value corresponding to the background area based on the light sensitivity value of each pixel contained in the background area. The terminal can calculate the second light sensitivity value corresponding to the non-background area based on the light sensitivity value of each pixel contained in the non-background area. Accordingly, the terminal calculates the color temperature value of each channel contained in the spectral data of the acquired target image to obtain the color temperature mean value corresponding to the target image.
[0094] Step 206, determining a target image compensation strategy according to the first light sensitivity value and the second light sensitivity value, and optimizing the light sensitivity parameters and color temperature parameters of the target image based on the target light sensitivity value, the color temperature mean value and the target image compensation strategy to obtain an optimized image.
[0095] Among them, the image compensation strategy can be an image optimization strategy for adjusting and configuring the light sensitivity parameters and color temperature parameters of the image. The image compensation strategy can include multiple image compensation strategies. The target image compensation strategy can be an image compensation strategy corresponding to both the first light sensitivity value and the second light sensitivity value.
[0096] Specifically, the terminal can determine a target image compensation strategy corresponding to the first light sensitivity value and the second light sensitivity value based on the first light sensitivity value and the second light sensitivity value. The terminal determines the target light sensitivity value, the color temperature mean, and the target image compensation strategy, optimizes the light sensitivity parameters of the target image, and optimizes the color temperature parameters of the target image to obtain an optimized image.
[0097] In the above-mentioned image optimization method, the light sensitivity data and spectral data of the target image are obtained; based on the light sensitivity data of the target image, the target light sensitivity value of the target image, the first light sensitivity value corresponding to the background area of the target image, and the second light sensitivity value corresponding to the non-background area of the target image are determined, and based on the spectral data of the target image, the color temperature average of the target image is determined; according to the first light sensitivity value and the second light sensitivity value, the target image compensation strategy is determined, and based on the target light sensitivity value, the color temperature average and the target image compensation strategy, the light sensitivity parameters and color temperature parameters of the target image are optimized to obtain an optimized image. By adopting this method, the light sensitivity parameters and color temperature parameters of the target image can be optimized and compensated based on the obtained light sensitivity data, spectral data and image compensation strategy of the target image, so that light sensitivity compensation and color temperature compensation can be achieved, and the image optimization effect and image quality can be improved.
[0098] In one embodiment, the specific processing of step 204 of “determining a target light sensitivity value of the target image based on the light sensitivity data of the target image” includes:
[0099] The light sensitivity value of each pixel of the target image is obtained, the average of the light sensitivity values of each pixel is calculated, and the average is determined as the target light sensitivity value.
[0100] The light sensitivity value of the pixel may be the brightness value of the pixel.
[0101] Specifically, the terminal can perform mean processing on the light sensitivity values of each pixel point contained in the target image determined based on the light sensitivity data of the target image. Based on this, the terminal can determine the mean of the calculated light sensitivity values as the target light sensitivity value corresponding to the target image.
[0102] In this embodiment, based on the average processing of the light sensitivity value of each pixel point of the target image obtained with the assistance of the hardware device, and then determining the target light sensitivity value, the performance of the hardware device can be fully utilized, the image optimization effect can be guaranteed, and the quality of the terminal output image can be improved.
[0103] In one embodiment, if Figure 3 As shown, the specific processing process of step 204 "determining the target light sensitivity value of the target image based on the light sensitivity data of the target image" includes:
[0104] Step 302: Calculate the light sensitivity fluctuation value corresponding to the target image based on the light sensitivity data of the target image.
[0105] The light sensitivity fluctuation value corresponding to the target image may be the fluctuation range of the light sensitivity curve corresponding to the target image, the first coordinate axis of the light sensitivity curve may represent the number of frames of the image, and the second coordinate axis of the light sensitivity curve may represent the light sensitivity value of the image; the light sensitivity curve corresponding to the target image may be determined based on the light sensitivity data of multiple frames of images corresponding to the target image; the light sensitivity data of the target image may include the light sensitivity data of multiple frames of images corresponding to the target image. In one example, the fluctuation range is the fluctuation range of the brightness value corresponding to each frame of the image.
[0106] Specifically, the terminal can determine the light sensitivity data of multiple frames of images corresponding to the target image based on the light sensitivity data of the target image, generate a light sensitivity curve corresponding to the target image based on the light sensitivity data of the multiple frames of images corresponding to the target image, and calculate the light sensitivity fluctuation value of the light sensitivity curve through a preset fluctuation algorithm.
[0107] In one example, the process of the terminal calculating the light sensitivity fluctuation value of the light sensitivity curve through the fluctuation algorithm may be that the terminal calculates the mean of the light sensitivity curve, performs processing based on the mean of the light sensitivity curve, and obtains the fluctuation range of the light sensitivity curve, that is, the light sensitivity fluctuation value.
[0108] Step 304, when the light sensitivity fluctuation value is greater than or equal to the preset light sensitivity fluctuation threshold, average processing is performed on the light sensitivity values of multiple frames of images corresponding to the target image, and the obtained average is determined as the target light sensitivity value of the target image.
[0109] The preset light sensitivity fluctuation threshold may be determined based on actual application scenarios, for example, five percent or the like.
[0110] Specifically, the terminal can compare the calculated light sensitivity fluctuation value of the light sensitivity curve with a preset light sensitivity fluctuation threshold. When it is determined that the light sensitivity fluctuation value is greater than or equal to the preset light sensitivity fluctuation threshold, the terminal can determine the light sensitivity values of multiple frames of images corresponding to the target image based on the light sensitivity data of the target image, and perform average processing based on the light sensitivity values of each frame of the image, and determine the average of the calculated light sensitivity values of each frame of the image as the target light sensitivity value corresponding to the target image.
[0111] In one example, when the terminal determines that the light sensitivity fluctuation value is greater than or equal to the preset light sensitivity fluctuation threshold, the terminal may determine to perform auxiliary debugging by fitting light sensitivity of multiple frames of images, that is, to calculate the average value based on the light sensitivity values corresponding to the multiple frames of images to obtain the target light sensitivity value of the target image. The light sensitivity values corresponding to the multiple frames of images may be multiple light sensitivity values corresponding to the multiple frames of images, respectively, and each light sensitivity value may be calculated based on the brightness value of each pixel point contained in the image of the corresponding frame.
[0112] In this embodiment, by determining the light sensitivity fluctuation value corresponding to the target image and calculating the target light sensitivity value based on the preset light sensitivity fluctuation threshold, it is possible to effectively avoid overexposure or over-darkness problems caused by sudden changes in the shooting environment of the target image, thereby ensuring the clarity of the target image subject and the authenticity of the background of the target image.
[0113] In one embodiment, the image optimization method further includes:
[0114] When the light sensitivity fluctuation value is less than the preset light sensitivity fluctuation threshold, the light sensitivity value of each pixel of the target image is obtained, the average of the light sensitivity values of each pixel is calculated, and the average is determined to be the target light sensitivity value.
[0115] Among them, the terminal can compare the calculated light sensitivity fluctuation value of the light sensitivity curve with the preset light sensitivity fluctuation threshold. When it is determined that the light sensitivity fluctuation value is greater than or equal to the preset light sensitivity fluctuation threshold, the terminal can determine the light sensitivity values of multiple frames of images corresponding to the target image based on the light sensitivity data of the target image, and perform average processing based on the light sensitivity values of each frame of the image, and determine the average of the calculated light sensitivity values of each frame of the image as the target light sensitivity value corresponding to the target image.
[0116] In one example, when the terminal determines that the light sensitivity fluctuation value is greater than or equal to the preset light sensitivity fluctuation threshold, the terminal may determine to perform auxiliary debugging by fitting light sensitivity of multiple frames of images, that is, to calculate the average value based on the light sensitivity values corresponding to the multiple frames of images to obtain the target light sensitivity value of the target image. The light sensitivity values corresponding to the multiple frames of images may be multiple light sensitivity values corresponding to the multiple frames of images, respectively, and each light sensitivity value may be calculated based on the brightness value of each pixel point contained in the image of the corresponding frame.
[0117] In this embodiment, by determining the light sensitivity fluctuation value corresponding to the target image and calculating the target light sensitivity value based on the preset light sensitivity fluctuation threshold, it is possible to effectively avoid overexposure or over-darkness problems caused by sudden changes in the shooting environment of the target image, thereby ensuring the clarity of the target image subject and the authenticity of the background of the target image.
[0118] In one embodiment, the spectral data includes color temperature data of at least one channel. Specifically, the spectral data may be spectral data detected by a spectral sensor on the terminal, for example, color temperature data of each channel corresponding to the target image.
[0119] Accordingly, if Figure 4 As shown, the specific processing process of the step of "determining the color temperature mean value of the target image based on the spectral data of the target image" includes:
[0120] Step 402 : performing color temperature detection based on the spectral data of the target image to obtain color temperature data of each channel corresponding to the target image.
[0121] Specifically, the process of the terminal detecting through the spectral sensor may be the process of the terminal detecting color temperature. The terminal may perform color temperature detection through the spectral sensor and multiple channels to obtain color temperature data corresponding to each channel, for example, the color temperature value corresponding to each channel may be obtained.
[0122] Step 404 , weighted calculation is performed on the color temperature data of each channel corresponding to the target image to obtain the color temperature mean of the target image.
[0123] Specifically, the terminal can perform weighted processing based on the color temperature data of each channel corresponding to the determined target image and the weights corresponding to each channel to obtain the color temperature mean value corresponding to the target image. In an example, the weights corresponding to each channel can be predetermined based on the actual application scenario, or can be determined based on the environment type of the target image, etc. The present disclosure does not limit the specific configuration process of the weights corresponding to each channel, and those skilled in the art can determine it specifically based on the actual application scenario.
[0124] In this embodiment, by performing color temperature detection through a spectral sensor, an accurate color temperature average value of the target image can be obtained, thereby achieving a better image optimization effect.
[0125] In one embodiment, Figure 5 As shown, the specific processing process of step 206 "determining the target image compensation strategy according to the first light sensitivity value and the second light sensitivity value, and optimizing the light sensitivity parameters and color temperature parameters of the target image based on the target light sensitivity value, the color temperature average and the target image compensation strategy to obtain an optimized image" includes:
[0126] Step 502, calculating the light sensitivity difference between the first light sensitivity value and the second light sensitivity value.
[0127] Among them, the first light sensitivity value can be the light sensitivity value corresponding to the background area in the target image, the second light sensitivity value can be the light sensitivity value corresponding to the non-background area in the target image, and the light sensitivity difference can be the degree of difference between the first light sensitivity value and the second light sensitivity value.
[0128] Specifically, the terminal may perform difference processing on the first light sensitivity value and the second light sensitivity value based on the first light sensitivity value and the second light sensitivity value, and determine the calculated difference as the light sensitivity difference between the first light sensitivity value and the second light sensitivity value.
[0129] Step 504, if the light sensitivity difference is greater than or equal to the preset brightness difference threshold, the light sensitivity optimization value of the target image is calculated based on the optimization algorithm corresponding to the target image, the first light sensitivity value, the second light sensitivity value and the color temperature average, and the color temperature optimization value is determined based on the color temperature average.
[0130] Among them, the optimization algorithm corresponding to the target image is determined based on the light sensitivity curve corresponding to the target image, and the preset brightness difference threshold can be the degree of brightness difference between the background area and the non-background area in the pre-configured image; the optimization algorithm corresponding to the target image can be an image optimization algorithm that adjusts the color temperature parameters and light sensitivity parameters of the image together, and the light sensitivity optimization value can be a light sensitivity value for adjusting the light sensitivity parameters calculated based on the optimization algorithm of the target image, the light sensitivity value and the color temperature average; the color temperature optimization value is the color temperature value used to adjust the color temperature parameters of the target image.
[0131] Specifically, the terminal can compare the light sensitivity difference with a preset brightness difference threshold. When the terminal determines that the light sensitivity difference is greater than or equal to the preset brightness difference threshold, the terminal can determine that the difference between the brightness of the background area and the brightness of the non-background area of the target image has exceeded the difference in brightness between the background area and the non-background area in the pre-configured image. Based on this, the terminal can determine the optimization algorithm for the target image in this case, and based on the determined optimization algorithm for the target image, combined with the parameters of the light sensitivity dimension including the first light sensitivity value and the second light sensitivity value, and the color temperature mean, calculate the light sensitivity optimization value for adjusting the light sensitivity parameters in the target image; accordingly, the terminal can determine the color temperature mean determined in the steps described in the above embodiment as the color temperature optimization value.
[0132] Step 506 , optimizing the light sensitivity parameters of the target image based on the light sensitivity optimization value, and optimizing the color temperature parameters of the target image based on the color temperature optimization value, to obtain an optimized image.
[0133] Specifically, the terminal may adjust the light sensitivity parameters and the color temperature parameters of the target image respectively based on the light sensitivity optimization value and the color temperature optimization value, and determine the adjusted target image as the optimized image.
[0134] In one example, the terminal can adjust the light parameters of the target image based on the light optimization value, for example, the specific numerical value corresponding to the light parameters of the target image can be configured as the light optimization value. Similarly, the terminal can adjust the color temperature parameters of the target image based on the color temperature optimization value, for example, the specific numerical value corresponding to the color temperature parameters of the target image can be configured as the color temperature optimization value to obtain an optimized image.
[0135] In this embodiment, by compensating the light sensitivity parameters and the color temperature parameters, the consistency of the output image effect can be ensured and the image acquisition performance of the terminal can be improved.
[0136] In one embodiment, Figure 6 As shown, the specific processing process of the step "calculating the light sensitivity optimization value of the target image based on the optimization algorithm corresponding to the target image, the first light sensitivity value, the second light sensitivity value and the color temperature average value" includes:
[0137] Step 602: Calculate a brightness adjustment parameter based on the first light sensitivity value and the second light sensitivity value.
[0138] Specifically, the terminal may calculate the square value of the first light sensitivity value, calculate the square value of the second light sensitivity value, and calculate the sum of the square value of the first light sensitivity value and the square value of the second light sensitivity value. Based on this, the terminal may calculate the brightness adjustment parameter based on the sum value and the first target value. In one example, the first target value may be the square root of 2.
[0139] Step 604: Calculate the color temperature adjustment parameter based on the color temperature mean value and the target reference value.
[0140] The target reference value may include multiple color temperature reference values.
[0141] Specifically, the terminal can calculate the square value of the color temperature average and the product of the first color temperature reference value and the color temperature average. Based on this, the terminal can calculate the color temperature adjustment parameter based on the square value of the color temperature average, the second color temperature reference value, the first color temperature reference value and the product between the color temperature average; in one example, the first color temperature reference value can be 2.3.
[0142] Step 606: Obtain a light perception optimization value based on the brightness adjustment parameter and the color temperature adjustment parameter.
[0143] Specifically, the terminal may calculate the light perception optimization value based on the brightness adjustment parameter and the color temperature adjustment parameter.
[0144] In an example, the terminal may calculate a product value between a brightness adjustment parameter and a color temperature adjustment parameter, and determine the product value as a light perception optimization value.
[0145] In an example, the terminal can calculate the light perception optimization value of the target image by the following formula:
[0146]
[0147] Wherein, L1 represents the first light sensitivity value, L2 represents the second light sensitivity value, the square root of 2 may be the first target value, S may be the color temperature average value, 2.3 may be the first color temperature reference value, 3800 may be the second color temperature reference value, and L may be the light sensitivity optimization value.
[0148] In this embodiment, the light sensitivity optimization value is determined by the light sensitivity value and the color temperature average, and the light sensitivity and color temperature can be combined through the AE brightness adjustment algorithm to improve the optimization effect of the image.
[0149] In one embodiment, Figure 7 As shown, the specific processing process of the step "determining the color temperature optimization value based on the color temperature average value" includes:
[0150] Step 702: Determine the color temperature average as the color temperature optimization value.
[0151] Specifically, the terminal may determine the color temperature mean value corresponding to the target image as the color temperature optimization value for adjusting the color temperature parameters of the target image.
[0152] Step 704: determine the target light source type corresponding to the color temperature mean value, and determine the color temperature optimization value corresponding to the target light source type based on the preset correspondence between the light source type and the color temperature optimization value.
[0153] The light source type may be the type of light source corresponding to the target image, for example, the moon, food, sun, street lamp, and other light source types.
[0154] Specifically, the terminal can determine the target light source type corresponding to the color temperature mean value of the target image based on the preset correspondence between the color temperature mean value and the light source, that is, determine the light source type corresponding to the target image. Based on this, the terminal can query in the correspondence between the pre-configured light source type and the color temperature optimization value to determine the color temperature optimization value corresponding to the target light source type, that is, determine the color temperature optimization value corresponding to the target image.
[0155] This embodiment does not limit the execution order between step 702 and step 704. Those skilled in the art may choose to execute either step 702 or step 704 based on actual application scenarios.
[0156] In this embodiment, the color temperature optimization value is determined by the color temperature mean value, or the color temperature optimization value is determined based on the light source type, so that the scene analysis of the target image can be performed to achieve accurate adjustment of the color temperature parameters of the image.
[0157] In one embodiment, the image optimization method further includes:
[0158] If the brightness difference is less than the preset brightness difference threshold, the light sensitivity parameter of the target image is configured as the target light sensitivity value, and the color temperature parameter of the target image is configured as the color temperature average, and the configured target image is determined to be an optimized image.
[0159] Specifically, the terminal can compare the brightness difference value with a preset brightness difference threshold. If the terminal determines that the brightness difference value is less than the preset brightness difference threshold, the terminal can configure the specific numerical value corresponding to the light sensitivity parameter of the target image as the target light sensitivity value, and configure the specific numerical value corresponding to the color temperature parameter of the target image as the color temperature average. In this way, the terminal can determine the target image after the light sensitivity parameter configuration processing and the color temperature parameter configuration processing as an optimized image.
[0160] In this embodiment, by compensating the light sensitivity parameters and the color temperature parameters, the consistency of the output image effect can be ensured and the image acquisition performance of the terminal can be improved.
[0161] The specific implementation process of the above image optimization method is described in detail below in conjunction with a specific embodiment:
[0162] like Figure 8 As shown, it can be an image optimization method that combines software and hardware. The image optimization method provided in this embodiment can include light detection, spectrum detection, and effect optimization. Among them, light detection can include the brightness of the environment to be identified, the brightness of the detected environment, and the output brightness curve; spectrum detection can include spectrum environment recognition and typical scene classification; effect optimization can include scene confirmation, AE adaptive adjustment, specific scene detection, and customized effect output.
[0163] Specifically, the terminal can detect the current ambient brightness through the rear photosensitive device, and distinguish the ambient brightness through the light feedback brightness (which can be recorded as lux), and the light value will not change with the change of zoom (focal length), and output the brightness curve. The terminal can compare the output brightness curve with the light curve stored in the database device. For example, it can calculate the similarity between the output brightness curve and the light curve stored in the database device, and determine the light curve stored in the database device with the highest similarity as the light curve corresponding to the output brightness curve, locate the environment, and call the appropriate AE algorithm. The terminal performs spectral detection to detect the color temperature of ambient light, identify different light sources, and accurately compensate and optimize the color of the picture. The terminal can optimize the effect by identifying the shooting scene and calling the AE adaptive algorithm to customize the output effect map based on the scene-specific detection.
[0164] like Fig. 9 As shown, the light detection process in the image optimization method provided in this embodiment may include: the terminal turns on light detection, outputs a light curve, and determines whether the curve fluctuation range is greater than 5%. When it is determined that the curve fluctuation range is greater than 5%, multiple frames are fitted with light values, and the LV value is converted by formula to assist AE debugging; if it is determined that the curve fluctuation range is less than or equal to 5%, the terminal can use a single-point assisted debugging method to perform light detection.
[0165] Specifically, when the fluctuation is less than 5%, single-point auxiliary debugging is adopted. When the fluctuation is greater than 5%, multi-frame fitting light perception is adopted to assist debugging. The terminal can be divided into 6 gradients based on the 20% brightness difference of the light perception brightness. For example, six brightness gradients can be obtained in order from small to large. For each brightness gradient, the corresponding frame image of the brightness gradient can be determined respectively, and the six frames of images corresponding to the six brightness gradients can be synthesized. For example, the target light perception value can be calculated based on the brightness value of the image corresponding to each brightness gradient. By measuring the brightness curve, the control accuracy of the image optimization processing can be improved.
[0166] like Fig.10 As shown, it can be a light perception curve graph output by the terminal, where the first coordinate axis can be the number of frames of the image, and the second coordinate axis can represent the brightness value (which can be recorded as LV). The terminal can effectively solve the overexposure and darkness caused by sudden changes in the environment through curve fitting, and avoid the influence of sudden changes in ambient light causing distortion of the picture effect. Multi-frame light perception fitting is adopted, that is, the ambient brightness is confirmed by the mean square error value, so as to keep the subject clear and the background real.
[0167] like Fig.11 As shown, the spectrum detection process in the image optimization method provided in this embodiment may include: the terminal starts the spectrum, color temperature detection, calculates the color temperature mean, and assists AWB debugging. Specifically, the terminal can perform color temperature detection through the spectral data of the image to assist in environmental identification and assist in AWB debugging. When the camera shoots a saturated color object at a close distance, the light received by the sensor and the camera contains the light of the actual light source and the monochromatic light reflected by the object. At this time, the ambient light CCT (color temperature) calculated by the sensor and the camera is not the actual CCT of the light source. Therefore, the actual CCT that can be detected by the terminal through the spectral sensor. And the type of light source can be determined according to the color temperature curve, so as to report the accurate CCT.
[0168] like Fig.12 As shown, the terminal can obtain light perception and spectral data, identify the environment, and determine whether the brightness difference between the subject and the background exceeds 30%. When the terminal determines that the brightness difference between the subject and the background exceeds 30%, the terminal can import light perception and color temperature compensation functions, output light perception and color temperature values, and output effect diagrams; when the terminal determines that the brightness difference between the subject and the background does not exceed 30%, the light perception value and color temperature value can be directly used to assist in optimization, and an effect diagram can be output.
[0169] The image optimization method provided in this embodiment is based on light perception detection and spectrum detection. Through hardware-assisted optimization, for scenes with large differences between the subject and the background, the terminal can compensate for the brightness and color temperature, avoiding the problem of large differences in pictures and too dark or too bright results caused by directly calling the light perception value and color temperature auxiliary adjustment. In other words, the image optimization method provided in this embodiment can be fitted with real shots of different scenes. By combining AE brightness adjustment with light perception and color temperature, the hardware performance can be fully utilized to improve the image optimization effect of specific scenes. The image optimization method provided in this embodiment proposes a color temperature and light perception assisted AE adjustment solution for the first time, and optimizes specific scenes by fitting compensation functions, which has better effects.
[0170] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0171] Based on the same inventive concept, the embodiment of the present application also provides an image optimization device for implementing the above-mentioned image optimization method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more image optimization device embodiments provided below can refer to the limitations on the image optimization method above, and will not be repeated here.
[0172] In one embodiment, Fig.13 As shown, an image optimization device 1300 is provided, comprising: a first acquisition module 1302, a first determination module 1304 and a second determination module 1306, wherein:
[0173] A first acquisition module 1302 is used to acquire light sensing data and spectral data of a target image;
[0174] A first determination module 1304 is used to determine, based on the light sensitivity data of the target image, a target light sensitivity value of the target image, a first light sensitivity value corresponding to a background area of the target image, and a second light sensitivity value corresponding to a non-background area of the target image, and to determine a color temperature average of the target image based on the spectral data of the target image;
[0175] The second determination module 1306 is used to determine the target image compensation strategy according to the first light sensitivity value and the second light sensitivity value, and optimize the light sensitivity parameters and color temperature parameters of the target image based on the target light sensitivity value, the color temperature mean and the target image compensation strategy to obtain an optimized image.
[0176] In one embodiment, the first determining module is specifically configured to:
[0177] The light sensitivity value of each pixel of the target image is obtained, the average of the light sensitivity values of the pixel points is calculated, and the average is determined as the target light sensitivity value.
[0178] In one embodiment, the first determining module is specifically configured to:
[0179] Based on the light perception data of the target image, calculating the light perception fluctuation value corresponding to the target image;
[0180] When the light sensitivity fluctuation value is greater than or equal to a preset light sensitivity fluctuation threshold, the light sensitivity values of multiple frames of images corresponding to the target image are averaged, and the obtained average is determined as the target light sensitivity value of the target image.
[0181] In one embodiment, the device further comprises:
[0182] The second acquisition module is used to obtain the light sensitivity value of each pixel point of the target image when the light sensitivity fluctuation value is less than a preset light sensitivity fluctuation threshold, calculate the average of the light sensitivity values of each pixel point, and determine the average as the target light sensitivity value.
[0183] In one embodiment, the spectral data includes color temperature data of at least one channel; and the first determination module is specifically configured to:
[0184] Based on the spectral data of the target image, color temperature detection is performed to obtain color temperature data of each channel corresponding to the target image;
[0185] A weighted calculation is performed on the color temperature data of each channel corresponding to the target image to obtain a color temperature mean value of the target image.
[0186] In one embodiment, the second determination module is specifically used to: calculate the light sensitivity difference between the first light sensitivity value and the second light sensitivity value;
[0187] If the light sensitivity difference is greater than or equal to a preset brightness difference threshold, then based on the optimization algorithm corresponding to the target image, the first light sensitivity value, the second light sensitivity value and the color temperature average, the light sensitivity optimization value of the target image is calculated, and based on the color temperature average, the color temperature optimization value is determined, and the optimization algorithm corresponding to the target image is determined based on the light sensitivity curve corresponding to the target image;
[0188] The light sensitivity parameters of the target image are optimized based on the light sensitivity optimization value, and the color temperature parameters of the target image are optimized based on the color temperature optimization value to obtain an optimized image.
[0189] In one embodiment, the second determination module is specifically configured to: calculate a brightness adjustment parameter based on the first light sensitivity value and the second light sensitivity value;
[0190] Calculating a color temperature adjustment parameter based on the color temperature average value and the target reference value;
[0191] The light perception optimization value is obtained based on the brightness adjustment parameter and the color temperature adjustment parameter.
[0192] In one embodiment, the second determining module is specifically configured to:
[0193] Determine the color temperature average as the color temperature optimization value; or,
[0194] The target light source type corresponding to the color temperature average value is determined, and based on a preset correspondence between the light source type and the color temperature optimization value, the color temperature optimization value corresponding to the target light source type is determined.
[0195] In one embodiment, the device further comprises:
[0196] A configuration module is used to configure the light sensitivity parameter of the target image to the target light sensitivity value if the brightness difference is less than a preset brightness difference threshold, and configure the color temperature parameter of the target image to the color temperature average, and determine that the configured target image is an optimized image.
[0197] Each module in the above-mentioned image optimization device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0198] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.14As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store target image data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an image optimization method is implemented.
[0199] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0200] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0201] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0202] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0203] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0204] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0205] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0206] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An image optimization method, characterized in that: The method comprises: Acquire light sensing data and spectral data of the target image; Determine, based on the light sensitivity data of the target image, a target light sensitivity value of the target image, a first light sensitivity value corresponding to a background area of the target image, and a second light sensitivity value corresponding to a non-background area of the target image, and determine, based on the spectral data of the target image, a color temperature average of the target image; A target image compensation strategy is determined according to the first light sensitivity value and the second light sensitivity value, and based on the target light sensitivity value, the color temperature mean value and the target image compensation strategy, the light sensitivity parameters and color temperature parameters of the target image are optimized to obtain an optimized image.
2. The method according to claim 1, characterized in that The step of determining a target light sensitivity value of the target image based on the light sensitivity data of the target image includes: The light sensitivity value of each pixel of the target image is obtained, the average of the light sensitivity values of the pixel points is calculated, and the average is determined as the target light sensitivity value.
3. The method according to claim 1, characterized in that The step of determining a target light sensitivity value of the target image based on the light sensitivity data of the target image includes: Based on the light perception data of the target image, calculating the light perception fluctuation value corresponding to the target image; When the light sensitivity fluctuation value is greater than or equal to a preset light sensitivity fluctuation threshold, the light sensitivity values of multiple frames of images corresponding to the target image are averaged, and the obtained average is determined as the target light sensitivity value of the target image.
4. The method according to claim 3, characterized in that The method further comprises: When the light sensitivity fluctuation value is less than a preset light sensitivity fluctuation threshold, the light sensitivity value of each pixel of the target image is obtained, the average of the light sensitivity values of each pixel is calculated, and the average is determined to be the target light sensitivity value.
5. The method according to claim 1, characterized in that The spectral data includes color temperature data of at least one channel; The step of determining the color temperature mean of the target image based on the spectral data of the target image comprises: Based on the spectral data of the target image, color temperature detection is performed to obtain color temperature data of each channel corresponding to the target image; A weighted calculation is performed on the color temperature data of each channel corresponding to the target image to obtain a color temperature mean value of the target image.
6. The method according to claim 1, characterized in that The method of determining a target image compensation strategy according to the first light sensitivity value and the second light sensitivity value, and optimizing the light sensitivity parameters and color temperature parameters of the target image based on the target light sensitivity value, the color temperature mean value and the target image compensation strategy to obtain an optimized image includes: Calculating a light sensitivity difference between the first light sensitivity value and the second light sensitivity value; If the light sensitivity difference is greater than or equal to a preset brightness difference threshold, then based on the optimization algorithm corresponding to the target image, the first light sensitivity value, the second light sensitivity value and the color temperature average, the light sensitivity optimization value of the target image is calculated, and based on the color temperature average, the color temperature optimization value is determined, and the optimization algorithm corresponding to the target image is determined based on the light sensitivity curve corresponding to the target image; The light sensitivity parameters of the target image are optimized based on the light sensitivity optimization value, and the color temperature parameters of the target image are optimized based on the color temperature optimization value to obtain an optimized image.
7. The method according to claim 6, characterized in that The calculating the light sensitivity optimization value of the target image based on the optimization algorithm corresponding to the target image, the first light sensitivity value, the second light sensitivity value, and the color temperature average value includes: Calculating a brightness adjustment parameter based on the first light sensitivity value and the second light sensitivity value; Calculating a color temperature adjustment parameter based on the color temperature average value and the target reference value; The light perception optimization value is obtained based on the brightness adjustment parameter and the color temperature adjustment parameter.
8. The method according to claim 6, characterized in that The step of determining the color temperature optimization value based on the color temperature average value includes: Determine the color temperature average as the color temperature optimization value; or, The target light source type corresponding to the color temperature average value is determined, and based on a preset correspondence between the light source type and the color temperature optimization value, the color temperature optimization value corresponding to the target light source type is determined.
9. The method according to claim 6, characterized in that The method further comprises: If the brightness difference is less than a preset brightness difference threshold, the light sensitivity parameter of the target image is configured as the target light sensitivity value, and the color temperature parameter of the target image is configured as the color temperature average, and the configured target image is determined to be an optimized image.
10. An image optimization device, characterized in that: The device comprises: A first acquisition module, used to acquire light sensing data and spectral data of a target image; a first determination module, configured to determine, based on the light sensitivity data of the target image, a target light sensitivity value of the target image, a first light sensitivity value corresponding to a background area of the target image, and a second light sensitivity value corresponding to a non-background area of the target image, and to determine, based on the spectral data of the target image, a color temperature average of the target image; The second determination module is used to determine a target image compensation strategy according to the first light sensitivity value and the second light sensitivity value, and optimize the light sensitivity parameters and color temperature parameters of the target image based on the target light sensitivity value, the color temperature mean and the target image compensation strategy to obtain an optimized image.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.