Image processing method, device, electronic device and storage medium

By adaptively adjusting the brightness of HDR images, the problem of image brightness imbalance after HDR technology processing is solved, the display effect of the image is improved, and the visual experience is enhanced.

CN112750086BActive Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202010900222.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-31
Publication Date
2024-10-15
Estimated Expiration
2040-08-31

AI Technical Summary

Technical Problem

When existing HDR technology processes video images, it makes dark areas darker and bright areas brighter, resulting in poor image display and affecting the visual experience.

Method used

By adaptively adjusting the brightness of the HDR image, using the brightness information of standard brightness pixels to perform non-linear processing on other pixels, the target HDR image is generated and the problem of dark areas being too dark and bright areas being too bright is reduced.

Benefits of technology

It improves the display effect of images, avoids brightness imbalance caused by HDR processing, and enhances the visual experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112750086B_ABST
    Figure CN112750086B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method, device, electronic device and storage medium, which perform HDR processing on an image of a video to be played to generate an HDR image to improve the contrast of the image, obtain a first pixel in the HDR image that represents the standard brightness of the HDR image, and based on the brightness information of the first pixel, perform nonlinear adaptive adjustment on the brightness information of second pixels other than the first pixel in the HDR image to generate a target HDR image, so as to reduce the impact on the display effect of the HDR image caused by the HDR processing, which makes the dark areas in the HDR image darker and the bright areas brighter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video processing technology, and more specifically, to an image processing method, device, electronic equipment and storage medium. Background Art

[0002] With the continuous development of broadband networks and display technologies, people have higher expectations for the quality of video images. Compared with ordinary videos, HDR videos generated by processing ordinary videos using HDR (High-Dynamic Range) technology can greatly expand the contrast of images in the video, thereby better reflecting the real environment and improving the visual experience.

[0003] Although the existing HDR technology can greatly expand the image contrast and color in the video, for the dark areas in the image, the dark areas in the image obtained by using the HDR technology will be darker, and the image details in the dark areas of the image will be less visible; and for the bright areas in the image, the bright areas in the image obtained by using the HDR technology will be brighter, which may cause the bright areas in the image to be overexposed, affecting the image display effect. Summary of the invention

[0004] In view of this, the present application provides an image processing method, device, electronic device and storage medium to achieve adaptive adjustment of image brightness while improving image contrast and enhancing image display effect. The technical solution is as follows:

[0005] An image processing method, comprising:

[0006] Determine an HDR image generated by performing high dynamic range (HDR) processing on an image in a video to be played;

[0007] Determine, from all pixels of the HDR image, a first pixel whose brightness information represents a standard brightness of the HDR image;

[0008] comparing brightness information of a second pixel in the HDR image with brightness information of the first pixel to determine brightness adjustment information of the second pixel, the second pixel being different from the first pixel;

[0009] With the brightness information of the second pixel being close to the brightness information of the first pixel as a target, nonlinear processing is performed on the brightness information of the second pixel using the brightness adjustment information of the second pixel to obtain the target brightness information of the second pixel;

[0010] A target HDR image for video playback is generated based on the target brightness information of the second pixel in the HDR image.

[0011] An image processing device, comprising:

[0012] An HDR processing unit, used for determining an HDR image generated by performing high dynamic range HDR processing on an image in the video to be played;

[0013] A first pixel determining unit, configured to determine, from all pixels of the HDR image, a first pixel whose brightness information represents a standard brightness of the HDR image;

[0014] a brightness adjustment information determining unit, configured to compare brightness information of a second pixel in the HDR image with the brightness information of the first pixel to determine brightness adjustment information of the second pixel, the second pixel being different from the first pixel;

[0015] a brightness adjustment unit, configured to perform nonlinear processing on the brightness information of the second pixel using the brightness adjustment information of the second pixel with the brightness information approaching the brightness information of the first pixel as a target to obtain the target brightness information of the second pixel;

[0016] A target HDR image generating unit is used to generate a target HDR image for video playback based on the target brightness information of the second pixel in the HDR image.

[0017] An electronic device comprises: a processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; and the memory is used to store a program, wherein the program is used to implement the image processing method.

[0018] A computer-readable storage medium stores computer-executable instructions for executing the image processing method.

[0019] The present application provides an image processing method, device, electronic device and storage medium, which perform HDR processing on an image of a video to be played to generate an HDR image to improve the contrast of the image, obtain a first pixel in the HDR image that represents the standard brightness of the HDR image, and based on the brightness information of the first pixel, perform nonlinear adaptive adjustment on the brightness information of second pixels other than the first pixel in the HDR image to generate a target HDR image, so as to reduce the impact on the display effect of the HDR image caused by the HDR processing, which makes the dark areas in the HDR image darker and the bright areas brighter. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0021] Figure 1 A schematic diagram of the structure of an image processing system provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of video playback provided in an embodiment of the present application;

[0023] Figure 3 Another video playback schematic diagram provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of another video playback provided in an embodiment of the present application;

[0025] Figure 5 A flow chart of an image processing method provided in an embodiment of the present application;

[0026] Figure 6 A flow chart of a method for performing HDR processing on an image to generate an HDR image provided in an embodiment of the present application;

[0027] Figure 7 A schematic diagram of an image processing effect provided in an embodiment of the present application;

[0028] Figure 8 A schematic diagram of a dark scene image processing effect provided by an embodiment of the present application;

[0029] Fig. 9 A schematic diagram of another dark scene image processing effect provided in an embodiment of the present application;

[0030] Fig.10 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;

[0031] Fig.11 A hardware structure block diagram of a terminal to which an image processing method provided in an embodiment of the present application is applicable;

[0032] Fig.12 A hardware structure block diagram of a server to which an image processing method provided in an embodiment of the present application is applicable. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] Example:

[0035] Standard-Dynamic Range (SDR) is also called standard range image. High-Dynamic Range (HDR) is also called high dynamic range image imaging. Compared with traditional SDR technology, the existing HDR technology can greatly expand the contrast and color of the image in the video, so that the video can better reflect the real environment and improve the user's visual experience.

[0036] Although the existing HDR technology can improve the contrast of the image, for the dark scenes (dark areas) in the image, after the image is processed by HDR technology, the dark scenes in the image will become darker, and the details of the image in the dark scenes will be harder to see; and for the bright scenes (bright areas) in the image, after the image is processed by HDR technology, the bright scenes in the image will become brighter, which may cause overexposure. However, whether the dark areas in the image are darker or the bright areas in the image are brighter, it will affect the display effect of the image and reduce the user's visual experience to a certain extent.

[0037] The embodiments of the present application provide an image processing method, device, server, and storage medium, which can not only perform HDR processing on the image in the video to be displayed to generate an HDR image to improve the contrast of the image, but also can further adaptively adjust the brightness of the HDR image to solve the problem that the dark areas in the image processed by the HDR technology are darker and the bright areas are brighter, which affects the image display effect. It should be noted that the image processed by the HDR technology can be called an HDR image.

[0038] The image processing method provided in the embodiment of the present application is applied to a video playback system. Figure 1 .like Figure 1 As shown, the video playback system is composed of a terminal and a server. The terminal provides a video application, and the server provides service support for the video application on the terminal.

[0039] In an embodiment of the present application, the video application provides at least one video playback mode, and the at least one video playback mode includes 270P (standard definition), 480P (high definition), 720P (ultra-high definition), 1080P (Blu-ray), HDR, etc.

[0040] When a user selects the "HDR" mode from at least one video playback mode provided by a video application, an image processing method provided in an embodiment of the present application can be used to process the image in the video to be played to generate a target HDR image, and then the video application renders the target HDR image to realize video playback in the HDR mode.

[0041] The above are merely preferred contents of the video playback mode provided in the embodiments of the present application. The inventors can set the specific contents of the video playback mode according to their own needs and are not limited here.

[0042] See also Figure 2 The video application currently plays videos in 720P (HD) video playback mode. If the user wants to switch to other video playback modes, click Figure 2 , then the video application displays buttons corresponding to at least one video playback mode. For details, see Figure 3 ; After clicking the "HDR" button, the user can turn on the HDR function and play the video in HDR video playback mode to achieve the HDR display effect of the video. For details, please refer to Figure 4 .

[0043] After the user turns on the HDR function, an image processing method provided in an embodiment of the present application processes the video to be played to generate a target HDR image for each frame of the video to be played, and then plays the video by rendering the target HDR image for each frame of the video to be played, thereby achieving an HDR playback effect.

[0044] The image processing method provided in the embodiment of the present application not only proposes a new HDR algorithm (see Figure 6 ), and also proposed a method for adaptively adjusting the brightness of an HDR image. For the specific implementation of the image processing method provided in the embodiment of the present application, please refer to Figure 5 , which will not be introduced in detail here.

[0045] When the inventor of the present application proposed a scheme for adaptively adjusting the brightness of an HDR image, he first thought of using a method of linearly processing the pixel brightness of the HDR image to achieve adaptive adjustment of the pixel brightness in the HDR image. For example, the first pixel representing the standard brightness of the HDR image can be determined among all the pixels of the HDR image, and then for the second pixel in the HDR image whose brightness value is greater than the brightness value of the first pixel, the brightness value of the second pixel is multiplied by a first value to obtain a target brightness value of the second pixel, and the first value is less than 1, so that the brightness value of the second pixel can be reduced; for the second pixel in the HDR image whose brightness value is less than the brightness value of the first pixel, the brightness value of the second pixel is multiplied by a second value to obtain a target brightness value of the second pixel, and the second value is greater than 1, so that the brightness value of the second pixel can be increased.

[0046] However, the inventors found through research that although this method can adjust the brightness of pixels in HDR images, the adjustment effect is not very ideal. Therefore, the inventors of the present application further improved it and proposed a method for nonlinearly adjusting the brightness of pixels in HDR images. For the specific implementation method of the nonlinear adjustment of the brightness of pixels in HDR images proposed by the inventors of the present application, please refer to the detailed description of the image processing method below, which will not be introduced here.

[0047] An image processing method provided in an embodiment of the present application can be applied to both a terminal and a server. In the embodiment of the present application, in order to improve the computing speed and save the computing power of the terminal, the image processing method provided in the embodiment of the present application is preferably executed by the server. The following is a detailed description from the perspective of the server executing an image processing method provided in an embodiment of the present application. Figure 5 A flow chart of an image processing method provided in an embodiment of the present application.

[0048] like Figure 5 As shown, the method includes:

[0049] S501, determining an HDR image generated by performing high dynamic range HDR processing on an image in a video to be played;

[0050] After the user clicks the HDR button in the video application on the terminal, the terminal sends an HDR video playback request to the server. The server responds to the HDR video playback request, performs image processing on the image in the video to be played to generate a target HDR image, and returns the target HDR image to the terminal, which renders the target HDR image to achieve the purpose of HDR video playback. The HDR video playback request is used to request video playback in HDR mode.

[0051] After receiving the HDR video playback request and determining the video to be played, the server decodes the video to be played and extracts frames to obtain the images in the video to be played. In accordance with the image playback order in the video to be played, each frame of the video to be played is processed as follows: HDR processing is performed on the image to generate an HDR image, and the brightness of the HDR image is adaptively adjusted to obtain the target HDR image. Accordingly, the server returns the target HDR image of each frame of the video to be played to the terminal, and the video application on the terminal renders the target HDR image to realize the video playback in HDR mode.

[0052] In the embodiment of the present application, the new HDR algorithm proposed by the inventor of the present application can be used to implement HDR processing of the image to generate a target HDR image. Based on the new HDR algorithm, the image contrast can be effectively improved and the image display effect can be enhanced. For the implementation of the new HDR algorithm, please refer to Figure 6 The detailed description is not repeated here.

[0053] S502, determining, from all pixels of the HDR image, a first pixel whose brightness information represents a standard brightness of the HDR image;

[0054] The HDR image generated by performing HDR processing on the image in the video to be played is an RGB image, and the HDR image is converted from the RGB image to a YUV image.

[0055] Please refer to Formula 1 for the method of converting RGB images to YUV images. Formula 1 is as follows:

[0056] Y=0.299×R+0.587×G+0.114×B

[0057] U=-0.147×R-0.289×G+0.436×B

[0058] V=0.615×R-0.515×G-0.100×B

[0059] The method of converting the HDR image from an RGB image to a YUV image is to convert the RGB information of each pixel in the HDR image into YUV information by using Formula 1. Taking the YUV information of a pixel as an example, the YUV information of the pixel includes the channel value of the pixel in the Y channel, the channel value of the pixel in the U channel, and the channel value of the pixel in the V channel; wherein the channel value of the pixel in the Y channel can be considered as the brightness value of the pixel, and can also be called the brightness information of the pixel.

[0060] Convert the HDR image from RGB to YUV, obtain the brightness value of each pixel in the YUV image, sort all pixels in the YUV image according to the brightness value to generate a pixel sequence, and the brightness values ​​of two adjacent pixels in the pixel sequence meet the preset sorting rules.

[0061] For example, if the sorting rule is the first sorting rule, when the first sorting rule indicates sorting from large to small, all pixels in the YUV image are sorted in the order of brightness values ​​from large to small to generate a pixel sequence. If the sorting rule is the second sorting rule, when the second sorting rule indicates sorting from small to large, all pixels in the YUV image are sorted in the order of brightness values ​​from small to large to generate a pixel sequence.

[0062] In the embodiment of the present application, selection rules that match each sorting rule are pre-set, and different sorting rules match different selection rules. For example, if the sorting rule is the first sorting rule, the selection rule that matches the first sorting rule can be the first selection rule; if the sorting rule is the second sorting rule, the selection rule that matches the second sorting rule can be the second selection rule.

[0063] Taking the first sorting rule as an example, all pixels in the YUV image are sorted in descending order of pixel value to generate a pixel sequence, the target position in the pixel sequence indicated by the first selection rule is determined, and the pixel at the target position in the pixel sequence is determined as the first pixel.

[0064] As a preferred implementation of the embodiment of the present application, the product of the number of pixels in the pixel sequence and the first ratio indicated by the first selection rule can be determined, and the product result is determined as the sorting sequence number of the pixel at the target position in the pixel sequence. For example, if there are 100 pixels in the pixel sequence, and the first ratio indicated by the first selection rule is 5%, 100×5%=5, then the sorting sequence number of the pixel at the target position in the pixel sequence is 5, and the 5th pixel in the pixel sequence is determined as the first pixel.

[0065] Taking the second sorting rule as an example, all pixels in the YUV image are sorted in ascending order of pixel value to generate a pixel sequence, the target position in the pixel sequence indicated by the second selection rule is determined, and the pixel at the target position in the pixel sequence is determined as the first pixel.

[0066] As a preferred implementation of the embodiment of the present application, the product of the number of pixels in the pixel sequence and the second ratio indicated by the second selection rule can be determined, and the product result is determined as the sorting number of the pixel at the target position in the pixel sequence. For example, if there are 100 pixels in the pixel sequence, and the second ratio indicated by the second selection rule is 95%, 100×95%=95, then the sorting number of the pixel at the target position in the pixel sequence is 95, and the 95th pixel in the pixel sequence is determined as the first pixel.

[0067] It is understood that the product result may not be an integer. In this case, the product result may be rounded to obtain a target product result, and then the target product result is determined as the sorting sequence number of the pixel at the target position in the pixel sequence.

[0068] In the embodiment of the present application, the brightness value of the first pixel can represent the standard brightness of the HDR image, and the brightness values ​​of other pixels (second pixels) in the HDR image can be adaptively adjusted based on the brightness value of the first pixel.

[0069] It should be noted that the standard brightness of the HDR image is not based on the highest brightness value of the pixels in the HDR image, but on the brightness value of the first pixel that is close to the highest brightness value but has not reached the highest brightness value. In this way, it can avoid the problem that the brightness values ​​of other pixels in the HDR image become very high when the highest brightness value of the pixels in the HDR image is adjusted based on the highest brightness value, which affects the final adjustment effect.

[0070] S503, comparing brightness information of a second pixel in the HDR image with brightness information of the first pixel to determine brightness adjustment information of the second pixel, where the second pixel is different from the first pixel;

[0071] The following process is performed on each pixel except the first pixel in the HDR image (for the sake of distinction, each pixel except the first pixel in the HDR image can be referred to as a second pixel): compare the brightness value of the second pixel with the brightness value of the first pixel to determine the comparison result of the second pixel; if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, determine that the first brightness adjustment information generated using the brightness value of the first pixel is the brightness adjustment information of the second pixel; if the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel, determine the pre-set second brightness adjustment information as the brightness adjustment information of the second pixel.

[0072] Taking the brightness adjustment information of the second pixel represented by gamma as an example, if the comparison result of the second pixel represents that the brightness value of the second pixel is greater than the brightness value of the first pixel, the pre-set brightness adjustment information is obtained (for the sake of distinction, the pre-set brightness adjustment information is called the second brightness adjustment information), and the second brightness adjustment information is determined as the brightness adjustment information of the second pixel.

[0073] In the embodiment of the present application, the preset second brightness adjustment information may be 1.2, that is, if the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel, the brightness adjustment information gamma of the second pixel is 1.2.

[0074] The above is only the preferred content of the second brightness adjustment information provided by the embodiment of the present application. The inventor can set the specific content of the second brightness adjustment information according to his own needs and is not limited here. However, it should be noted that in order to ensure the brightness adjustment effect, the value of the pre-set second brightness adjustment information needs to be greater than 1.

[0075] Still taking the example of using gamma to represent the brightness adjustment information of the second pixel, if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, the brightness adjustment information generated using the brightness value of the first pixel is determined (for ease of distinction, the brightness adjustment information generated using the brightness value of the first pixel is referred to as the first brightness adjustment information), and the first brightness adjustment information is determined as the brightness adjustment information of the second pixel.

[0076] The method of generating the first brightness adjustment information by using the brightness value of the first pixel can be referred to in Formula 2. The specific Formula 2 is as follows:

[0077] gamma=1-β*(255-y_max) / 255, where β is greater than 0, y_max is the brightness value of the first pixel, and the range of y_max is in the interval [0, 255].

[0078] In the embodiment of the present application, β=0.45. The above is only the preferred value of β provided in the embodiment of the present application. The inventor can set the specific value of β according to his own needs and it is not limited here.

[0079] It should be noted that the value of the first brightness adjustment information generated using the brightness value of the first pixel is greater than 0 and less than 1. That is, if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, the brightness adjustment information of the second pixel is 0. <gamma<1。

[0080] Further, if the comparison result of the second pixel indicates that the brightness value of the second pixel is equal to the brightness value of the first pixel, the preset third brightness adjustment information is obtained, and the preset third brightness adjustment information is determined as the brightness adjustment information of the second pixel. In the embodiment of the present application, the value of the third brightness adjustment information is equal to 1. That is, if the comparison result of the second pixel indicates that the brightness value of the second pixel is equal to the brightness value of the first pixel, the brightness adjustment information gamma of the second pixel is 1.

[0081] S504, using the brightness adjustment information of the second pixel to perform nonlinear processing on the brightness information of the second pixel with the goal of approaching the brightness information of the first pixel to obtain target brightness information of the second pixel;

[0082] In an embodiment of the present application, the brightness value of the second pixel can be normalized to generate a first brightness value of the second pixel; the first brightness value of the second pixel can be nonlinearly processed based on brightness adjustment information of the second pixel with the goal of approaching the brightness value of the first pixel to generate a second brightness value of the second pixel; the second brightness value of the second pixel can be denormalized to generate a third brightness value of the second pixel; and the target brightness information of the second pixel can be determined using the third brightness value of the second pixel in combination with the comparison result of the second pixel.

[0083] Referring to Formula 3, the method of using the brightness adjustment information of the second pixel to process the brightness information of the second pixel with the goal of approaching the brightness information of the first pixel to obtain the third brightness value of the second pixel is as follows:

[0084] Wherein, Y is the brightness value of the second pixel, and Y′ is the third brightness value of the second pixel.

[0085] Referring to Formula 3, we can It is considered to be a process of normalizing the brightness value of the second pixel to generate the first brightness value of the second pixel. The first brightness value of the second pixel is

[0086] And, you can It is considered that the process of performing nonlinear processing on the first brightness value of the second pixel based on the brightness adjustment information of the second pixel with the goal of approaching the brightness value of the first pixel to generate the second brightness value of the second pixel. The second brightness value of the second pixel is

[0087] Furthermore, we can is considered to be the second brightness value of the second pixel The process of performing a back-normalization process to generate a third brightness value Y′ of the second pixel. The third brightness value Y′ of the second pixel is

[0088] After the third brightness value of the second pixel is determined, it is necessary to further determine the target brightness information of the second pixel in combination with the comparison result of the second pixel and the third brightness value of the second pixel.

[0089] In the embodiment of the present application, the method of determining the target brightness information of the second pixel by using the third brightness value of the second pixel in combination with the comparison result of the second pixel can be: if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, the third brightness value of the second pixel is determined as the target brightness information of the second pixel. Conversely, if the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel, it is necessary to determine whether the third brightness value of the second pixel is less than the brightness value of the first pixel; if the third brightness value of the second pixel is less than the brightness value of the first pixel, the brightness value of the first pixel is determined as the target brightness information of the second pixel; if the third brightness value of the second pixel is not less than the brightness value of the first pixel, the third brightness value of the second pixel is determined as the target brightness information of the second pixel.

[0090] In the case where the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel, the brightness value of the second pixel can be reduced based on Formula 3 to obtain the third brightness value of the second pixel. In order to prevent the brightness value of the second pixel from being reduced too much, the third brightness value of the second pixel can be compared with the brightness value of the first pixel to determine whether the third brightness value of the second pixel is lower than the brightness value of the first pixel. If the third brightness value of the second pixel is lower than the brightness value of the first pixel, the brightness value of the first pixel is determined as the target brightness value of the second pixel; conversely, if the third brightness value of the second pixel is not lower than the brightness value of the first pixel, the third brightness value of the second pixel is determined as the target pixel value of the second pixel.

[0091] When the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, since the β value is greater than 0, the range of y_max is in the interval [0, 255], and the value of gamma is greater than 0 and less than 1, the value of Y will be higher than before. In the image processing method provided by the embodiment of the present application, when the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, the brightness of the dark area is improved more, and the brightness of the bright area is improved less.

[0092] When the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel, since the value of gamma is greater than 1, the value of Y will be lower than before.

[0093] When the comparison result of the second pixel indicates that the brightness value of the second pixel is equal to the brightness value of the first pixel, since the value of gamma is equal to 1, the value of Y remains unchanged.

[0094] An image processing method provided in an embodiment of the present application can realize adaptive adjustment of the brightness in an image. In particular, when the entire HDR image is relatively dark, y_max will be relatively small, so that the gamma value is relatively large, and Y will be increased more; and when the HDR image is a relatively bright image, the value of y_max is close to 255, at this time the value of gamma will tend to 1, and the image will basically not change.

[0095] S505: Generate a target HDR image for video playback based on target brightness information of the second pixel in the HDR image.

[0096] In the embodiment of the present application, the UV channel of the YUV image converted from the HDR image remains unchanged, a Y′UV image is synthesized, and then the Y′UV image is converted into an RGB image to obtain a target HDR image to be rendered. The target HDR image is used for rendering to realize video playback in HDR mode.

[0097] In the embodiment of the present application, the method of synthesizing the Y′UV image without changing the UV channel in the YUV image may be to update the brightness information of the second pixel in the YUV image to the target brightness information of the second pixel to obtain the Y′UV image.

[0098] The method of converting a YUV image to an RGB image can be found in the following formula 4:

[0099] R=Y+1.140×V

[0100] G=Y-0.394×U-0.581×V

[0101] B=Y+2.032×U

[0102] After converting the Y′UV image into an RGB image, a target HDR image is obtained, and the target HDR image is an image used for rendering to achieve video playback. The video application provided in the embodiment of the present application can achieve video playback in HDR mode by rendering the target HDR image.

[0103] An image processing method provided in an embodiment of the present application can not only perform HDR processing on an image in a video to be played to generate an HDR image to improve the contrast of the image, but also can further perform brightness processing on the HDR image to achieve adaptive adjustment of the brightness of pixels in the HDR image, reduce the impact of HDR processing on image brightness, and further improve image display effects.

[0104] The new HDR algorithm proposed by the inventor of the present application is used to process an image to generate an HDR image. The new HDR algorithm proposed by the inventor of the present application is described in detail from the perspective of performing HDR processing on an image to generate an HDR image. For details, please refer to Figure 6 .

[0105] like Figure 6 As shown, the method includes:

[0106] S601, normalizing the channel value of each pixel in the image in each of the three RGB channels to obtain the first channel value of each pixel in the image in each channel;

[0107] In the embodiment of the present application, the resolution of the image to be processed by HDR is not less than 1080p Blu-ray. The above is only the preferred image format of the image to be processed by HDR provided in the embodiment of the present application. The inventor can set the specific image format of the image to be processed by HDR according to his own needs, and it is not limited here.

[0108] Get the RGB information of each pixel in the image and normalize it to [0,1]. Specifically, get the RGB information of all pixels in the image, and normalize the RGB information of each pixel in the image. Take the RGB information of a pixel as an example. The RGB information of the pixel includes the channel value of the pixel in the R channel, the channel value of the pixel in the G channel, and the channel value of the pixel in the B channel. The channel value of the pixel in the R channel is normalized to obtain the first channel value of the pixel in the R channel, the channel value of the pixel in the G channel is normalized to obtain the first channel value of the pixel in the G channel, and the channel value of the pixel in the B channel is normalized to obtain the first channel value of the pixel in the B channel.

[0109] For example, the RGB information of pixel 1 in the image is 10, 255, 50; then the RGB information of pixel 1 is normalized as 10 / 255, 255 / 255, 50 / 255, that is, the first channel value of pixel 1 in the R channel is 2 / 51, the first channel value of pixel 1 in the G channel is 1, and the first channel value of pixel 1 in the B channel is 10 / 51.

[0110] S602, based on the first channel value of each pixel in each channel of the image, convert each channel in the three RGB channels of the image from the Gamma space to the linear space;

[0111] In the embodiment of the present application, for each pixel in the image, the first channel value of the pixel in each channel is converted from the gamma space to the linear space. Taking the first channel value of a pixel in a channel as an example, the first channel value of the pixel in the channel is converted from the gamma space to the linear space using Formula 5. Formula 5 is as follows:

[0112]

[0113]

[0114] Among them, color0 is the first channel value of the pixel in the channel; color1 is the channel value of the pixel in the channel in the linear space.

[0115] Combined with the above formula five, it can be known that when the first channel value of the pixel in the channel is less than or equal to 0.04045, the first channel value of the pixel in the channel is divided by 12.92 to obtain the channel value of the pixel in the channel in the linear space; when the first channel value of the pixel in the channel is greater than 0.04045, the sum of the first channel value of the pixel in the channel and 0.055 is calculated as the first result, the first result is divided by 1.055 to obtain the second result, and the result calculated with 2.4 as the exponent of the second result is used as the channel value of the pixel in the channel in the linear space.

[0116] S603, processing the channel value of each pixel of the image in the linear space in each channel to obtain the second channel value of each pixel of the image in the linear space in each channel;

[0117] Step S603 is the key to the HDR algorithm, and its main purpose is to improve the contrast of the image. Step S603 can be implemented by formula six.

[0118] Formula 6 is as follows:

[0119] color2=hdrmode×(color1 / hdrmode) hdrGamma , where color2 is the second channel value, hdrmode and hdrGamma are two parameters used to adjust the contrast of the image. When hdrmode=1, hdrGamma=1, the output image is the same as the original image. Obviously, since color1<1, when hdrGamma>1, the image contrast decreases, and when hdrGamma<1, the image contrast increases.

[0120] In the formula 6 of the present application embodiment, hdrmode=1.5857, hdrGamma=1.24. The above are only the preferred contents of the two parameters hdrmode and hdrGamma in the formula 6 provided in the present application embodiment. The inventors can set the specific contents of the two parameters according to their own needs and are not limited here.

[0121] In the embodiment of the present application, based on Formula 6, the channel value of each pixel of the image in the linear space in each channel is converted into a second channel value, so as to achieve the purpose of improving the contrast of the image.

[0122] Taking the channel value of a pixel of an image in a linear space in a channel as an example, the channel value of the pixel of the image in the linear space in the channel is calculated using Formula 6 to obtain the second channel value of the pixel of the image in the channel in the linear space.

[0123] S604, converting the image from linear space to Gamma space;

[0124] In the embodiment of the present application, for each pixel of the image in the linear space, the second channel value of each channel is calculated by Formula 7 to achieve the purpose of converting the image from the linear space to the Gamma space.

[0125] Formula 7 is as follows:

[0126] color3=12.92×color2,color2≤0.0031308;

[0127] color3=1.055×color2 1.0 / 2.4 -0.055,color2>0.0031308;

[0128] Combined with Formula 7, we can know that taking the second channel value of a pixel of an image in a linear space as an example, if the second channel value of the pixel in the channel is less than or equal to 0.0031308, the second channel value is multiplied by 12.92; if the second channel value of the pixel in the channel is greater than 0.0031308, 1.055*pow(color2, 1.0 / 2.4)-0.055 is output.

[0129] S605: Map the image in the Gamma space into an HDR image.

[0130] The channel values ​​of each RGB channel of the image in the Gamma space are multiplied by 1.2 and mapped to the range of [0,255] to generate a new image. For the sake of distinction, the generated new image is called an HDR image.

[0131] Formula 8: color4=1.2×color3×255

[0132] After the image is converted from the linear space to the Gamma space, the channel value of each channel for each pixel of the image in the Gamma space is calculated by Formula 8 to convert the image into an HDR image.

[0133] Through the above Figure 6 From the analysis, we can see that: when the image input is less than 10, the output is 0, when the image input is around 130, the input and output are equal; when the image input exceeds 230, the output has reached 255.

[0134] See also Figure 7 As shown in the figure, the curve corresponding to the adaptive algorithm represents the case where the input and output are equal, and the curve corresponding to the online algorithm represents the above Figure 6The image generated by the steps shown in the figure is as follows. It should be noted that the input of the image can be considered as the channel value of the pixel in the channel in the image, and the output of the image can be considered as the channel value of the pixel in the channel in the image after the channel value is converted into the channel value. Figure 6 The result obtained after the HDR processing method is shown in the figure. As can be seen from the above figure, for dark scenes, the image brightness is low, and the HDR image obtained by using the online algorithm (also called the online HDR algorithm) will be darker. The image processing algorithm is required to adaptively adjust the pixel brightness of the HDR image. For images in relatively dark scenes, the image brightness is improved after the image processing method is used.

[0135] The embodiment of the present application provides an image processing method, which can not only perform HDR processing on an image to enhance the image contrast, but also analyze the brightness information of the HDR image, increase the brightness information of the dark area in the image, and reduce the brightness information of the very bright area in the image, so as to improve the viewing experience. Figure 8-9 These are examples of two dark scenes. The entire image is divided into three equal parts. The left part is the original image, the middle area is the processing result of the original image based on an image processing method provided in an embodiment of the present application, and the right area is the processing result of the original image based on the existing HDR technology.

[0136] from Figure 8-9 From the two examples, it can be seen that when the original image shows a dark scene, the brightness of the original image processed by the existing HDR technology on the right side will be lower than that of the original image, causing more areas to be unclear. Using an image processing method provided in an embodiment of the present application, the brightness information of the image can be improved, so that the darker the image, the more the brightness is improved; and for images close to normal brightness scenes, the correction range of formula 6 of an image brightness processing method provided in an embodiment of the present application is limited, and the actual effect after correction is closer to normal brightness scenes.

[0137] Fig.10 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application.

[0138] like Fig.10 As shown, the device comprises:

[0139] The HDR processing unit 1001 is used to determine an HDR image generated by performing high dynamic range HDR processing on an image in a video to be played;

[0140] A first pixel determining unit 1002 is used to determine, from all pixels of the HDR image, a first pixel whose brightness information represents a standard brightness of the HDR image;

[0141] a brightness adjustment information determining unit 1003, configured to compare brightness information of a second pixel in the HDR image with brightness information of the first pixel to determine brightness adjustment information of the second pixel, the second pixel being different from the first pixel;

[0142] A brightness adjustment unit 1004, configured to perform nonlinear processing on the brightness information of the second pixel using the brightness adjustment information of the second pixel with the brightness information approaching the brightness information of the first pixel as a target to obtain target brightness information of the second pixel;

[0143] The target HDR image generating unit 1005 is used to generate a target HDR image for video playback based on the target brightness information of the second pixel in the HDR image.

[0144] In the embodiment of the present application, preferably, the first pixel determination unit includes:

[0145] A brightness information calculation unit, used to calculate the brightness information of each pixel in the HDR image respectively, where the brightness information of the pixel is the brightness value of the pixel;

[0146] A pixel sequence generating unit is used to sequentially sort all pixels in the HDR image according to brightness values ​​to generate a pixel sequence, wherein the brightness values ​​of two adjacent pixels in the pixel sequence meet a preset sorting rule;

[0147] The first pixel determination subunit is used to determine a selection rule that matches the sorting rule, and obtain a first pixel at a target position in the pixel sequence indicated by the selection rule, wherein the brightness value of the first pixel represents a standard brightness of the HDR image.

[0148] In the embodiment of the present application, preferably, the brightness adjustment information determining unit includes:

[0149] a comparison result generating unit, configured to compare a brightness value of a second pixel of the HDR image with a brightness value of the first pixel to generate a comparison result of the second pixel;

[0150] a first determining unit, configured to determine, if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, that first brightness adjustment information generated using the brightness value of the first pixel is the brightness adjustment information of the second pixel;

[0151] The second determining unit is configured to determine the preset second brightness adjustment information as the brightness adjustment information of the second pixel if the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel.

[0152] In the embodiment of the present application, preferably, the brightness adjustment unit includes:

[0153] A first brightness value generating unit, configured to normalize the brightness value of the second pixel to generate a first brightness value of the second pixel;

[0154] A second brightness value generating unit, configured to generate a second brightness value of the second pixel by performing nonlinear processing on the first brightness value of the second pixel based on the brightness adjustment information of the second pixel with the goal of approaching the brightness value of the first pixel;

[0155] A third brightness value generating unit, configured to perform a denormalization process on the second brightness value of the second pixel to generate a third brightness value of the second pixel;

[0156] The brightness adjustment subunit is used to determine target brightness information of the second pixel by using the third brightness value of the second pixel in combination with the comparison result of the second pixel.

[0157] In the embodiment of the present application, preferably, the brightness adjustment subunit includes:

[0158] a first brightness adjustment unit, configured to determine a third brightness value of the second pixel as target brightness information of the second pixel if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel;

[0159] a judging unit, configured to judge whether a third brightness value of the second pixel is less than the brightness value of the first pixel if the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel;

[0160] a second brightness adjustment unit, configured to determine the brightness value of the first pixel as target brightness information of the second pixel if the third brightness value of the second pixel is less than the brightness value of the first pixel;

[0161] The third brightness adjustment unit is configured to determine the third brightness value of the second pixel as target brightness information of the second pixel if the third brightness value of the second pixel is not less than the brightness value of the first pixel.

[0162] In the embodiment of the present application, preferably, the second brightness value generating unit is specifically used to perform nonlinear processing on the first brightness value of the second pixel with the first brightness value of the second pixel as the base and the brightness adjustment information of the second pixel as the exponent to generate the second brightness value of the second pixel.

[0163] Among them, if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, the brightness adjustment information of the second pixel is greater than 0 and less than 1; if the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel, the brightness adjustment information of the second pixel is greater than 1.

[0164] In an embodiment of the present application, preferably, the target HDR image generation unit is specifically used to update the brightness information of the second pixel in the HDR image to the target brightness information of the second pixel to obtain a target HDR image to be rendered, and the target HDR image is used to be rendered for video playback.

[0165] The present application provides an image processing device, which can perform HDR processing on an image of a video to be played to generate an HDR image to improve the contrast of the image, obtain a first pixel in the HDR image that represents the standard brightness of the HDR image, and based on the brightness information of the first pixel, perform nonlinear adaptive adjustment on the brightness information of second pixels other than the first pixel in the HDR image to generate a target HDR image, so as to reduce the impact on the display effect of the HDR image caused by the HDR processing, which makes the dark areas in the HDR image darker and the bright areas brighter.

[0166] Furthermore, an embodiment of the present application also provides an electronic device, which is used to execute an image processing method provided in an embodiment of the present application. The electronic device may be a terminal or a server.

[0167] Fig.11 A hardware structure block diagram of a terminal to which an image processing method provided in an embodiment of the present application is applicable.

[0168] like Fig.11 The terminal shown may include: a processor 1101 , a memory 1102 , a communication interface 1103 , an input unit 1104 , a display 1105 , and a communication bus 1106 .

[0169] The memory 1102 is used to store one or more programs. The program may include program code, and the program code includes computer operation instructions. In the embodiment of the present invention, the memory at least stores a program for implementing the following functions:

[0170] Determine an HDR image generated by performing high dynamic range (HDR) processing on an image in a video to be played;

[0171] Determine, from all pixels of the HDR image, a first pixel whose brightness information represents a standard brightness of the HDR image;

[0172] comparing brightness information of a second pixel in the HDR image with brightness information of the first pixel to determine brightness adjustment information of the second pixel, the second pixel being different from the first pixel;

[0173] With the brightness information of the second pixel being close to the brightness information of the first pixel as a target, nonlinear processing is performed on the brightness information of the second pixel using the brightness adjustment information of the second pixel to obtain the target brightness information of the second pixel;

[0174] A target HDR image for video playback is generated based on target brightness information of a second pixel in the HDR image.

[0175] That is, the program stored in the memory is used to implement the image processing method provided by the above embodiment.

[0176] Optionally, the detailed and extended functions of the program may refer to the above description.

[0177] The processing module 1101 , the memory 1102 , the communication interface 1103 , the input unit 1104 , and the display 1105 all communicate with each other via the communication bus 1106 .

[0178] In the embodiment of the present invention, the processor 1101 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, etc.

[0179] The processor may call and execute the program stored in the memory 1102 .

[0180] The communication interface 1103 may be an interface of a communication module, such as an interface of a GSM module.

[0181] The present invention may further include an input unit 1104, which may include a touch sensing unit for sensing a touch event on the touch display panel, a keyboard, and the like.

[0182] The display 1105 includes a display panel, such as a touch display panel, etc. In a possible case, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0183] certainly, Fig.11 The terminal structure shown does not constitute a limitation on the terminal in the embodiment of the present invention. In actual applications, the terminal may include Fig.11 More or fewer components than shown, or combinations of certain components.

[0184] Fig.12 This is a hardware structure diagram of a server to which an image processing method provided in an embodiment of the present application is applicable. Fig.12, the hardware structure of the server may include: a processor 121, a communication interface 122, a memory 123 and a communication bus 124;

[0185] In the embodiment of the present invention, the number of the processor 121, the communication interface 122, the memory 123, and the communication bus 124 may be at least one, and the processor 121, the communication interface 122, and the memory 123 communicate with each other through the communication bus 124;

[0186] The processor 121 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;

[0187] The memory 123 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0188] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to:

[0189] Determine an HDR image generated by performing high dynamic range (HDR) processing on an image in a video to be played;

[0190] Determine, from all pixels of the HDR image, a first pixel whose brightness information represents a standard brightness of the HDR image;

[0191] comparing brightness information of a second pixel in the HDR image with brightness information of the first pixel to determine brightness adjustment information of the second pixel, the second pixel being different from the first pixel;

[0192] With the brightness information of the second pixel being close to the brightness information of the first pixel as a target, nonlinear processing is performed on the brightness information of the second pixel using the brightness adjustment information of the second pixel to obtain the target brightness information of the second pixel;

[0193] A target HDR image for video playback is generated based on target brightness information of a second pixel in the HDR image.

[0194] Optionally, the detailed and extended functions of the program may refer to the above description.

[0195] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used to execute the above-mentioned image processing method.

[0196] Optionally, the detailed functions and extended functions of the computer executable instructions may refer to the above description.

[0197] The present application provides an image processing method, device, electronic device and storage medium, which perform HDR processing on an image of a video to be played to generate an HDR image to improve the contrast of the image, obtain a first pixel in the HDR image that represents the standard brightness of the HDR image, and based on the brightness information of the first pixel, perform nonlinear adaptive adjustment on the brightness information of second pixels other than the first pixel in the HDR image to generate a target HDR image, so as to reduce the impact on the display effect of the HDR image caused by the HDR processing, which makes the dark areas in the HDR image darker and the bright areas brighter.

[0198] The above is a detailed introduction to an image processing method, device, server and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a person skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0199] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0200] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device that includes a series of elements is inherent to the elements, or also includes elements inherent to these processes, methods, articles or devices. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.

[0201] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image processing method, It is characterized in that include: Determine an HDR image generated by performing high dynamic range (HDR) processing on an image in a video to be played; Calculating the brightness information of each pixel in the HDR image respectively, where the brightness information of the pixel is the brightness value of the pixel; Sorting all pixels in the HDR image in sequence according to brightness values ​​to generate a pixel sequence, wherein the brightness values ​​of two adjacent pixels in the pixel sequence satisfy a preset sorting rule; Determine a selection rule that matches the sorting rule, determine the product of the number of pixels in the pixel sequence and the ratio indicated by the selection rule, and determine a first pixel located at a target position in the pixel sequence according to the product result, wherein the brightness value of the first pixel represents the standard brightness of the HDR image; Comparing brightness information of a second pixel in the HDR image with brightness information of the first pixel to determine brightness adjustment information of the second pixel, the second pixel being different from the first pixel; Normalizing the brightness value of the second pixel to generate a first brightness value of the second pixel; With the goal of approaching the brightness value of the first pixel, based on the brightness adjustment information of the second pixel, nonlinearly process the first brightness value of the second pixel to generate a second brightness value of the second pixel; performing a denormalization process on the second brightness value of the second pixel to generate a third brightness value of the second pixel; determining target brightness information of the second pixel by using a third brightness value of the second pixel in combination with the comparison result of the second pixel; The brightness information of the second pixel in the HDR image is updated to the target brightness information of the second pixel to obtain a target HDR image to be rendered, where the target HDR image is used to be rendered for video playback.

2. The method according to claim 1, It is characterized in that The comparing brightness information of a second pixel in the HDR image with the brightness information of the first pixel to determine brightness adjustment information of the second pixel, where the second pixel is different from the first pixel, includes: Comparing a brightness value of a second pixel of the HDR image with a brightness value of the first pixel to generate a comparison result of the second pixel; If the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, determining first brightness adjustment information generated by using the brightness value of the first pixel as the brightness adjustment information of the second pixel; If the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel, the preset second brightness adjustment information is determined as the brightness adjustment information of the second pixel.

3. The method according to claim 1, It is characterized in that The determining target brightness information of the second pixel by using the third brightness value of the second pixel in combination with the comparison result of the second pixel includes: If the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, determining the third brightness value of the second pixel as the target brightness information of the second pixel; If the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel, determining whether a third brightness value of the second pixel is less than the brightness value of the first pixel; If the third brightness value of the second pixel is less than the brightness value of the first pixel, determining the brightness value of the first pixel as the target brightness information of the second pixel; If the third brightness value of the second pixel is not less than the brightness value of the first pixel, the third brightness value of the second pixel is determined as the target brightness information of the second pixel.

4. The method according to claim 1, It is characterized in that The step of performing nonlinear processing on the first brightness value of the second pixel based on the brightness adjustment information of the second pixel with the goal of approaching the brightness value of the first pixel to generate the second brightness value of the second pixel includes: Taking the first brightness value of the second pixel as the base and the brightness adjustment information of the second pixel as the exponent, performing nonlinear processing on the first brightness value of the second pixel to generate a second brightness value of the second pixel; Among them, if the comparison result of the second pixel represents that the brightness value of the second pixel is less than the brightness value of the first pixel, the brightness adjustment information of the second pixel is greater than 0 and less than 1; if the comparison result of the second pixel represents that the brightness value of the second pixel is greater than the brightness value of the first pixel, the brightness adjustment information of the second pixel is greater than 1.

5. An image processing device, It is characterized in that include: An HDR processing unit, used for determining an HDR image generated by performing high dynamic range HDR processing on an image in the video to be played; A first pixel determining unit, configured to determine, from all pixels of the HDR image, a first pixel whose brightness information represents a standard brightness of the HDR image; a brightness adjustment information determining unit, configured to compare brightness information of a second pixel in the HDR image with the brightness information of the first pixel to determine brightness adjustment information of the second pixel, the second pixel being different from the first pixel; a brightness adjustment unit, configured to perform nonlinear processing on the brightness information of the second pixel using the brightness adjustment information of the second pixel with the brightness information approaching the brightness information of the first pixel as a target to obtain the target brightness information of the second pixel; a target HDR image generating unit, configured to update the brightness information of the second pixel in the HDR image to the target brightness information of the second pixel to obtain a target HDR image to be rendered, wherein the target HDR image is used to be rendered for video playback; The first pixel determination unit includes: A brightness information calculation unit, used to calculate the brightness information of each pixel in the HDR image respectively, where the brightness information of the pixel is the brightness value of the pixel; A pixel sequence generating unit is used to sequentially sort all pixels in the HDR image according to brightness values ​​to generate a pixel sequence, wherein the brightness values ​​of two adjacent pixels in the pixel sequence meet a preset sorting rule; a first pixel determination subunit, configured to determine a selection rule matching the sorting rule, determine a product of the number of pixels in the pixel sequence and the ratio indicated by the selection rule, and determine a first pixel located at a target position in the pixel sequence according to the product result, wherein a brightness value of the first pixel represents a standard brightness of the HDR image; The brightness adjustment unit comprises: A first brightness value generating unit, configured to normalize the brightness value of the second pixel to generate a first brightness value of the second pixel; A second brightness value generating unit, configured to generate a second brightness value of the second pixel by performing nonlinear processing on the first brightness value of the second pixel based on the brightness adjustment information of the second pixel with the goal of approaching the brightness value of the first pixel; A third brightness value generating unit, configured to perform a denormalization process on the second brightness value of the second pixel to generate a third brightness value of the second pixel; The brightness adjustment subunit is used to determine target brightness information of the second pixel by using the third brightness value of the second pixel in combination with the comparison result of the second pixel.

6. The device according to claim 5, It is characterized in that The brightness adjustment information determining unit comprises: a comparison result generating unit, configured to compare a brightness value of a second pixel of the HDR image with a brightness value of the first pixel to generate a comparison result of the second pixel; a first determining unit, configured to determine, if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, that first brightness adjustment information generated using the brightness value of the first pixel is the brightness adjustment information of the second pixel; The second determining unit is configured to determine the preset second brightness adjustment information as the brightness adjustment information of the second pixel if the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel.

7. The device according to claim 5, It is characterized in that The brightness adjustment subunit comprises: a first brightness adjustment unit, configured to determine a third brightness value of the second pixel as target brightness information of the second pixel if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel; a judging unit, configured to judge whether a third brightness value of the second pixel is less than the brightness value of the first pixel if the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel; a second brightness adjustment unit, configured to determine the brightness value of the first pixel as target brightness information of the second pixel if the third brightness value of the second pixel is less than the brightness value of the first pixel; The third brightness adjustment unit is used to determine the third brightness value of the second pixel as the target brightness information of the second pixel if the third brightness value of the second pixel is not less than the brightness value of the first pixel.

8. The device according to claim 5, It is characterized in that The second brightness value generating unit is specifically configured to perform nonlinear processing on the first brightness value of the second pixel by taking the first brightness value of the second pixel as a base and the brightness adjustment information of the second pixel as an exponent to generate a second brightness value of the second pixel; Among them, if the comparison result of the second pixel indicates that the brightness value of the second pixel is less than the brightness value of the first pixel, the brightness adjustment information of the second pixel is greater than 0 and less than 1; if the comparison result of the second pixel indicates that the brightness value of the second pixel is greater than the brightness value of the first pixel, the brightness adjustment information of the second pixel is greater than 1.

9. An electronic device, It is characterized in that include: A processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program, and the program is used to implement the image processing method according to any one of claims 1 to 4.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the image processing method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Image enhancing method and device

    CN103971330A

  • Image effect improving method and apparatus

    CN106210921A

  • High dynamic range image composition using multiple images

    CN106797437A

  • Video signal processing method and device

    CN108900823A

  • Image brightness adjustment method and device, storage medium and electronic device

    CN110120021A