Image processing method and device, electronic equipment and medium
By mapping a first color gamut image to a second color gamut and enhancing the colors in electronic devices, the problem of image display changes caused by color gamut mismatch is solved, achieving true-to-life color image display and improving the user experience.
Patent Information
- Application Number
- CN202410866709.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-12-30
AI Technical Summary
The color gamut of existing electronic devices cannot meet the requirements of HDR technology, resulting in changes in image brightness and color when displaying HDR content, which affects the user's visual experience.
By acquiring an image in the first color gamut and mapping it to an image in the second color gamut, and then performing color enhancement processing on the second image, including color gamut mapping and color correction, the display effect is ensured to be consistent with the original image.
It improves the user's visual experience, making the color-enhanced image display similar to or the same as the original image, and provides a true-to-life color image display.
Smart Images

Figure CN121235964A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to an image processing method, apparatus, electronic device and medium. Background Technology
[0002] Currently, electronic devices typically use the P3 or sRGB color gamuts, which cannot meet the color gamut requirements of HDR (High Dynamic Range Imaging) technology. When displaying HDR content, the HDR image is usually first mapped to an SDR (Standard Dynamic Range) image, and then the SDR image is displayed.
[0003] However, because HDR and SDR images correspond to different color gamuts, the mapped image may have changes in brightness and color compared to the original HDR image during the mapping process, resulting in changes in the image display effect and a poor visual experience for the user. Summary of the Invention
[0004] To overcome the problems existing in related technologies, this disclosure provides an image processing method, apparatus, electronic device, and medium.
[0005] According to a first aspect of the present disclosure, an image processing method is provided, comprising:
[0006] Acquire a first image; the first image is an image within a first color gamut;
[0007] The first image is mapped to a second image; the second image is an image in a second color gamut, and the first color gamut is different from the second color gamut.
[0008] Based on the first image, the second image is color-enhanced to obtain a color-enhanced second image.
[0009] In some embodiments, mapping the first image to the second image includes:
[0010] Convert the first image in the first color space to a third image in the second color space;
[0011] The third image is mapped to a fourth image; the fourth image is an image in the second color gamut.
[0012] The fourth image in the second color space is converted to the second image in the first color space.
[0013] In some embodiments, mapping the third image to a fourth image includes:
[0014] A first region corresponding to the first color gamut, a second region corresponding to the second color gamut, and a third region are determined under a preset coordinate system; the horizontal axis of the preset coordinate system is the chromaticity parameter, the vertical axis of the preset coordinate system is the luminance parameter, and the third region is a region determined based on a preset range boundary of the second region; the first region includes the second region, and the second region includes the third region.
[0015] Based on the first region and the third region, multiple target pixels in the third image are determined; the target pixels are pixels in a preset region, and the preset region is the region in the first region other than the third region.
[0016] The color parameters of the target pixel are compressed into the second region to obtain compressed color parameters; the color parameters include the chromaticity parameter and the brightness parameter.
[0017] The fourth image is determined based on the compressed color parameters and the color parameters located in the third region of the third image.
[0018] In some embodiments, the step of color-enhancing the second image based on the first image to obtain a color-enhanced second image includes:
[0019] Based on the hue parameter of each target pixel, the second image is color-enhanced to obtain the color-enhanced second image.
[0020] In some embodiments, the step of color enhancement of the second image based on the hue parameter of each target pixel to obtain the color-enhanced second image includes:
[0021] Based on the configuration information and the hue parameter of each target pixel, the statistical information corresponding to each color range is determined; the configuration information includes multiple color ranges, each color range has a corresponding hue parameter range, and the statistical information is used to characterize the distribution of the target pixels in each color range.
[0022] Based on the statistical information corresponding to each color range, the second image is color-enhanced to obtain the color-enhanced second image.
[0023] In some embodiments, determining the statistical information corresponding to each color range based on configuration information and the hue parameter of each target pixel includes:
[0024] For each color range, a first quantity corresponding to the color range is determined; the first quantity is the number of hue parameters of the plurality of target pixels that are located in the hue parameter range corresponding to the color range.
[0025] The ratio of the first quantity to the second quantity is determined as the statistical information corresponding to the color range; the second quantity is the number of the plurality of target pixels.
[0026] In some embodiments, the step of color enhancement of the second image based on statistical information corresponding to each color range to obtain the color-enhanced second image includes:
[0027] Convert the second image in the first color space to the fifth image in the third color space;
[0028] Based on the statistical information of each color range, the saturation parameter of the target pixel is corrected to obtain the corrected saturation parameter;
[0029] Based on the corrected saturation parameters, the fifth image is updated to obtain the updated fifth image;
[0030] Based on the updated fifth image, the color-enhanced second image is determined.
[0031] In some embodiments, the step of correcting the saturation parameter of the target pixel based on statistical information of each color range to obtain the corrected saturation parameter includes:
[0032] For each color range, based on the statistical information of the color range, the correction parameter corresponding to the color range is determined;
[0033] Based on the correction parameters, the saturation parameters of the target pixels in the color range are corrected to obtain the corrected saturation parameters.
[0034] In some embodiments, the method further includes:
[0035] A first color range is determined, which is the color range corresponding to the largest statistical information among multiple statistical information corresponding to the first image;
[0036] Obtain the sixth image; the sixth image is the currently displayed image, and the sixth image is an image under the first color gamut;
[0037] Determine a second color range, which is the color range corresponding to the largest statistical information among multiple statistical information corresponding to the sixth image;
[0038] Determine the variation parameters between the first color range and the second color range; the variation parameters are used to characterize the number of color ranges that are spaced apart between the first color range and the second color range;
[0039] When the change parameter is less than a preset threshold, the sixth image is mapped to the seventh image based on the target mapping relationship; the seventh image is an image in the second color gamut, and the target mapping relationship is determined based on the first image and the color-enhanced second image. The target mapping relationship is used for color gamut mapping between the first color gamut and the second color gamut.
[0040] In some embodiments, the method further includes:
[0041] The second image, with enhanced color, is displayed.
[0042] According to a second aspect of the present disclosure, an image processing apparatus is provided, comprising:
[0043] The acquisition module is configured to acquire a first image; the first image is an image in a first color gamut.
[0044] The mapping module is configured to map the first image to a second image; the second image is an image in a second color gamut, and the first color gamut is different from the second color gamut.
[0045] The processing module is configured to perform color enhancement on the second image based on the first image to obtain a color-enhanced second image.
[0046] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0047] processor;
[0048] Memory used to store processor-executable instructions;
[0049] The processor is configured to perform the image processing method as described in the first aspect of this disclosure.
[0050] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image processing method as described in the first aspect of the present disclosure.
[0051] The method described in this disclosure has the following beneficial effects: This disclosure acquires a first image in a first color gamut, maps the first image to a second image in a second color gamut, and then enhances the color of the second image based on the first image to obtain a color-enhanced second image. By enhancing the color of the image obtained after color gamut mapping, the color-enhanced second image can be made to have a similar or identical display effect to the first image, thereby providing users with a color-accurate image and improving the user's visual experience.
[0052] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0053] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0054] Figure 1 This is a flowchart illustrating an image processing method according to an exemplary embodiment.
[0055] Figure 2 This is a flowchart illustrating an image processing method according to an exemplary embodiment.
[0056] Figure 3 This is a schematic diagram of various regions in a color gamut mapping process according to an exemplary embodiment.
[0057] Figure 4 This is a flowchart illustrating an image processing method according to an exemplary embodiment.
[0058] Figure 5 This is a flowchart illustrating an image processing method according to an exemplary embodiment.
[0059] Figure 6 This is a block diagram of an image processing apparatus according to an exemplary embodiment.
[0060] Figure 7 This is a block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation
[0061] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0062] With the continuous development of color display technology, HDR technology has gradually become widespread. HDR technology refers to a processing technique that improves image brightness and contrast, providing a wider dynamic range and more image detail, making the colors of the image richer and thus enhancing the user's viewing experience. HDR technology requires a large color gamut; however, the color gamut of current electronic devices is generally P3 or sRGB, which cannot meet the requirements of HDR technology. Therefore, when displaying HDR content, the HDR image is usually first mapped to an SDR image and then displayed. Because the color gamuts of HDR and SDR images are different, the mapped image may have changes in brightness and color compared to the original HDR image, resulting in changes in the image display effect and a poor visual experience for the user. Color gamut refers to the range of colors that a certain color model can represent. Different devices may have different color gamuts; for example, monitors and printers have different color gamuts. Currently, there are several color gamuts, such as sRGB, DCI-P3, and Adobe RGB. The larger the color gamut space of a device, the more colors it can represent.
[0063] To address the aforementioned problems, this disclosure provides an image processing method. This method involves acquiring a first image in a first color gamut, mapping the first image to a second image in a second color gamut, and then performing color enhancement on the second image based on the first image to obtain a color-enhanced second image. By enhancing the color of the image obtained after color gamut mapping, the color-enhanced second image can be made to display similarly or identically to the first image, thereby providing users with a color-accurate image and improving their visual experience.
[0064] The image processing method provided in this disclosure is executed by an electronic device, which may specifically be a mobile phone, tablet computer, laptop, smart robot, smart wearable device, or other smart device. Furthermore, the electronic device is also equipped with various hardware resources and an energy storage device that provides power for the operation of these hardware resources.
[0065] Figure 1 This is a flowchart illustrating an image processing method according to an exemplary embodiment, executed by an electronic device, see [link to flowchart]. Figure 1 The method includes the following steps:
[0066] Step S101: Obtain the first image; the first image is an image under the first color gamut.
[0067] The first color gamut is the color gamut corresponding to the first image. In one example, the first color gamut can be determined based on the properties of the first image. For example, when the first image is an HDR image, the first color gamut can be the BT2020 color gamut; or when the first image is an SDR image, the first color gamut can be the BT709 color gamut.
[0068] Step S102: Map the first image to the second image; the second image is an image in the second color gamut, and the first color gamut is different from the second color gamut.
[0069] The second color gamut is the color gamut corresponding to the second image. In one example, the second color gamut can be determined based on the properties of the second image. For example, when the second image is an SDR image, the second color gamut can be the BT.709 color gamut. It should be noted that the first color gamut and the second color gamut are different. For example, the color gamut range of the first color gamut is larger than that of the second color gamut, or the color gamut range of the first color gamut is the same as that of the second color gamut, but the colors included in the first color gamut and the second color gamut are different.
[0070] In one example, both the first image and the second image are images that can be directly displayed on the screen of an electronic device. Therefore, the first color space corresponding to the first image and the second image can be the color space used by the screen of the electronic device. Since the screen can use the RGB color space to display images, the first color space can be the RGB color space.
[0071] In some embodiments, a first image can be mapped to a second image based on a preset mapping relationship. This preset mapping relationship is used for color gamut mapping between a first color gamut and a second color gamut. The preset mapping relationship can characterize the association between pixels in the first color gamut and pixels in the second color gamut. This association can be a correspondence (e.g., a correspondence between pixels) or a functional relationship (a functional relationship between the color parameters of pixels before and after mapping). When the association is a correspondence, the preset mapping relationship can directly represent the correspondence between pixels in the first color gamut and pixels in the second color gamut; for example, pixel A in the first color gamut corresponds to pixel B in the second color gamut. When the association is a functional relationship, the preset mapping relationship can represent the functional relationship between the color parameters of pixels in the first color gamut and the color parameters of pixels in the second color gamut. Thus, given the color parameters of pixels in the first color gamut, the mapped color parameters can be determined based on the functional relationship, and the corresponding pixels in the second color gamut can be determined based on the mapped color parameters.
[0072] It should be noted that during the color gamut mapping process, the color parameters of some pixels may not change. For example, for pixels within the device color gamut of an electronic device, the color parameters of those pixels will not change before and after mapping. The device color gamut can be any color gamut supported by the electronic device, such as P3 or sRGB.
[0073] In one example, the preset mapping relationship may include a preset mapping algorithm, such as the SGCK (Chroma-dependent sigmoidal lightness mapping and cusp knee scaling) mapping algorithm, which is an image color gamut compression algorithm recommended by the CIE (International Commission on Illumination); or the HPminDE (hue-angle preserving minimum color difference) algorithm.
[0074] The SGCK mapping algorithm is a color gamut mapping technique for mathematical image and video processing. It includes multiple steps such as color space conversion and color mapping, enabling efficient color gamut mapping. The SGCK algorithm is an iso-tone mapping algorithm; during the color gamut mapping process, the color parameters representing the hue of a pixel, such as hue and saturation, remain unchanged. The principle of the SGCK mapping algorithm is as follows: based on the chroma of the pixel corresponding to a color outside the device's color gamut, the lightness of that pixel is determined. Based on the lightness of the pixel and an S-curve lookup table, the lightness of the pixel is mapped to the lightness range of the electronic device. Finally, on the iso-tone plane, the pixel is mapped to the device's color gamut using a piecewise compression method.
[0075] The HPminDE algorithm works as follows: for a pixel corresponding to a color outside the device's color gamut, the pixel is mapped to the point on the device's color gamut boundary where the color difference from that color is minimized. Here, the device color gamut refers to the color gamut that an electronic device can display; in this context, the device color gamut can refer to the area corresponding to a second color gamut.
[0076] Step S103: Based on the first image, perform color enhancement on the second image to obtain the color-enhanced second image.
[0077] After color gamut mapping is completed, because the first and second color gamuts are different, the color parameters of pixels mapped from the first to the second color gamut may differ from their color parameters in the first color gamut. Thus, the color parameters of pixels in the second color gamut may deviate from their original color parameters in the first color gamut. This deviation in the mapped pixel color parameters can lead to display errors and a poor visual experience in the second image.
[0078] In some embodiments, color correction can be performed on the second image based on the first image. The color of pixels after image mapping may be lighter or darker than the color of pixels before mapping. Therefore, the colors of pixels in the second image whose colors have changed can be corrected based on the actual display conditions and the colors of the first image, so that the display effects of the first image and the corrected second image are the same or similar. For example, for pixels whose colors have become lighter, their colors can be enhanced, while for pixels whose colors have become darker, their colors can be weakened. For example, when the colors of pixels after mapping are weakened compared to the colors of pixels before mapping, color enhancement can be performed on the second image based on the first image. For instance, based on the colors of each pixel in the first image, the pixels in the second image that have color deviations from those in the first image can be enhanced, so that the display effects of the pixels in the first image and the color-enhanced second image are not significantly different.
[0079] In one example, the color of a pixel is determined by multiple color parameters. Therefore, correcting the color of a pixel involves correcting each of its individual color parameters. These color parameters include brightness, hue, chroma, and saturation parameters.
[0080] After obtaining the color-enhanced second image, it can be displayed on the screen for the user to view.
[0081] In this embodiment of the disclosure, by performing color enhancement on the image obtained after color gamut mapping, the display effect of the color-enhanced second image can be similar to or the same as that of the first image, thereby providing users with an image that can represent true colors and improving the user's visual experience.
[0082] In some embodiments, during the process of mapping the first image to the second image, the color parameters such as brightness, chromaticity, and hue of each pixel in the image may change. Since the changes in each color parameter cannot be directly determined based on the RGB color space, the color space of the image can be converted, for example, converting an image in the first color space to an image in the second color space. The second color space is a color space that can directly reflect the color parameters, such as the L(brightness)C(chromaticity)H(hue) color space. The following will combine... Figure 2 and Figure 3 The process of color gamut mapping for images is explained.
[0083] Figure 2 This is a flowchart illustrating an image processing method according to an exemplary embodiment, executed by an electronic device, see [link to flowchart]. Figure 2 The method includes the following steps:
[0084] Step S201: Convert the first image in the first color space into a third image in the second color space.
[0085] In some embodiments, the second color space can be the LCH color space. Here, L represents luminance, C represents chrominance, and H represents hue. The luminance and chrominance of a pixel in the second color space can be represented by percentage values; for example, 100% luminance represents complete brightness. The hue of a pixel in the second color space is represented by angle values, ranging from [0°, 360°], such as 30°, 90°, etc.
[0086] It should be noted that the third image and the first image belong to the same color gamut. Accordingly, when multiple pixels in the first image have the same RGB parameter values, the LCH parameter values of those pixels in the converted third image will also be the same. For example, if pixel A and pixel C have the same RGB parameter values, then the converted LCH parameter values of pixel A and pixel C will also be the same.
[0087] Since the RGB color space cannot be directly converted to the LCH color space, in some embodiments, the conversion from the first color space to the second color space can be achieved through an intermediate color space. This intermediate color space can be YUV, HSL, XYZ, etc. In one example, the conversion process from the first color space to the second color space includes: converting the first image from the first color space to the intermediate color space to obtain an image in the intermediate color space; then converting the image in the intermediate color space back to the second color space to obtain a third image. For example, first converting the first image from the RGB color space to the HSL color space, then converting the image in the HSL color space back to the LCH color space to obtain the third image in the LCH color space.
[0088] Taking the XYZ color space as an example, the conversion of a first image in the first color space to a third image in the second color space is described in detail:
[0089] First, the conversion of the first image from the RGB color space to the XYZ color space is implemented. The following formula can be used to characterize the relationship between the color parameters of a pixel in the first color space and the color parameters of a pixel in an intermediate color space. Based on the following formula, the color parameters of each pixel in the first image in the XYZ color space can be calculated. Based on the color parameters of each pixel in the XYZ color space, the image in the XYZ color space corresponding to the first image can be determined.
[0090] X=0.4124564R+0.3575761G+0.1804375B
[0091] Y=0.2126729R+0.7151522G+0.0721750B
[0092] Z=0.0193339R+0.1191920G+0.9503041B
[0093] Where X, Y, and Z represent the red, green, and blue components, respectively, and R, G, and B represent the red, green, and blue components, respectively.
[0094] Next, the image in the XYZ color space is converted to the LCH color space. The following formula characterizes the relationship between the color parameters of a pixel in the intermediate color space and the color parameters of a pixel in the second color space. Based on the following formula, the color parameters of each pixel in the XYZ color space image in the LCH color space can be calculated. Based on the color parameters of each pixel in the LCH color space, the third image can be determined.
[0095] L = 116 * f(Y / Yn) * 16
[0096] C = sqrt(a 2 +b 2 )
[0097] H = arctan2(b, a)
[0098] Where L, C, and H represent luminance, chromaticity, and hue, respectively, and f(q) represents the operation function, the expression of which needs to be determined based on the value of q. When q is greater than 0.008856, f(q) = q. (1 / 3) When q is less than 0.008856, f(q) = 7.787 * q + 16 / 116. a and b represent parameters, where a = 500 * (f(X / Xn) * f(Y / Yn)) and b = 200 * (f(Y / Yn) * f(Z / Zn)), and Xn, Yn, and Zn represent the parameter values of the reference white point for X, Y, and Z, respectively.
[0099] Step S202: Map the third image to the fourth image; the fourth image is an image in the second color gamut.
[0100] Assuming the preset mapping relationship is the SGCK mapping algorithm, since the SGCK mapping algorithm is based on the isotone platform mapping, the hue parameters and / or tone parameters of the pixels are different during the color gamut mapping process.
[0101] Taking the SGCK mapping algorithm as an example, the process of mapping the third image to the fourth image can include: determining the first region corresponding to the first color gamut, the second region corresponding to the second color gamut, and the third region under the preset coordinate system; determining multiple target pixels in the third image based on the first and third regions; then compressing the color parameters of the target pixels to the second region to obtain the compressed color parameters; and finally determining the fourth image based on the compressed color parameters and the color parameters located in the third region of the third image.
[0102] In this system, the horizontal axis of the preset coordinate system represents the chromaticity parameter, the vertical axis represents the luminance parameter, and the third region is defined based on the preset boundary of the second region. For example, the third region is defined based on 90% of the boundary of the second region. The first region includes the second region, and the second region includes the third region. The target pixel is a pixel within the preset region, which is the area within the first region excluding the third region. (Reference) Figure 3 The diagram shown illustrates the various regions involved in a color gamut mapping process. Figure 3 A preset coordinate system is provided, with the x-axis representing the chromaticity parameter C and the y-axis representing the luminance parameter L. Figure 3In this diagram, the area formed by the solid line and the vertical axis can be defined as the first region, the area formed by the dashed line and the vertical axis as the second region, and the area formed by the dotted line and the vertical axis as the third region. Furthermore, the relationship between the three regions satisfies the condition that the first region includes the second region, and the second region includes the third region. Figure 3 The dots and lines in the text can refer to the preset boundaries of the second region, such as the 90% boundary.
[0103] It should be noted that the color parameters of the pixels corresponding to the colors in the third region remain unchanged before and after mapping. In some embodiments, multiple target pixels in the regions other than the third region in the first region can be identified, and the color parameters of the multiple target pixels can be compressed so that the color parameters of each target pixel are compressed into the second region, thereby achieving color gamut mapping. The color parameters include the chromaticity parameter C and the luminance parameter L.
[0104] In some embodiments, the preset area includes a first preset area and a second preset area, wherein the first preset area is the area in the first area excluding the second area, and the second preset area is the area in the second area excluding the third area.
[0105] In some embodiments, when the target pixel is located in a first preset region, the color parameters of the target pixel can be compressed based on the range of color parameters in a second region, so that the target pixel in that region is compressed into the second region. When the target pixel is located in a second preset region, the color parameters of the target pixel can be compressed based on the range of color parameters in a third region.
[0106] It should be noted that compressing the pixel parameters of target pixels located in the second preset region alters their color parameters, preventing them from being identical to those compressed into the second preset region. Furthermore, compressing the color parameters of target pixels in the second preset region ensures a smooth transition between the compressed color parameters of target pixels in the first preset region and those in the second preset region, thus optimizing the display effect.
[0107] Since the color parameters of pixels located in the third region do not change during color gamut mapping, the color parameters of the target pixels in the third image are updated based on the compressed color parameters. The fourth image is then determined based on the updated target pixel color parameters and the color parameters of the pixels located in the third region of the third image. Because compression may reduce the color parameters of the target pixels, the color of the target pixels in the fourth image may be weaker compared to the corresponding pixels in the third image.
[0108] Step S203: Convert the fourth image in the second color space into the second image in the first color space.
[0109] The fourth and second images involve color space conversion but not gamut mapping. Referring to the process of converting from the first color space to the second color space shown in step S201, the method for converting an image from the second color space to the first color space can be to convert the fourth image from the second color space to an intermediate color space, and then convert the image in the intermediate color space back to the first color space to obtain the second image in the first color space. The specific conversion process between the second color space, the intermediate color space, and the first color space can be found in step S201 and will not be repeated here.
[0110] This embodiment of the disclosure can map a first image to a second image, thereby achieving initial color gamut mapping and facilitating subsequent color enhancement processing.
[0111] In some embodiments, the second image can be color-enhanced based on the hue parameter of each target pixel to obtain a color-enhanced second image. The following is an example... Figure 4 The illustrated embodiment explains the process of color enhancement for the second image.
[0112] Figure 4 This is a flowchart illustrating an image processing method according to an exemplary embodiment, executed by an electronic device, see [link to flowchart]. Figure 4 The method includes the following steps:
[0113] Step S401: Based on the configuration information and the hue parameters of each target pixel, determine the statistical information corresponding to each color range; the configuration information includes multiple color ranges.
[0114] Among them, the hue parameter of the target pixel can refer to the hue value of the target pixel (expressed in angle form). Each color range has a corresponding hue parameter range, which refers to the range of hue values. Statistical information is used to characterize the distribution of target pixels in each color range.
[0115] In some embodiments, multiple color ranges can be preset, each including multiple colors and a corresponding hue parameter for each color. For example, color range D includes color d, color e, and color f, as well as the hue parameters corresponding to each of these colors. The types of colors included in each color range and the range of values for the hue parameters can be set according to actual needs, and this embodiment does not impose any limitations.
[0116] In some embodiments, multiple color ranges can be set using a color wheel. A color wheel refers to a circular arrangement of hues in the spectrum, with colors arranged according to the order in which they appear in nature. A color wheel includes multiple color ranges, and the hue parameter range corresponding to each color range is of the same size. The size of the hue parameter range corresponding to each color range can be determined based on 360° and the number of color ranges. The size of the hue parameter range corresponding to each color range is the ratio of 360° to the number of color ranges. In a color wheel, if two colors correspond to each other at 180 degrees, they are called complementary colors, i.e., colors with the greatest contrast; 120 degrees, they are contrasting colors; 90 degrees, they are intermediate colors; 60 degrees, they are adjacent colors; and 30 degrees, they are analogous colors. Currently, there are various types of color wheels, such as 6-color, 12-color, 24-color, and 36-color color wheels. Taking the 24-color color wheel as an example, the basic hues of the 24-color color wheel are eight primary hues: yellow, orange, red, purple, blue, blue-green, green, and yellow-green. Each basic hue is further divided into three parts, forming 24 segmented color wheels. That is, the 24-color color wheel has 24 color ranges, and the size of the hue parameter range corresponding to each color range is 15°.
[0117] After determining multiple color ranges and the corresponding hue parameter ranges for each color range, multiple target pixels can be divided into corresponding color ranges based on their hue parameters, thus determining the distribution of target pixels within each color range. For example, color range D includes colors d, e, and f, and their respective hue parameters. Target pixels F and G have the same hue parameters as colors d and e, therefore, target pixels F and G belong to color range D, and color range D includes two target pixels. Following this method, the number of target pixels in each color range can be determined.
[0118] In some embodiments, the distribution of target pixels can be the number of target pixels in each color range, for example, color range D includes 5 target pixels and color range E includes 6 target pixels; it can also be the ratio of the number of target pixels in each color range to the total number of target pixels, for example, if the total number of target pixels is 20, the statistical information corresponding to color range D is 0.25 and the statistical information corresponding to color range E is 0.3.
[0119] When the distribution of target pixels is the ratio of the number of target pixels in each color range to the total number of target pixels, in some embodiments, for each color range, a first quantity corresponding to the color range can be determined, and the ratio of the first quantity to a second quantity can be determined as the statistical information corresponding to the color range. The first quantity is the number of target pixels whose hue parameters fall within the hue parameter range corresponding to the color range; the second quantity is the number of target pixels. For example, if the hue parameters of the target pixels are 20°, 15°, 10°, 30°, 35°, 36°, 40°, and 55° (the second quantity is 8), and the color ranges are divided according to a 24-color hue wheel, then the hue parameter ranges corresponding to the multiple color ranges are [0°, 15°], [16°, 30°], [31°, 45°], [45°, 60°], ... Therefore, the number of hue parameters for multiple target pixels in [0°, 15°] is 2, the number of hue parameters for multiple target pixels in [16°, 30°] is 2, the number of hue parameters for multiple target pixels in [31°, 45°] is 3, and the number of hue parameters for multiple target pixels in [45°, 60°] is 1. Correspondingly, the first quantities for the above multiple color ranges are 2, 2, 3, and 1, respectively. Based on the first and second quantities, the statistical information for the above multiple color ranges can be determined to be 0.25, 0.25, 0.375, and 0.125, respectively.
[0120] Step S402: Based on the statistical information corresponding to each color range, perform color enhancement on the second image to obtain the color-enhanced second image.
[0121] To achieve better color enhancement, the second image in the first color space can be converted to the fifth image in the third color space. The third color space can be the HSL space, where H represents hue, S represents saturation, and L represents brightness. The conversion process between RGB and HSL color spaces will not be detailed here.
[0122] In some embodiments, the saturation parameters of target pixels in the second image can be corrected based on statistical information of each color range to obtain corrected saturation parameters. The fifth image is then updated based on the corrected saturation parameters, and the color-enhanced second image is determined based on the updated fifth image.
[0123] In one example, based on the statistical information of each color range, the correction parameter corresponding to each color range can be determined. The correction parameter is used to correct the saturation parameter in the fifth image. Based on the correction parameter corresponding to each color range, the saturation parameter of the target pixel in the corresponding color range is corrected.
[0124] The correction parameter can be expressed by the following formula:
[0125] s = log2(1+t)
[0126] Where s represents the correction parameter, t represents the statistical information, and log2() represents the logarithm to the base 2.
[0127] The correction of the saturation parameter of the target pixel based on the correction parameters can be expressed by the following formula:
[0128] S2 = (S1 / 100) (1-s) *100
[0129] Where S2 represents the corrected saturation parameter, and S1 represents the saturation parameter.
[0130] After obtaining the corrected saturation parameters, the previous saturation parameters can be replaced with the corrected saturation parameters to obtain the new color parameters of the target pixel. For example, if the previous color parameters of the target pixel were (H1, S1, L1), the updated color parameters of the target pixel would be (H1, S2, L2).
[0131] Additionally, it should be noted that in the application, other color parameters of the target pixel can be corrected based on the statistical information (and actual needs) of each color range to obtain the corrected color parameters. Based on the corrected color parameters, the fifth image is updated, and based on the updated fifth image, the color-enhanced second image is determined.
[0132] In some embodiments, after determining the updated fifth image, it is necessary to convert the updated fifth image from the third color space to the first color space to obtain the color-enhanced second image. The conversion process between the third color space and the first color space will not be described in detail here.
[0133] This disclosure provides a specific method for color enhancement of a second image. By enhancing the saturation of target pixels in the second image, the color of target pixels with weakened color can be enhanced, thereby making the color of the target pixels similar to the color of the target pixels in the first image, ensuring the realism of the image and improving the user's viewing experience.
[0134] In some embodiments, after processing the first image, subsequent images can be processed. If the colors of subsequent images are not significantly different from the first image—for example, if the color range of the content displayed in the current image is similar to that of the first image—processing that image again might waste computational resources. Therefore, processing can be performed on the image based on the processing done on the first image, thereby saving computational resources and image processing time. The following describes... Figure 5 The illustrated embodiment explains the subsequent image processing procedure.
[0135] Figure 5 This is a flowchart illustrating an image processing method according to an exemplary embodiment, executed by an electronic device, see [link to flowchart]. Figure 5 The method includes the following steps:
[0136] Step S501: Determine the first color range.
[0137] The first color range is the color range corresponding to the largest statistical information among multiple statistical information corresponding to the first image. That is, the first color range can be used to characterize the color range with the most target pixels in the first image. It should be noted that determining the first color range can determine the main color range in the first image that needs to be corrected.
[0138] Step S502: Obtain the sixth image.
[0139] The sixth image is the currently displayed image, and it is an image in the first color gamut. That is, the sixth image is the currently displayed image, and it is an image in the first color space. For a description of the first color space, please refer to step S101, which will not be repeated here.
[0140] Step S503: Determine the second color range.
[0141] The second color range is the color range corresponding to the largest statistical information among multiple statistical information corresponding to the sixth image. That is, the second color range is used to characterize the color range with the most target pixels in the sixth image, and determining the second color range can determine the main color range to be corrected in the sixth image.
[0142] It should be noted that before determining the second color range, the statistical information corresponding to each color range of the sixth image can be determined first. Specifically, this may include converting the sixth image under the first color gamut and the first color space into an eighth image under the first color gamut and the second color space. Then, the third region, the first region corresponding to the first color gamut, and the second region corresponding to the second color gamut are determined (unless otherwise specified, the positions and sizes of the above regions are the same as those determined in step S202; for details, please refer to...). Figure 3 Based on the first and third regions, the pixels in the eighth image located in the preset regions (i.e., target pixels) are determined. Finally, based on the hue parameters and configuration information of each target pixel, the statistical information corresponding to each color range is determined.
[0143] The second color range can be determined by comparing the magnitude of the statistical information corresponding to each color range.
[0144] Step S504: Determine the variation parameters of the first color range and the second color range.
[0145] The variation parameter can be used to characterize the change between the first color range and the second color range, specifically the number of color ranges between them. For example, when the first color range is [0°, 15°] and the second color range is [16°, 30°], the number of color ranges between them is 1 (here, the number of color ranges between two adjacent color ranges is defined as 1). If the second color range is [31°, 45°], the number of color ranges between them is 2. Furthermore, based on the hue parameter's value range, i.e., the hue parameter range is [0°, 360°], when the second color range is [346°, 360°], the number of color ranges between them is also 1.
[0146] Step S505: When the changing parameter is less than the preset threshold, the sixth image is mapped to the seventh image based on the target mapping relationship.
[0147] The preset threshold can be set and selected based on actual needs; for example, the preset threshold can be 1 or 2. The seventh image is an image in the second color gamut. The target mapping relationship is determined based on the first image and the color-enhanced second image, and the target mapping relationship is used for color gamut mapping between the first and second color gamuts.
[0148] In some embodiments, after determining the color-enhanced second image, a target mapping relationship can be determined based on the first image and the color-enhanced second image, and the target mapping relationship can be stored. The target mapping relationship is used for color gamut mapping between the first color gamut and the second color gamut. Thus, in subsequent image processing, if the color difference between the image to be processed and the first image is small, the target mapping relationship can be directly invoked. In some embodiments, the target mapping relationship can include the mapping relationship of color parameters of multiple pre-selected nodes before and after mapping. When determining the color parameters of a pixel before and after mapping, the mapped color parameters can be calculated by interpolation. For example, multiple nodes (17*17*17 LUT (Look Up Table) nodes) can be selected in the first color space, and the color parameters of each node before and after mapping can be determined.
[0149] In some embodiments, when the variation parameter is less than a preset threshold, it indicates that the difference in the main color range to be corrected between the first image and the sixth image is not significant. Therefore, to save computational resources, for images where the difference in the main color range to be corrected is not significant, the target mapping relationship can be directly invoked for image processing to obtain the seventh image. The seventh image is an image that has undergone color enhancement, and after obtaining the seventh image, it can be displayed on the screen. Alternatively, when the variation parameter is greater than or equal to the preset threshold, the sixth image is processed according to steps S101-S103 to obtain the seventh image. Furthermore, a corresponding target mapping relationship can be determined based on the sixth and seventh images, and the target mapping relationship can be stored for direct invocation in subsequent processes.
[0150] It should be noted that the electronic device stores multiple target mapping relationships, each of which is associated with a first color range. For example, target mapping relationship I is associated with the first color range [0°, 15°], and target mapping relationship K is associated with the first color range [16°, 30°]. In some embodiments, a suitable target mapping relationship can be determined from the stored multiple target mapping relationships, and the color gamut mapping of the image can be performed based on the determined target mapping relationship. For example, when performing color enhancement on the sixth image, the target mapping relationship associated with the first color range that is the same as the second color range can be used preferentially, that is, the target mapping relationship associated with the first color range when the change parameter is 0 can be used for image mapping; if the electronic device does not store a target mapping relationship that is the same as the second color range, then the target mapping relationship associated with the first color range whose change parameter between the two color ranges is less than a preset threshold can be used for image mapping. In some embodiments, if a suitable target mapping relationship is not determined from the multiple target mapping relationships, the sixth image can be processed according to steps S101-S103 to obtain the seventh image.
[0151] In this embodiment of the disclosure, a target mapping relationship is determined. In subsequent implementation, if the color difference between the displayed image and the first image is small, the target mapping relationship can be directly called to map the image, thereby directly obtaining the color-enhanced image without additional color enhancement. This not only saves computing resources but also speeds up the image processing process and improves the user experience.
[0152] Figure 6 This is a block diagram illustrating an image processing apparatus according to an exemplary embodiment, configured in an electronic device, see [link to relevant documentation]. Figure 6 The device includes:
[0153] The acquisition module 601 is configured to acquire a first image; the first image is an image under a first color gamut.
[0154] The mapping module 602 is configured to map a first image to a second image; the second image is an image in a second color gamut, and the first color gamut is different from the second color gamut.
[0155] The processing module 603 performs color enhancement on the second image based on the first image to obtain a color-enhanced second image.
[0156] In some embodiments, the mapping module 602 is configured as follows:
[0157] Convert the first image in the first color space to the third image in the second color space;
[0158] The third image is mapped to the fourth image; the fourth image is an image in the second color gamut.
[0159] Convert the fourth image in the second color space to the second image in the first color space.
[0160] In some embodiments, the mapping module 602 is configured as follows:
[0161] Determine the first region corresponding to the first color gamut, the second region corresponding to the second color gamut, and the third region under the preset coordinate system; the horizontal axis of the preset coordinate system is the chromaticity parameter, the vertical axis of the preset coordinate system is the luminance parameter, the third region is the region determined based on the preset range boundary of the second region, the first region includes the second region, and the second region includes the third region;
[0162] Based on the first region and the third region, multiple target pixels in the third image are determined; the target pixels are pixels in a preset region, and the preset region is the region in the first region excluding the third region.
[0163] The color parameters of the target pixel are compressed into the second region to obtain the compressed color parameters; the color parameters include chromaticity parameters and luminance parameters.
[0164] The fourth image is determined based on the compressed color parameters and the color parameters of the third region in the third image.
[0165] In some embodiments, the processing module 603 is configured to:
[0166] Based on the hue parameter of each target pixel, the second image is color-enhanced to obtain the color-enhanced second image.
[0167] In some embodiments, the processing module 603 is configured to:
[0168] Based on the configuration information and the hue parameter of each target pixel, the statistical information corresponding to each color range is determined. The configuration information includes multiple color ranges, each of which has a corresponding hue parameter range. The statistical information is used to characterize the distribution of target pixels in each color range.
[0169] Based on the statistical information corresponding to each color range, the second image is color-enhanced to obtain the color-enhanced second image.
[0170] In some embodiments, the processing module 603 is configured to:
[0171] For each color range, determine the first quantity corresponding to the color range; the first quantity is the number of hue parameters of multiple target pixels that are located in the hue parameter range corresponding to the color range.
[0172] The ratio of the first quantity to the second quantity is determined as the statistical information corresponding to the color range; the second quantity is the number of multiple target pixels.
[0173] In some embodiments, the processing module 603 is configured to:
[0174] Convert the second image in the first color space to the fifth image in the third color space;
[0175] Based on the statistical information of each color range, the saturation parameters of the target pixels are corrected to obtain the corrected saturation parameters.
[0176] Based on the corrected saturation parameters, the fifth image is updated to obtain the updated fifth image;
[0177] Based on the updated fifth image, determine the color-enhanced second image.
[0178] In some embodiments, the processing module 603 is configured to:
[0179] For each color range, the correction parameters corresponding to the color range are determined based on the statistical information of the color range;
[0180] Based on the correction parameters, the saturation parameters of the target pixels in the color range are corrected to obtain the corrected saturation parameters.
[0181] In some embodiments, the processing module 603 is configured to:
[0182] Determine a first color range, which is the color range corresponding to the largest statistical information among multiple statistical information corresponding to the first image;
[0183] Get the sixth image; the sixth image is the currently displayed image, and the sixth image is the image under the first color gamut;
[0184] Determine the second color range, which is the color range corresponding to the largest statistical information among multiple statistical information corresponding to the sixth image;
[0185] Determine the variation parameters between the first color range and the second color range; the variation parameters are used to characterize the number of color ranges that are spaced between the first color range and the second color range;
[0186] When the change parameter is less than the preset threshold, the sixth image is mapped to the seventh image based on the target mapping relationship; the seventh image is an image in the second color gamut, and the target mapping relationship is determined based on the first image and the color-enhanced second image. The target mapping relationship is used for color gamut mapping between the first color gamut and the second color gamut.
[0187] In some embodiments, the processing module 603 is configured to:
[0188] Display the second image with enhanced colors.
[0189] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0190] This disclosure also provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the image processing method described above.
[0191] Figure 7 This is a block diagram of an electronic device 700 according to an exemplary embodiment.
[0192] Reference Figure 7The electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power supply component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, and a communication component 716.
[0193] Processing component 702 typically controls the overall operation of electronic device 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 702 may include one or more modules to facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.
[0194] Memory 704 is configured to store various types of data to support the operation of electronic device 700. Examples of this data include instructions for any application or method operating on electronic device 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 704 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 storage, flash memory, magnetic disk, or optical disk.
[0195] Power supply component 706 provides power to various components of electronic device 700. Power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 700.
[0196] Multimedia component 708 includes a screen that provides an output interface between the electronic device 700 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 may be implemented as a touchscreen 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 may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0197] Audio component 710 is configured to output and / or input audio signals. For example, audio component 710 includes a microphone (MIC) configured to receive external audio signals when electronic device 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 704 or transmitted via communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
[0198] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0199] Sensor assembly 714 includes one or more sensors for providing state assessments of various aspects of electronic device 700. For example, sensor assembly 714 can detect the on / off state of electronic device 700, the relative positioning of components such as the display and keypad of electronic device 700, changes in position of electronic device 700 or a component of electronic device 700, the presence or absence of user contact with electronic device 700, orientation or acceleration / deceleration of electronic device 700, and temperature changes of electronic device 700. Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 714 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0200] Communication component 716 is configured to facilitate wired or wireless communication between electronic device 700 and other devices. Electronic device 700 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 716 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 716 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0201] In an exemplary embodiment, the electronic device 700 may 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 to perform the methods described above.
[0202] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, which can be executed by a processor 720 of an electronic device 700 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0203] This disclosure also provides a non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the image processing method provided in the exemplary embodiments of this disclosure.
[0204] Other embodiments of this disclosure will readily occur 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 this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0205] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. An image processing method, characterized by, The method comprises: obtaining a first image; the first image is an image under a first color gamut; mapping the first image into a second image; the second image is an image under a second color gamut, and the first color gamut is different from the second color gamut; performing color enhancement on the second image based on the first image to obtain a second image after color enhancement.
2. The image processing method of claim 1, wherein, The method of mapping the first image into a second image comprises: converting the first image under a first color space into a third image under a second color space; mapping the third image into a fourth image; the fourth image is an image under the second color gamut; converting the fourth image under the second color space into the second image under the first color space.
3. The image processing method of claim 2, wherein, The method of mapping the third image into a fourth image comprises: determining a first region corresponding to the first color gamut, a second region corresponding to the second color gamut, and a third region in a preset coordinate system; the horizontal coordinate of the preset coordinate system is a chroma parameter, the vertical coordinate of the preset coordinate system is a luminance parameter, the third region is a region determined based on a preset range boundary of the second region, the first region includes the second region, and the second region includes the third region; determining a plurality of target pixel points in the third image based on the first region and the third region; the target pixel point is a pixel point in a preset region, and the preset region is a region in the first region except the third region; compressing a color parameter of the target pixel point to the second region to obtain a compressed color parameter; the color parameter includes the chroma parameter and the luminance parameter; determining the fourth image based on the compressed color parameter and a color parameter of the third region in the third image.
4. The image processing method of claim 3, wherein, The method of performing color enhancement on the second image based on the first image to obtain a second image after color enhancement comprises: performing color enhancement on the second image based on a hue parameter of each target pixel point to obtain the second image after color enhancement.
5. The image processing method of claim 4, wherein, The method of performing color enhancement on the second image based on a hue parameter of each target pixel point to obtain the second image after color enhancement comprises: determining statistical information corresponding to each color range based on configuration information and the hue parameter of each target pixel point; the configuration information includes a plurality of color ranges, each color range has a corresponding hue parameter range, and the statistical information is used to represent the distribution of the target pixel points in each color range; performing color enhancement on the second image based on the statistical information corresponding to each color range to obtain the second image after color enhancement.
6. The image processing method of claim 5, wherein, The method of determining statistical information corresponding to each color range based on configuration information and a hue parameter of each target pixel point comprises: for each color range, determining a first number corresponding to the color range; the first number is the number of hue parameters of the plurality of target pixel points in the hue parameter range corresponding to the color range. A ratio of the first quantity and a second quantity is determined as the statistical information corresponding to the color range; the second quantity is the number of the plurality of target pixel points.
7. The image processing method of claim 5, wherein, The color enhancement of the second image is performed based on the statistical information corresponding to each color range, to obtain the second image after color enhancement. The second image in the first color space is converted into a fifth image in a third color space; The saturation parameter of the target pixel point is corrected based on the statistical information of each color range, to obtain the corrected saturation parameter; The fifth image is updated based on the corrected saturation parameter, to obtain an updated fifth image; The second image after color enhancement is determined based on the updated fifth image.
8. The image processing method of claim 7, wherein, The saturation parameter of the target pixel point is corrected based on the statistical information of each color range, to obtain the corrected saturation parameter, including: For each color range, a correction parameter corresponding to the color range is determined based on the statistical information of the color range; The saturation parameter of the target pixel point in the color range is corrected based on the correction parameter, to obtain the corrected saturation parameter.
9. The image processing method of claim 5, wherein, The method further includes: A first color range is determined, which is a color range corresponding to the largest statistical information in the plurality of statistical information corresponding to the first image; A sixth image is obtained; the sixth image is a currently displayed image, and the sixth image is an image in a first color gamut; A second color range is determined, which is a color range corresponding to the largest statistical information in the plurality of statistical information corresponding to the sixth image; A change parameter of the first color range and the second color range is determined; the change parameter is used to represent the number of color ranges between the first color range and the second color range; When the change parameter is less than a preset threshold, the sixth image is mapped into a seventh image based on a target mapping relationship; the seventh image is an image in a second color gamut, the target mapping relationship is determined based on the first image and the second image after color enhancement, and the target mapping relationship is used for color gamut mapping between the first color gamut and the second color gamut.
10. The image processing method of any of claims 1-8, wherein, The method further includes: The second image after color enhancement is displayed.
11. An image processing apparatus characterized by comprising: It includes: An acquisition module is configured to acquire a first image; The first image is an image in a first color gamut; A mapping module is configured to map the first image into a second image; the second image is an image in a second color gamut, and the first color gamut is different from the second color gamut; A processing module is configured to perform color enhancement on the second image based on the first image, to obtain the second image after color enhancement.
12. An electronic device, comprising: It includes: A processor; A memory for storing processor-executable instructions; The processor is configured to execute the image processing method according to any one of claims 1-10.
13. A non-transitory computer-readable storage medium, comprising: When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the image processing method according to any one of claims 1-10.