Color style correction method and system, electronic device, storage medium and chip
By obtaining the brightness adjustment parameters and white balance requirements of the target device, and adjusting the brightness and white balance parameters of the device to be debugged, the problem of brightness and saturation influence in color style replication is solved, and color style consistency correction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SPREADTRUM SEMICON (NANJING) CO LTD
- Filing Date
- 2023-08-31
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, the effects of the target device's brightness adjustment parameters on the saturation and white balance of the captured image are not effectively considered when copying color styles, making it difficult to achieve true color style copying.
By acquiring the brightness adjustment parameters of the target device, brightness restoration processing is performed, saturation gain and white balance requirements are calculated, the white balance parameters of the device to be debugged are adjusted, and the color style of the device to be debugged is corrected by combining the brightness and white balance parameters.
It achieves consistency correction between the color style of the device under test and the target device, improving the accuracy and consistency of color style replication.
Smart Images

Figure CN117156289B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of color style correction technology, and in particular to a color style correction method, system, electronic device, storage medium and chip. Background Technology
[0002] Color style replication refers to adjusting the color style of the device under test to match that of the target device, so that the color styles of the images captured by the two devices are as close as possible under different color temperatures and ambient brightness.
[0003] Color style is the result of the combined action of multiple ISP (Image Signal Processing) modules. For example, ISP modules include Gamma (gamma correction), LTM (Local Tone Mapping), AWB (Auto White Balance), and CCM (Color Correction Matrix) modules, which adjust the contrast and color of the captured image.
[0004] In existing technologies, color style replication is generally achieved based on the white balance gain value of the captured image obtained through analysis. However, this approach does not actually take into account the impact of the target device's brightness adjustment parameters on the saturation and white balance of the captured image, making it difficult to achieve true color style replication. Summary of the Invention
[0005] In order to solve the above-mentioned technical problems, this disclosure provides a color style correction method, system, electronic device, storage medium and chip.
[0006] This disclosure solves the above-mentioned technical problems through the following technical solution:
[0007] Firstly, this disclosure provides a color style correction method. The color style correction method includes:
[0008] Under a preset light source, the first sample image captured by the device under test and the second sample image captured by the target device are acquired respectively.
[0009] Obtain the brightness adjustment parameters of the target device;
[0010] The second sample image is subjected to brightness restoration processing according to the brightness adjustment parameters;
[0011] Based on the color information of the second sample image after brightness restoration processing and the preset standard color information, the first saturation gain of the target device corresponding to the preset light source is calculated;
[0012] Based on the color information of the second sample image after brightness restoration processing and the first saturation gain, the target white balance requirement is obtained by analysis.
[0013] Based on the color information of the first sample image and the target white balance requirement, the target white balance parameters of the device to be debugged are determined so that the image captured by the device to be debugged based on the target white balance parameters meets the target white balance requirement.
[0014] The color style of the device to be debugged is corrected using the brightness adjustment parameters and the target white balance parameters.
[0015] Optionally, the step of obtaining the target white balance requirement through analysis includes:
[0016] The first position information of the color information of the second sample image in the target coordinate system and the second position information of the preset standard color information in the target coordinate system are obtained; wherein, the target coordinate system is established based on the channels representing color information in the preset color space;
[0017] Obtain the distance between the first location information and the second location information;
[0018] The radius length is calculated based on the first saturation gain and the distance.
[0019] Based on a preset central angle, a fan-shaped region is obtained from a circular region centered on the second position information and with the radius length as the radius, as the target color information range; wherein, the median line of the fan-shaped region coincides with the line connecting the first position information and the second position information, and the target color information range is used to characterize the target white balance requirement.
[0020] Optionally, the step of adjusting the white balance parameters of the device to be debugged includes:
[0021] Obtain the third position information of the color information of the first sample image in the target coordinate system;
[0022] Based on the positional relationship between the third positional information and the first positional information, the white balance parameters of the device to be debugged are adjusted until the positional information of the color information of the captured image of the device to be debugged in the target coordinate system is within the range of the target color information.
[0023] Optionally, after the step of determining the target white balance parameters of the device to be debugged, the method further includes:
[0024] Acquire a third sample image of the device to be debugged based on the target white balance parameters;
[0025] For the second sample image and the third sample image, an initial color correction matrix is obtained by fitting the color information;
[0026] The third sample image is processed according to the initial color correction matrix and the brightness adjustment parameters;
[0027] Obtain the color difference between the second sample image and the third sample image in a preset color space;
[0028] If the color difference is greater than the preset color difference value, iterate the initial color correction matrix until the color difference does not exceed the preset color difference value to obtain the target color correction matrix;
[0029] The step of correcting the color style of the device to be debugged includes:
[0030] The color style of the device to be debugged is corrected using the target color correction matrix.
[0031] Optionally, the step of acquiring the first sample image captured by the device under test and the second sample image captured by the target device respectively includes:
[0032] Under the preset light source with different brightness, the first photosensitive parameters of the device under test and the second photosensitive parameters of the target device are obtained respectively.
[0033] After the steps of acquiring the first sample image captured by the device under test and the second sample image captured by the target device, the method further includes:
[0034] Based on the color information of the first sample image and the preset standard color information, the second saturation gain of the device to be debugged corresponding to the preset light source is calculated;
[0035] Based on the first photosensitivity parameter, the second photosensitivity parameter, the first saturation gain, and the second saturation gain, a mapping relationship between the first photosensitivity parameter and saturation of the device under test is obtained by fitting.
[0036] The step of correcting the color style of the device to be debugged also includes:
[0037] The color style of the device to be debugged is corrected using the mapping relationship.
[0038] Optionally, the step of obtaining the brightness adjustment parameters of the target device includes:
[0039] Under the preset light source, a first grayscale image obtained by the device under test from a preset grayscale color chart and a second grayscale image obtained by the target device from the preset grayscale color chart are acquired respectively.
[0040] For the first grayscale image and the second grayscale image, the brightness information of the neutral color blocks is obtained respectively;
[0041] Calculate the comparison value of the brightness information of the neutral color block between the first grayscale image and the second grayscale image to obtain the brightness gain;
[0042] The brightness of the first grayscale image is compensated based on the brightness gain to update the brightness information of the neutral color blocks in the first grayscale image.
[0043] The brightness adjustment parameters are obtained by fitting the brightness information of the neutral color blocks between the first grayscale image and the second grayscale image.
[0044] Optionally, before the step of acquiring the brightness information of the neutral color patches respectively, the method further includes:
[0045] Saturated pixels are removed from both the first grayscale image and the second grayscale image.
[0046] Optionally, the step of calculating the comparison value of the brightness information of the neutral color patch between the first grayscale image and the second grayscale image includes:
[0047] Target neutral color patches are determined in the first grayscale image and the second grayscale image respectively; wherein, the target neutral color patch includes the neutral color patch whose brightness information meets the preset brightness condition;
[0048] For the first grayscale image and the second grayscale image, the brightness gain is calculated based on the brightness information of the corresponding neutral color blocks of the same target.
[0049] Optionally, before the step of fitting based on the brightness information of the neutral color patches between the first grayscale image and the second grayscale image, the method further includes:
[0050] For the second grayscale image, neutral color blocks whose brightness information does not meet the preset brightness gain requirements are removed.
[0051] Optionally, the device to be debugged only takes pictures based on the black level compensation module, automatic exposure module, automatic focus module, automatic white balance module, and color filter matrix module.
[0052] Optionally, the second sample image is a DNG image.
[0053] Secondly, based on the same concept, this disclosure provides a color style correction system to implement the color style correction method described in the first aspect. The color style correction system includes:
[0054] The image acquisition module is used to acquire a first sample image captured by the device under test and a second sample image captured by the target device under a preset light source.
[0055] A brightness resolution module is used to obtain the brightness adjustment parameters of the target device;
[0056] A brightness restoration module is used to perform brightness restoration processing on the second sample image according to the brightness adjustment parameters;
[0057] The saturation analysis module is used to calculate the first saturation gain of the target device corresponding to the preset light source based on the color information of the second sample image after brightness restoration processing and the preset standard color information.
[0058] The white balance analysis module is used to analyze the target white balance requirement based on the color information of the second sample image after brightness restoration processing and the first saturation gain.
[0059] The white balance adjustment module is used to determine the target white balance parameters of the device to be debugged based on the color information of the first sample image and the target white balance requirement, so that the image captured by the device to be debugged based on the target white balance parameters meets the target white balance requirement.
[0060] The color style correction module is used to correct the color style of the device to be debugged using the brightness adjustment parameters and the target white balance parameters.
[0061] Optionally, the white balance analysis module is used for:
[0062] The first position information of the color information of the second sample image in the target coordinate system and the second position information of the preset standard color information in the target coordinate system are obtained; wherein, the target coordinate system is established based on the channels representing color information in the preset color space;
[0063] Obtain the distance between the first location information and the second location information;
[0064] The radius length is calculated based on the first saturation gain and the distance.
[0065] Based on a preset central angle, a fan-shaped region is obtained from a circular region centered on the second position information and with the radius length as the radius, as the target color information range; wherein, the median line of the fan-shaped region coincides with the line connecting the first position information and the second position information, and the target color information range is used to characterize the target white balance requirement.
[0066] Optionally, the white balance adjustment module is used for:
[0067] Obtain the third position information of the color information of the first sample image in the target coordinate system;
[0068] Based on the positional relationship between the third positional information and the first positional information, the white balance parameters of the device to be debugged are adjusted until the positional information of the color information of the captured image of the device to be debugged in the target coordinate system is within the range of the target color information.
[0069] Optionally, the color style correction system further includes a color correction analysis module, which is used for:
[0070] Acquire a third sample image of the device to be debugged based on the target white balance parameters;
[0071] For the second sample image and the third sample image, an initial color correction matrix is obtained by fitting the color information;
[0072] The third sample image is processed according to the initial color correction matrix and the brightness adjustment parameters;
[0073] Obtain the color difference between the second sample image and the third sample image in a preset color space;
[0074] If the color difference is greater than the preset color difference value, iterate the initial color correction matrix until the color difference does not exceed the preset color difference value to obtain the target color correction matrix;
[0075] The color style correction module is used for:
[0076] The color style of the device to be debugged is corrected using the target color correction matrix.
[0077] Optionally, the image acquisition module is used for:
[0078] Under the preset light source with different brightness, the first photosensitive parameters of the device under test and the second photosensitive parameters of the target device are obtained respectively.
[0079] The color style correction system further includes a mapping relationship parsing module, which is used for:
[0080] Based on the color information of the first sample image and the preset standard color information, the second saturation gain of the device to be debugged corresponding to the preset light source is calculated;
[0081] Based on the first photosensitivity parameter, the second photosensitivity parameter, the first saturation gain, and the second saturation gain, a mapping relationship between the first photosensitivity parameter and saturation of the device under test is obtained by fitting.
[0082] The color style correction module is used for:
[0083] The color style of the device to be debugged is corrected using the mapping relationship.
[0084] Optionally, the brightness resolution module is used for:
[0085] Under the preset light source, a first grayscale image obtained by the device under test from a preset grayscale color chart and a second grayscale image obtained by the target device from the preset grayscale color chart are acquired respectively.
[0086] For the first grayscale image and the second grayscale image, the brightness information of the neutral color blocks is obtained respectively;
[0087] Calculate the comparison value of the brightness information of the neutral color block between the first grayscale image and the second grayscale image to obtain the brightness gain;
[0088] The brightness of the first grayscale image is compensated based on the brightness gain to update the brightness information of the neutral color blocks in the first grayscale image.
[0089] The brightness adjustment parameters are obtained by fitting the brightness information of the neutral color blocks between the first grayscale image and the second grayscale image.
[0090] Optionally, the brightness analysis module is further configured to remove saturated pixels from the first grayscale image and the second grayscale image before acquiring the brightness information of the neutral color blocks respectively.
[0091] Optionally, the brightness resolution module is used for:
[0092] Target neutral color patches are determined in the first grayscale image and the second grayscale image respectively; wherein, the target neutral color patch includes the neutral color patch whose brightness information meets the preset brightness condition;
[0093] For the first grayscale image and the second grayscale image, the brightness gain is calculated based on the brightness information of the corresponding neutral color blocks of the same target.
[0094] Optionally, the brightness analysis module is used to, before fitting the brightness information of the neutral color blocks between the first grayscale image and the second grayscale image, remove neutral color blocks whose brightness information does not meet the preset brightness gain requirements for the second grayscale image.
[0095] Optionally, the device to be debugged only takes pictures based on the black level compensation module, automatic exposure module, automatic focus module, automatic white balance module, and color filter matrix module.
[0096] Optionally, the second sample image is a DNG image.
[0097] Thirdly, this disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and used to run on the processor, wherein when the processor executes the computer program, it implements the color style correction method described in the first aspect.
[0098] Fourthly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the color style correction method described in the first aspect.
[0099] Fifthly, this disclosure provides a chip for performing the color style correction method described in the first aspect.
[0100] In a sixth aspect, this disclosure provides a chip module, including a transceiver component and a chip, the chip being used to perform the color style correction method described in the first aspect.
[0101] Based on common knowledge in the field, the above-described embodiments can be combined in any way to obtain the preferred embodiments of this disclosure.
[0102] The positive and progressive effects of this disclosure are as follows: The color style correction method, system, electronic device, storage medium and chip provided by this disclosure, by sequentially analyzing the brightness adjustment parameters, saturation gain and white balance effect of the target device, decouple the effects of the ISP modules that adjust brightness, saturation and white balance, obtain the function parameters of each ISP module, and then correct the color style of the device to be debugged based on the analyzed function parameters, so as to make the color style of the device to be debugged consistent with the device style of the target device. Attached Figure Description
[0103] Figure 1 A schematic flowchart illustrating the color style correction method provided in this embodiment of the disclosure;
[0104] Figure 2 A schematic diagram illustrating the target color information range provided in the embodiments of this disclosure;
[0105] Figure 3 A schematic diagram of the process for obtaining the target color correction matrix provided in an embodiment of this disclosure;
[0106] Figure 4 A schematic diagram of the modules of the color style correction system provided in the embodiments of this disclosure;
[0107] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0108] The present disclosure is further illustrated below by way of embodiments, but the present disclosure is not limited to the scope of the embodiments described herein.
[0109] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.
[0110] It should be noted that the subject executing the color style correction method provided in this embodiment can be a separate chip, chip module, or UE (User Equipment, terminal device), or it can be a chip or chip module integrated into the UE.
[0111] The color style correction system described in the embodiments can be a standalone chip, chip module, or UE, or it can be a chip or chip module integrated into the UE. The various modules / units included in the color style correction system can be software modules / units, hardware modules / units, or a combination of both.
[0112] For example, for various devices and products applied to or integrated into a chip, each module / unit can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, each module / unit can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules... Each module / unit can be implemented using software programs that run on a processor integrated within the chip module. The remaining modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the UE, each module / unit can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on a processor integrated within the UE, while the remaining modules / units can be implemented using hardware methods such as circuits.
[0113] The color style correction method provided in this disclosure embodiment, such as Figure 1 As shown, it includes the following steps:
[0114] S1. Under a preset light source, acquire the first sample image captured by the device to be debugged and the second sample image captured by the target device, respectively;
[0115] S2. Obtain the brightness adjustment parameters of the target device;
[0116] S3. Perform brightness restoration processing on the second sample image according to the brightness adjustment parameters;
[0117] S4. Calculate the first saturation gain of the target device corresponding to the preset light source based on the color information of the second sample image after brightness restoration processing and the preset standard color information.
[0118] S5. Based on the color information and first saturation gain of the second sample image after brightness restoration processing, the target white balance requirement is obtained by analysis.
[0119] S6. Based on the color information of the first sample image and the target white balance requirements, determine the target white balance parameters of the device to be debugged so that the image captured by the device to be debugged based on the target white balance parameters meets the target white balance requirements.
[0120] S7. Use the brightness adjustment parameters and target white balance parameters to correct the color style of the device to be debugged.
[0121] In step S1, specifically, the first sample image and the second sample image obtained by taking pictures of a preset color chart on the device to be debugged and the target device, respectively. The preset multicolor chart includes multiple color blocks.
[0122] The preset light source primarily adopts standard light sources specified in color science and lighting engineering, because standard light sources are usually sufficiently bright, and modules that increase local brightness, such as noise reduction and LTM, have little or no effect. As a feasible implementation method, the preset light source includes at least one standard light source selected from A, H, TL83, TL84, D50, D65, and D75.
[0123] Since the brightness adjustment during the imaging process of the target device's captured image can affect the saturation of the final output image to some extent, and the saturation adjustment of the captured image can also affect the white balance effect of the final output image to some extent, it is necessary to analyze the brightness and saturation of the target device before analyzing the white balance effect of the captured image.
[0124] In step S2, if the first sample image and the second sample image contain multiple colors, it is not conducive to brightness analysis. Therefore, the brightness of the target device can also be analyzed by acquiring grayscale images of the device to be debugged and the target device respectively using a preset grayscale color chart.
[0125] As one possible implementation method, step S2 includes:
[0126] S21. Under a preset light source, acquire the first grayscale image obtained by the device to be debugged from the preset grayscale color chart and the second grayscale image obtained by the target device from the preset grayscale color chart.
[0127] S22. For the first grayscale image and the second grayscale image, obtain the brightness information of the neutral color blocks respectively;
[0128] S23. Calculate the comparison value of the brightness information of the neutral color block between the first grayscale image and the second grayscale image to obtain the brightness gain;
[0129] S24. Perform brightness compensation on the first grayscale image based on brightness gain to update the brightness information of neutral color blocks in the first grayscale image.
[0130] S25. Fit the brightness information of the neutral color blocks between the first grayscale image and the second grayscale image to obtain the brightness adjustment parameters.
[0131] The preset grayscale color chart includes multiple neutral color blocks, and the color concentration of these neutral color blocks varies in a gradient.
[0132] Based on the above implementation method, the brightness gain of the second grayscale image compared to the first grayscale image can be obtained by comparing the brightness information of the neutral color blocks between the first and second grayscale images. Then, the brightness gain is used to compensate for the brightness of the first grayscale image to ensure that the brightness of the first and second grayscale images is similar. Finally, based on the brightness information of the neutral color blocks between the first and second grayscale images, brightness adjustment parameters are fitted to obtain the brightness.
[0133] The embodiments disclosed herein take into account that saturated pixels may cause some areas of the image to lose detail, and may cause color overflow or distortion in some cases, so it is necessary to remove saturated pixels from the image.
[0134] As a possible implementation, before step S22, the method further includes: removing saturated pixels from the first grayscale image and the second grayscale image respectively.
[0135] In this context, a saturated pixel refers to a pixel in a color space where a certain channel (e.g., red, green, blue) has reached its maximum or minimum value and cannot be increased or decreased further. In the RGB color space, when a pixel value in a channel reaches 255 (the maximum value for an 8-bit image) or 0 (the minimum value for an 8-bit image), the pixel in that channel is considered saturated.
[0136] In step S23, the brightness gain can be obtained by acquiring the brightness information of the neutral color blocks corresponding to the preset grayscale color card in the first grayscale image and the second grayscale color block, calculating the comparison value of the average brightness between the first grayscale image and the second grayscale image.
[0137] This embodiment of the disclosure takes into account that the automatic exposure module in the target device and the device to be tested has a decisive influence on the brightness of the neutral color block during the shooting process. Therefore, the brightness information of the neutral color block can reflect the effect of the automatic exposure module of the corresponding device, and then the most representative neutral color block can be selected for brightness analysis.
[0138] As one possible implementation, step S23 includes:
[0139] S231. Determine the target neutral color blocks in the first grayscale image and the second grayscale image respectively; wherein, the target neutral color blocks include neutral color blocks whose brightness information meets the preset brightness conditions;
[0140] S232. For the first grayscale image and the second grayscale image, calculate the brightness gain based on the brightness information of the corresponding neutral color blocks of the same target.
[0141] Among them, the target neutral color block can be the neutral color block with the greatest brightness information.
[0142] Based on the above implementation method, the first grayscale image and the second grayscale image respectively use the neutral color block with the largest brightness to represent their respective brightness information in order to determine the target neutral color block. Then, based on the brightness information of the target neutral color block, the brightness gain of the target device compared with the device to be debugged can be calculated.
[0143] Furthermore, since the brightness adjustment parameters have certain limitations on the brightness gain of the grayscale color chart, neutral color blocks with unreasonable brightness gain in the second grayscale image can be removed, avoiding inaccurate brightness information from participating in the fitting, which can further improve the accuracy of brightness information, thereby making the brightness adjustment parameters more accurate.
[0144] Before step S25, the method further includes: for the second grayscale image, removing neutral color blocks whose brightness information does not meet the preset brightness gain requirements.
[0145] Specifically, the difference in brightness information between adjacent neutral color blocks in the second grayscale image is calculated. If the difference does not reach the set value, the corresponding neutral color block is removed.
[0146] For example, when both the first grayscale image and the second grayscale image are RGB images, saturated pixels in the first grayscale image and the second grayscale image are first removed. Based on the channel value of the G channel, the channel mean value of the G channel of each neutral color block of the corresponding grayscale color card in the first grayscale image and the second grayscale image is calculated to characterize the brightness information of each neutral color block.
[0147] Then, based on the mean value of the G channel, the brightest neutral color block is selected as the target neutral color block. The mean value of the G channel of the target neutral color block reflects the effect of the automatic exposure modules of the device under test and the target device when shooting the grayscale color card. By calculating the ratio of the mean value of the G channel of the target neutral color block between the first grayscale image and the second grayscale image, the brightness gain of the target device compared to the device under test can be obtained.
[0148] The brightness of the first grayscale image is then compensated using brightness gain, which involves multiplying the brightness gain by the channel value of the G channel in the first grayscale image. Then, it is determined whether the difference in the mean value of the G channel between adjacent neutral color blocks in the second grayscale image reaches a set value. If it does not, the brightness gain between adjacent neutral color blocks is considered unreasonable, and these blocks can be removed to retain those with reasonable brightness gains.
[0149] Finally, the mean G channel values of the corresponding neutral color blocks in the first grayscale image and the second grayscale image are taken as a set of target channel values to form multiple sets of target channel values. Linear fitting, nonlinear least squares and other methods are used to fit the values to obtain the brightness adjustment curve, i.e. the brightness adjustment parameters.
[0150] Furthermore, in order to decouple the effects of some ISP modules used for basic color calibration, the effective ISP modules can be minimized when capturing the first sample image and the second sample image.
[0151] When capturing the first sample image or the first grayscale image, the device under test can enable only some necessary ISP modules, such as the BLE (Black Level Correction) module, AE (Auto Exposure) module, AF (Auto Focus) module, AWB (Auto White Balance) module, and CFA (Color Correction Matrix) module, to reduce the number of active ISP modules and facilitate the decoupling of the effects of the ISP modules.
[0152] As a feasible implementation method, the device to be tested only takes pictures based on the black level compensation module, automatic exposure module, automatic focus module, automatic white balance module, and color filter matrix module.
[0153] Similarly, when capturing the second sample image or the second grayscale image, the target device captures the image in a shooting mode that can produce the original image, such as the professional mode in a mobile phone camera, which can produce DNG (Digital Negative). Furthermore, in professional mode, the ISP module, including the beautification module, color mapping module, and color enhancement module, is largely inactive or has a relatively low level of effectiveness, thus reducing the number of active ISP modules.
[0154] As a possible implementation method, both the second sample image and the second grayscale image are DNG images.
[0155] In step S3, the inverse function of the brightness adjustment curve can be obtained to get the inverse brightness adjustment curve, and then the inverse brightness adjustment curve can be used to process the second sample image to achieve brightness restoration processing of the second sample image.
[0156] The inverse brightness adjustment curve can be applied to images to map the pixel values of the image back to the input light intensity. It is commonly used for image correction, inverse mapping, and restoring the original information of the image.
[0157] In step S4, the color information of the second sample image after brightness restoration is compared with the preset standard color information to determine the first saturation gain of the target device corresponding to the preset light source.
[0158] As one possible implementation method, step S4 specifically includes:
[0159] S41. Convert the second sample image to a preset color space to obtain the color information of the second sample image; wherein, different channels are used in the preset color space to represent color information and brightness information respectively;
[0160] S42. Obtain the preset standard color information corresponding to the preset color space;
[0161] S43. Calculate the first saturation gain based on the color information of the second sample image and the preset standard color information.
[0162] The preset color space is a color space that separates luminance information and color information, such as YUV, YCbCr, CIELAB (also known as Lab) color spaces.
[0163] For example, the second sample image is an RGB image. First, the second sample image is converted from the RGB color space to the CIELAB color space. That is, the pixel value of each pixel in the first sample image (the channel value of the three RGB channels) is converted into the channel value of the three Lab channels to obtain the color information of the second sample image in the CIELAB color space.
[0164] The CIELAB color space is a three-dimensional color model used to describe all possible colors perceived by human vision. It consists of three channels: the L channel, the a channel, and the b channel. The a and b channels represent color information, while the L channel represents brightness information. The a channel represents the range from green to red, with positive values indicating a shift towards red and negative values indicating a shift towards green. The b channel represents the range from blue to yellow, with positive values indicating a shift towards yellow and negative values indicating a shift towards blue. Typically, the values for the a and b channels range from approximately -128 to +128.
[0165] Based on the color information of the second sample image and the preset standard color information of the corresponding preset color space, the preset multicolor chart includes n color patches. According to the above formula, the first saturation gain of the second sample image can be expressed as:
[0166]
[0167] Where S is the first saturation gain, a1, a2, ..., a n The values of channel a for color patches 1 through n are b1, b2, ..., bn. n The b-channel values are the values from the 1st to the nth color patch, where mean represents the average value. 01 a 02 ...a 0n The standard values for channel a of the first to nth color patches, and channel b. 01 b02 ...b 0n The standard b-channel values for the first to nth color blocks.
[0168] Specifically, the preset standard color information can be set according to the LAB standard values provided by X-Rite, that is, the preset standard color information includes the standard values of the a channel and the standard values of the b channel.
[0169] In step S5, the target color information range used to characterize the target white balance condition of the device to be debugged can be determined by using the color information of the second sample image and the first saturation gain.
[0170] As one possible implementation method, step S5 includes:
[0171] S51. Obtain the first position information of the color information of the second sample image in the target coordinate system, and the second position information of the preset standard color information in the target coordinate system;
[0172] S52. Obtain the distance between the first location information and the second location information;
[0173] S53. The radius length is calculated based on the first saturation gain and the distance.
[0174] S54. Based on the preset central angle, obtain a fan-shaped area from the circular region centered on the second position information and with a radius length as the radius, as the target color information range.
[0175] The target coordinate system is established based on the channels representing color information in a preset color space. The median line of the sector coincides with the line connecting the first and second position information, and the target color information range is used to characterize the target white balance requirements.
[0176] Based on the above implementation method, the white balance effect and hue bias of the target device can be more accurately represented by converting the second sample image to the CIELAB color space and using the a-channel and b-channel values of the CIELAB color space.
[0177] For example, see Figure 2 In the CIELAB color space, a target coordinate system is established with channel a as the x-axis and channel b as the y-axis, with point M as the origin. In the target coordinate system, the color information of the second sample image is represented by point C, and the preset standard color information is represented by point O.
[0178] Calculate the distance OC between point O and point C. Multiply the saturation gain by the distance OC to obtain the radius length. Based on the preset central angle, determine a sector area as the target color information range within a circular region centered at point O and with the radius length as the radius. Furthermore, the median line of the sector area should coincide with the line connecting points O and C, i.e., the sector area POQ.
[0179] As one possible implementation method, step S6 includes:
[0180] S61. Obtain the third position information of the color information of the first sample image in the target coordinate system;
[0181] S62. Based on the positional relationship between the third positional information and the first positional information, adjust the white balance parameters of the device to be debugged until the positional information of the color information of the captured image of the device to be debugged in the target coordinate system is within the range of the target color information.
[0182] For example, the color information of the first sample image is represented as point D in the target coordinate system. Based on the positional relationship between point D and point C, the color cast of the device to be debugged relative to the target device can be determined, and then the white balance parameters of the device to be debugged can be adjusted according to the color cast.
[0183] After adjusting the white balance parameters of the device under test, the device under test is used to re-capture the preset multicolor chart to obtain the first sample image, and brightness compensation is performed on the first sample image using brightness gain. It is then determined whether the position information of the color information of the brightness-compensated first sample image in the target coordinate system is within the target color information range. If so, the device under test is considered to meet the target white balance condition. If not, the color cast of the device under test relative to the target device is determined again based on the position information, and the white balance parameters of the device under test are adjusted again based on the color cast until the captured image of the device under test meets the target white balance requirements, thus determining the target white balance parameters.
[0184] In step S7, the brightness adjustment parameters and target white balance parameters obtained from the analysis are set for the device to be debugged, thereby correcting the color style of the device to be debugged.
[0185] In order to make the color style of the device under test closer to that of the target device, this embodiment of the present disclosure can further analyze the color correction matrix of the target device by combining the target white balance parameters of the device under test with the brightness adjustment curve.
[0186] As a feasible implementation method, the above-mentioned color style correction method is as follows: Figure 3 As shown, after step S6, the following steps are also included:
[0187] Acquire a third sample image of the device to be debugged based on the target white balance parameters;
[0188] For the second and third sample images, an initial color correction matrix is obtained by fitting the color information.
[0189] The third sample image is processed based on the initial color correction matrix and brightness adjustment curve;
[0190] Obtain the color difference between the second and third sample images in a preset color space;
[0191] If the color difference is greater than the preset color difference value, iterate the initial color correction matrix until the color difference does not exceed the preset color difference value, and obtain the target color correction matrix.
[0192] Accordingly, step S7 also includes: using the target color correction matrix to correct the color style of the device to be debugged.
[0193] Among them, color difference can be obtained by using internationally recognized color difference calculation methods such as CIE1976 or CIE2000.
[0194] For example, based on the color information of the second and third sample images, an initial color correction matrix can be obtained using nonlinear least squares fitting. The parameters of the initial color correction matrix are then iteratively updated according to the selected optimization algorithm until the color difference between the second and third sample images in the preset color space does not exceed a preset color difference value, thus obtaining a suitable target color correction matrix. This ensures that, under a preset light source, the color style of the device under test is corrected to match the color style of the target device.
[0195] Furthermore, the embodiments of this disclosure also take into account the different saturation levels under different brightness levels. The preset light source can be adjusted to different brightness levels, and steps S1-S7 can be repeated to achieve color style replication under preset light sources with different brightness levels.
[0196] Specifically, as a possible implementation method, step S1 further includes:
[0197] Under preset light sources of varying brightness, the first photosensitive parameters of the device under test and the second photosensitive parameters of the target device are acquired.
[0198] For example, the brightness of the preset light source is successively adjusted to 1 lux, 10 lux, 100 lux, 500 lux, and 1000 lux, respectively, to obtain the first photosensitive parameters when the device under test takes a picture and the second photosensitive parameters when the target device takes a picture.
[0199] Following step S1, the method further includes: calculating the second saturation gain of the preset light source corresponding to the device under test based on the color information of the first sample image and the preset standard color information; and fitting the mapping relationship between the first photosensitive parameter and the saturation of the device under test based on the first photosensitive parameter, the second photosensitive parameter, the first saturation gain and the second saturation gain.
[0200] Accordingly, step S7 also includes: using the mapping relationship to correct the color style of the device to be debugged.
[0201] Based on the above implementation method, the mapping relationship between the first photosensitive parameter and saturation of the device to be debugged can be obtained. Combined with the target color correction matrix corresponding to different brightness of the device to be debugged obtained by repeating steps S1-S7, global color style replication can be achieved, so that the color style of the device to be debugged is closer to the color style of the target device.
[0202] Based on the same concept, embodiments of this disclosure also provide a color style correction system to implement the above-described color style correction method. For example... Figure 4 As shown, the color style correction system includes:
[0203] The image acquisition module 401 is used to acquire, under a preset light source, a first sample image captured by the device under test and a second sample image captured by the target device.
[0204] Brightness resolution module 402 is used to obtain the brightness adjustment parameters of the target device;
[0205] Brightness restoration module 403 is used to perform brightness restoration processing on the second sample image according to brightness adjustment parameters;
[0206] The saturation analysis module 404 is used to calculate the first saturation gain of the target device corresponding to the preset light source based on the color information of the second sample image after brightness restoration processing and the preset standard color information.
[0207] The white balance analysis module 405 is used to analyze the target white balance requirement based on the color information and the first saturation gain of the second sample image after brightness restoration processing.
[0208] The white balance adjustment module 406 is used to determine the target white balance parameters of the device to be debugged based on the color information of the first sample image and the target white balance requirements, so that the image captured by the device to be debugged based on the target white balance parameters meets the target white balance requirements.
[0209] The color style correction module 407 is used to correct the color style of the device to be tested using brightness adjustment parameters and target white balance parameters.
[0210] The image acquisition module 401 can specifically acquire a first sample image and a second sample image obtained by capturing images of a preset color chart on the device under test and the target device, respectively. The preset multi-color chart includes multiple color blocks.
[0211] The preset light source primarily adopts standard light sources specified in color science and lighting engineering, because standard light sources are usually sufficiently bright, and modules that increase local brightness, such as noise reduction and LTM, have little or no effect. As a feasible implementation method, the preset light source includes at least one standard light source selected from A, H, TL83, TL84, D50, D65, and D75.
[0212] Since the brightness adjustment during the imaging process of the target device's captured image can affect the saturation of the final output image to some extent, and the saturation adjustment of the captured image can also affect the white balance effect of the final output image to some extent, it is necessary to analyze the brightness and saturation of the target device before analyzing the white balance effect of the captured image.
[0213] For the brightness analysis module 402, if the first sample image and the second sample image contain multiple colors, it is not conducive to brightness analysis. Therefore, the brightness of the target device can also be analyzed by acquiring grayscale images of the device under test and the target device respectively using a preset grayscale color chart.
[0214] As one feasible implementation method, the luminance resolution module 402 is specifically used for:
[0215] Under a preset light source, the first grayscale image obtained by the device under test from the preset grayscale color chart and the second grayscale image obtained by the target device from the preset grayscale color chart are acquired respectively.
[0216] For the first grayscale image and the second grayscale image, obtain the brightness information of the neutral color blocks respectively;
[0217] The brightness gain is obtained by comparing the brightness information of neutral color blocks between the first grayscale image and the second grayscale image.
[0218] Brightness compensation is performed on the first grayscale image based on brightness gain to update the brightness information of neutral color blocks in the first grayscale image.
[0219] The brightness adjustment parameters are obtained by fitting the brightness information of the neutral color blocks between the first grayscale image and the second grayscale image.
[0220] The preset grayscale color chart includes multiple neutral color blocks, and the color concentration of these neutral color blocks varies in a gradient.
[0221] Based on the above implementation method, the brightness gain of the second grayscale image compared to the first grayscale image can be obtained by comparing the brightness information of the neutral color blocks between the first and second grayscale images. Then, the brightness gain is used to compensate for the brightness of the first grayscale image to ensure that the brightness of the first and second grayscale images is similar. Finally, based on the brightness information of the neutral color blocks between the first and second grayscale images, brightness adjustment parameters are fitted to obtain the brightness.
[0222] The embodiments disclosed herein take into account that saturated pixels may cause some areas of the image to lose detail, and may cause color overflow or distortion in some cases, so it is necessary to remove saturated pixels from the image.
[0223] As a possible implementation, the brightness resolution module 402 is further configured to remove saturated pixels from the first grayscale image and the second grayscale image before acquiring the brightness information of the neutral color blocks.
[0224] In this context, a saturated pixel refers to a pixel in a color space where a certain channel (e.g., red, green, blue) has reached its maximum or minimum value and cannot be increased or decreased further. In the RGB color space, when a pixel value in a channel reaches 255 (the maximum value for an 8-bit image) or 0 (the minimum value for an 8-bit image), the pixel in that channel is considered saturated.
[0225] The brightness analysis module 402 can obtain the brightness information of the neutral color blocks corresponding to the preset grayscale color card in the first grayscale image and the second grayscale color block, calculate the comparison value of the average brightness between the first grayscale image and the second grayscale image, and then obtain the brightness gain.
[0226] This embodiment of the disclosure takes into account that the automatic exposure module in the target device and the device to be tested has a decisive influence on the brightness of the neutral color block during the shooting process. Therefore, the brightness information of the neutral color block can reflect the effect of the automatic exposure module of the corresponding device, and then the most representative neutral color block can be selected for brightness analysis.
[0227] As one possible implementation, the brightness resolution module 402 is used for:
[0228] Target neutral color patches are determined in the first grayscale image and the second grayscale image respectively; wherein, the target neutral color patches include neutral color patches whose brightness information meets the preset brightness conditions;
[0229] For the first grayscale image and the second grayscale image, the brightness gain is calculated based on the brightness information of the corresponding neutral color blocks of the same target.
[0230] Among them, the target neutral color block can be the neutral color block with the greatest brightness information.
[0231] Based on the above implementation method, the first grayscale image and the second grayscale image respectively use the neutral color block with the largest brightness to represent their respective brightness information in order to determine the target neutral color block. Then, based on the brightness information of the target neutral color block, the brightness gain of the target device compared with the device to be debugged can be calculated.
[0232] Furthermore, since the brightness adjustment parameters have certain limitations on the brightness gain of the grayscale color chart, neutral color blocks with unreasonable brightness gain in the second grayscale image can be removed, avoiding inaccurate brightness information from participating in the fitting, which can further improve the accuracy of brightness information, thereby making the brightness adjustment parameters more accurate.
[0233] The brightness analysis module 402 is used to remove neutral color blocks whose brightness information does not meet the preset brightness gain requirements for the second grayscale image before fitting the brightness information of the neutral color blocks between the first grayscale image and the second grayscale image.
[0234] Specifically, the difference in brightness information between adjacent neutral color blocks in the second grayscale image is calculated. If the difference does not reach the set value, the corresponding neutral color block is removed.
[0235] For example, when both the first grayscale image and the second grayscale image are RGB images, saturated pixels in the first grayscale image and the second grayscale image are first removed. Based on the channel value of the G channel, the channel mean value of the G channel of each neutral color block of the corresponding grayscale color card in the first grayscale image and the second grayscale image is calculated to characterize the brightness information of each neutral color block.
[0236] Then, based on the mean value of the G channel, the brightest neutral color block is selected as the target neutral color block. The mean value of the G channel of the target neutral color block reflects the effect of the automatic exposure modules of the device under test and the target device when shooting the grayscale color card. By calculating the ratio of the mean value of the G channel of the target neutral color block between the first grayscale image and the second grayscale image, the brightness gain of the target device compared to the device under test can be obtained.
[0237] The brightness of the first grayscale image is then compensated using brightness gain, which involves multiplying the brightness gain by the channel value of the G channel in the first grayscale image. Then, it is determined whether the difference in the mean value of the G channel between adjacent neutral color blocks in the second grayscale image reaches a set value. If it does not, the brightness gain between adjacent neutral color blocks is considered unreasonable, and these blocks can be removed to retain those with reasonable brightness gains.
[0238] Finally, the mean G channel values of the corresponding neutral color blocks in the first grayscale image and the second grayscale image are taken as a set of target channel values to form multiple sets of target channel values. Linear fitting, nonlinear least squares and other methods are used to fit the values to obtain the brightness adjustment curve, i.e. the brightness adjustment parameters.
[0239] Furthermore, in order to decouple the effects of some ISP modules used for basic color calibration, the effective ISP modules can be minimized when capturing the first sample image and the second sample image.
[0240] When capturing the first sample image or the first grayscale image, the device under test can enable only some necessary ISP modules, such as the BLE (Black Level Correction) module, AE (Auto Exposure) module, AF (Auto Focus) module, AWB (Auto White Balance) module, and CFA (Color Correction Matrix) module, to reduce the number of active ISP modules and facilitate the decoupling of the effects of the ISP modules.
[0241] As a feasible implementation method, the device to be tested only takes pictures based on the black level compensation module, automatic exposure module, automatic focus module, automatic white balance module, and color filter matrix module.
[0242] Similarly, when capturing the second sample image or the second grayscale image, the target device captures the image in a shooting mode that can produce the original image, such as the professional mode in a mobile phone camera, which can produce DNG (Digital Negative). Furthermore, in professional mode, the ISP module, including the beautification module, color mapping module, and color enhancement module, is largely inactive or has a relatively low level of effectiveness, thus reducing the number of active ISP modules.
[0243] As a possible implementation method, both the second sample image and the second grayscale image are DNG images.
[0244] Specifically, the brightness restoration module 403 can obtain the inverse function of the brightness adjustment curve to get the inverse brightness adjustment curve, and then use the inverse brightness adjustment curve to process the second sample image to achieve brightness restoration processing of the second sample image.
[0245] The inverse brightness adjustment curve can be applied to images to map the pixel values of the image back to the input light intensity. It is commonly used for image correction, inverse mapping, and restoring the original information of the image.
[0246] The saturation analysis module 404 compares the color information of the second sample image after brightness restoration with the preset standard color information to determine the first saturation gain of the target device corresponding to the preset light source.
[0247] As a feasible implementation method, the saturation analysis module 404 is specifically used for:
[0248] The second sample image is converted to a preset color space to obtain the color information of the second sample image; wherein, different channels are used in the preset color space to represent color information and brightness information respectively;
[0249] Obtain the preset standard color information corresponding to the preset color space;
[0250] The first saturation gain is calculated based on the color information of the second sample image and the preset standard color information.
[0251] The preset color space is a color space that separates luminance information and color information, such as YUV, YCbCr, CIELAB (also known as Lab) color spaces.
[0252] For example, the second sample image is an RGB image. First, the second sample image is converted from the RGB color space to the CIELAB color space. That is, the pixel value of each pixel in the first sample image (the channel value of the three RGB channels) is converted into the channel value of the three Lab channels to obtain the color information of the second sample image in the CIELAB color space.
[0253] The CIELAB color space is a three-dimensional color model used to describe all possible colors perceived by human vision. It consists of three channels: the L channel, the a channel, and the b channel. The a and b channels represent color information, while the L channel represents brightness information. The a channel represents the range from green to red, with positive values indicating a shift towards red and negative values indicating a shift towards green. The b channel represents the range from blue to yellow, with positive values indicating a shift towards yellow and negative values indicating a shift towards blue. Typically, the values for the a and b channels range from approximately -128 to +128.
[0254] Based on the color information of the second sample image and the preset standard color information of the corresponding preset color space, the preset multicolor chart includes n color patches. According to the above formula, the first saturation gain of the second sample image can be expressed as:
[0255]
[0256] Where S is the first saturation gain, a1, a2, ..., a n The values of channel a for color patches 1 through n are b1, b2, ..., bn.n The b-channel values are the values from the 1st to the nth color patch, where mean represents the average value. 01 a 02 ...a 0n The standard values for channel a of the first to nth color patches, and channel b. 01 b 02 ...b 0n The standard b-channel values for the first to nth color blocks.
[0257] Specifically, the preset standard color information can be set according to the LAB standard values provided by X-Rite, that is, the preset standard color information includes the standard values of the a channel and the standard values of the b channel.
[0258] Specifically, the white balance analysis module 405 can determine the target color information range used to characterize the target white balance conditions of the device under test by using the color information of the second sample image and the first saturation gain.
[0259] As a feasible implementation method, the white balance analysis module 405 is specifically used for:
[0260] Obtain the first position information of the color information of the second sample image in the target coordinate system, and the second position information of the preset standard color information in the target coordinate system;
[0261] Obtain the distance between the first location information and the second location information;
[0262] The radius length is calculated based on the first saturation gain and the distance.
[0263] Based on the preset central angle, a fan-shaped region is obtained from the circular region centered on the second position information and with a radius length as the radius, as the target color information range.
[0264] The target coordinate system is established based on the channels representing color information in a preset color space. The median line of the sector coincides with the line connecting the first and second position information, and the target color information range is used to characterize the target white balance requirements.
[0265] Based on the above implementation method, the white balance effect and hue bias of the target device can be more accurately represented by converting the second sample image to the CIELAB color space and using the a-channel and b-channel values of the CIELAB color space.
[0266] For example, see Figure 2In the CIELAB color space, a target coordinate system is established with channel a as the x-axis and channel b as the y-axis, with point M as the origin. In the target coordinate system, the color information of the second sample image is represented by point C, and the preset standard color information is represented by point O.
[0267] Calculate the distance OC between point O and point C. Multiply the saturation gain by the distance OC to obtain the radius length. Based on the preset central angle, determine a sector area as the target color information range within a circular region centered at point O and with the radius length as the radius. Furthermore, the median line of the sector area should coincide with the line connecting points O and C, i.e., the sector area POQ.
[0268] As one feasible implementation method, the white balance adjustment module 406 is specifically used for:
[0269] Obtain the third position information of the color information of the first sample image in the target coordinate system;
[0270] Based on the positional relationship between the third positional information and the first positional information, adjust the white balance parameters of the device under test until the positional information of the color information of the captured image of the device under test in the target coordinate system is within the range of the target color information.
[0271] For example, the color information of the first sample image is represented as point D in the target coordinate system. Based on the positional relationship between point D and point C, the color cast of the device to be debugged relative to the target device can be determined, and then the white balance parameters of the device to be debugged can be adjusted according to the color cast.
[0272] After adjusting the white balance parameters of the device under test, the device under test is used to re-capture the preset multicolor chart to obtain the first sample image, and brightness compensation is performed on the first sample image using brightness gain. It is then determined whether the position information of the color information of the brightness-compensated first sample image in the target coordinate system is within the target color information range. If so, the device under test is considered to meet the target white balance condition. If not, the color cast of the device under test relative to the target device is determined again based on the position information, and the white balance parameters of the device under test are adjusted again based on the color cast until the captured image of the device under test meets the target white balance requirements, thus determining the target white balance parameters.
[0273] The color style correction module 407 sets the brightness adjustment parameters and target white balance parameters obtained from the analysis to correct the color style of the device to be tested.
[0274] In order to make the color style of the device under test closer to that of the target device, this embodiment of the present disclosure can further analyze the color correction matrix of the target device by combining the target white balance parameters of the device under test with the brightness adjustment curve.
[0275] As a feasible implementation, the above-mentioned color style correction system further includes a color correction analysis module, used for:
[0276] Acquire a third sample image of the device to be debugged based on the target white balance parameters;
[0277] For the second and third sample images, an initial color correction matrix is obtained by fitting the color information.
[0278] The third sample image is processed based on the initial color correction matrix and brightness adjustment curve;
[0279] Obtain the color difference between the second and third sample images in a preset color space;
[0280] If the color difference is greater than the preset color difference value, iterate the initial color correction matrix until the color difference does not exceed the preset color difference value, and obtain the target color correction matrix.
[0281] Correspondingly, the color style correction module 407 is used to correct the color style of the device to be debugged using the target color correction matrix.
[0282] Among them, color difference can be obtained by using internationally recognized color difference calculation methods such as CIE1976 or CIE2000.
[0283] For example, based on the color information of the second and third sample images, an initial color correction matrix can be obtained using nonlinear least squares fitting. The parameters of the initial color correction matrix are then iteratively updated according to the selected optimization algorithm until the color difference between the second and third sample images in the preset color space does not exceed a preset color difference value, thus obtaining a suitable target color correction matrix. This ensures that, under a preset light source, the color style of the device under test is corrected to match the color style of the target device.
[0284] Furthermore, this embodiment of the present disclosure also takes into account the different saturation levels under different brightness levels. The preset light source can be adjusted to different brightness levels, and the image acquisition module 401 to the color style correction module 407 can be repeatedly called to achieve color style replication under preset light sources with different brightness levels.
[0285] Specifically, as a possible implementation, the image acquisition module 401 is also used for:
[0286] Under preset light sources of varying brightness, the first photosensitive parameters of the device under test and the second photosensitive parameters of the target device are acquired.
[0287] For example, the brightness of the preset light source is successively adjusted to 1 lux, 10 lux, 100 lux, 500 lux, and 1000 lux, respectively, to obtain the first photosensitive parameters when the device under test takes a picture and the second photosensitive parameters when the target device takes a picture.
[0288] Accordingly, the aforementioned color style correction system also includes a mapping relationship parsing module, which is used for:
[0289] Based on the color information of the first sample image and the preset standard color information, the second saturation gain of the preset light source corresponding to the device under test is calculated; based on the first photosensitive parameter, the second photosensitive parameter, the first saturation gain and the second saturation gain, the mapping relationship between the first photosensitive parameter and the saturation of the device under test is fitted.
[0290] Correspondingly, the color style correction module 407 is used to correct the color style of the device to be debugged using the mapping relationship.
[0291] Based on the above implementation method, the mapping relationship between the first photosensitive parameter and saturation of the device under test can be obtained. Combined with the obtained target color correction matrix corresponding to different brightness of the device under test, global color style replication can be achieved, so that the color style of the device under test is closer to the color style of the target device.
[0292] Figure 5 The structure of one type of electronic device disclosed herein is shown. The electronic device includes a memory, a processor, and a computer program stored in the memory and executed on the processor. When the processor executes the program, it implements the aforementioned color style correction method. Figure 5 The electronic device 50 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0293] like Figure 5 As shown, the electronic device 50 can also be represented in the form of a general computing device, such as a server device. The components of the electronic device 50 may include, but are not limited to: at least one processor 51, at least one memory 52, and a bus 53 connecting different system components (including memory 52 and processor 51).
[0294] Bus 53 includes a data bus, an address bus, and a control bus.
[0295] The memory 52 may include volatile memory, such as random access memory (RAM) 521 and / or cache memory 522, and may further include read-only memory (ROM) 523.
[0296] The memory 52 may also include a program / utility 525 having a set (at least one) program module 526, such program module 524 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0297] The processor 51 executes various functional applications and data processing by running computer programs stored in the memory 52, such as the color style correction method described above in this disclosure.
[0298] Electronic device 50 can also communicate with one or more external devices 54 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 55. Furthermore, the model-generating device 50 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 55. Figure 5 As shown, network adapter 56 communicates with other modules of the model-generated device 50 via bus 53. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 50, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.
[0299] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0300] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described color style correction method.
[0301] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0302] In a possible implementation, this disclosure can also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to execute and implement the above-described color style correction method.
[0303] The program code for executing this disclosure can be written using any combination of one or more programming languages. The program code can be executed entirely on a user device, partially on a user device, as a standalone software package, partially on a user device and partially on a remote device, or entirely on a remote device.
[0304] While specific embodiments of this disclosure have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of this disclosure is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of this disclosure, but all such changes and modifications fall within the scope of protection of this disclosure.
Claims
1. A color style correction method, characterized in that, The color style correction method includes: Under a preset light source, the first sample image captured by the device under test and the second sample image captured by the target device are acquired respectively. Obtain the brightness adjustment parameters of the target device; The second sample image is subjected to brightness restoration processing according to the brightness adjustment parameters; Based on the color information of the second sample image after brightness restoration processing and the preset standard color information, the first saturation gain of the target device corresponding to the preset light source is calculated; Based on the color information of the second sample image after brightness restoration processing and the first saturation gain, the target white balance requirement is obtained by analysis. Based on the color information of the first sample image and the target white balance requirement, the target white balance parameters of the device to be debugged are determined so that the image captured by the device to be debugged based on the target white balance parameters meets the target white balance requirement. The color style of the device to be debugged is corrected using the brightness adjustment parameters and the target white balance parameters.
2. The color style correction method according to claim 1, characterized in that, The steps for obtaining the target white balance requirement through analysis include: The first position information of the color information of the second sample image in the target coordinate system and the second position information of the preset standard color information in the target coordinate system are obtained; wherein, the target coordinate system is established based on the channels representing color information in the preset color space; Obtain the distance between the first location information and the second location information; The radius length is calculated based on the first saturation gain and the distance. Based on a preset central angle, a fan-shaped region is obtained from a circular region centered on the second position information and with the radius length as the radius, as the target color information range; wherein, the median line of the fan-shaped region coincides with the line connecting the first position information and the second position information, and the target color information range is used to characterize the target white balance requirement.
3. The color style correction method according to claim 2, characterized in that, The step of adjusting the white balance parameters of the device to be debugged includes: Obtain the third position information of the color information of the first sample image in the target coordinate system; Based on the positional relationship between the third positional information and the first positional information, the white balance parameters of the device to be debugged are adjusted until the positional information of the color information of the captured image of the device to be debugged in the target coordinate system is within the range of the target color information.
4. The color style correction method according to claim 1, characterized in that, After the step of determining the target white balance parameters of the device to be debugged, the method further includes: Acquire a third sample image of the device to be debugged based on the target white balance parameters; For the second sample image and the third sample image, an initial color correction matrix is obtained by fitting the color information; The third sample image is processed according to the initial color correction matrix and the brightness adjustment parameters; Obtain the color difference between the second sample image and the third sample image in a preset color space; If the color difference is greater than the preset color difference value, iterate the initial color correction matrix until the color difference does not exceed the preset color difference value to obtain the target color correction matrix; The step of correcting the color style of the device to be debugged includes: The color style of the device to be debugged is corrected using the target color correction matrix.
5. The color style correction method according to claim 1, characterized in that, The steps of acquiring the first sample image captured by the device under test and the second sample image captured by the target device respectively include: Under the preset light source with different brightness, the first photosensitive parameters of the device under test and the second photosensitive parameters of the target device are obtained respectively. After the steps of acquiring the first sample image captured by the device under test and the second sample image captured by the target device, the method further includes: Based on the color information of the first sample image and the preset standard color information, the second saturation gain of the device to be debugged corresponding to the preset light source is calculated; Based on the first photosensitivity parameter, the second photosensitivity parameter, the first saturation gain, and the second saturation gain, a mapping relationship between the first photosensitivity parameter and saturation of the device under test is obtained by fitting. The step of correcting the color style of the device to be debugged also includes: The color style of the device to be debugged is corrected using the mapping relationship.
6. The color style correction method according to claim 1, characterized in that, The step of obtaining the brightness adjustment parameters of the target device includes: Under the preset light source, a first grayscale image obtained by the device under test from a preset grayscale color chart and a second grayscale image obtained by the target device from the preset grayscale color chart are acquired respectively. For the first grayscale image and the second grayscale image, the brightness information of the neutral color blocks is obtained respectively; Calculate the comparison value of the brightness information of the neutral color block between the first grayscale image and the second grayscale image to obtain the brightness gain; The brightness of the first grayscale image is compensated based on the brightness gain to update the brightness information of the neutral color blocks in the first grayscale image. The brightness adjustment parameters are obtained by fitting the brightness information of the neutral color blocks between the first grayscale image and the second grayscale image.
7. The color style correction method according to claim 6, characterized in that, Before the step of acquiring the brightness information of the neutral color patches respectively, the method further includes: Saturated pixels are removed from the first grayscale image and the second grayscale image respectively; And / or, The step of calculating the comparison value of the brightness information of the neutral color blocks between the first grayscale image and the second grayscale image includes: Target neutral color patches are determined in the first grayscale image and the second grayscale image respectively; wherein, the target neutral color patch includes the neutral color patch whose brightness information meets the preset brightness condition; For the first grayscale image and the second grayscale image, the brightness gain is calculated based on the brightness information of the corresponding neutral color blocks of the same target. And / or, Before the step of fitting the neutral color patch brightness information between the first grayscale image and the second grayscale image, the method further includes: For the second grayscale image, neutral color blocks whose brightness information does not meet the preset brightness gain requirements are removed.
8. The color style correction method according to any one of claims 1-7, characterized in that, The device under test only takes pictures based on the black level compensation module, automatic exposure module, automatic focus module, automatic white balance module, and color filter matrix module; And / or, The second sample image is a DNG image.
9. A color style correction system, characterized in that, The color style correction system includes: The image acquisition module is used to acquire a first sample image captured by the device under test and a second sample image captured by the target device under a preset light source. A brightness resolution module is used to obtain the brightness adjustment parameters of the target device; A brightness restoration module is used to perform brightness restoration processing on the second sample image according to the brightness adjustment parameters; The saturation analysis module is used to calculate the first saturation gain of the target device corresponding to the preset light source based on the color information of the second sample image after brightness restoration processing and the preset standard color information. The white balance analysis module is used to analyze the target white balance requirement based on the color information of the second sample image after brightness restoration processing and the first saturation gain. The white balance adjustment module is used to determine the target white balance parameters of the device to be debugged based on the color information of the first sample image and the target white balance requirement, so that the image captured by the device to be debugged based on the target white balance parameters meets the target white balance requirement. The color style correction module is used to correct the color style of the device to be debugged using the brightness adjustment parameters and the target white balance parameters.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and for running on the processor, characterized in that, When the processor executes a computer program, it implements the color style correction method as described in any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the color style correction method as described in any one of claims 1-8.
12. A chip used in electronic devices, characterized in that, The chip includes a processor for performing the color style correction method as described in any one of claims 1-8.
13. A chip module, used in electronic devices, characterized in that, It includes a transceiver component and a chip, the chip being used to perform the color style correction method as described in any one of claims 1-8.