Image Processing Method and Apparatus, Electronic Device, and Computer-Readable Medium

By constructing the color correction matrix sequence and interpolation processing, the accuracy of image color correction in multi-light source environment is solved, the global integrity and smooth transition of image color correction are achieved, and the accuracy of image processing is improved.

CN115239739BActive Publication Date: 2025-07-25GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210847998.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-19
Publication Date
2025-07-25
Estimated Expiration
2042-07-19

AI Technical Summary

Technical Problem

In a multi-light source environment, it is difficult for the prior art to effectively correct the color distortion of the image, resulting in a decrease in the accuracy of image color correction.

Method used

A color correction matrix sequence is constructed, the image is divided into multiple image blocks according to the first color correction matrix of different light sources, the second color correction matrix of each image block is determined separately, and the third color correction matrix of pixel points in the image block is obtained by interpolation to achieve correction of image color parameters.

Benefits of technology

It improves the accuracy and authenticity of the color correction of images in a multi-light environment, avoids regional distortion and color abruptness caused by correction compromises between image blocks, and ensures the integrity of the global color correction of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115239739B_ABST
    Figure CN115239739B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing method, which relates to the technical field of image processing. The method includes: obtaining a sequence of color correction matrices, where the sequence of color correction matrices is constructed based on a first color correction matrix for different light sources; dividing an image into a plurality of image blocks, and respectively determining a second color correction matrix for each of the image blocks based on the sequence of color correction matrices; interpolating to obtain a third color correction matrix for each pixel point in each of the image blocks according to the second color correction matrix of each of the image blocks and the position of the image block; and correcting the color parameters of the image by using each of the third color correction matrices. The present disclosure can improve the color correction accuracy of multi-light source images.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In order to make the colors of the images captured by a device consistent with human eye vision in color perception, it is possible to correct the cross effect of spectral response and response intensity, convert the color space related to the device to a device-independent color space, and achieve image color correction. However, when there are multiple light sources in the field of view, there are parts of the field of view corresponding to different light sources in the scene of capturing images with multiple light sources, which affects the accuracy of image color correction. Summary of the Invention

[0003] The purpose of the present disclosure is to provide an image processing method, an image processing device, an electronic device, and a computer-readable medium, so as to at least improve the accuracy of image color correction to a certain extent.

[0004] According to a first aspect of the present disclosure, there is provided an image processing method, including: obtaining a sequence of color correction matrices, where the sequence of color correction matrices is constructed based on first color correction matrices of different light sources; dividing an image into a plurality of image blocks, and respectively determining second color correction matrices of the respective image blocks based on the sequence of color correction matrices; interpolating to obtain third color correction matrices of pixel points in the respective image blocks according to the second color correction matrices of the respective image blocks and the positions of the image blocks; and correcting color parameters of the image by using the third color correction matrices of the respective image blocks.

[0005] According to a second aspect of the present disclosure, there is provided an image processing device, including: an obtaining module, configured to obtain a sequence of color correction matrices, where the sequence of color correction matrices is constructed based on first color correction matrices of different light sources; a matrix processing module, configured to divide an image into a plurality of image blocks, and respectively determine second color correction matrices of the respective image blocks based on the sequence of color correction matrices; an interpolation processing module, configured to interpolate to obtain third color correction matrices of pixel points in the respective image blocks according to the second color correction matrices of the respective image blocks and the positions of the image blocks; and a correction module, configured to correct color parameters of the image by using the third color correction matrices of the respective image blocks.

[0006] According to a third aspect of the present disclosure, there is provided an electronic device, characterized by including: a processor; and a memory, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the one or more processors to implement the above method.

[0007] According to a fourth aspect of the present disclosure, there is provided a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0008] In the technical solutions provided by some embodiments of the present disclosure, on the one hand, a color correction matrix sequence is constructed according to the first color correction matrices of different light sources, and the second color correction matrices of each image block in the image are respectively determined based on the color correction matrix sequence, so that the image blocks in the field of view corresponding to different light sources can obtain the second color correction matrices that match their corresponding light sources, thereby the field of view parts corresponding to different light sources can be respectively corrected. There is no need to adopt a unique correction method among the image blocks of the multi-light-source captured images, avoiding the distortion of some areas caused by the correction compromise among the image blocks of the multi-light-source captured images. That is, the correction of the field of view parts of multiple light sources is taken into account in the same image, improving the accuracy and authenticity of the image color correction of multiple light sources. On the other hand, according to the second color correction matrix of the image block and the position of the image block, the third color correction matrix of the pixel points in each image block is obtained by interpolation. There is no need for overlapping parts between the image blocks to complete the transition. The third color correction matrix of each image block is obtained by interpolation, making the correction of the color parameters of the pixel points between the image blocks transition in a smoother manner, avoiding the generation of abrupt color areas between the image blocks, and ensuring the global integrity of the color correction of the multi-light-source captured images. On the other hand, for the rapid expansion of the device application scenarios, improving the accuracy of the color correction of the multi-light-source captured images has practical significance for improving the user experience and further increasing the device application scenarios.

[0009] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts. In the drawings:

[0011] Figure 1 A schematic diagram showing an application scenario of an image processing method and apparatus to which the embodiments of the present disclosure can be applied;

[0012] Figure 2 A flowchart schematically showing an image processing method in an exemplary embodiment of the present disclosure;

[0013] Figure 3 A schematic diagram showing adjacent image blocks of a pixel point in an exemplary embodiment of the present disclosure;

[0014] Figure 4 A flowchart schematically showing an implementation manner of obtaining a color correction matrix sequence in an exemplary embodiment of the present disclosure;

[0015] Figure 5 A schematic diagram showing an implementation manner of calibrating a first color correction matrix for each light source in an exemplary embodiment of the present disclosure;

[0016] Figure 6 A flowchart showing an implementation manner of determining a second color correction matrix for an image block in an exemplary embodiment of the present disclosure;

[0017] Figure 7 A schematic diagram showing an implementation manner of interpolating to obtain a third color correction matrix for pixel points in each image block based on the position of the image block and using the second color correction matrices of adjacent image blocks corresponding to the pixel points in each image block in an exemplary embodiment of the present disclosure;

[0018] Figure 8 A flowchart showing an implementation manner of interpolating to obtain a third color correction matrix for pixel points in each image block in an exemplary embodiment of the present disclosure;

[0019] Figure 9 A schematic diagram showing an image processing method in an application scenario in an exemplary embodiment of the present disclosure;

[0020] Figure 10 A schematic diagram of an image after applying the image processing method of the exemplary embodiment of the present disclosure;

[0021] Figure 11 A schematic diagram of an image after applying the global color correction method in the related art;

[0022] Figure 12 A schematic diagram showing the composition of an image processing apparatus in an exemplary embodiment of the present disclosure;

[0023] Figure 13 A schematic diagram of an electronic device to which the exemplary embodiment of the present disclosure can be applied is shown. Detailed implementation manners

[0024] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0025] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0026] Figure 1 FIG. shows a schematic diagram of an application scenario of an image processing method and apparatus to which embodiments of the present disclosure can be applied.

[0027] As Figure 1 shown, the device 101 may be an intelligent device with image processing capabilities, such as a smart phone, a computer, a tablet computer, a smart watch, a smart speaker, a vehicle-mounted device, a wearable device, a monitoring device, and other intelligent devices. A camera may or may not be provided in the device 101, as long as it can process images. The image to be processed may be any type of image in various scenarios, which may be captured by the device 101 or obtained from a network or other devices. The image to be processed may be an image captured under a single light source or an image captured under multiple light sources, and no special limitation is imposed thereon.

[0028] In an embodiment of the present disclosure, the device 101 obtains the image 104 to be processed from the memory 102 and sends it to the processor 103. In the processor 103, the image is segmented into multiple image blocks, and a second color correction matrix for each image block is determined based on a sequence of color correction matrices. According to the second color correction matrix of each image block and the position of the image block, a third color correction matrix for each pixel point in the image block is obtained by interpolation. The color parameters of the image are corrected by using each third color correction matrix to obtain a target image 105 with color correction. Among them, before processing the image, the processor 103 first constructs a sequence of color correction matrices according to the first color correction matrices of different light sources.

[0029] It should be noted that the image processing method provided in the embodiments of the present disclosure may be executed by the device 101. Correspondingly, the image processing method may be set in the device 101 by means of a program or the like. The image processing method provided in the embodiments of the present disclosure may also be executed by a server. The server may be a background system that provides image processing-related services in the embodiments of the present disclosure, and may include a portable computer, a desktop computer, a smart phone, and other electronic devices with computing functions or a cluster formed by multiple electronic devices. In the embodiments of the present disclosure, the case where the image processing method is executed by a device is taken as an example for description.

[0030] In related technologies, it is difficult to keep the colors of pictures captured or received by a device consistent with human eye vision, resulting in color distortion. In the ISP (Image Signal Processing) path, a Color Correction Matrix (CCM) can be used to convert the device-related color space to a device-independent color space, thereby completing the correction of the cross effect of spectral response and response intensity.

[0031] However, when there are multiple light sources in the field of view, for an image including a multi-light-source field of view, it is always necessary to compromise between different light-source corresponding image regions to complete color correction. For example, the color correction matrix corresponding to a certain light source is used to complete the color correction of the global image, reducing the color correction accuracy of the overall image.

[0032] Based on the above one or more problems, the present exemplary embodiment provides an image processing method for color-correcting an image. Referring Figure 2 as shown, the image processing method may include the following steps S210 to step S240:

[0033] In step S210, a color correction matrix sequence is obtained.

[0034] In an exemplary embodiment of the present disclosure, the color correction matrix sequence is constructed based on the first color correction matrices of different light sources. The color correction matrix is a 3×3 matrix for converting the device-related color space to a device-independent color space. In actual implementation, the color parameters of each pixel can be corrected using the color correction matrix of that pixel. In the embodiment of the present disclosure, the first color correction matrices of different light sources are arranged in order as the color correction matrix sequence. For example, the color correction matrix sequence is CCM1, CCM2, CCM3,..., CCM n-1 , CCM n , where n is the number of light sources.

[0035] Herein, a light source refers to an object that can emit electromagnetic waves within a certain wavelength range. Images captured under different ambient light (light source) conditions exhibit different color display results. Since the color temperatures of different light sources are different, objects present different colors under different light sources. For example, under a low-color-temperature light source, a white object appears red, and under a high-color-temperature light source, a white object appears blue. The human eye vision judges and recognizes the true color based on the memory of the brain. For images captured under different light sources, to present a display effect close to the human eye vision, color correction is required.

[0036] In the embodiments of the present disclosure, the type and quantity of light sources can be determined according to the correction requirements. For example, different light sources can include seven standard light sources: D75, D65, D50, TL84, CWF, A, and H. The standard light sources are artificial light sources that simulate various environmental lights and have the same lighting effect as the actual light sources. The relative color temperature values of each light source are, for example, 7500K, 6500K, 5000K, 4020K, 4063K, 2928K, and 2349K. It should be noted that the quantity and type of light sources can be adjusted according to actual requirements, and the embodiments of the present disclosure do not make special limitations on the type and quantity of light sources.

[0037] During actual implementation, the first color correction matrix of each light source can be calibrated separately to obtain the first color correction matrices of all light sources, and the first color correction matrices of all light sources can be sorted to form a sequence. Exemplarily, the first color correction matrix can be sorted based on the relative color temperature values of different light sources.

[0038] The first color correction matrices of different light sources are fused to construct a color correction matrix sequence. Based on the serialized first color correction matrix, it can be used as a reference basis for simultaneously processing images containing different light sources, without the need to repeatedly obtain the color correction matrices of different light sources, thereby improving the correction efficiency of processing images captured by multiple light sources.

[0039] In step S220, the image is segmented into multiple image blocks, and the second color correction matrix of each image block is determined based on the color correction matrix sequence.

[0040] In the exemplary embodiments of the present disclosure, the image is segmented into multiple image blocks, there is no overlapping area between the image blocks, and the second color correction matrix of each image block is determined based on the color correction matrix sequence.

[0041] In some possible implementation manners, the number of segmented image blocks can be determined according to the device hardware information. Among them, if the device has a color temperature sensing module and it completely matches the field of view of the device's image sensing module, the number of segmented image blocks is the same as the array structure of the color temperature sensing module. The image sensing module can be the image sensor corresponding to a main camera, a wide-angle camera, a telephoto camera, etc. If the color temperature sensing array matched with it is M×N, then the segmented array of image blocks is M×N.

[0042] Based on this, each image block has a corresponding color temperature sensing module, so that information such as the color temperature and spectrum of each image block can be obtained through the color temperature sensing module, and the measured information can be directly involved in the prediction of the first color correction matrix of the subsequent image block, with relatively high prediction accuracy.

[0043] In some possible embodiments, the number of image segments may also be determined based on one or more factors such as actual light source characteristic data, target image resolution, image prediction effect, and prediction calculation amount. Among them, the actual light source characteristic data at least includes light source direction, number of light sources, distance between the light source and the image, number of light sources, and light source distribution. Combining various factors to determine the number of segments of the image blocks. For example, the image may be optionally segmented into image blocks of 4×3 or 8×6.

[0044] After obtaining multiple image blocks corresponding to the image, based on the color correction matrix, the second color correction matrix of each image block can be interpolated. While obtaining the second color correction matrix that matches the visual field parts corresponding to different light sources in the image, the transition between the visual field parts corresponding to different light sources is smooth and natural.

[0045] In step S230, according to the second color correction matrix of each image block and the image block position, the third color correction matrix of the pixel points in each image block is interpolated.

[0046] In the exemplary embodiment of the present disclosure, based on the image block position, the second color correction matrix of the image block can be used to obtain the third color correction matrix of the pixel points in the image block, that is, the color correction matrix between the image blocks.

[0047] Among them, according to the image block position, the number of adjacent image blocks of the pixel points in the image block is determined. Since the number of adjacent image blocks of the pixel points is different, in order to make the smooth transition between the image blocks, first determine the actual number of adjacent image blocks of the pixel points, and then perform interpolation processing based on the second color correction matrix of the adjacent image blocks of the pixel points to obtain the third color correction matrix of the above pixel points. Without the need for an overlapping part between the image blocks, through the interpolation method of the second color correction matrix between the image blocks, the third color correction matrix of the pixel points between the image blocks is smoothly transitioned, avoiding abrupt regions in the entire image.

[0048] The adjacent image blocks of the pixel points include the image block corresponding to the pixel point (the belonging image block) and the adjacent image blocks of the image block corresponding to the pixel point. As Figure 3 Schematically shows a schematic diagram of an adjacent image block of a pixel point in an exemplary embodiment of the present disclosure.

[0049] As Figure 3As shown, the image is divided into 4×5 image blocks. For the pixels in the area indicated by identification 1, the adjacent image blocks are the corresponding image blocks of the pixels, that is, for the pixels in the corner area of the image, the adjacent image blocks are the corresponding image blocks of the pixels. For the pixels in the area indicated by identification 2, the adjacent image blocks of the pixels are the corresponding image blocks of the pixels and an image block adjacent horizontally to the corresponding image block, that is, for the pixels in the edge area of the image, the adjacent image blocks of the pixels are the corresponding image blocks of the pixels and an image block adjacent horizontally to the corresponding image block. For the pixels in the area indicated by identification 3, the adjacent image blocks of the pixels are the corresponding image blocks of the pixels and three image blocks adjacent to the corresponding image block of the pixels. That is to say, for the pixels in the internal area of the image, the adjacent image blocks of the pixels are the corresponding image blocks of the pixels and three image blocks adjacent to the corresponding image block of the pixels.

[0050] It should be noted that Figure 3 The basis for dividing the image area shown is the symmetry center of the image block. In the embodiments of the present disclosure, the basis for dividing the image area can also be adjusted according to actual correction requirements, and no special limitation is made here.

[0051] Determine the adjacent image blocks of the pixels in each image block according to the position of the image block, and interpolate to obtain the third color correction matrix of the pixels based on the second color correction matrix of the adjacent image blocks, so that the third color correction matrices of the pixels between the image blocks are smoothly transitioned.

[0052] In step S240, use each third color correction matrix to correct the color parameters of the image.

[0053] In the exemplary embodiments of the present disclosure, after obtaining the third color correction matrix of the pixels in the image, the color parameters of the corresponding pixels can be corrected by using the third color correction matrix, such as correcting the RGB data of the corresponding pixels to obtain the corrected image.

[0054] Exemplarily, the RGB data of each pixel can be multiplied by the corresponding third color correction matrix to obtain the corrected RGB data, as shown in the following formula (1):

[0055]

[0056] Wherein, R’, G’ and B’ are the RGB data before correction, and R, G and B are the RGB data after correction.

[0057] In the image processing method according to an exemplary embodiment of the present disclosure, a color correction matrix sequence is constructed based on the first color correction matrices of different light sources, and the second color correction matrix of each image block in the image is determined respectively based on the color correction matrix sequence, so that the image blocks in the field of view corresponding to different light sources obtain the second color correction matrix matching the corresponding light source, thereby the field of view parts corresponding to different light sources can be corrected respectively, and there is no need to adopt a unique correction method between the image blocks of the multi-light-source captured image, avoiding the distortion of partial regions caused by the correction compromise between the image blocks of the multi-light-source captured image, that is, the correction of the field of view parts of multiple light sources is taken into account in the same image, improving the accuracy and authenticity of the image color correction of multiple light sources; on the other hand, according to the second color correction matrix of the image block and the position of the image block, the third color correction matrix of the pixel points in each image block is obtained by interpolation, without the need for an overlapping part between the image blocks to complete the transition, and the third color correction matrix of each image block is obtained by interpolation, so that the color parameter correction of the pixel points between the image blocks is transitioned in a smoother manner, avoiding the generation of color abrupt regions between the image blocks, and ensuring the global integrity of the color correction of the multi-light-source captured image.

[0058] In an exemplary embodiment, an implementation manner for obtaining a color correction matrix sequence is provided. Obtaining the color correction matrix sequence may include the following steps S410 to step S430:

[0059] Step S410: Obtain the first color correction matrix corresponding to each light source.

[0060] For each light source, polynomial fitting processing may be performed on the target color value and the measured color value under the light source to obtain the first color correction matrix. Among them, the target color value and the measured color value are obtained based on the standard color card image.

[0061] Exemplarily, in each light source environment, 24 color card images are collected, and the 24 measured color values and target color values of the color card images are used as inputs, and the least squares method is used for fitting to obtain the first color correction sequence with the smallest difference between the output image and the target image data.

[0062] Figure 5 Schematically shows a schematic diagram of an implementation manner for calibrating the first color correction matrix of each light source in an exemplary embodiment of the present disclosure. As Figure 5 shown, sensor_RGB is the source color space, non-linear sRGB is the target color space, the 24 color blocks corresponding to the source color space, the 24 color blocks corresponding to non-linear sRGB, and the numerical values of M1 and γ are known. Then, the inverse Gamma correction can be first performed on non-linear sRGB to obtain linear sRGB, and then the linear RGB is converted to the XYZ space to obtain the following formula (2):

[0063]

[0064] Among them, m is the size of the color block. If a 24-color card is used, m is 24, and n is the average color value of each color block. Based on formula (2), the following formula is obtained:

[0065]

[0066] That is, the first color correction matrix M = M 2 ×M 1 .

[0067] It should be noted that in the embodiments of the present disclosure, the first color correction matrix corresponding to each light source can also be obtained by other means. For example, the first color correction matrix corresponding to each light source can be obtained by using the 3D-LUT (3D-Look-Up-Table) method. The embodiments of the present disclosure do not make special limitations on this.

[0068] The calibration method based on the standard color card image is beneficial to the objective calibration correction and restoration of the mixture of multiple light sources in the same field of view, and thus ensures the objectivity and accuracy of color correction.

[0069] Step SS420: Obtain the relative color temperature values of each light source.

[0070] For each light source, a light source illuminometer can be used to sequentially collect the relative color temperature values of each light source.

[0071] Step SS430: Sort the first color correction matrices according to the relative color temperature values of the corresponding light sources to obtain a color correction matrix sequence.

[0072] In order to perform interpolation processing based on the color correction matrix sequence subsequently, the first color correction matrices of different light sources can be sorted according to the relative color temperature values of the corresponding light sources to obtain a color correction matrix sequence.

[0073] Optionally, the first color correction matrices can be sorted in descending order of the relative color temperature values of the corresponding light sources to obtain a color correction matrix sequence; optionally, the first color correction matrices can be sorted in descending order of the relative color temperature values of the corresponding light sources to obtain a color correction matrix sequence, and no limitation is made here.

[0074] Exemplarily, sorting the relative color temperature values of different light sources in ascending order gives a relative color temperature value sequence: CCT1, CCT2, CCT3,..., CCT n-1 , CCT n , where n is the number of light sources, and the corresponding color correction matrix sequence is CCM1, CCM2, CCM3,..., CCM n-1 , CCM n。There is a corresponding relationship between the elements in the two sequences.

[0075] Since the relative color temperature value of the light source changes with the spectral composition of the visible light, sorting the first color correction matrices according to the relative color temperature values of different light sources into a color correction matrix sequence can reflect the color correction matrices of different light sources. At the same time, based on the color correction matrix sequence and the color temperature values of each image block, it is convenient to perform interpolation to obtain the second color correction matrix of each image block.

[0076] In an exemplary embodiment of the present disclosure, an implementation manner for determining the second color correction matrix of an image block is provided. Dividing the image into multiple image blocks and respectively determining the second color correction matrix of each image block based on the color correction matrix sequence may include steps S610 to S630:

[0077] Step 610: Divide the image into multiple image blocks.

[0078] Among them, the image can be divided according to the target number to obtain multiple image blocks. The target number is determined at least according to the actual light source characteristic data and the target image resolution. The actual light source characteristic data at least includes the light source direction, the distance between the light source and the image, the number of light sources, and the distribution.

[0079] In actual implementation, in addition to the actual light source characteristic data and the target image resolution, the target number can also be determined in combination with the image prediction effect and the prediction calculation amount, etc.

[0080] Exemplarily, the decision factor for determining the target number of image block division may include the light source direction. For example, if the light source diffuses in all directions at the same time, dividing the image block into a square is better than a matrix. The shape of the image block division can be determined according to the radiation direction of the light source.

[0081] Exemplarily, the decision factor for determining the target number of image block division may include the target image resolution. For example, if the main camera, wide-angle, and telephoto resolutions of the device are all 4096×3072, and the corresponding image aspect ratio is 4:3, and the image can be evenly divided into squares, the image block can be divided into squares, such as 4×3, 8×6, and 12×9, etc.

[0082] Exemplarily, the decision factor for determining the target number of image block division may include the distance between the light source and the image, the number of light sources, and the distribution. For example, in the field of view of the shooting scene in actual application, when the distance between the light source and the object being photographed is far, the multiple light sources have been completely mixed when reaching the device, and there is no situation where the light sources are distributed in the same image block. Therefore, only the situation where the distance between the light source and the photographed object is relatively close needs to be considered. When the number of light sources does not exceed 10, the situation where there are more than 2 light sources distributed in the same image block is less. Therefore, the target number of the image block can be greater than 10. The embodiments of the present disclosure can adjust the target number of the image block according to actual needs.

[0083] Exemplarily, the decision factors for determining the target number of image block divisions may include algorithm performance and algorithm effect. Since a corresponding second color correction matrix needs to be determined for each image block, the more the target number of image blocks, the greater the computational load. Therefore, the value of the target number can be appropriately reduced. However, the second color correction matrix is related to the image content. The larger the image block, the richer the image content. To increase the richness of the image block content and ensure the global effect of the second color correction matrix, the value of the target number should be appropriately increased. For example, the image blocks are 4×3, 8×6, etc.

[0084] It should be noted that the use of the above decision factors in the embodiments of the present disclosure is not absolute. Instead, according to the actual correction requirements, one or more of the above decision factors are combined to determine the target number with the goal of ensuring stable computational performance and improving the accuracy of the second color correction matrix.

[0085] Step S620: Obtain the color temperature values of each image block.

[0086] To obtain the color temperature value of an image block, if each image block has a corresponding color temperature sensing module, the color temperature values of each image block can be directly collected through the color temperature sensing module. The collection result is closer to the true color temperature of the image block and has high accuracy.

[0087] If there is no corresponding color temperature sensing module for each image block, the color temperature value of the image block can be determined using the RGB data of the image block.

[0088] Exemplarily, the average values of R, G, and B of the image block can be calculated respectively, and sampling can be performed using the corresponding relationship between the average value and the preset color value and color temperature value to obtain the color temperature values of each image block. It should be noted that in the embodiments of the present disclosure, other methods can also be used to determine the color temperature value of the image block using the RGB data of the image block, and no specific limitation is made here.

[0089] Step S630: For each image block, perform interpolation processing in the color correction matrix sequence using the color temperature value to obtain the second color correction matrix of each image block.

[0090] For any image block, linear interpolation can be performed in the color correction matrix sequence using the color temperature value to obtain the second color correction matrix of each image block.

[0091] Exemplarily, continue to refer to the relative color temperature values of different light sources sorted in ascending order as shown in step 430 to obtain the relative color temperature value sequence: CCT1, CCT2, CCT3,..., CCT n-1 , CCT n , where n is the number of light sources, and the corresponding color correction matrix sequence is CCM1, CCM2, CCM3,..., CCMn-1 , CCM n . If the color temperature value of the image block A is CCT x , using the color temperature value CCT x to interpolate in the color correction matrix sequence, and determining that the image block A is located between the first color correction matrices CCM2 and CCM3, then the corresponding first color correction matrices CCM2 and CCM3 are weighted and added together, and the second color correction matrix of the image block A is obtained by interpolation. Among them, the weight can be determined according to the CCT of the image block A x and the distance between the first color correction matrices CCM2 and CCM3. The present disclosure does not make special limitations on this.

[0092] Based on the color temperature values of each image block, taking into account the visual field parts corresponding to different light sources, the second color correction matrix matching the corresponding light source is obtained, so that the visual field parts corresponding to different light sources can be corrected respectively. There is no need to adopt a unique correction method between the image blocks of the multi-light source captured images, avoiding the distortion of some regions caused by the correction compromise between the image blocks of the multi-light source captured images, and improving the accuracy of the image color correction of the multi-light source.

[0093] In an exemplary embodiment, in order to make the colors between different image blocks be smoothly transitioned, the color correction matrix between the image blocks can also be obtained, that is, the third color correction matrix of the pixel points in the image block. In the case of avoiding overlapping regions between the image blocks, the smooth transition between the image blocks is realized naturally. According to the second color correction matrix of each image block and the image block position, interpolating to obtain the third color correction matrix of the pixel points in each image block may include:

[0094] Based on the image block position, using the second color correction matrices of the adjacent image blocks of the image block corresponding to each pixel point, interpolating to obtain the third color correction matrix of the pixel points in each image block.

[0095] Among them, since the number of adjacent image blocks of the pixel points is different, in order to make the smooth transition between the image blocks, first determine the actual number of adjacent image blocks of the pixel points, and then perform interpolation processing based on the second color correction matrices of the adjacent image blocks of the pixel points to obtain the third color correction matrix of the above pixel points.

[0096] Such as Figure 7 schematically shows a schematic diagram of obtaining the third color correction matrix of the pixel points in each image block by interpolating using the second color correction matrices of the adjacent image blocks of the image block corresponding to each pixel point in an exemplary embodiment of the present disclosure, Figure 7 and Figure 3Correspondence. The third color correction matrix of the pixel points in the area indicated by the identifier 1 can be determined by the second color correction matrix of the image block corresponding to the pixel point. That is, the third color correction matrix of the pixel points in the area at the top corner of the image is directly the second color correction matrix of the corresponding image block (i.e., the third color correction matrix of the area indicated by the identifier 1 is the second color correction matrix corresponding to point A). The third color correction matrix of the pixel points in the area indicated by the identifier 2 is interpolated based on the second color correction matrices of the image block corresponding to the pixel point and an image block adjacent horizontally to the corresponding image block (point A and point B). The third color correction matrix of the pixel points in the area indicated by the identifier 3 is obtained by interpolating based on the second color correction matrices of the corresponding image block and three image blocks adjacent to the image block corresponding to the pixel point (point A, point B, point C, and point D).

[0097] The target interpolation methods corresponding to different identifier - indicated areas can be different, for example, selected from one of nearest - neighbor interpolation, linear interpolation, bilinear interpolation, etc.

[0098] Interpolate to obtain the third color correction matrix of the pixel points in each image block according to the second color correction matrix of the image block and the position of the image block. There is no need for overlapping parts between image blocks to complete the transition. Interpolating to obtain the third color correction matrix of each image block makes the color parameter correction of the pixel points between image blocks transition in a smoother manner, avoids the generation of color - abrupt areas between image blocks, and ensures the global integrity of the color correction of the multi - light - source captured image.

[0099] In an exemplary embodiment, based on the position of the image block, using the second color correction matrices of the adjacent image blocks of the image block corresponding to each pixel point, interpolating to obtain the third color correction matrix of the pixel points in each image block may include steps S810 to S830:

[0100] Step S810: According to the position of the image block, divide the image into multiple image areas, where the pixel points in different image areas correspond to different numbers of adjacent image blocks.

[0101] Determine the adjacent relationship between image blocks according to the position of the image block, so as to divide the image into multiple image areas according to the adjacent relationship, such that the pixel points in different image areas correspond to different numbers of adjacent image blocks.

[0102] Continue to refer to Figure 3 As shown, the image is divided into three areas: the top - corner area 1 of the image, the edge area 2 of the image, and the internal area 3 of the image. The pixel points in each area corresponding to the image block have different numbers of adjacent image blocks.

[0103] Step S820: For the pixel points in each image area, determine the adjacent image blocks of the image block corresponding to the pixel point.

[0104] In this step, the adjacent image blocks corresponding to the pixel points in each image region are determined, which can be specifically referred to in step S230 and will not be elaborated here.

[0105] Step S830: Using the second color correction matrix of the image block corresponding to the pixel point and the second color correction matrix of the corresponding adjacent image block, interpolate to obtain the third color correction matrix of the pixel point according to the target interpolation processing method of the image region to which the pixel point belongs.

[0106] After determining the image region to which each pixel point belongs and the adjacent image blocks corresponding to the image block of each pixel point, use the second color correction matrix of the image block corresponding to the pixel point and the second color correction matrix of the corresponding adjacent image block, and interpolate to obtain the third color correction matrix of each pixel point according to the target interpolation processing method of the image region to which the pixel point belongs.

[0107] For example, continue to refer to Figure 3 , for the pixel points in the top corner region 1 of the image, the nearest neighbor interpolation method is used to interpolate and obtain the third color correction matrix of each pixel point. For the edge region 2 of the image, the linear interpolation method is used to interpolate and obtain the third color correction matrix of each pixel point, and for the internal region 3 of the image, the bilinear interpolation method is used to interpolate and obtain the third color correction matrix of each pixel point.

[0108] By adopting the respective corresponding target interpolation processing methods for each image region to interpolate the second color correction matrix of the adjacent image blocks of the image block corresponding to the pixel point, the third color correction matrix of the pixel point is obtained, avoiding the sudden change of the third color correction matrix of the pixel points between image blocks, but achieving a smooth transition, thereby avoiding the generation of color abrupt regions in the color parameter correction of the pixel points of the entire image and improving the global color accuracy of image processing.

[0109] In an exemplary embodiment of the present disclosure, the entire image can also be used as an image block for interpolation processing. After obtaining the color correction matrix sequence, the whole image can also be used as an image block, so that interpolating to obtain the third color correction matrix of the pixel points in each image block can further include:

[0110] Based on the RGB data of each pixel point in the image block, obtain the pixel color temperature value of each pixel point, and then use the pixel color temperature value to perform interpolation processing in the color correction matrix sequence to obtain the third color correction matrix of each pixel point.

[0111] Among them, based on the preset target conversion matrix of RGB data and tristimulus values, the RGB data can be converted into target tristimulus values, and then according to the target tristimulus values, the color coordinates of the corresponding pixel points can be determined to use the color coordinates to determine the pixel color temperature value of the corresponding pixel point.

[0112] For example, after obtaining a relative color temperature value sequence: CCT1, CCT2, CCT3, ……, CCT n-1 , CCT n , where n is the number of light sources, and the corresponding color correction matrix sequence is CCM1, CCM2, CCM3, ……, CCM n-1 , CCM n , without segmenting the image, directly calculate the pixel color temperature value using the RGB data of each pixel, and then perform one-dimensional linear interpolation on the color correction matrix sequence using the pixel color temperature value to obtain the third color correction matrix of the pixel.

[0113] Based on this, without image block division, interpolation processing is performed on the color correction matrix sequence through the pixel color temperature values of the pixel points in each region of the image, so that the third color correction matrix of the pixel points in each region also has a smooth transition.

[0114] In an exemplary embodiment of the present disclosure, the image can also be segmented into multiple image blocks, and then the color temperature values of each image block are obtained respectively, and then based on a preset three-dimensional lookup table 3D-LUT, the third color correction matrix of any pixel point is looked up. Where the size of the 3D-LUT is M×N×D, M and N are the block data in the horizontal and vertical directions, and D is the relative color temperature value of the light source.

[0115] Since each third color correction matrix is a 3×3 matrix, and each element position corresponds to a 3D-LUT, without interpolation processing, the third color correction matrix of any pixel point can be obtained by looking up the table 9 times respectively, thus avoiding interpolation operations in the GPU (Graphics Processing Unit) hardware and improving the operation speed.

[0116] Figure 9 Schematically shows a schematic diagram of an image processing method in an application scenario of an exemplary embodiment of the present disclosure. Below, taking the image segmentation into image blocks as an example, in combination with Figure 9 the image processing method of the embodiment of the present disclosure will be described in detail.

[0117] First, construct a color correction matrix sequence CCM1, CCM2, CCM3, ……, CCM n-1 , CCM n according to the first color correction matrices of seven standard light sources D75, D65, D50, TL84, CWF, A, and H.

[0118] Secondly, the image is divided into nine image patches without overlapping regions between the patches. According to the positions of the image patches, the image is determined to be divided into multiple image regions, including image region 91 (image top corner region), image region 92 (image edge region), and image region 93 (image internal region).

[0119] Next, the adjacent image patches corresponding to the pixel points in each image region are determined. Part of the region is enlarged, and the following steps are described based on the enlarged part of the region.

[0120] Further, for image region 91, using the second color correction matrix of the image patch corresponding to the pixel point and the second color correction matrix of the corresponding adjacent image patch, the third color correction matrix of the pixel point is interpolated by the nearest neighbor interpolation method. For image region 92, using the second color correction matrix of the image patch corresponding to the pixel point and the second color correction matrix of the corresponding adjacent image patch, the third color correction matrix of the pixel point is interpolated by the linear interpolation method; for image region 93, using the second color correction matrix of the image patch corresponding to the pixel point and the second color correction matrix of the corresponding adjacent image patch, the third color correction matrix CCM of the pixel point is interpolated by the bilinear interpolation method.

[0121] Finally, the third color correction matrix of each pixel point is multiplied by the corresponding RGB data to obtain the corrected RGB data, that is, the image after color correction.

[0122] As Figure 10 and Figure 11 respectively show the image after applying the image processing method of the present disclosure embodiment and the image after applying the global color correction method in the related art. By comparison, it can be seen that in the image processing method of the present disclosure embodiment, for the image patches in the visual field parts corresponding to different light sources, the second color correction matrix matching the corresponding light source is obtained, so that the visual field parts corresponding to different light sources can be corrected respectively. There is no need to adopt a unique correction method between the image patches of the multi-light-source captured image, avoiding partial region distortion caused by correction compromise between the image patches of the multi-light-source captured image. That is, the correction of the visual field parts of multiple light sources is taken into account in the same image, improving the accuracy of image color correction for multiple light sources; according to the second color correction matrix of the image patch and the position of the image patch, the third color correction matrix of the pixel points in each image patch is interpolated. There is no need for overlapping parts between the image patches to complete the transition. The third color correction matrix of each image patch is interpolated, making the correction of the color parameters of the pixel points between the image patches transition in a smoother manner, avoiding the generation of color abrupt regions between the image patches, and ensuring the global integrity of the color correction of the multi-light-source captured image.

[0123] It should be noted that the above-mentioned accompanying drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, rather than for limiting purposes. It is easy to understand that the processes shown in the above-mentioned accompanying drawings do not indicate or limit the chronological order of these processes. Additionally, it is also easy to understand that these processes can be executed synchronously or asynchronously in, for example, multiple modules.

[0124] Further, referring to Figure 12 as shown, in an exemplary embodiment of the present disclosure, an image processing apparatus 1200 is provided, including an acquisition module 1210, a matrix processing module 1220, an interpolation processing module 1230, and a correction module 1240. Among them:

[0125] The acquisition module 1210 is configured to acquire a color correction matrix sequence, where the color correction matrix sequence is constructed based on the first color correction matrices of different light sources;

[0126] The matrix processing module 1220 is configured to divide an image into multiple image blocks, and respectively determine the second color correction matrices of the respective image blocks based on the color correction matrix sequence;

[0127] The interpolation processing module 1230 is configured to interpolate and acquire the third color correction matrices of the pixel points in the respective image blocks according to the second color correction matrices of the respective image blocks and the image block positions;

[0128] The correction module 1240 is configured to correct the color parameters of the image by using the respective third color correction matrices.

[0129] In an exemplary embodiment, the acquisition module 1210 may include:

[0130] A first acquisition unit configured to acquire the first color correction matrix corresponding to each of the light sources;

[0131] A second acquisition unit configured to acquire the relative color temperature values of the respective light sources;

[0132] A sorting unit configured to sort the respective first color correction matrices according to the magnitudes of the relative color temperature values of the corresponding light sources to obtain the color correction matrix sequence.

[0133] In an exemplary embodiment, the first acquisition unit is configured as:

[0134] For each type of light source, perform polynomial fitting processing on the target color value and the measured color value under the light source to obtain the first color correction matrix;

[0135] Wherein, the target color value and the measured color value are obtained based on a standard color card image.

[0136] In an exemplary embodiment, the matrix processing module 1220 may include:

[0137] An image segmentation unit, configured to segment the image into the plurality of image blocks;

[0138] A third acquisition unit, configured to acquire the color temperature value of each of the image blocks;

[0139] A first interpolation processing unit, configured to perform interpolation processing on each of the image blocks in the color correction matrix sequence by using the color temperature value, so as to acquire the second color correction matrix of each of the image blocks.

[0140] In an exemplary embodiment, the third acquisition unit is configured to:

[0141] Acquire the color temperature value of each of the image blocks through a color temperature sensing module corresponding to each of the image blocks.

[0142] In an exemplary embodiment, the interpolation processing module 1230 is configured to:

[0143] Based on the image block positions, interpolate to acquire the third color correction matrix of the pixel points in each of the image blocks by using the second color correction matrices of the adjacent image blocks of the image blocks corresponding to the pixel points.

[0144] In an exemplary embodiment, the interpolation processing module 1230 may include:

[0145] A region division unit, configured to divide the image into a plurality of image regions according to the image block positions, wherein the pixel points in different image regions correspond to different numbers of adjacent image blocks;

[0146] An image block determination unit, configured to determine the adjacent image blocks of the image blocks corresponding to the pixel points for the pixel points in each of the image regions;

[0147] A second interpolation processing unit, configured to interpolate to acquire the third color correction matrix of the pixel points by using the second color correction matrix of the image block corresponding to the pixel points and the second color correction matrices of the corresponding adjacent image blocks, according to the target interpolation processing manner of the image region to which the pixel points belong.

[0148] In an exemplary embodiment, the matrix processing module 1220 is configured to:

[0149] Segment the image into the plurality of image blocks according to a target number, where the target number is determined at least according to actual light source characteristic data and a target image resolution, and the actual light source characteristic data includes at least a light source direction, a distance between the light source and the image, a light source number, and a distribution.

[0150] In an exemplary embodiment, the matrix processing module 1220 is further configured to: take the whole of the image as an image block, and the interpolation processing module 1230 may further include:

[0151] A pixel color temperature acquisition unit, configured to acquire a pixel color temperature value of each pixel point based on the RGB data of each pixel point in the image block;

[0152] A third interpolation processing unit, configured to perform interpolation processing in the color correction matrix sequence by using the pixel color temperature value to obtain the third color correction matrix of each pixel point.

[0153] In an exemplary embodiment, the pixel color temperature acquisition unit is configured to:

[0154] Convert the RGB data into target tristimulus values based on a preset target conversion matrix between RGB data and tristimulus values;

[0155] Determine the color coordinates of the corresponding pixel point according to the target tristimulus values, so as to determine the pixel color temperature value of the corresponding pixel point by using the color coordinates.

[0156] The specific details of each module in the above device have been described in detail in the implementation manner of the method part. The undisclosed detailed content can refer to the implementation manner content of the method part, and thus will not be elaborated here.

[0157] Those skilled in the art to which the present disclosure pertains can understand that various aspects of the present disclosure can be implemented as a system, a method, or a program product. Therefore, various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation manner, a complete software implementation manner (including firmware, microcode, etc.), or an implementation manner combining hardware and software aspects, which can be collectively referred to as "circuitry", "module", or "system" here.

[0158] An exemplary embodiment of the present disclosure further provides an electronic device for implementing an image processing method, which may be Figure 1 the device 101 in, or a server. Generally, the electronic device at least includes a processor and a memory. The memory is used to store executable instructions of the processor, and the processor is configured to execute the image processing method by executing the executable instructions.

[0159] Next, taking Figure 13 the mobile terminal 1300 in as an example, the structure of the electronic device in the embodiment of the present disclosure will be described exemplarily. Those skilled in the art should understand that, except for the components specifically for mobile purposes, Figure 13The structure in [the above] can also be applied to fixed-type devices. In some other embodiments, the mobile terminal 1300 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware. The interface connection relationships between the components are only schematically shown and do not constitute a structural limitation on the mobile terminal 1300. In some other embodiments, the mobile terminal 1300 may also adopt an interface connection method different from Figure 13 or a combination of multiple interface connection methods.

[0160] As Figure 13 shown, the mobile terminal 1300 may specifically include: a processor 1301, a memory 1302, a bus 1303, a mobile communication module 1304, an antenna 1, a wireless communication module 1305, an antenna 2, a display screen 1306, a camera module 1307, an audio module 1308, a power module 1309, and a sensor module 1310.

[0161] The processor 1301 may include one or more processing units. For example, the processor 1301 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit), etc. The image processing method in this exemplary embodiment may be executed by the AP, the ISP, or the DSP. When the method involves color correction processing, it may be executed by the ISP. For example, the ISP may correct the color parameters of the image based on a color correction matrix sequence. Exemplarily, a color correction matrix sequence may be obtained, and the color correction matrix sequence is constructed based on the first color correction matrix of different light sources; the image is divided into multiple image blocks, and the second color correction matrix of each image block is determined based on the color correction matrix sequence; according to the second color correction matrix of each image block and the position of the image block, the third color correction matrix of the pixel points in each image block is obtained by interpolation; and the color parameters of the image are corrected using the third color correction matrix of each image block.

[0162] An encoder can encode (i.e., compress) an image or video to reduce the data size for easier storage or transmission. A decoder can decode (i.e., decompress) the encoded data of an image or video to restore the image or video data. The mobile terminal 1300 can support one or more encoders and decoders, such as image formats like JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), BMP (Bitmap), and video formats like MPEG (Moving Picture Experts Group) 1, MPEG10, H.1063, H.1064, HEVC (High Efficiency Video Coding).

[0163] The processor 1301 can form connections with the memory 1302 or other components via the bus 1303.

[0164] The memory 1302 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 1301 executes various functional applications and data processing of the mobile terminal 1300 by running the instructions stored in the memory 1302. The memory 1302 can also store application data, such as storing files like images and videos.

[0165] The communication function of the mobile terminal 1300 can be implemented through the mobile communication module 1304, antenna 1, wireless communication module 1305, antenna 2, modulation and demodulation processor, and baseband processor, etc. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 1304 can provide 3G, 4G, 5G, etc. mobile communication solutions for the mobile terminal 1300. The wireless communication module 1305 can provide wireless communication solutions such as wireless local area network, Bluetooth, and near-field communication for the mobile terminal 1300.

[0166] The display screen 1306 is used to implement the display function, such as displaying the user interface, images, videos, etc. The camera module 1307 is used to implement the shooting function, such as shooting images, videos, etc. The audio module 1308 is used to implement the audio function, such as playing audio, collecting voice, etc. The power module 1309 is used to implement the power management function, such as charging the battery, powering the device, monitoring the battery status, etc. The sensor module 1310 can include one or more sensors for implementing corresponding sensing and detection functions. For example, the sensor module 1310 can include an inertial sensor, which is used to detect the motion pose of the mobile terminal 1300 and output inertial sensing data.

[0167] In addition, the exemplary embodiments of the present disclosure also provide a computer-readable storage medium, on which a program product capable of implementing the above methods of this specification is stored. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.

[0168] It should be noted that the computer-readable medium shown in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0169] In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0170] In addition, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, execute as a stand-alone software package, execute partially on the user's computing device and partially on a remote computing device, or execute entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., by using an Internet service provider to connect through the Internet).

[0171] Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are pointed out by the claims.

Claims

1. An image processing method, characterized in that, Including: Obtain a sequence of color correction matrices, where the sequence of color correction matrices is constructed based on the first color correction matrices of different light sources; Segment the image into multiple image blocks, and respectively determine the second color correction matrix of each image block based on the sequence of color correction matrices; Interpolate to obtain the third color correction matrix of each pixel in each image block according to the second color correction matrix of each image block and the image block position; Use each of the third color correction matrices to correct the color parameters of the image; Among them, the obtaining of the sequence of color correction matrices includes: Obtain the first color correction matrix corresponding to each light source; Obtain the relative color temperature value of each light source; Sort the first color correction matrices according to the relative color temperature values of the corresponding light sources to obtain the sequence of color correction matrices; The determining of the second color correction matrix of each image block based on the sequence of color correction matrices includes: For each image block, perform interpolation processing on the color temperature value of the image block in the sequence of color correction matrices to obtain the second color correction matrix of each image block.

2. The method according to claim 1, characterized in that, The obtaining of the first color correction matrix corresponding to each light source includes: For each type of light source, perform polynomial fitting on the target color value and the measured color value under the light source to obtain the first color correction matrix; Among them, the target color value and the measured color value are obtained based on a standard color card image.

3. The method according to claim 1, wherein The obtaining of the color temperature value of each image block includes: Obtain the color temperature value of each image block through a color temperature sensing module corresponding to each image block.

4. The method according to claim 1, characterized in that, The interpolating to obtain the third color correction matrix of each pixel in each image block according to the second color correction matrix of each image block and the image block position includes: Based on the image block position, use the second color correction matrices of the adjacent image blocks of the image block corresponding to each pixel to interpolate to obtain the third color correction matrix of each pixel in each image block.

5. The method according to claim 4, wherein The interpolating to obtain the third color correction matrix of each pixel in each image block based on the image block position and using the second color correction matrices of the adjacent image blocks of the image block corresponding to each pixel includes: According to the image block position, divide the image into multiple image regions, where the pixels in different image regions correspond to different numbers of adjacent image blocks; For the pixels in each image region, determine the adjacent image blocks of the image block corresponding to the pixel; Use the second color correction matrix of the image block corresponding to the pixel and the second color correction matrices of the corresponding adjacent image blocks, and interpolate to obtain the third color correction matrix of the pixel according to the target interpolation processing method of the image region to which the pixel belongs.

6. The method according to any one of claims 1 to 5, characterized in that The segmenting of the image into multiple image blocks includes: Segment the image according to a target number to obtain the multiple image blocks, where the target number is determined at least according to actual light source characteristic data and a target image resolution, and the actual light source characteristic data at least includes the light source direction, the distance between the light source and the image, the number of light sources, and the distribution.

7. The method according to claim 1, wherein After obtaining the color correction matrix sequence, the method further includes: Regarding the whole of the image as an image block, the step of interpolating to obtain the third color correction matrix of each pixel point in each image block may further include: Based on the RGB data of each pixel point in the image block, obtaining the pixel color temperature value of each pixel point; Performing interpolation processing on the color correction matrix sequence by using the pixel color temperature value to obtain the third color correction matrix of each pixel point.

8. The method according to claim 7, characterized in that, The step of obtaining the pixel color temperature value of each pixel point based on the RGB data of each pixel point in the image block includes: Based on a preset target conversion matrix of RGB data and tristimulus values, converting the RGB data into target tristimulus values; According to the target tristimulus values, determining the color coordinates of the corresponding pixel points, so as to determine the pixel color temperature value of the corresponding pixel points by using the color coordinates.

9. An image processing apparatus, characterized in that, Includes: An acquisition module, configured to acquire a color correction matrix sequence, where the color correction matrix sequence is constructed according to the first color correction matrices of different light sources; A matrix processing module, configured to divide an image into multiple image blocks, and respectively determine the second color correction matrices of each image block based on the color correction matrix sequence; An interpolation processing module, configured to interpolate and obtain the third color correction matrix of each pixel point in each image block according to the second color correction matrix of each image block and the image block position; A correction module, configured to correct the color parameters of the image by using each third color correction matrix; The acquisition module is configured to execute: Obtaining the first color correction matrix corresponding to each light source; Obtaining the relative color temperature value of each light source; Sorting each first color correction matrix according to the relative color temperature value of the corresponding light source to obtain the color correction matrix sequence; The matrix processing module is configured to execute: For each image block, performing interpolation processing on the color correction matrix sequence by using the color temperature value of the image block to obtain the second color correction matrix of each image block.

10. An electronic device, characterized in that, Includes: A processor; And A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the method according to any one of claims 1 to 8 by executing the executable instructions.

11. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Pixel-based color restoration device and method

    CN108377373A