Image processing method and device and electronic equipment

By converting the image to a larger first gamut space and mapping the color gamut to the target gamut space, the problems of image color overflow and detail loss are solved, and the effective preservation of image color is achieved.

CN120375733APending Publication Date: 2025-07-25BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410710986.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

Due to the different color gamut spaces of different display devices, images are prone to hypergamut after color correction matrix processing, resulting in color overflow and loss of details.

Method used

The image to be processed is converted to a larger first gamut space and converted from the first gamut space to the target gamut space through gamut mapping, ensuring that the target gamut space is contained in the first gamut space and avoiding hyper gamut problems.

Benefits of technology

The target image obtained after color gamut mapping avoids color overflow and details loss, and maintains the color appearance of the image color.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120375733A_ABST
    Figure CN120375733A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing method and device and electronic equipment, and relates to the technical field of image processing. The method comprises the following steps: acquiring original color information of each pixel point in a to-be-processed image; converting the original color information of each pixel point into first color information of a first color gamut space based on the color correction matrix; wherein the color correction matrix is calibrated based on the first color gamut space; mapping the first color information of each pixel point to a target color gamut space to obtain a target image corresponding to the to-be-processed image; wherein the target color gamut space is contained in the first color gamut space. According to the scheme, the target color gamut space is contained in the first color gamut space, so that the target image obtained after color gamut mapping does not have a hypercolor gamut problem, the color appearance of the image color can be better maintained, and image color overflow and detail loss are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, and electronic device. Background Art

[0002] Since different display devices have different corresponding color gamut spaces, it is necessary to perform color gamut conversion on images for display on the corresponding display devices. Generally, an image is converted to a standard color gamut space (such as sRGB, P3, Rec.2020, etc.) through a corresponding color correction matrix. However, after the image is processed by the color correction matrix, out-of-gamut situations may occur, causing problems such as image color overflow and detail loss. Summary of the Invention

[0003] To overcome the problems in the related art, the present disclosure provides an image processing method, apparatus, and electronic device.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, including:

[0005] Obtaining the original color information of each pixel point in the image to be processed;

[0006] Based on a color correction matrix, converting the original color information of each pixel point into first color information in a first color gamut space; wherein, the color correction matrix is calibrated based on the first color gamut space;

[0007] Mapping the first color information of each pixel point to a target color gamut space to obtain a target image corresponding to the image to be processed; wherein, the target color gamut space is included in the first color gamut space.

[0008] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, including:

[0009] An obtaining module, configured to obtain the original color information of each pixel point in the image to be processed;

[0010] A conversion module, configured to convert the original color information of each pixel point into first color information in a first color gamut space based on a color correction matrix; wherein, the color correction matrix is calibrated based on the first color gamut space;

[0011] A mapping module, configured to map the first color information of each pixel point to a target color gamut space to obtain a target image corresponding to the image to be processed; wherein, the target color gamut space is included in the first color gamut space.

[0012] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method described in the first aspect above is implemented.

[0013] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described in the first aspect above is implemented.

[0014] According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program. When the computer program is executed by a processor, the method described in the first aspect above is implemented.

[0015] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: By obtaining the original color information of each pixel point in the image to be processed, based on the color correction matrix, converting the original color information of each pixel point into the first color information in the first color gamut space, and mapping the first color information of each pixel point to the target color gamut space to obtain the target image corresponding to the image to be processed. Since the target color gamut space is included in the first color gamut space, the target image obtained through color gamut mapping will not have the problem of out-of-gamut, so that the color appearance of the image can be better maintained, and color overflow and detail loss of the image can be avoided.

[0016] 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

[0017] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.

[0018] Figure 1 It is a flowchart of an image processing method provided by an embodiment of the present disclosure;

[0019] Figure 2 It is a flowchart of another image processing method provided by an embodiment of the present disclosure;

[0020] Figure 3 It is a flowchart of yet another image processing method provided by an embodiment of the present disclosure;

[0021] Figure 4 It is a flowchart of yet another image processing method provided by an embodiment of the present disclosure;

[0022] Figure 5 It is a flowchart of yet another image processing method provided by an embodiment of the present disclosure;

[0023] Figure 6 This is an example diagram of a curve related to determining mapping information between uniform grid points and non-uniform grid points in the embodiments of the present disclosure;

[0024] Figure 7 This is a structural block diagram of an image processing device provided by the embodiments of the present disclosure;

[0025] Figure 8 This is a structural block diagram of an electronic device provided by the embodiments of the present disclosure. Detailed implementation manners

[0026] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present invention. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0027] It should be noted that since the color gamut spaces corresponding to different display devices are different, it is necessary to perform color gamut conversion on the image for display on the corresponding display device. Generally, the image is converted to a standard color gamut space (such as sRGB, P3, Rec.2020, etc.) through a corresponding color correction matrix. However, after the image is processed by the color correction matrix, the situation of out-of-gamut may occur, resulting in problems such as image color overflow and detail loss.

[0028] To solve the above problems, the present disclosure provides an image processing method, device, and electronic device. By converting the image to be processed to a larger color gamut space and then performing color gamut mapping from the large color gamut space to the final output color gamut space, the problem of out-of-gamut can be avoided.

[0029] Figure 1 This is a flowchart of an image processing method provided by the embodiments of the present disclosure. It should be noted that the image processing method of the embodiments of the present disclosure can also be applied to the image processing device in the embodiments of the present disclosure, and the device can be configured in an electronic device. Among them, the electronic device can be a smart phone, a tablet computer, a personal digital assistant, a wearable device, etc. As Figure 1 shown, the method may include the following steps:

[0030] Step 101, obtain the original color information of each pixel point in the image to be processed.

[0031] It should be noted that the present disclosure solution can be applied to Scenario 1, that is, in the process of an electronic device processing an image captured by itself, or to Scenario 2, that is, in the process of an electronic device processing an acquired offline image. That is to say, the image to be processed can be an image captured by a camera module equipped in the electronic device, or an offline image selected / uploaded by a user obtained by the electronic device based on a human-computer interaction interface, or an offline image transmitted to the electronic device through other channels. Among them, the offline image refers to an image that is not captured in real time.

[0032] As an example, for Application Scenario 1, a camera module can be installed in the electronic device, and several application programs can also be installed. The application program can initiate an image acquisition instruction to acquire an image, and the camera module acquires the image to obtain the image to be processed. The electronic device further includes a processor for executing the image processing method of the present disclosure to obtain a target image. Among them, the camera module can include a front camera module and / or a rear camera module. Finally, the target image is sent to the target application program. Among them, the electronic device can be a camera, a smart phone, a tablet computer, a personal digital assistant, a wearable device, etc.

[0033] For example, for Application Scenario 1, a camera can be installed on the electronic device, and an image can be acquired through the installed camera. The camera can be classified into types such as a laser camera and a visible light camera according to the different acquired images. The laser camera can acquire an image formed by laser irradiating an object, and the visible light image can acquire an image formed by visible light irradiating an object. Several cameras can be installed on the electronic device, and the installation positions are not limited. For example, a camera can be installed on the front panel of the electronic device, and two cameras can be installed on the back panel. The camera can also be installed inside the electronic device in an embedded manner and then opened by rotating or sliding. Specifically, a front camera and a rear camera can be installed on the electronic device. The front camera and the rear camera can acquire images from different perspectives. Generally, the front camera can acquire an image from the front perspective of the electronic device, and the rear camera can acquire an image from the back perspective of the electronic device. It should be understood that in the present disclosure, the front camera or the rear camera is only used as an example to distinguish the shooting angles of different cameras, rather than restricting the functions of multiple cameras. Multiple cameras in the present disclosure can all be rear cameras or all be front cameras at the same time, which is not limited in the present disclosure.

[0034] As another example, for Application Scenario 2, the electronic device can be a television, a computer, etc. The electronic device is equipped with a display screen and a processor. Among them, the processor processes the received image to be processed as an offline image, that is, an image that is not captured in real time. The processor executes the image processing method of the present disclosure embodiment to obtain a target image and displays the target image on the display screen.

[0035] In the embodiments of the present disclosure, the original color information of each pixel point in the image to be processed refers to the color information in the corresponding color gamut space. For example, if the image to be processed is an image captured by the camera module of an electronic device, the original color information of each pixel point is the original RGB value of each pixel point captured by the camera module.

[0036] Step 102: Based on the color correction matrix, convert the original color information of each pixel point into the first color information in the first color gamut space; wherein, the color correction matrix is calibrated based on the first color gamut space.

[0037] In some embodiments of the present disclosure, for application scenario 1, the color correction matrix is the color correction matrix from the color of the image captured by the camera module under the corresponding light source to the color in the first color gamut space. That is to say, by obtaining the light source corresponding to the current shooting scene, the color correction matrix corresponding to the light source is determined from the color correction matrices calibrated based on the first color gamut space of a variety of preset light sources. Among them, the first color gamut space can be a large color gamut RGB color gamut space, such as the Rec.2020 color gamut space, so as to cover all colors that may be encountered in the actual environment.

[0038] As an implementation manner, the color correction matrix can be pre-calibrated based on the first color gamut space. For example, the method of shooting a standard color card under various typical light sources can be adopted. The typical light sources generally can be selected from the typical light sources recommended by the CIE, or the actual scene light source spectrum can be collected by the device and simulated in the laboratory.

[0039] In some other embodiments of the present disclosure, for application scenario 2, the color correction matrix is the color gamut conversion matrix from the color gamut space of the image to be processed to the first color gamut space, and the first color gamut space can be a large color gamut space that can cover all colors that may be encountered in the actual environment.

[0040] As an implementation manner, based on the color correction matrix, converting the original color information of each pixel point into the first color information in the first color gamut space includes: multiplying the original color information of each pixel point by the color correction matrix respectively to obtain the first color information of each pixel point in the first color gamut space.

[0041] Step 103: Map the first color information of each pixel point to the target color gamut space to obtain the target image corresponding to the image to be processed; wherein, the target color gamut space is included in the first color gamut space.

[0042] Among them, the target color gamut space can be determined according to actual needs. For example, it can be the color gamut space corresponding to the display screen of the electronic device, or a preset standard color gamut space.

[0043] It should be noted that the implementation process of mapping the first color information of each pixel point to the target color gamut space can be achieved by the color gamut mapping method in related technologies, and the present disclosure does not limit this.

[0044] In some embodiments, based on the three primary color coordinates and the white point coordinates in the first color gamut space, a conversion matrix from the first color gamut space to the target color gamut space can be determined, and based on this conversion matrix, the first color information of each pixel point is mapped to the target color gamut space.

[0045] In other embodiments, interpolation calculation can also be performed based on the three-dimensional lookup table between the first color gamut space and the target color gamut space to determine the target color information of the first color information of each pixel point in the target color gamut space, so as to map the first color information of each pixel point to the target color gamut space.

[0046] That is to say, the solution of the present disclosure converts the image to be processed to a larger first color gamut space, and then converts it from the first color gamut space to the target color gamut space through color gamut mapping. Since the target color gamut space is included in the first color gamut space, there will be no out-of-gamut situation after color gamut conversion, thus avoiding problems such as image color overflow and detail loss.

[0047] According to the image processing method of the embodiments of the present disclosure, by obtaining the original color information of each pixel point in the image to be processed, based on the color correction matrix, the original color information of each pixel point is converted into the first color information of the first color gamut space, and the first color information of each pixel point is mapped to the target color gamut space to obtain the target image corresponding to the image to be processed. Since the target color gamut space is included in the first color gamut space, the target image obtained after color gamut mapping will not have the problem of out-of-gamut, thus better maintaining the color appearance of the image and avoiding image color overflow and detail loss.

[0048] Generally, when performing color gamut mapping by means of three-dimensional lookup table interpolation calculation, there will be a problem of low accuracy. To improve the interpolation accuracy, the present disclosure provides another embodiment.

[0049] Figure 2 It is a flowchart of another image processing method provided by the embodiments of the present disclosure. As Figure 2 shown, based on the above embodiments, Figure 1 The implementation process of step 103 in

[0050] Step 201: Map the first color information of each pixel point to the target color gamut space based on the first three-dimensional lookup table. The first three-dimensional lookup table is determined based on the color gamut mapping error of the second three-dimensional lookup table. Both the first three-dimensional lookup table and the second three-dimensional lookup table contain mapping information between the first color gamut space and the target color gamut space. The lattice points in the first three-dimensional lookup table are non-uniformly distributed, and the lattice points in the second three-dimensional lookup table are uniformly distributed.

[0051] It can be understood that when performing color gamut mapping based on a three-dimensional lookup table, the lattice points of the three-dimensional lookup table are usually uniformly distributed, so the interpolation accuracy is relatively low. To improve the interpolation accuracy, in the embodiments of the present disclosure, the second three-dimensional lookup table is adjusted based on the color gamut mapping error of the existing three-dimensional lookup table (the second three-dimensional lookup table), the lattice point density in the area with a larger color gamut error is increased, and the lattice point density in the area with a smaller color gamut error is decreased, to obtain the first three-dimensional lookup table with non-uniform lattice point distribution.

[0052] As an example, the three dimensions of the second three-dimensional lookup table are respectively the three color channels corresponding to the first color gamut space. Each dimension is evenly divided into multiple lattice points. The lattice points of each dimension correspond to the color information of the corresponding channel in the first color gamut space, and the intersection points of the lattice points in each dimension in space correspond to the color information of the target color gamut space.

[0053] The color gamut mapping error of the second three-dimensional lookup table refers to the error between the color information obtained by mapping the points in the first color gamut space to the target color gamut space based on the second three-dimensional lookup table and the true color information.

[0054] In some embodiments, the implementation process of mapping the first color information of each pixel point to the target color gamut space based on the first three-dimensional lookup table includes: for each pixel point, according to the first color information of the pixel point, find the first color information and the target color information corresponding to the three lattice points closest to it from the first three-dimensional lookup table, and perform interpolation calculation based on the first color information of the pixel point and the first color information and the target color information corresponding to the closest lattice points, to obtain the target color information of the pixel point in the target color gamut space.

[0055] As an implementation manner, the implementation process of determining the first three-dimensional lookup table may include: uniformly sampling the first color gamut space, determining the second color information of each sampling point in the target color gamut space based on the second three-dimensional lookup table, and determining the color gamut mapping error of each sampling point according to the first color information and the second color information of each sampling point. According to the number of grid points divided in each dimension of the second three-dimensional lookup table, based on the color gamut mapping error of each sampling point, re-divide the grid points in each dimension, so that the grid points in the area where the sampling points with larger color gamut mapping errors are located are divided more densely, and the grid points in the area where the sampling points with smaller color gamut errors are located are divided more sparsely, thereby improving the interpolation accuracy of the first three-dimensional lookup table, further improving the color accuracy of the target image after image processing, and maintaining the color appearance of the image color to a greater extent.

[0056] It should be noted that the number of grid points in each dimension of the first three-dimensional lookup table is the same as that of the second three-dimensional lookup table, but the distance between adjacent grid points is different.

[0057] Next, the construction process of the first three-dimensional lookup table will be introduced in detail.

[0058] Figure 3 This is a flowchart of another image processing method provided by the embodiments of the present application. Based on the above embodiments, the method further includes the construction process of the first three-dimensional lookup table, which is specifically as follows:

[0059] Step 301, uniformly sample the first color gamut space to determine the first color information of each sampling point.

[0060] It should be noted that the interval between the sampling points here needs to be less than the interval between adjacent grid points in the second three-dimensional lookup table, that is, the sampling accuracy needs to be greater than the accuracy of the grid points in the second three-dimensional lookup table.

[0061] Step 302, based on the second three-dimensional lookup table, determine the second color information of each sampling point in the target color gamut space.

[0062] That is, according to the first color information of each sampling point, perform interpolation calculation based on the second three-dimensional lookup table to obtain the second color information of each sampling point in the target color gamut space.

[0063] Step 303, according to the first color information and the second color information, determine the color gamut mapping error corresponding to each sampling point.

[0064] As a possible implementation, the true color information of the corresponding sampling point in the target color gamut space can be determined based on the first color information of each sampling point; according to the true color information of each sampling point in the target color gamut space and the second color information, the color gamut mapping error corresponding to each sampling point can be determined. Among them, the true color information of each sampling point in the target color gamut space can be obtained through a color sample library or determined based on a color gamut mapping method in related technologies, which is not limited here. The color gamut mapping error corresponding to each sampling point can be in the form of a color difference term.

[0065] Step 304: Determine a first three-dimensional lookup table according to the first color information and the color gamut mapping error of each sampling point.

[0066] It can be understood that in order to improve the interpolation accuracy, for each dimension, according to the distribution of the color gamut mapping error in each dimension, the lattice point interval in the area with a larger color gamut mapping error can be increased, and the lattice point interval in the area with a smaller color gamut mapping error can be reduced.

[0067] According to the image processing method of the embodiments of the present disclosure, by uniformly sampling the first color gamut space, the first color information of each sampling point is determined, based on the second three-dimensional lookup table, the second color information of each sampling point in the target color gamut space is determined, according to the first color information and the second color information, the color gamut mapping error corresponding to each sampling point is determined, and according to the first color information and the color gamut mapping error of each sampling point, a first three-dimensional lookup table is determined, so that the lattice points in the first three-dimensional lookup table are non-uniformly distributed according to the color gamut mapping error, thereby improving the interpolation accuracy of the first three-dimensional lookup table.

[0068] Figure 4 This is a flowchart of another image processing method provided by the embodiments of the present disclosure. As Figure 4 shown, based on the above embodiments, Figure 3 The implementation process of step 304 in

[0069] Step 401: Determine a first error histogram for each color channel according to the first color information and the color gamut mapping error of each sampling point.

[0070] Among them, the abscissa of the first error histogram of each color channel is the bin divided by the corresponding color channel, and the ordinate is the sum result of the color gamut mapping errors of the sampling points included in the corresponding bin, or the normalized value after summing the color gamut mapping errors of the sampling points included in the corresponding bin.

[0071] As a possible implementation, determine the number of bins of the first error histogram under each color channel, and the value range of the color channel corresponding to each bin; for each color channel, determine the bin to which each sampling point belongs in the first error histogram of the color channel according to the first color information of each sampling point; for each bin in the first error histogram of the color channel, accumulate the gamut mapping errors of all sampling points corresponding to the bin; and normalize the accumulated value of the gamut mapping errors corresponding to each bin to obtain the normalized gamut mapping error corresponding to each bin. Fit multiple points formed with each bin as the abscissa and the normalized gamut mapping error corresponding to each bin as the ordinate to obtain the first error histogram of each color channel.

[0072] As an example, the first error histogram of each color channel obtained can be expressed by formula (1):

[0073]

[0074] where c is the color channel c in the first gamut space; k is the k-th bin corresponding to the color channel c; N is the number of bins of the first error histogram corresponding to the color channel c; is all sampling points belonging to the k-th bin in the first error histogram corresponding to the color channel c; ΔE i is the gamut mapping error of the i-th sampling point in; f c (k) is the summation result of the gamut mapping errors of all sampling points corresponding to the k-th bin in the first error histogram of the color channel c; E c is the summation result of the gamut mapping errors of all bins in the first error histogram of the color channel c; hist c (k) is the ordinate value corresponding to the k-th bin in the first error histogram of the color channel c, that is, the normalized result after summing the gamut mapping errors of the sampling points corresponding to the k-th bin.

[0075] Step 402, according to the first error histogram, determine the mapping information between the uniform grid points and the non-uniform grid points under each color channel.

[0076] Among them, the mapping information between the uniform grid points and the non-uniform grid points can be the mapping relationship between the coordinate points corresponding to each uniform grid point and the coordinates of each non-uniform grid point of the corresponding color channel.

[0077] As a possible implementation, the error accumulation histogram of each color channel can be determined according to the first error histogram, and then the inverse function of the error accumulation histogram can be determined, and the inverse function of the error histogram can be determined as the mapping information between the uniform grid points and the non-uniform grid points under the corresponding color channel.

[0078] Step 403: Determine the first three-dimensional lookup table based on the mapping information between the uniform grid points and the non-uniform grid points under each color channel.

[0079] That is to say, based on the mapping relationship between the uniform grid points and the non-uniform grid points under each color channel, according to the positions of every two adjacent uniform grid points, the position of each grid point in the second three-dimensional lookup table is adjusted to obtain the first three-dimensional lookup table of the non-uniform grid points.

[0080] According to the image processing method of the embodiments of the present disclosure, by determining the first error histogram of each color channel according to the first color information and the gamut mapping error of each sampling point, determining the mapping information between the uniform grid points and the non-uniform grid points under each color channel according to the first error histogram, and determining the first three-dimensional lookup table based on the mapping information between the uniform grid points and the non-uniform grid points under each color channel, the division of the non-uniform grid points in the three-dimensional lookup table can be performed by constructing the error histogram of each color channel, so as to greatly improve the interpolation accuracy of the first three-dimensional lookup table, and further ensure the true and complete color after image processing.

[0081] Figure 5 This is a flowchart of another image processing method provided by the embodiments of the present disclosure. As Figure 5 shown, based on the above embodiments, Figure 4 the implementation process of step 402 in

[0082] Step 501: Determine the error accumulation histogram of each color channel according to the first error histogram.

[0083] The error accumulation histogram of each color channel is equivalent to summing the ordinate values corresponding to each point in the first error histogram and the ordinate values corresponding to all the points before that point, obtaining the error accumulation values corresponding to each bin, so as to obtain the error accumulation histogram of the corresponding color channel.

[0084] As an example, if the first error histogram of each color channel is as shown in formula (1), then the error accumulation histogram of each color channel is as shown in formula (2) below:

[0085]

[0086] where sumhist c(k) is the ordinate value corresponding to the k-th bin in the error accumulation histogram of color channel c.

[0087] In some embodiments of the present disclosure, in order to make the first error histogram as smooth as possible, Gaussian smoothing can be performed on the first error histogram corresponding to each color channel. The implementation process of determining the error accumulation histogram of each color channel according to the first error histogram includes: performing Gaussian smoothing on the first error histogram of each color channel respectively to obtain the second error histogram of the corresponding color channel; determining the error accumulation histogram of each color channel according to the second error histogram.

[0088] As an implementation manner, for the convenience of subsequent calculation, the abscissa of the error accumulation histogram of each color channel can be converted to the range of 0-1, that is, each bin distribution is mapped to the range of 0-1.

[0089] Step 502, determine the inverse function of the error accumulation histogram.

[0090] Step 503, based on the inverse function of the error accumulation histogram, determine the mapping information between the uniform grid points and the non-uniform grid points under the corresponding color channel.

[0091] It can be considered that the error accumulation histogram is a monotonically increasing curve, and the magnitude of its slope represents the magnitude of the gamut mapping error at the corresponding point. The slope of the inverse function of the error accumulation histogram is opposite to that of the error accumulation histogram, that is, in the region with a larger gamut error, the slope is smaller, and in the region with a smaller gamut error, the slope is larger. When performing non-uniform grid division, it is necessary to reduce the interval of grid points in the range with a larger gamut error and increase the interval of grid points in the range with a smaller gamut error. Therefore, the inverse function of the error accumulation histogram can express the change law of the non-uniform grid point positions, so that the mapping information between the uniform grid points and the non-uniform grid points under the corresponding color channel can be determined based on the inverse function of the error accumulation histogram.

[0092] As a possible implementation manner, the inverse function of the error accumulation histogram of each color channel can be determined as the mapping information between the uniform grid points and the non-uniform grid points under the corresponding color channel.

[0093] It can be understood that if the inverse function of the error accumulation histogram is used as the mapping information between the uniform grid points and the non-uniform grid points under the corresponding color channel, it is necessary to ensure that the inverse function of the error accumulation histogram is one-to-one, that is, it is necessary to ensure that the error accumulation histogram is monotonically increasing. However, there may be a situation where the ordinate value of a certain bin or several bins in the first error histogram is 0, resulting in the error accumulation histogram of the corresponding channel not being strictly monotonically increasing.

[0094] To solve this problem, the implementation process of step 501 may include: performing Gaussian smoothing on the first error histograms of each color channel respectively to obtain the third error histograms of the corresponding color channels; performing weighted smoothing on the third error histograms of each color channel respectively to obtain the second error histograms of the corresponding color channels; determining the error accumulation histograms of each color channel according to the second error histograms. That is to say, the second error histograms are obtained by performing weighted smoothing on the third error histograms after Gaussian smoothing, so as to ensure that there are no bins with a vertical coordinate value of 0 in the second error histograms under each color channel, thereby ensuring the monotonicity of the error accumulation histograms, and further ensuring the one-to-one relationship in the inverse function.

[0095] As an example, the second error histograms of each color channel obtained by weighted smoothing are shown in the following formula (3):

[0096]

[0097] where, hist c (k, a) is the vertical coordinate value corresponding to the k-th bin in the second error histogram of color channel c; Gauss{hist c (k)} is the result after Gaussian smoothing of hist c (k); a is the weight coefficient, and the value of a can be set based on the actual situation, and the range of a is 0 - 1; N is the number of bins of color channel c.

[0098] Next, taking the RGB color space gamut as an example, the process of determining the mapping information between the uniform grid points and the non-uniform grid points under each color channel according to the first error histogram will be introduced. Among them, taking the number of bins from the non-uniform grid points to the error histogram as 128 as an example, Figure 6 is an example diagram of the curve related to determining the mapping information between the uniform grid points and the non-uniform grid points, where, Figure 6 a, Figure 6 b, and Figure 6 c are the second error histograms under each color channel, Figure 6 d, Figure 6 e, Figure 6 f are the error accumulation histograms under each color channel, and the abscissas of the error accumulation histograms under each color channel have been converted to the range of 0 - 1; Figure 6 g, Figure 6 h, and Figure 6i is the inverse function of the error accumulation histogram for each color channel. After mapping the value range of each uniform grid point in the second three-dimensional look-up table to the range of 0-1, the inverse function of the error accumulation histogram is equivalent to the mapping relationship diagram between the uniform grid points and the non-uniform grid points. If the corresponding value of a certain uniform grid point in the R color channel of the second three-dimensional look-up table is 0.2, then based on Figure 6 g, the coordinate value of the non-uniform grid point corresponding to this uniform grid point can be determined to be 0.12. Based on Figure 6 g, Figure 6 h, and Figure 6 i, the pose of each uniform grid point in each channel of the second three-dimensional look-up table can determine a corresponding non-uniform grid point position, so that the first three-dimensional look-up table of non-uniform nodes can be obtained.

[0099] According to the image processing method of the present disclosure, by determining the error accumulation histogram of each color channel according to the first error histogram and determining the inverse function of the error accumulation histogram, based on the inverse function of the error accumulation histogram, the mapping information between the uniform grid points and the non-uniform grid points in the corresponding color channel can be determined, so that the position of the uniform grid points in the second three-dimensional look-up table can be changed to the position of the corresponding non-uniform grid points, so that in the area with a large gamut error, the interval between grid points is small, and in the area with a small gamut error, the interval between grid points is large, thereby greatly improving the interpolation accuracy of the first three-dimensional look-up table.

[0100] To implement the above embodiments, the present disclosure also provides an image processing apparatus.

[0101] Figure 7 It is a structural block diagram of an image processing apparatus provided by the present disclosure. As Figure 7 shown, the apparatus includes:

[0102] An acquisition module 710, configured to acquire the original color information of each pixel point in the image to be processed;

[0103] A conversion module 720, configured to convert the original color information of each pixel point into the first color information in the first color gamut space based on a color correction matrix; wherein, the color correction matrix is calibrated based on the first color gamut space;

[0104] A mapping module 730, configured to map the first color information of each pixel point to a target color gamut space to obtain a target image corresponding to the image to be processed; wherein, the target color gamut space is included in the first color gamut space.

[0105] In some embodiments of the present disclosure, the mapping module 730 is specifically configured to:

[0106] Based on a first three-dimensional look-up table, map the first color information of each pixel point to the target color gamut space; wherein, the first three-dimensional look-up table is determined based on the color gamut mapping error of a second three-dimensional look-up table; both the first three-dimensional look-up table and the second three-dimensional look-up table contain mapping information between the first color gamut space and the target color gamut space; the lattice points in the first three-dimensional look-up table are non-uniformly distributed, and the lattice points in the second three-dimensional look-up table are uniformly distributed.

[0107] As an implementation manner, the apparatus further includes a construction module 740; the construction module 740 includes:

[0108] A sampling unit 741, configured to uniformly sample the first color gamut space to determine the first color information of each sampling point;

[0109] A first determination unit 742, configured to determine the second color information of each sampling point in the target color gamut space based on the second three-dimensional look-up table;

[0110] A second determination unit 743, configured to determine the color gamut mapping error corresponding to each sampling point according to the first color information and the second color information;

[0111] A third determination unit 744, configured to determine the first three-dimensional look-up table according to the first color information and the color gamut mapping error of each sampling point.

[0112] As an implementation manner, the third determination unit 744 is specifically configured to:

[0113] Determine the first error histogram of each color channel according to the first color information and the color gamut mapping error of each sampling point;

[0114] Determine the mapping information between the uniform lattice points and the non-uniform lattice points under each color channel according to the first error histogram;

[0115] Determine the first three-dimensional look-up table based on the mapping information between the uniform lattice points and the non-uniform lattice points under each color channel.

[0116] As another implementation manner, the third determination unit 744 is further configured to:

[0117] Determine the error accumulation histogram of each color channel according to the first error histogram;

[0118] Determine the inverse function of the error accumulation histogram;

[0119] Determine the mapping information between the uniform lattice points and the non-uniform lattice points under the corresponding color channel based on the inverse function of the error accumulation histogram.

[0120] As yet another implementation manner, the third determination unit 744 is further configured to:

[0121] Perform Gaussian smoothing on the first error histograms of each color channel respectively to obtain the second error histograms of the corresponding color channels;

[0122] Determine the error cumulative histograms of each color channel according to the second error histograms.

[0123] As another implementation manner, the third determination unit 744 is further configured to:

[0124] Perform Gaussian smoothing on the first error histograms of each color channel respectively to obtain the third error histograms of the corresponding color channels;

[0125] Perform weighted smoothing on the third error histograms of each color channel respectively to obtain the second error histograms of the corresponding color channels.

[0126] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0127] Figure 8 It is a structural block diagram of an electronic device provided by an embodiment of the present disclosure. This electronic device is used to implement the image processing method in the above embodiments. For example, the electronic device 800 may be a mobile phone, a camera, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0128] Refer to Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0129] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0130] The memory 804 is configured to store various types of data to support the operation of the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0131] The power supply component 806 provides power to various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0132] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of the touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0133] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.

[0134] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a start button, and a lock button.

[0135] The sensor assembly 814 includes one or more sensors for providing an assessment of various aspects of the electronic device 800. For example, the sensor assembly 814 can detect the on / off state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800. The sensor assembly 814 can also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0136] The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices in a wired or wireless manner. The electronic device 800 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0137] In an exemplary embodiment, the electronic device 800 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above method.

[0138] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 804 including instructions, is also provided. The above instructions can be executed by the processor 820 of the electronic device 800 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0139] Other embodiments of the present invention 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 invention, which follow the general principles of the invention and include known common general knowledge or conventional technical means in the technical field not disclosed in this disclosure. The specification and examples are only regarded as exemplary, and the true scope and spirit of the invention are pointed out by the following claims.

[0140] It should be understood that the present invention is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.

Claims

1. An image processing method, characterized in that, Including: Obtaining the original color information of each pixel point in the image to be processed; Based on a color correction matrix, converting the original color information of each pixel point into first color information in a first color gamut space; wherein, the color correction matrix is calibrated based on the first color gamut space; Mapping the first color information of each pixel point to a target color gamut space to obtain a target image corresponding to the image to be processed; wherein, the target color gamut space is included in the first color gamut space.

2. The method according to claim 1, characterized in that, The mapping of the first color information of each pixel point to the target color gamut space includes: Based on a first three-dimensional look-up table, mapping the first color information of each pixel point to the target color gamut space; wherein, the first three-dimensional look-up table is determined based on the gamut mapping error of a second three-dimensional look-up table; both the first three-dimensional look-up table and the second three-dimensional look-up table include mapping information between the first color gamut space and the target color gamut space; the lattice points in the first three-dimensional look-up table are non-uniformly distributed, and the lattice points in the second three-dimensional look-up table are uniformly distributed.

3. The method according to claim 2, wherein The first three-dimensional look-up table is obtained in advance through the following steps: Performing uniform sampling on the first color gamut space to determine the first color information of each sampling point; Based on the second three-dimensional look-up table, determining the second color information of each sampling point in the target color gamut space; According to the first color information and the second color information, determining the gamut mapping error corresponding to each sampling point; According to the first color information and the gamut mapping error of each sampling point, determining the first three-dimensional look-up table.

4. The method according to claim 3, characterized in that, The determining of the first three-dimensional look-up table according to the first color information and the gamut mapping error of each sampling point includes: According to the first color information and the gamut mapping error of each sampling point, determining a first error histogram for each color channel; According to the first error histogram, determining the mapping information between the uniform lattice points and the non-uniform lattice points for each color channel; Based on the mapping information between the uniform lattice points and the non-uniform lattice points for each color channel, determining the first three-dimensional look-up table.

5. The method according to claim 4, wherein The determining of the mapping information between the uniform lattice points and the non-uniform lattice points for each color channel according to the first error histogram includes: According to the first error histogram, determining an error cumulative histogram for each color channel; Determining the inverse function of the error cumulative histogram; Based on the inverse function of the error cumulative histogram, determining the mapping information between the uniform lattice points and the non-uniform lattice points for the corresponding color channel.

6. The method according to claim 5, characterized in that, The determining of the error cumulative histogram for each color channel according to the first error histogram includes: Performing Gaussian smoothing on the first error histogram for each color channel respectively to obtain a second error histogram for the corresponding color channel; According to the second error histogram, determining the error cumulative histogram for each color channel.

7. The method according to claim 6, wherein The performing of Gaussian smoothing on the first error histogram for each color channel respectively to obtain a second error histogram for the corresponding color channel includes: Perform Gaussian smoothing on the first error histogram of each of the color channels respectively to obtain the third error histogram of the corresponding color channel; Perform weighted smoothing on the third error histogram of each of the color channels respectively to obtain the second error histogram of the corresponding color channel.

8. An image processing apparatus, characterized in that, It includes: An acquisition module, configured to acquire the original color information of each pixel point in the image to be processed; A conversion module, configured to convert the original color information of each pixel point into the first color information in the first color gamut space based on a color correction matrix; wherein, the color correction matrix is calibrated based on the first color gamut space; A mapping module, configured to map the first color information of each pixel point to a target color gamut space to obtain the target image corresponding to the image to be processed; wherein, the target color gamut space is included in the first color gamut space.

9. The device according to claim 8, characterized in that Specifically, the mapping module is configured to: Based on a first three-dimensional lookup table, map the first color information of each pixel point to the target color gamut space; wherein, the first three-dimensional lookup table is determined based on the gamut mapping error of a second three-dimensional lookup table; both the first three-dimensional lookup table and the second three-dimensional lookup table include the mapping information between the first color gamut space and the target color gamut space; the lattice points in the first three-dimensional lookup table are non-uniformly distributed, and the lattice points in the second three-dimensional lookup table are uniformly distributed.

10. The device according to claim 9, characterized in that, It further includes a construction module; the construction module includes: A sampling unit, configured to uniformly sample the first color gamut space to determine the first color information of each sampling point; A first determination unit, configured to determine the second color information of each sampling point in the target color gamut space based on the second three-dimensional lookup table; A second determination unit, configured to determine the gamut mapping error corresponding to each sampling point according to the first color information and the second color information; A third determination unit, configured to determine the first three-dimensional lookup table according to the first color information and the gamut mapping error of each sampling point.

11. The device according to claim 10, characterized in that, Specifically, the third determination unit is configured to: Determine the first error histogram of each color channel according to the first color information and the gamut mapping error of each sampling point; Determine the mapping information between the uniform lattice points and the non-uniform lattice points under each color channel according to the first error histogram; Determine the first three-dimensional lookup table based on the mapping information between the uniform lattice points and the non-uniform lattice points under each color channel.

12. The device according to claim 11, characterized in that, The third determination unit is further configured to: Determine the error accumulation histogram of each color channel according to the first error histogram; Determine the inverse function of the error accumulation histogram; Determine the mapping information between the uniform lattice points and the non-uniform lattice points under the corresponding color channel based on the inverse function of the error accumulation histogram.

13. The device according to claim 12, characterized in that, The third determination unit is further configured to: Perform Gaussian smoothing on the first error histogram of each color channel respectively to obtain the second error histogram of the corresponding color channel; Determine the error accumulation histogram of each color channel according to the second error histogram.

14. The device according to claim 13, characterized in that, The third determination unit is further configured to: Perform Gaussian smoothing on the first error histogram of each of the color channels respectively to obtain the third error histogram of the corresponding color channel; Perform weighted smoothing on the third error histogram of each of the color channels respectively to obtain the second error histogram of the corresponding color channel.

15. An electronic device, characterized in that, Comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

16. A computer-readable storage 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 7 is implemented.

17. A computer program product, characterized in that, Comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.