Image processing method, device and storage medium

By dynamically adjusting the image brightness range using fitted brightness values ​​from multiple color spaces during the color channel pixel value conversion process, the problem of information and detail loss in existing technologies is solved, and the accuracy of the image brightness range is improved.

CN115170680BActive Publication Date: 2026-03-27BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-06
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies, when compressing the dynamic range of real-world scenes to the grayscale range of display devices, result in a significant loss of information and detail in the image.

Method used

By using fitted brightness values ​​from at least two color spaces during the conversion of color channel pixel values ​​to brightness channel pixel values, the brightness range of the image is dynamically adjusted, including a weighted summation of YUV, HSV, and HOK color spaces, to reduce information and detail loss.

Benefits of technology

It improves the accuracy of image brightness range, reduces the loss of information and detail, and makes dynamically adjusted images closer to the brightness seen by the human eye.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115170680B_ABST
    Figure CN115170680B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image processing method, device and storage medium. The image processing method comprises: acquiring a to-be-processed image, and determining color channel pixel values of the to-be-processed image. Brightness values of the color channel pixel values in at least two color spaces are determined, and the brightness values in the at least two color spaces are fitted to obtain fitted brightness values. Based on the fitted brightness values, a brightness range of the to-be-processed image is dynamically adjusted. According to the image processing method provided by the present disclosure, the fitted brightness values corresponding to the to-be-processed image are determined through the at least two color spaces, which helps to reduce the loss of information or details in the to-be-processed image in the process of converting the color channel pixel values into brightness channel pixel values, and further helps to improve the accuracy of dynamically adjusting the brightness range of the to-be-processed image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of image processing, and particularly relates to an image processing method and device and storage medium. BACKGROUND

[0002] In the real world, the range of luminance distribution is too wide. For example, the maximum luminance can reach 10^5 candela per square meter (cd / m2), and the minimum luminance is about (1 / 10^3) cd / m2. In different luminance scenes, the range of luminance seen by the human eye is also different, and the maximum range is about 10^5. For photography, how to better present the scene seen by the human eye is an important research topic.

[0003] In the related art, the dynamic range of a real scene is mainly compressed nonlinearly through a tone mapping algorithm, so that the real scene is displayed to people through an image. However, due to the technology and cost of the display device, the gray level range of the display is only 0-255, resulting in a serious loss of information and details in a large number of regions in the image. SUMMARY

[0004] To overcome the problems in the related art, the purpose of the present disclosure is to provide an image processing method, device and storage medium, which can reduce the loss of information or details in a to-be-processed image in the process of converting color channel pixel values into luminance channel pixel values, and further improve the accuracy of dynamically adjusting the luminance range of the to-be-processed image.

[0005] To achieve the above purpose, the technical solution adopted by the present disclosure is as follows:

[0006] According to a first aspect of an embodiment of the present disclosure, an image processing method is provided, comprising: acquiring a to-be-processed image, and determining color channel pixel values of the to-be-processed image. Determining luminance values of the color channel pixel values in at least two color spaces, and fitting the luminance values in the at least two color spaces to obtain fitted luminance values. Dynamically adjusting a luminance range of the to-be-processed image based on the fitted luminance values.

[0007] In an embodiment, before determining the luminance values of the color channel pixel values in at least two color spaces, the image processing method further comprises: determining at least two color spaces based on image parameters of the to-be-processed image that need to be processed, the image parameters comprising one or more of a luminance improvement threshold, a saturation, and a region luminance.

[0008] In another embodiment, in response to the image parameter including a brightness boost threshold and / or a saturation, the at least two color spaces include a YUV color space and an HSV color space. The determining the brightness values of the color channel pixel values in the at least two color spaces and fitting the brightness values in the at least two color spaces to obtain a fitted brightness value includes determining a first brightness value of the color channel pixel values in the YUV color space and determining a second brightness value of the color channel pixel values in the HSV color space. The first brightness value and the second brightness value are weighted and summed to obtain a first fitted brightness value. The dynamically adjusting the brightness range of the image to be processed based on the fitted brightness value includes dynamically adjusting the brightness range of the image to be processed based on the first fitted brightness value.

[0009] In yet another embodiment, in response to the image parameter including a brightness boost threshold, a saturation, and / or a region brightness, the determining the at least two color spaces includes a YUV color space, an HSV color space, and a Hok color space. The determining the brightness values of the color channel pixel values in the at least two color spaces and fitting the brightness values in the at least two color spaces to obtain a fitted brightness value includes determining a first brightness value of the color channel pixel values in the YUV color space, determining a second brightness value of the color channel pixel values in the HSV color space, and determining a third brightness value of the color channel pixel values in the Hok color space. The first brightness value, the second brightness value, and the third brightness value are weighted and summed to obtain a second fitted brightness value. The dynamically adjusting the brightness range of the image to be processed based on the fitted brightness value includes dynamically adjusting the brightness range of the image to be processed based on the second fitted brightness value.

[0010] In yet another embodiment, before the determining the brightness values of the color channel pixel values in the at least two color spaces, the image processing method further includes, if the image to be processed has not been subjected to a brightness correction process and a brightness of the image to be processed is lower than a brightness threshold, performing a brightness correction on the image to be processed according to a color space distribution of the image to be processed.

[0011] According to a second aspect of the embodiments of the present disclosure, an image processing apparatus is provided, including: an acquisition unit configured to acquire an image to be processed and determine color channel pixel values of the image to be processed; a fitting unit configured to determine brightness values of the color channel pixel values in at least two color spaces and fit the brightness values in the at least two color spaces to obtain a fitted brightness value; and an adjustment unit configured to dynamically adjust a brightness range of the image to be processed based on the fitted brightness value.

[0012] In an embodiment, the image processing apparatus further comprises a determining unit configured to determine at least two color spaces based on image parameters of the image to be processed, the image parameters comprising one or more of a brightness boost threshold, a saturation, and a region brightness.

[0013] In another embodiment, in response to the image parameters comprising the brightness boost threshold and / or the saturation, the at least two color spaces comprise a YUV color space and an HSV color space. The fitting unit is configured to determine brightness values of the color channel pixel value in the at least two color spaces and fit the brightness values in the at least two color spaces to obtain a fitted brightness value in the following manner: determining a first brightness value of the color channel pixel value in the YUV color space and determining a second brightness value of the color channel pixel value in the HSV color space. The fitting unit is configured to fit the first brightness value and the second brightness value to obtain a first fitted brightness value. The adjusting unit is configured to dynamically adjust the brightness range of the image to be processed based on the fitted brightness value in the following manner: dynamically adjusting the brightness range of the image to be processed based on the first fitted brightness value.

[0014] In yet another embodiment, in response to the image parameters comprising the brightness boost threshold, the saturation, and / or the region brightness, the determining the at least two color spaces comprises a YUV color space, an HSV color space, and a Hok color space. The fitting unit is configured to determine brightness values of the color channel pixel value in the at least two color spaces and fit the brightness values in the at least two color spaces to obtain a fitted brightness value in the following manner: determining a first brightness value of the color channel pixel value in the YUV color space, determining a second brightness value of the color channel pixel value in the HSV color space, and determining a third brightness value of the color channel pixel value in the Hok color space. The fitting unit is configured to fit the first brightness value, the second brightness value, and the third brightness value to obtain a second fitted brightness value. The adjusting unit is configured to dynamically adjust the brightness range of the image to be processed based on the fitted brightness value in the following manner: dynamically adjusting the brightness range of the image to be processed based on the second fitted brightness value.

[0015] In yet another embodiment, the image processing apparatus further comprises a correcting unit configured to perform brightness correction on the image to be processed according to a color space distribution of the image to be processed if the image to be processed has not been processed by a brightness correction process and a brightness of the image to be processed is lower than a brightness threshold.

[0016] According to a third aspect of embodiments of the present disclosure, an image processing apparatus is provided, comprising: a memory configured to store instructions; and a processor configured to invoke the instructions stored in the memory to execute any of the image processing methods described above.

[0017] According to a fourth aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores instructions. When the instructions are executed by a processor, the image processing method described above is performed.

[0018] The technical solutions provided by the embodiments of the present disclosure can have the following beneficial effects: according to the image processing method provided by the present disclosure, the fitting luminance value corresponding to the image to be processed is determined through at least two color spaces, which helps to reduce the loss of information or details in the image to be processed in the process of converting the color channel pixel value into the luminance channel pixel value, and further helps to improve the accuracy of dynamically adjusting the luminance range of the image to be processed.

[0019] 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 DRAWINGS

[0020] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.

[0021] Figure 1 is a luminance histogram according to an exemplary embodiment.

[0022] Figure 2 is another luminance histogram according to an exemplary embodiment.

[0023] Figure 3 is yet another luminance histogram according to an exemplary embodiment.

[0024] Figure 4 is yet another luminance histogram according to an exemplary embodiment.

[0025] Figure 5 is a flowchart of an image processing method according to an exemplary embodiment.

[0026] Figure 6 is a flowchart of another image processing method according to an exemplary embodiment.

[0027] Figure 7 is a flowchart of yet another image processing method according to an exemplary embodiment.

[0028] Figure 8 is a flowchart of yet another image processing method according to an exemplary embodiment.

[0029] Figure 9 is a flowchart of yet another image processing method according to an exemplary embodiment.

[0030] Figure 10 is a to-be-processed image according to an exemplary embodiment.

[0031] Figure 11a is an effect diagram after image processing according to an exemplary embodiment.

[0032] Figure 11b is an effect diagram after image processing according to an exemplary embodiment.

[0033] Figure 11c is an effect diagram after image processing according to an exemplary embodiment.

[0034] Figure 11d is an effect diagram after image processing according to an exemplary embodiment.

[0035] Figure 12 is a to-be-processed image according to an exemplary embodiment.

[0036] Figure 13a is an effect diagram after image processing according to an exemplary embodiment.

[0037] Figure 13b is an effect diagram after image processing according to an exemplary embodiment.

[0038] Figure 13c is an effect diagram after image processing according to an exemplary embodiment.

[0039] Figure 13d is an effect diagram after image processing according to an exemplary embodiment.

[0040] Figure 14 is a block diagram of an image processing device according to an exemplary embodiment.

[0041] Figure 15 is a block diagram of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION

[0042] The exemplary embodiments will be described in detail herein with reference to the attached drawings. In the following description, the same numbers are used to indicate the same elements throughout the several figures. The embodiments described in the following exemplary embodiments are not meant to represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0043] When the terminal takes a picture, it will automatically and dynamically adjust the exposure parameter according to the scene brightness to obtain a well-exposed image. However, in some extreme implementation scenarios, simply relying on automatic exposure cannot obtain an image with appropriate brightness and contrast. For example, in the case of underexposure, the brightness pixel value distribution of the obtained image can be as shown in FIG. 3. Figure 1 Figure 1 is a brightness histogram according to an example embodiment, in which the horizontal axis represents a pixel value and the vertical axis represents brightness. By Figure 1 , it can be determined that in the case of underexposure, the brightness pixel value of the image is mostly distributed in the dark area (the region with a smaller pixel value on the horizontal axis), which easily leads to insufficient global contrast of the image and loss of dark details. In the case of overexposure, the brightness pixel value distribution of the obtained image can be as shown in FIG. 4. Figure 2 Figure 2 is another brightness histogram according to an example embodiment, in which the horizontal axis represents a pixel value and the vertical axis represents brightness. By Figure 2 , it can be determined that in the case of overexposure, the brightness pixel value of the image is mostly distributed in the highlight area (the region with a larger pixel value on the horizontal axis), which also easily leads to insufficient global contrast of the image and loss of image details. In the case of low global contrast, the brightness pixel value distribution of the obtained image can be as shown in FIG. 5. Figure 3 Figure 3 is still another brightness histogram according to an example embodiment, in which the horizontal axis represents a pixel value and the vertical axis represents brightness. By Figure 3 , it can be determined that in the case of low global contrast, the brightness pixel value of the image is mostly distributed in the local brightness area (the region with an intermediate pixel value on the horizontal axis), which leads to difficulty in distinguishing image details and requires stretching of the dynamic range to the entire gray scale range. In the case of a high dynamic range (High-Dynamic Range, HDR for short) scene, the brightness pixel value distribution of the image obtained by backlight shooting can be as shown in FIG. 6. Figure 4 Figure 4 is still another brightness histogram according to an example embodiment, in which the horizontal axis represents a pixel value and the vertical axis represents brightness. By Figure 4 , it can be determined that in the case of backlight shooting in an HDR scene, the image pixels are mainly distributed in the extremely bright area (the region with a too small pixel value on the horizontal axis) and the extremely dark area (the region with a too large pixel value on the horizontal axis), the image has good global contrast, but the local contrast is seriously insufficient, leading to serious loss of details in the bright area and the dark area.

[0044] ​​​​In the related art, for the above scenario, a tone mapping algorithm is mainly used to nonlinearly compress the brightness range of the real scene, and then dynamically adjust the brightness range of the image, so as to display the real scene through the image in front of people. The tone mapping algorithm is a computer graphics technology for approximately displaying a high dynamic range image on a limited dynamic range medium. However, in actual application, the determination of the image brightness value directly affects the subsequent dynamic adjustment of the brightness range of the image.

[0045] Therefore, the present disclosure provides an image processing method. Before dynamically adjusting the brightness range of a to-be-processed image, a fitting brightness value of the to-be-processed image is determined according to color channel pixel values of the to-be-processed image and brightness values in at least two color spaces, thereby improving the accuracy of determining the brightness value of the to-be-processed image. In the process of converting the color channel pixel value into a brightness channel pixel value, it helps to reduce the loss of information or details in the to-be-processed image, thereby helping to improve the accuracy of dynamically adjusting the brightness range of the to-be-processed image, and making the brightness of the dynamically adjusted to-be-processed image closer to the brightness seen by the human eye.

[0046] Figure 5 FIG. 1 is a flowchart of an image processing method according to an example embodiment. As shown in FIG. 1, the image processing method includes the following steps S11-S13. Figure 5

[0047] In step S11, a to-be-processed image is obtained, and color channel pixel values of the to-be-processed image are determined.

[0048] In the embodiment of the present disclosure, the to-be-processed image is an image that needs to be adjusted in brightness range. The color of each pixel in the to-be-processed image is generated by superimposing and mixing colors in the color channel, and each color channel stores information of color elements in the image. The brightness corresponding to the to-be-processed image can be determined through the color channel of the to-be-processed image. Therefore, to determine the brightness corresponding to the to-be-processed image, the color channel pixel value of the to-be-processed image is determined first.

[0049] In some examples, the to-be-processed image can be obtained by a local database, a cloud, or a terminal on-site collection. In an example, the terminal can include a terminal capable of obtaining an image, such as a mobile phone, a tablet, a notebook, etc. In another example, the structure of the terminal can include a double-sided screen terminal, a folding screen terminal, a full-screen terminal, etc.

[0050] In an implementation scenario, the color of each pixel in the to-be-processed image is composed of three primary colors, so the color channel of the to-be-processed image can include a red (R) channel, a green (G) channel, and a blue (B) channel.

[0051] ​In step S12, luminance values of the color channel pixel value in at least two color spaces are determined, and the luminance values in the at least two color spaces are fitted to obtain fitted luminance values.

[0052] In the embodiments of the present disclosure, the color space can be understood as an abstract mathematical model capable of defining a color range based on a coordinate system, used to describe colors under a specified standard. The types of color spaces can include an RGB color space, an HSV color space, an HOK color space, an HSI color space, and the like. Under different color spaces, image parameters for expressing the color channel pixel value are different. Therefore, when the luminance of the image to be processed is extracted in different color spaces, part of the information or details in the original image is likely to be lost in the extraction process, resulting in inaccurate luminance value expression, and the luminance value obtained is likely to affect the subsequent luminance dynamic adjustment.

[0053] To avoid or reduce the loss of information or details of the image to be processed in the process of determining the luminance of the image to be processed, at least two color spaces are used to express the luminance of the image to be processed when the luminance value corresponding to the image to be processed is obtained. The luminance expressed by different color spaces is fitted, and then the deficiencies in expressing the luminance in different color spaces are compensated by luminance value fitting, to obtain fitted luminance values capable of expressing the luminance of the image to be processed, thereby improving the accuracy of extracting the luminance of the image to be processed, so that effective adjustment can be performed when the luminance range of the image to be processed is adjusted subsequently.

[0054] In step S13, the luminance range of the image to be processed is dynamically adjusted based on the fitted luminance value.

[0055] In the embodiments of the present disclosure, based on the obtained fitted luminance value, the luminance distribution of the image to be processed can be determined, and then the luminance range of the image to be processed is dynamically adjusted by a tone mapping algorithm. The types of tone mapping algorithms include a global tone mapping algorithm, a local tone mapping algorithm, or a hybrid tone mapping algorithm. Global mapping can be understood as a method of using the same mapping function for the entire image. For example, by linear (non-linear) contrast stretching or image histogram equalization mapping processing, a luminance mapping curve is determined to re-adjust the gray scale range of the image obtained by the image sensor. The local tone mapping method refers to using different mapping processing for different positions of the pixel. For example, adaptive histogram equalization with limited contrast, fast bilateral filtering, and the like. Hybrid mapping combines both global and local mapping schemes, and uses global mapping as a foundation, and then performs local contrast adjustment based on the global mapping. When the luminance range of the image to be processed is dynamically adjusted, any one of the above tone mapping algorithms can be used for adjustment.

[0056] By the above embodiment, the luminance value of the to-be-processed image is obtained through at least two color spaces, which helps to make up for the defects of obtaining the luminance value of the to-be-processed image by using a single color space, and further avoids or reduces the loss of information or details of the to-be-processed image in the process of extracting the luminance through the color channel pixel value, improves the accuracy of extracting the luminance of the to-be-processed image, and thus makes the luminance of the dynamically adjusted to-be-processed image closer to the luminance seen by the human eye when adjusting the luminance range of the to-be-processed image.

[0057] For ease of understanding, the following will take an RGB image as an example to describe the defects that are easily caused by determining the luminance value of the image through a single color space. Each pixel point I(r, c) in the RGB image is composed of three color channels R, G, and B, which respectively represent R(r, c), G(r, c), and B(r, c). Where (r, c) is the coordinate of the pixel in the RGB image. The color space used by the RGB image is the RGB color space.

[0058] When the luminance value is determined based on the RGB image itself, the luminance value of each pixel point I(r, c) can be determined according to the average of the R, G, and B channels. That is, L(r, c) = (R(r, c) + G(r, c) + B(r, c)) / 3, where L(r, c) represents the luminance value of the pixel point I(r, c). When this method is used to determine the luminance of the image, the saturation of the area with high saturation in the image is likely to be reduced or even the color is lost.

[0059] When the RGB image is converted into the HSV color space to determine the luminance value, that is, when the RGB color space is converted into the HSV color space for expression, the following color space conversion formula can be used to determine the luminance value of each pixel point I(r, c):

[0060] V = max(R, G, B)

[0061]

[0062] Where, in the HSV color space, V represents the luminance of the image. When this method is used to determine the luminance, it helps to protect the single channel or the image with high saturation, but for the area with too low luminance in the image, the noise of the area with too low luminance is likely to be enhanced.

[0063] In HSV, V represents the luminance of the image, S represents the saturation of the image, and H represents the hue of the image. Therefore, the luminance value determined through the conversion formula of the HSV color space is L(r, c) = max(R(r, c), G(r, c), B(r, c)).

[0064] When the RGB image is converted into YUV color space to determine the luminance value, i.e., when the RGB color space is converted into YUV color space for expression, different conversion protocols can be used to determine the luminance value of each pixel point I(r, c) based on different image quality and color gamut. For example, under the BT.601 standard conversion protocol, the conversion formula of the YUV color space is: Y = 0.299 * R + 0.587 * G + 0.114 * B; U = -0.169 * R - 0.331 * G + 0.5 * B; and V = 0.5 * R - 0.419 * G - 0.081 * B. Under the BT.709 standard conversion protocol, the conversion formula of the YUV color space is: Y = 0.2126 * R + 0.7152 * G + 0.0722 * B; U = -0.1146 * R - 0.3854 * G + 0.5 * B; and V = 0.5 * R - 0.4542 * G - 0.0468 * B. Under the BT.2020 standard conversion protocol, the conversion formula of the YUV color space is: Y = 0.2627 * R + 0.6780 * G + 0.0593 * B; U = -0.1396 * R - 0.3604 * G + 0.5 * B; and V = 0.5 * R - 0.4598 * G - 0.0402 * B. In the YUV color space, Y represents the luminance signal, and U and V represent the chrominance signals.

[0065] In an implementation scenario, the sRGB (standard Red Green Blue) standard protocol is a color language protocol that can be used for color restoration without difference in different display systems. The color gamut range described by the sRGB protocol corresponds to the BT.709 standard conversion protocol. Therefore, to avoid differences between display systems, when the RGB image is converted into YUV color space, the BT.709 standard conversion protocol can be used for conversion. Therefore, the luminance value determined by the YUV color space is: L(r, c) = 0.2126 * R(r, c) + 0.7152 * G(r, c) + 0.0722 * B(r, c). When this method is used to determine the luminance of the area with high saturation in the image, the saturation of the area with high saturation is likely to be reduced or even color loss.

[0066] Based on the same concept, the embodiment of the present disclosure also provides another image processing method. The advantages of different color spaces in determining the luminance value of the image to be processed can be used to determine the color space that needs to be converted for the image parameter of the image to be processed.

[0067] Figure 6is a flow chart of another image processing method according to an exemplary embodiment. As shown in Figure 6 The image processing method includes the following steps S21 to S24.

[0068] In step S21, an image to be processed is acquired, and color channel pixel values of the image to be processed are determined.

[0069] In step S22, at least two color spaces are determined based on image parameters of the image to be processed that need to be processed.

[0070] In the embodiments of the present disclosure, the image parameters can include one or more of a brightness enhancement threshold, a saturation, and a region brightness. When determining the color spaces, at least two color spaces that can protect the corresponding image parameters in the process of extracting the brightness values can be determined according to the image parameters of the image to be processed that need to be processed, so as to avoid loss of the original image parameters of the image to be processed.

[0071] In step S23, brightness values of the color channel pixel values in the at least two color spaces are determined, and the brightness values in the at least two color spaces are fitted to obtain fitted brightness values.

[0072] In the embodiments of the present disclosure, because the brightness values obtained by the color channel pixel values in different color spaces are different, the fitting manner can be used to combine the two together to finally determine the brightness value of the image to be processed, that is, the fitted brightness value. In an example, the brightness values of the color channel pixel values in different color spaces can be fitted in a weighted manner to utilize the advantages of each color space in determining the brightness value of the image to be processed and to protect the required image parameters. The weighting can include equal division or allocation of different weight coefficients.

[0073] In step S24, a brightness range of the image to be processed is dynamically adjusted based on the fitted brightness value.

[0074] In an embodiment, when the image parameters that need to be processed are the brightness enhancement threshold, the saturation, or the brightness enhancement threshold and the saturation, the region with high saturation of the single channel pixel value in the image to be processed needs to be protected by dynamically adjusting the brightness range of the image to be processed. Based on the foregoing, the HSV color space is helpful for protecting the single channel or the image with high saturation, and the aforementioned sRGB standard protocol is a color language protocol that can perform color restoration without difference in different display systems. Therefore, when the color spaces are determined according to the image parameters, the YUV color space and the HSV color space can be used to determine the fitted brightness value of the image to be processed, so as to help prevent the problem of over-brightness enhancement or saturation reduction in the region with high saturation in the process of extracting the brightness value.

[0075] According to the YUV color space and the HSV color space, the process of dynamically adjusting the brightness range of the to-be-processed image can be as shown in Figure 7 Figure 7 is a flowchart of yet another image processing method according to an exemplary embodiment.

[0076] In step S31, the to-be-processed image is acquired, and color channel pixel values of the to-be-processed image are determined.

[0077] In step S32, the YUV color space and the HSV color space are determined based on image parameters for which the to-be-processed image needs to be processed.

[0078] In step S33, a first brightness value of the color channel pixel values in the YUV color space is determined, and a second brightness value of the color channel pixel values in the HSV color space is determined.

[0079] In the embodiments of the present disclosure, the color channels of the to-be-processed image are described by taking R, G, and B three-color channels as examples for ease of description. When the first brightness value of the color channel pixel values in the YUV color space is determined, a conversion formula of the YUV color space can be determined based on the conversion protocol adopted, and then the first brightness value is obtained. For example, when the BT.709 standard conversion protocol is adopted, the first brightness value is determined by the conversion formula of the YUV color space: Y = 0.2126 * R + 0.7152 * G + 0.0722 * B. When the BT.2020 standard conversion protocol is adopted, the first brightness value is determined by the conversion formula of the YUV color space: Y = 0.2627 * R + 0.6780 * G + 0.0593 * B. When the second brightness value of the color channel pixel values in the HSV color space is determined, the second brightness value can be determined by the conversion formula of the HSV color space: L(r, c) = max(R(r, c), G(r, c), B(r, c)).

[0080] In step S34, the first brightness value and the second brightness value are weighted and summed to obtain a first fitted brightness value.

[0081] In the embodiments of the present disclosure, the first weight corresponding to the first brightness value and the second weight corresponding to the second brightness value can be respectively set according to requirements, and then the first fitted brightness value is obtained by weighted summation. The sum of the first weight and the second weight is 1. For example, the first weight corresponding to the first brightness value is 0.8, and the second weight corresponding to the second brightness value is 0.2. For ease of description, the first brightness value is denoted by Y, the second brightness value is denoted by V, and then the first fitted brightness value L(r, c) = 0.8 * Y + 0.2 * V is obtained.

[0082] ​In an example, the first weight and the second weight can be determined based on a specified ratio. In an example, the weight values corresponding to the first weight and the second weight can be determined based on the adjustment requirement of the actual brightness range. In another example, the first weight and the second weight can be determined according to the numerical value between the first brightness value and the second brightness value. If the first brightness value is greater than the second brightness value, the first weight is greater than the second weight. For example, the specified ratio is 3:7, if the first brightness value is greater than the second brightness value, the first weight is 0.7 and the second weight is 0.3. If the first brightness value is less than the second brightness value, the first weight is 0.3 and the second weight is 0.7. In yet another example, the first weight and the second weight can be specified weight coefficients. For example, the first weight and the second weight are both 0.5.

[0083] In an embodiment, the determination of the first weight and the second weight can depend on the brightness value of each pixel point in the image to be processed. For example, if the brightness value of each pixel point in the image to be processed is relatively low, the second brightness value obtained through the HSV color space is likely to enhance the noise in the dark area of the image to be processed, resulting in a large difference between the extracted second brightness value and the true brightness value of each pixel point in the image to be processed. Therefore, when setting the weight values corresponding to the first weight and the second weight, the weight value corresponding to the first weight can be set to be greater than the weight value corresponding to the second weight. If the brightness value of each pixel point in the image to be processed is relatively high, the weight value corresponding to the first weight can be set to be less than the weight value corresponding to the second weight. In an implementation scenario, the setting of the first weight can depend on the overall brightness of the image to be processed. If the overall brightness is relatively high, the first weight is correspondingly reduced. If the overall brightness is relatively low, the first weight is correspondingly increased.

[0084] In step S35, the brightness range of the image to be processed is dynamically adjusted based on the first fitted brightness value.

[0085] In another embodiment, when the image parameters to be processed include the region brightness in addition to the brightness enhancement threshold, the saturation, or the brightness enhancement threshold and the saturation, that is, the image parameters to be processed at least include any one or more of the following: the brightness enhancement threshold, the saturation, and the region brightness, the HOK color space can be used to determine the fitted brightness value of the image to be processed while the YUV color space and the HSV color space are determined, and then the brightness range of the image to be processed is dynamically adjusted. The HOK color space is a color space that can protect the highlight area of the image when extracting the brightness. By increasing the brightness of the color channel pixel value in the HOK color space in the process of fitting the brightness value, it is helpful for the transition of the highlight area to be more natural when adjusting the brightness range of the image to be processed, and to a certain extent, it is helpful to avoid the problem of reverse brightness of the highlight area.

[0086] Based on the YUV color space, the HSV color space, and the Hok color space, the process of obtaining the fitting brightness value and dynamically adjusting the brightness range of the to-be-processed image can be as shown in the following formula. Figure 8 Figure 8 FIG. 8 is a flowchart of another image processing method according to an example embodiment.

[0087] In step S41, the to-be-processed image is obtained, and the color channel pixel value of the to-be-processed image is determined.

[0088] In step S42, the YUV color space and the HSV color space are determined based on the image parameters of the to-be-processed image that need to be processed.

[0089] In step S43, the first brightness value of the color channel pixel value in the YUV color space is determined, and the second brightness value of the color channel pixel value in the HSV color space is determined.

[0090] In step S44, the first brightness value and the second brightness value are weighted and summed to obtain the first fitting brightness value.

[0091] In step S45, the third brightness value of the color channel pixel value in the Hok color space is determined.

[0092] In the embodiments of the present disclosure, when the third brightness value of the color channel pixel value in the Hok color space is determined, the following conversion formula can be used to determine the third brightness value:

[0093] ,

[0094] L B = B,

[0095] ,

[0096] ,

[0097] ,

[0098] ,

[0099] wherein the value corresponding to HokY is the third brightness value.

[0100] In step S46, the first fitting brightness value and the third brightness value are weighted and summed to obtain the second fitting brightness value.

[0101] In the embodiments of the present disclosure, the first fitting brightness value determined and the third brightness value determined are weighted and summed to further obtain the second fitting brightness value that can represent the brightness value of the to-be-processed image. ​

[0102] In an example, the first fitting luminance value and the third luminance value can be set with weights, and then weighted sum is performed to obtain the second fitting luminance value. In another embodiment, the first luminance value, the second luminance value and the third luminance value can be set with weights respectively, and then the second fitting luminance value is determined according to the first luminance value, the weight corresponding to the first luminance value, the second luminance value, the weight corresponding to the second luminance value, the third luminance value and the weight corresponding to the third luminance value. For example, the first luminance value is represented by Y, the second luminance value is represented by V, the third luminance value is represented by HokY, a, b, c represent the weight corresponding to the first luminance value, the weight corresponding to the second luminance value and the weight corresponding to the third luminance value respectively, and a+b+c=1. Therefore, the second fitting luminance value L=a*Y+b*v+c*HokY. In an example, the weight corresponding to the first luminance value, the weight corresponding to the second luminance value and the weight corresponding to the third luminance value can be specified weight coefficients. In another example, the weight corresponding to the first luminance value, the weight corresponding to the second luminance value and the weight corresponding to the third luminance value can be determined according to the luminance range adjustment requirement.

[0103] In another example, the first fitting luminance value and the third luminance value can be set with weights respectively, and then weighted sum is performed to obtain the second fitting luminance value. For example, L=d*L(r,c)+e*HokY, wherein L represents the second fitting value, L(r,c) represents the first fitting value, HokY represents the third luminance value, d and e represent the weight corresponding to the first fitting value and the weight corresponding to the third luminance value respectively, and d+e=1.

[0104] In an embodiment, if the luminance value of the pixel points in the part of the region in the image to be processed is relatively high, and the luminance of the part of the region needs to be protected, the weight value of the weight corresponding to the third luminance value can be adjusted correspondingly when the weight corresponding to the third luminance value is set. The higher the luminance value of the pixel points in the part of the region, the greater the weight value of the weight corresponding to the third luminance value.

[0105] In step S47, the luminance range of the image to be processed is dynamically adjusted based on the second fitting luminance value.

[0106] In an implementation scenario, based on the second fitted luminance value, the second fitted luminance value corresponding to each pixel point in the to-be-processed image can be determined, and a luminance channel image is obtained. To facilitate dynamic adjustment of the luminance range of the to-be-processed image, the luminance channel image obtained can be processed by using a local tone mapping algorithm. For example, the luminance channel image obtained is equalized by using a limited-contrast adaptive histogram. The luminance channel image is divided into m*n blocks, the histogram of each sub-image is counted respectively, and the luminance distribution of each pixel point in each sub-image is determined. m and n are any positive integers. To limit the contrast, a luminance threshold is determined, the part of each sub-image histogram that is higher than the threshold is all cut off, the remaining part of each histogram is normalized, a binary (bin) histogram corresponding to each histogram is obtained, then the part higher than the threshold is evenly distributed to each bin, and then a mapping curve of each image is obtained by calculating a cumulative histogram. To avoid block effect when each pixel point in each sub-image is subjected to tone mapping transformation by using the mapping function of the block, a bilinear interpolation algorithm is used to interpolate the mapping function curve between each sub-image, so as to eliminate the block effect caused by the local tone mapping algorithm, and further to avoid causing a halo problem. When the luminance range of the to-be-processed image is adjusted, the gain value of each pixel point in the luminance channel image processed by using the local tone mapping algorithm is obtained respectively, the gain value of each pixel point is multiplied by the corresponding pixel point of the R, G, and B color channel pixel value of the to-be-processed image, and then a color image obtained after dynamic adjustment of the to-be-processed image is obtained.

[0107] By using the image processing method, the fitted luminance value of the to-be-processed image is determined based on the luminance value of the color channel pixel value in the plurality of color spaces, the problem that the area with too high saturation is excessively brightened or the saturation is reduced can be avoided in the process of obtaining the luminance value, the problem of reverse luminance in the highlight area can be avoided, and the noise in the area with low luminance value in the to-be-processed image can be well suppressed.

[0108] Based on the same concept, the disclosure further provides another image processing method.

[0109] Figure 9 is a flowchart of another image processing method according to an example embodiment. As shown in Figure 9 The image processing method includes the following steps S51 to S54.

[0110] In step S51, a to-be-processed image is obtained, and color channel pixel values of the to-be-processed image are determined.

[0111] In step S52, if the image to be processed has not undergone brightness correction processing and the brightness of the image to be processed is lower than the brightness threshold, then the brightness of the image to be processed is corrected according to the color space distribution of the image to be processed.

[0112] In this embodiment, a brightness threshold is used to determine whether the image to be processed is a dark image. If the brightness of the image to be processed is lower than the brightness threshold, it indicates that the brightness of the image to be processed is mainly distributed in areas with low pixel values. If the brightness range of the image to be processed is directly adjusted based on the fitted brightness value corresponding to the image to be processed that is lower than the brightness threshold, it is easy to cause distortion of the adjusted image during the adjustment process, affecting the visual experience of the image. Therefore, for the image to be processed with a brightness lower than the brightness threshold, before obtaining the fitted brightness value, brightness correction is performed on the image to be processed to avoid the brightness of the image to be processed being too concentrated in areas with low pixel values, thereby improving the effectiveness of adjusting the brightness range of the image to be processed. In one implementation scenario, when performing brightness correction on the image to be processed, a gamma correction algorithm can be used to perform a logarithmic (log) transformation on the image to be processed, thereby enhancing the brightness of the image to be processed. Brightness correction helps to improve the color of areas with brightness lower than the brightness threshold in the image to be processed, reduce color errors at each gray level, make the details of the image to be processed clear, the image brightness and color are consistent, the transparency is good, and the contrast is obvious.

[0113] In step S53, the brightness values ​​of the color channel pixel values ​​in at least two color spaces are determined, and the brightness values ​​in the at least two color spaces are fitted to obtain the fitted brightness values.

[0114] In step S54, the brightness range of the image to be processed is dynamically adjusted based on the fitted brightness value.

[0115] To facilitate a clear and intuitive description of the beneficial effects of dynamically adjusting the brightness range of the image to be processed using any of the above image processing methods, the following will combine... Figures 10-13d This will be introduced. Among them, Figure 10 This is an example of an image to be processed, as shown in an exemplary embodiment. The image to be processed is a highly saturated image. Figure 11a To achieve the image processing method provided in this disclosure, the adjusted... Figure 10 The image shown is a result of the brightness range of the image to be processed. Figure 11b The adjustments were based on the YUV color space. Figure 10 The image shown is a brightness range of the image to be processed, and the resulting image is shown. Figure 11c The adjustments were based on the HSV color space. Figure 10 The image shown is a brightness range of the image to be processed, and the resulting image is shown. Figure 11d Adjusting the average RGB three color channelsFigure 10 The resulting effect image based on the luminance range of the to-be-processed image shown in Figures 11a-11d The resulting effect image based on the luminance range of the to-be-processed image shown in Figure 11a The saturation of the region can be well protected, and Figures 11c-11d There is a different degree of reduction in saturation. Figure 12 is a to-be-processed image according to an exemplary embodiment. The to-be-processed image is a low-luminance image. Figure 13a The resulting adjustment Figure 12 The resulting effect image based on the luminance range of the to-be-processed image shown in Figure 13b The resulting adjustment Figure 12 The resulting effect image based on the luminance range of the to-be-processed image shown in Figure 13c The resulting adjustment Figure 12 The resulting effect image based on the luminance range of the to-be-processed image shown in Figure 13d The resulting adjustment Figure 12 The resulting effect image based on the luminance range of the to-be-processed image shown in Figures 13a-13d Based on each of the effect images in

[0116] Based on the same concept, the embodiments of the present disclosure further provide an image processing device.

[0117] It can be understood that the image processing device provided by the embodiments of the present disclosure includes the corresponding hardware structure and / or software modules for executing each function in order to achieve the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiments of the present disclosure, the embodiments of the present disclosure can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of the embodiments of the present disclosure.

[0118] Figure 14 is a block diagram of an image processing device according to an exemplary embodiment. Referring to Figure 14 The image processing device 100 includes an acquisition unit 101, a fitting unit 102, and an adjustment unit 103.

[0119] The acquisition unit 101 is configured to acquire a to-be-processed image and determine color channel pixel values of the to-be-processed image.

[0120] The fitting unit 102 is configured to determine luminance values of the color channel pixel values in at least two color spaces, and fit the luminance values in the at least two color spaces to obtain a fitted luminance value.

[0121] The adjusting unit 103 is configured to dynamically adjust the luminance range of the image to be processed based on the fitted luminance value.

[0122] In an embodiment, the image processing apparatus 100 further comprises a determining unit configured to determine the at least two color spaces based on image parameters of the image to be processed, the image parameters comprising one or more of a luminance boost threshold, a saturation, and a region luminance.

[0123] In another embodiment, in response to the image parameters comprising the luminance boost threshold and / or the saturation, the at least two color spaces comprise a YUV color space and an HSV color space. The fitting unit 102 is configured to determine the luminance values of the color channel pixel values in the at least two color spaces, and fit the luminance values in the at least two color spaces to obtain the fitted luminance value, by determining a first luminance value of the color channel pixel values in the YUV color space, and determining a second luminance value of the color channel pixel values in the HSV color space. The first luminance value and the second luminance value are weighted and summed to obtain a first fitted luminance value. The adjusting unit 103 is configured to dynamically adjust the luminance range of the image to be processed based on the fitted luminance value, by dynamically adjusting the luminance range of the image to be processed based on the first fitted luminance value.

[0124] In yet another embodiment, in response to the image parameters comprising the luminance boost threshold, the saturation, and / or the region luminance, the at least two color spaces comprise a YUV color space, an HSV color space, and a Hok color space. The fitting unit 102 is configured to determine the luminance values of the color channel pixel values in the at least two color spaces, and fit the luminance values in the at least two color spaces to obtain the fitted luminance value, by determining a first luminance value of the color channel pixel values in the YUV color space, determining a second luminance value of the color channel pixel values in the HSV color space, and determining a third luminance value of the color channel pixel values in the Hok color space. The first luminance value, the second luminance value, and the third luminance value are weighted and summed to obtain a second fitted luminance value. The adjusting unit 103 is configured to dynamically adjust the luminance range of the image to be processed based on the fitted luminance value, by dynamically adjusting the luminance range of the image to be processed based on the second fitted luminance value.

[0125] In yet another embodiment, the image processing apparatus 100 further comprises a correcting unit configured to perform luminance correction on the image to be processed according to a color space distribution of the image to be processed, if the image to be processed has not been subjected to a luminance correction process, and a luminance of the image to be processed is lower than a luminance threshold.

[0126] With regard to the apparatuses in the above-described embodiments, a specific manner in which the respective modules perform operations has been described in detail in the embodiments related to the methods, and thus will not be described in detail here.

[0127] Figure 15 is a block diagram of a terminal for image processing according to an exemplary embodiment. For example, the terminal 200 can be a mobile phone, computer, digital broadcast terminal, messaging equipment, game console, tablet equipment, medical equipment, fitness equipment, personal digital assistant, etc.

[0128] Referring to Figure 15 , the terminal 200 can include one or more of the following components: a processing component 202, a memory 204, a power supply component 206, a multimedia component 208, an audio component 210, an input / output (I / O) interface 212, a sensor component 214, and a communication component 216.

[0129] The processing component 202 usually controls overall operations of the terminal 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 can include one or more processors 220 to execute instructions to complete all or part of steps of the above-described methods. In addition, the processing component 202 can include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 can include a multimedia module to facilitate the interaction between the multimedia component 208 and the processing component 202.

[0130] The memory 204 is configured to store various types of data to support operations of the terminal 200. Examples of these data include instructions for any application or method operating on the terminal 200, contact data, phonebook data, messages, pictures, videos, etc. The memory 204 can be implemented by any type of volatile or non-volatile storage devices 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.

[0131] The power supply component 206 supplies electrical power for various components of the terminal 200. The power supply component 206 can include a power supply management system, one or more power sources, and other components associated with generating, managing and distributing electrical power for the terminal 200.

[0132] The multimedia component 208 includes a screen providing an output interface between the terminal 200 and a user. In some embodiments, the screen can 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 a user. The touch panel includes one or more touch sensors to sense touch, slide and gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the terminal 200 is in an operation 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 and rear camera can be a fixed optical lens system or have a focal length and optical zooming capability.

[0133] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC) to receive an external audio signal when the terminal 200 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 204 or transmitted via the communication component 216. In some embodiments, the audio component 210 further includes a speaker to output audio signals.

[0134] The I / O interface 212 provides an interface between the processing component 202 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0135] The sensor component 214 includes one or more sensors to provide various state assessments for the terminal 200. For example, the sensor component 214 can detect an open / closed state of the terminal 200, relative positioning of components, such as a display and a keypad of the terminal 200, a change in position of the terminal 200 or a component of the terminal 200, presence or absence of user contact with the terminal 200, an orientation or acceleration / deceleration of the terminal 200, and a temperature change of the terminal 200. The sensor component 214 can include a proximity sensor configured to detect presence of a nearby object without any physical touch. The sensor component 214 can further include a light sensor such as a CMOS or CCD image sensor for use in an imaging application. In some embodiments, the sensor component 214 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0136] The communication component 216 is configured to facilitate wired or wireless communication between the terminal 200 and other devices. The terminal 200 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 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 216 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 terminal 200 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, micro-controllers, microprocessors, or other electronic elements, for performing the above-described methods.

[0138] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 204 including instructions, is also provided, which can be executed by the processor 220 of the terminal 200 to complete the above-described methods. 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 disc, and an optical data storage device, etc.

[0139] It should further be appreciated that "multiple" in the present disclosure refers to two or more, and other quantifiers are similar thereto. "And / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after it are in an "or" relationship. The singular form "a", "said" and "the" are also intended to include the plural form, unless the context clearly indicates otherwise.

[0140] It should further be appreciated that the terms "first", "second", and the like are used to describe various information, but these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not represent a specific order or importance. In fact, the expressions "first", "second", and the like can be used interchangeably. For example, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information without departing from the scope of the present disclosure.

[0141] It will be further understood that "connected" can include direct connection between two members or indirect connection between two members through other members.

[0142] It will be further understood that, unless otherwise specified, "connected" includes direct connection or indirect connection through others.

[0143] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the present disclosure be considered as including any variations, uses, or adaptations of this application following, in general, the principles of the application and including such steps and inci- dents to the practice of the application as come within the purview of the prior art to which this application pertains. It is intended to cover by the claims appended hereto any and all adaptations or variations of this application. The specification and examples are to be construed as merely illustrative of the preferred embodiments of the present disclosure and not limitative of the scope of the disclosure. It is intended to cover by the patent claims appended hereto any and all adaptations or variations of this application.

[0144] It is to be understood that the application is not limited to the precise details of design and construction set forth above and illustrated in the drawings as modifications obvious to one skilled in the art are intended to be part of this application. The scope of the application is to be limited only by the claims appended hereto.

Claims

1. An image processing method, characterized in that, The image processing method includes: Acquire the image to be processed and determine the pixel values ​​of the color channels of the image to be processed; Determine the brightness value of the color channel pixel value in at least two color spaces, and perform a weighted summation of the brightness values ​​in the at least two color spaces, using the weighted summation brightness value as the fitted brightness value; Based on the fitted brightness value, the brightness range of the image to be processed is dynamically adjusted.

2. The image processing method according to claim 1, characterized in that, Before determining the brightness values ​​of the color channel pixel values ​​in at least two color spaces, the image processing method further includes: Based on the image parameters that need to be processed from the image to be processed, at least two color spaces are determined, and the image parameters include one or more of the following: brightness enhancement threshold, saturation, and regional brightness.

3. The image processing method according to claim 2, characterized in that, In response to the image parameters including brightness enhancement threshold and / or saturation, the at least two color spaces include the YUV color space and the HSV color space; The step of determining the brightness value of the color channel pixel value in at least two color spaces, and performing a weighted summation of the brightness values ​​in the at least two color spaces, and using the weighted summation brightness value as the fitted brightness value, includes: Determine the first brightness value of the color channel pixel value in the YUV color space, and determine the second brightness value of the color channel pixel value in the HSV color space; The first brightness value and the second brightness value are weighted and summed, and the weighted summed brightness value is used as the first fitted brightness value; Based on the fitted brightness value, dynamically adjust the brightness range of the image to be processed, including: Based on the first fitted brightness value, the brightness range of the image to be processed is dynamically adjusted.

4. The image processing method according to claim 2, characterized in that, In response to the image parameters including brightness enhancement threshold, saturation and / or regional brightness, it is determined that the at least two color spaces include YUV color space, HSV color space and Hok color space, wherein the Hok color space is a color space that can protect the highlight areas in the image when extracting brightness. The step of determining the brightness value of the color channel pixel value in at least two color spaces, and performing a weighted summation of the brightness values ​​in the at least two color spaces, and using the weighted summation brightness value as the fitted brightness value, includes: Determine a first brightness value of the color channel pixel value in the YUV color space, determine a second brightness value of the color channel pixel value in the HSV color space, and determine a third brightness value of the color channel pixel value in the Hok color space; The first brightness value, the second brightness value, and the third brightness value are weighted and summed, and the weighted summed brightness value is used as the second fitted brightness value. Based on the fitted brightness value, dynamically adjust the brightness range of the image to be processed, including: Based on the second fitted brightness value, the brightness range of the image to be processed is dynamically adjusted; When determining the third luminance value of the color channel pixel value in the Hok color space, the following conversion formula is used to determine the third luminance value: ; L B = B; ; ; ; ; Wherein, the value corresponding to HokY represents the third brightness value, a, b, and c represent the weights corresponding to the first brightness value, the second brightness value, and the third brightness value, respectively, and R, G, and B represent the pixel values ​​of the red channel, the green channel, and the blue channel, respectively.

5. The image processing method according to any one of claims 1 to 4, characterized in that, Before determining the brightness values ​​of the color channel pixel values ​​in at least two color spaces, the image processing method further includes: If the image to be processed has not undergone brightness correction processing and the brightness of the image to be processed is lower than the brightness threshold, then the brightness of the image to be processed is corrected according to the color space distribution of the image to be processed.

6. An image processing apparatus, characterized in that, The image processing device includes: An acquisition unit is used to acquire an image to be processed and determine the color channel pixel values ​​of the image to be processed. A fitting unit is used to determine the brightness value of the color channel pixel value in at least two color spaces, and to perform a weighted summation of the brightness values ​​in the at least two color spaces, and to use the weighted summation brightness value as the fitted brightness value. An adjustment unit is used to dynamically adjust the brightness range of the image to be processed based on the fitted brightness value.

7. The image processing apparatus according to claim 6, characterized in that, The image processing device further includes: The determining unit is used to determine at least two color spaces based on the image parameters that the image to be processed needs to be processed. The image parameters include one or more of the following: brightness enhancement threshold, saturation, and regional brightness.

8. The image processing apparatus according to claim 7, characterized in that, In response to the image parameters including brightness enhancement threshold and / or saturation, the at least two color spaces include the YUV color space and the HSV color space; The fitting unit determines the brightness value of the color channel pixel value in at least two color spaces using the following method, and performs a weighted summation of the brightness values ​​in the at least two color spaces, using the weighted summation brightness value as the fitted brightness value: Determine the first brightness value of the color channel pixel value in the YUV color space, and determine the second brightness value of the color channel pixel value in the HSV color space; The first brightness value and the second brightness value are weighted and summed, and the weighted summed brightness value is used as the first fitted brightness value; The adjustment unit dynamically adjusts the brightness range of the image to be processed based on the fitted brightness value in the following manner: Based on the first fitted brightness value, the brightness range of the image to be processed is dynamically adjusted.

9. The image processing apparatus according to claim 7, characterized in that, In response to the image parameters including brightness enhancement threshold, saturation and / or regional brightness, it is determined that the at least two color spaces include YUV color space, HSV color space and Hok color space, wherein the Hok color space is a color space that can protect the highlight areas in the image when extracting brightness. The fitting unit determines the brightness value of the color channel pixel value in at least two color spaces using the following method, and performs a weighted summation of the brightness values ​​in the at least two color spaces, using the weighted summation brightness value as the fitted brightness value: Determine a first brightness value of the color channel pixel value in the YUV color space, determine a second brightness value of the color channel pixel value in the HSV color space, and determine a third brightness value of the color channel pixel value in the Hok color space; The first brightness value, the second brightness value, and the third brightness value are weighted and summed, and the weighted summed brightness value is used as the second fitted brightness value. The adjustment unit dynamically adjusts the brightness range of the image to be processed based on the fitted brightness value in the following manner: Based on the second fitted brightness value, the brightness range of the image to be processed is dynamically adjusted; When determining the third luminance value of the color channel pixel value in the Hok color space, the following conversion formula is used to determine the third luminance value: ; L B = B; ; ; ; ; Wherein, the value corresponding to HokY represents the third brightness value, a, b, and c represent the weights corresponding to the first brightness value, the second brightness value, and the third brightness value, respectively, and R, G, and B represent the pixel values ​​of the red channel, the green channel, and the blue channel, respectively.

10. The image processing apparatus according to any one of claims 6 to 9, characterized in that, The image processing device further includes: The correction unit is used to perform brightness correction on the image to be processed according to the color space distribution of the image to be processed if the image to be processed has not undergone brightness correction processing and the brightness of the image to be processed is lower than the brightness threshold.

11. An image processing apparatus, characterized in that, The image processing device includes: Memory, used to store instructions; and A processor is configured to invoke instructions stored in the memory to execute the image processing method as described in any one of claims 1-5.

12. A computer-readable storage medium, characterized in that, The device stores instructions that, when executed by a processor, perform the image processing method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Automatic adjustment method of color image brightness

    CN105096273A

  • Brightness adjusting method and device

    CN105225647A