Image processing method and device, electronic equipment and storage medium
By obtaining reference brightness values and determining target mapping relationships for tone mapping, the problem of brightness differences in HDR videos under different display windows is solved, ensuring consistent display effects and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2024-12-12
- Publication Date
- 2026-06-12
AI Technical Summary
When HDR videos are displayed in full screen or in a small window, the difference in brightness causes the user to perceive an inconsistent video display effect, affecting the user's visual experience.
By obtaining reference brightness values, the target mapping relationship is determined, and tone mapping is performed based on grayscale parameters and brightness parameters to ensure that the display effect of video frames is consistent in different display windows.
It ensures consistent display across different window sizes, avoiding noticeable brightness changes and enhancing the user's visual experience.
Smart Images

Figure CN122201157A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to an image processing method, apparatus, electronic device and storage medium. Background Technology
[0002] High-Dynamic Range (HDR) video is increasingly widely used due to its advantages such as higher dynamic range, richer color reproduction, and higher resolution. However, due to the display characteristics of terminal devices, there will be a certain brightness difference when HDR video is displayed in full screen and in a small window, resulting in different perceived video display effects for users. Inconsistent display effects of the same video on the same terminal device can affect the user's visual experience. Summary of the Invention
[0003] To overcome the problems existing in related technologies, this disclosure provides an image processing method, apparatus, electronic device, and storage medium.
[0004] According to a first aspect of the present disclosure, an image processing method is provided, the method comprising:
[0005] When displaying the target video in the first area, a reference brightness value is obtained, which represents the current screen display brightness value;
[0006] Determine the target mapping relationship corresponding to the reference brightness value, wherein the target mapping relationship characterizes the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the reference brightness value;
[0007] The brightness parameter of the first image is determined based on the grayscale parameters of the first image and the target mapping relationship, wherein the first image is any video frame in the target video;
[0008] Based on the brightness parameters of the first image, tone mapping is performed on the first image.
[0009] In an exemplary embodiment, the grayscale parameters of the first image include a first grayscale value and a second grayscale value, wherein both the first grayscale value and the second grayscale value are statistical values of the grayscale values of all pixels in the first image, and the first grayscale value and the second grayscale value are different; determining the brightness parameters of the first image based on the grayscale parameters of the first image and the target mapping relationship includes:
[0010] Based on the first grayscale value and the target mapping relationship, a first brightness value is determined;
[0011] The second brightness value is determined based on the second grayscale value and the target mapping relationship;
[0012] The step of performing tone mapping on the first image based on the brightness parameters of the first image includes:
[0013] The first image is tone-mapped based on the first brightness value and the second brightness value.
[0014] In an exemplary embodiment, the step of performing tone mapping on the first image based on the first brightness value and the second brightness value includes:
[0015] Based on the first brightness value, determine the first hue mapping curve;
[0016] Determine the second hue mapping curve based on the second brightness value;
[0017] Determine the target tone mapping curve based on the first tone mapping curve and the second tone mapping curve;
[0018] The first image is tone-mapped according to the target tone mapping curve.
[0019] In an exemplary embodiment, the step of performing tone mapping on the first image based on the first brightness value and the second brightness value includes:
[0020] Determine the target gamma value based on the target mapping relationship;
[0021] The first image is tone-mapped based on the first brightness value, the second brightness value, and the target gamma value.
[0022] In one exemplary embodiment, obtaining the reference brightness value includes:
[0023] When the target video meets the preset conditions, the reference brightness value is obtained, whereby the preset conditions indicate that the change in the display brightness of the target video exceeds a brightness threshold.
[0024] In one exemplary embodiment, the preset condition includes at least one of the following:
[0025] The display area of the target video is switched from the second area to the first area, and the absolute value of the difference between the size of the first area and the size of the second area is greater than a first threshold.
[0026] The absolute value of the difference between the grayscale parameters of the first image and the grayscale parameters of the second image is greater than a second threshold, the second image is a historical video frame of the first image in the target video, and the second image is spaced apart from the first image by a preset time interval.
[0027] In an exemplary embodiment, determining the target mapping relationship corresponding to the reference brightness value includes:
[0028] If the reference brightness value is the same as the first preset brightness value among a plurality of preset brightness values, the preset mapping relationship corresponding to the first preset brightness value is taken as the target mapping relationship;
[0029] If the reference brightness value is different from all of the plurality of preset brightness values, the target mapping relationship is determined according to the preset mapping relationship corresponding to the second preset brightness value, wherein the absolute value of the difference between the second preset brightness value and the reference brightness value is the smallest.
[0030] In one exemplary embodiment, the method further includes:
[0031] Based on the grayscale parameters of the target image displayed in the third region and the target mapping relationship, the brightness parameters of the target image are determined, wherein the third region is the region in the display screen other than the first region;
[0032] Based on the brightness parameters of the target image, tone mapping is performed on the target image.
[0033] According to a second aspect of the present disclosure, an image processing apparatus is provided, the apparatus comprising:
[0034] The acquisition module is configured to acquire a reference brightness value when the target video is displayed in the first area, the reference brightness value representing the current screen display brightness value;
[0035] The first determining module is configured to determine the target mapping relationship corresponding to the reference brightness value, wherein the target mapping relationship characterizes the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the reference brightness value;
[0036] The second determining module is configured to determine the brightness parameter of the first image based on the grayscale parameter of the first image and the target mapping relationship, wherein the first image is any video frame in the target video;
[0037] The processing module is configured to perform tone mapping on the first image based on the brightness parameters of the first image.
[0038] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0039] processor;
[0040] Memory used to store processor-executable instructions;
[0041] The processor is configured to perform the method described in the first aspect of the embodiments of this disclosure.
[0042] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method described in the first aspect of the present disclosure.
[0043] The method described above has the following advantages: the method determines the brightness parameter by adapting to the actual grayscale parameter of the current first region, so that the brightness parameter is adapted to the size of the current real-time display window. By performing tone mapping on each video frame in real time through the brightness parameter, it can ensure that the display effect of the target video remains consistent under different display window sizes, avoid users perceiving obvious brightness changes when switching display window sizes, and improve the user's visual experience when watching the target video.
[0044] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0045] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0046] Figure 1 This is a schematic diagram illustrating an HDR video display according to an exemplary embodiment;
[0047] Figure 2 This is a flowchart illustrating an image processing method according to an exemplary embodiment;
[0048] Figure 3 This is a schematic diagram illustrating an HDR video display process according to an exemplary embodiment;
[0049] Figure 4 This is a flowchart illustrating an image processing method according to an exemplary embodiment;
[0050] Figure 5 This is a schematic diagram illustrating a tone mapping process according to an exemplary embodiment;
[0051] Figure 6 This is a schematic diagram illustrating an HDR video display according to an exemplary embodiment;
[0052] Figure 7 This is a block diagram illustrating an image processing apparatus according to an exemplary embodiment;
[0053] Figure 8 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0054] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0055] In some embodiments, in order to accurately restore the original brightness information of the HDR video, a tone mapping (TM) curve is used to tone map the HDR video when displaying it. This can achieve an HDR display effect that fits the standard (Perceptual Quantizer, PQ) curve based on perceptual quantizer, making the HDR video more in line with the characteristics of human visual perception.
[0056] In related technologies, the formula for generating a tone mapping curve is expressed as: TM_Curve = func(PQ, max_brightness, gamma), where TM_Curve represents the tone mapping curve, PQ represents the PQ curve, max_brightness represents the maximum display brightness value of the video image, which changes with the ambient light or the displayed content, and gamma represents the gamma value of the screen, which is used to indicate the relationship between the grayscale and brightness of the image displayed on the screen. The gamma value is usually 2.2.
[0057] Under the premise that ambient light and displayed content remain unchanged, theoretically the maximum display brightness value of the video image will not change, and therefore the video display effect will not change. However, when the display window of an HDR video is enlarged or shrunk, the proportion of white screen changes, causing the user's perceived maximum display brightness value of the video image to actually change. For example, the brightness of a 50% white screen proportion is lower than that of a 10% white screen proportion. If the tone mapping curve is still generated using the unchanged maximum display brightness value of the video image, then using the tone mapping curve in related technologies to tone map HDR videos cannot guarantee the consistency of HDR video display effects under different display window sizes. For example, Figure 1 This is a schematic diagram illustrating an HDR video display according to an exemplary embodiment, such as... Figure 1As shown, tone mapping curves from related technologies are used to tone map HDR videos. The left image represents a full-screen display of an HDR video, while the right image represents a partial window display of an HDR video. It can be seen that the display brightness of the same HDR video image differs between full-screen and partial window displays, resulting in different perceived display effects for the user. When the user switches from full-screen to partial window display, or vice versa, the user can perceive a significant change in display brightness, affecting the user's video viewing experience.
[0058] In an exemplary embodiment of this disclosure, to overcome the problem of inconsistent display effects of the same video in different windows in related technologies, an image processing method is provided, comprising: when displaying a target video in a first area, obtaining a reference brightness value, the reference brightness value representing the current screen display brightness value; determining a target mapping relationship corresponding to the reference brightness value, the target mapping relationship representing the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the reference brightness value; determining the brightness parameters of a first image based on the grayscale parameters of the first image and the target mapping relationship, the first image being any video frame in the target video; and performing tone mapping on the first image based on the brightness parameters of the first image. This method determines the brightness parameters by adapting to the actual grayscale parameters of the current first area, so that the brightness parameters simultaneously adapt to the size of the current real-time display window. By performing tone mapping on each video frame in real time using the brightness parameters, it can ensure that the display effect of the target video remains consistent under different display window sizes, avoiding noticeable brightness changes when the user switches display window sizes, and improving the user's visual experience when watching the target video.
[0059] In an exemplary embodiment of this disclosure, an image processing method is provided. Figure 2 This is a flowchart illustrating an image processing method according to an exemplary embodiment, such as... Figure 2 As shown, it includes the following steps:
[0060] Step S201: When displaying the target video in the first area, obtain a reference brightness value, which represents the current screen display brightness value;
[0061] Step S202: Determine the target mapping relationship corresponding to the reference brightness value. The target mapping relationship represents the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the reference brightness value.
[0062] Step S203: Determine the brightness parameters of the first image based on the grayscale parameters of the first image and the target mapping relationship. The first image is any video frame in the target video.
[0063] Step S204: Perform tone mapping on the first image based on the brightness parameters of the first image.
[0064] The image processing method in this disclosure is applied to electronic devices, including smartphones, tablets, smart vehicle systems, smart wearable devices, smart IoT devices, smart screens, and other electronic devices with HDR video display capabilities.
[0065] In some embodiments, the video display includes two display modes: HDR display mode and Standard Dynamic Range (SDR) display mode. The brightness and grayscale ranges are different in the different display modes. The maximum display brightness in HDR display mode is higher than that in SDR display mode. The maximum display brightness in SDR display mode is usually in the range of 100 nits to 500 nits, while the maximum display brightness in HDR display mode is higher than or even much higher than 500 nits. The grayscale range in HDR display mode is usually 0 to 255 grayscale levels, while the grayscale range in SDR display mode is usually 0 to 1023 grayscale levels.
[0066] In step S201, the first region is the display area where the target video's current display window is located. This can be any area on the display screen, such as the area where the floating window or small window is located in floating window or small window mode. If the target video is an HDR video, and the reference brightness value is the screen display brightness of the electronic device when displaying the HDR video, then the reference brightness value is the brightness value in HDR display mode. The reference brightness value is independent of the displayed content and is adaptively set based on ambient light, or manually set by the user. Under the reference brightness value, the display brightness of the target video is related to the video content; the higher the grayscale value of the video content, the higher the display brightness of the video content. However, the maximum allowable display brightness of the video content is the reference brightness value. In one example, the current screen display brightness value, i.e., the reference brightness value, is obtained by reading the current backlight node of the electronic device screen.
[0067] In step S202, multiple preset mapping relationships are pre-stored in the electronic device. The representation of these preset mapping relationships is unrestricted; they can be preset mapping tables, preset mapping expressions, or algorithms. Each preset mapping relationship represents the mapping relationship between the grayscale parameters and brightness parameters of an image under a preset screen display brightness. The mapping relationship between the grayscale parameters and brightness parameters differs depending on the preset screen display brightness. The preset screen display brightness is the brightness value in HDR display mode, and the image brightness parameter is also the brightness value in HDR display mode. The image grayscale parameters can be grayscale values in HDR display mode or grayscale values in SDR display mode. The number of preset mapping relationships is the same as the number of preset screen display brightness values. The number of preset screen display brightness values can be determined according to actual needs. The more preset screen display brightness values there are, the larger the range covered by the preset mapping relationships, making it easier to match the current screen display brightness, i.e., the reference brightness value, thus making the final calculation result more accurate. For example, the preset screen display brightness includes three values: 800 nits, 1200 nits, and 1600 nits.
[0068] The target mapping relationship is the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the reference brightness value. The target mapping relationship can be determined by selecting the preset screen display brightness that is closest to the current reference brightness value from multiple preset screen display brightness values and then determining the target mapping relationship based on its corresponding preset mapping relationship.
[0069] In step S203, the first image is any video frame in the target video, which is the real-time video frame to be displayed. For example, if the target video includes 10 video frames and the currently displayed video frame is the 6th video frame, then the first image is the 6th video frame. The grayscale parameters of the first image are used to characterize the overall grayscale level of the first image. For example, they are statistical values of the grayscale values of all pixels contained in the first image, including the maximum value of all pixel grayscale values, the average value of all pixel grayscale values, the median value of all pixel grayscale values, etc. The number of grayscale parameters can be determined according to actual needs, and can be one or more. The target mapping relationship is the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the current reference brightness value. The brightness parameters corresponding to the grayscale parameters of the first image are matched from the target mapping relationship, which are the brightness parameters of the first image. Therefore, the number of brightness parameters is the same as the number of grayscale parameters. Since the first image is the real-time video frame to be displayed in the first area, its grayscale parameters are not only adapted to the current ambient light and the currently displayed content, but also to the current real-time display window size. Therefore, the brightness parameters of the first image obtained based on its grayscale parameters are also adapted to the current ambient light, the current displayed content, and the current real-time display window size—that is, the actual brightness parameters displayed in the current video frame. Furthermore, determining the brightness parameters through target mapping relationships and grayscale parameters, compared to calculating the brightness parameters corresponding to grayscale parameters using a conventional gamma value (i.e., 2.2), allows the obtained brightness parameters to better match the hardware brightness characteristics of the current electronic device screen, achieving a more accurate brightness reconstruction effect.
[0070] In step S204, the brightness parameters of the first image are substituted into the tone mapping curve described above. The tone mapping curve corresponding to the first image can then be obtained based on the PQ curve and the gamma value. In one example, when the grayscale parameters of the first image include the maximum grayscale value, the maximum grayscale value is the maximum value of the grayscale values of all pixels in the first image. The brightness parameters of the first image, i.e., the maximum brightness value, are determined based on the maximum grayscale value and the target mapping relationship. The tone mapping curve of the first image is then generated based on the maximum brightness value, the PQ curve, and the gamma value, as shown below:
[0071] TM_Curve_max=func(PQ, Lv_max, gamma)
[0072] Where TM_Curve_max represents the tone mapping curve of the first image, Lv_max represents the maximum brightness value of the first image, PQ represents the PQ curve, and gamma represents the gamma value.
[0073] Then, the brightness of the first image is mapped to the range of brightness that the electronic device can display, using the tone mapping curve corresponding to the first image. In some possible implementations, Figure 3 This is a schematic diagram illustrating an HDR video display process according to an exemplary embodiment, such as... Figure 3 As shown, the display process of HDR video on an electronic device includes several steps: upper-layer decoding, video layer processing, overlay, image layer processing, and screen display. Upper-layer decoding refers to decoding the HDR video. Video layer processing includes HDR content layer processing and user interface (UI) layer processing. The UI layer represents the user interface of the video and does not require special processing; it only needs to be adapted to the display window size. The HDR content layer represents each video frame in the video. Content layer processing is performed in the video processing module and includes Electro-Optical Transfer Function (EOTF) processing, TM processing, and Optical-Electro Transfer Function (OETF) processing. After obtaining the tone mapping curve of the first image, the tone mapping curve of the first image is stored in the video processing module. When performing TM processing on the first image, the tone mapping curve of the first image is used to perform tone mapping. Overlay refers to merging the UI layer and the content layer. After the image processing module processes the merged image, it can be displayed on the screen.
[0074] The tone mapping curve of the first image is calculated using its brightness parameters. By updating the tone mapping curve, tone mapping is performed based on the brightness parameters of the first image. This only requires changing the tone mapping curve of the video frame and does not affect the user interface or other display effects. Furthermore, since the brightness parameters of the first image are adapted to the current first region, the display effect of the first image after tone mapping is also adapted to the current first region, thus ensuring a consistent display effect when the first image is displayed in display windows of different sizes.
[0075] In an exemplary embodiment of this disclosure, a target mapping relationship between the grayscale parameters and the brightness parameters of an image at the reference brightness value is determined based on the reference brightness value when the target video is displayed in the first region. Then, the brightness parameters of the first image are determined based on the grayscale parameters of the first image in the target video and the target mapping relationship. Finally, tone mapping is performed on the first image based on its brightness parameters. This method determines the brightness parameters by adapting them to the actual grayscale parameters of the current first region. This ensures that the brightness parameters adapt to the current ambient light and the current displayed content, while also adapting to the size of the current real-time display window. By performing tone mapping on each video frame in real time using the brightness parameters, the method adapts to display windows of different sizes. This ensures that the display effect of the target video remains consistent across different display window sizes, avoiding noticeable brightness changes when the user switches display window sizes and improving the user's visual experience when watching the target video.
[0076] In an exemplary embodiment of this disclosure, an image processing method is provided. Figure 4 This is a flowchart illustrating an image processing method according to an exemplary embodiment, such as... Figure 4 As shown, it includes the following steps:
[0077] Step S401: When the target video meets the preset conditions, obtain the reference brightness value. The preset conditions indicate that the change in the display brightness of the target video exceeds the brightness threshold.
[0078] Step S402: Determine the target mapping relationship corresponding to the reference brightness value. The target mapping relationship represents the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the reference brightness value.
[0079] Step S403: Determine the first brightness value of the first image based on the first grayscale value of the first image and the target mapping relationship;
[0080] Step S404: Determine the second brightness value of the first image based on the second grayscale value of the first image and the target mapping relationship;
[0081] Step S405: Perform tone mapping on the first image based on the first brightness value and the second brightness value.
[0082] In step S401, since the content of video frames may change every second when watching HDR video, color mapping based on the brightness parameters of each video frame may cause brightness flickering. Therefore, the frequency of color mapping based on the brightness parameters of the current video frame is limited by a preset condition. If the target video meets the preset condition, the brightness parameters of the first image are calculated in real time, and color mapping is performed according to the brightness parameters of the first image, i.e., the subsequent steps of this embodiment are executed; if the target video does not meet the preset condition, it is not necessary to calculate the brightness parameters of the first image in real time and perform color mapping according to the brightness parameters of the first image. Instead, the brightness parameters of the previous video frame of the first image are used for color mapping, i.e., the process of this embodiment ends.
[0083] The preset condition indicates that the change in display brightness of the target video exceeds a brightness threshold. Display brightness refers to the brightness that the user can perceive. The change in display brightness of the target video can be within the same video frame or between different video frames. Since the determination of whether the target video meets the preset condition is performed before tone mapping processing of the video frames, the display brightness cannot be directly obtained. It needs to be indirectly represented by parameters that reflect display brightness, such as the proportion of white space in the video frame or the grayscale value of the video frame. The brightness threshold corresponds to the way display brightness is represented, such as a white space proportion threshold or a grayscale value threshold. The size of the brightness threshold is an empirical value and can be set according to actual needs, for example, using the amount of brightness change that the user can perceive as the brightness threshold.
[0084] In some implementations, the preset conditions include at least one of the following two cases:
[0085] The first method involves switching the display area of the target video from the second area to the first area, where the absolute value of the difference between the size of the first area and the size of the second area is greater than a first threshold.
[0086] The size of the target video's display window affects the proportion of white space in the video frames, thus influencing the target video's display brightness. The absolute value of the difference between the size of the first area and the size of the second area must be greater than a first threshold. This first threshold is an empirical value, used to determine the brightness change in the target video that is perceptible to the user. The display area of the target video switches from the second area to the first area; for example, this could be a switch from full-screen display to a partial window display or a partial floating window display. Therefore, the change in the target video's display brightness can be indirectly determined by the change in the display area size. The size of the display area can be at least one of the area, length, and width of the display area.
[0087] The second method is where the absolute value of the difference between the grayscale parameters of the first image and the grayscale parameters of the second image is greater than a second threshold, the second image is a historical video frame of the first image in the target video, and the second image is spaced apart from the first image by a preset time interval.
[0088] The second image is a historical video frame of the first image, meaning it follows the chronological order of the HDR video, with the second image appearing before the first image. For example, the second image might be the video frame played at the 4th second, and the first image at the 6th second. Furthermore, the second image is spaced apart from the first image by a preset duration. This preset duration can be a time length, such as 5 seconds, or a preset number of video frames. The preset number is set according to actual needs; for example, a preset number of 4 means a check is performed every 5 video frames.
[0089] In one example, the HDR video consists of 12 video frames arranged sequentially according to playback time. With a preset duration of 4 video frames, a check is performed every 5 video frames to determine if a preset condition is met. The following process is executed: The display brightness of the first video frame is obtained; the first to fourth video frames undergo tone mapping based on the brightness parameters of the first video frame. When the fifth video frame needs to be displayed, its display brightness is obtained. If the fifth video frame meets the preset condition (i.e., the absolute value of the difference between its display brightness and that of the first video frame exceeds a brightness threshold), the brightness parameters of the fifth video frame are calculated in real-time, and the display brightness of the fifth video frame is adjusted accordingly. The system performs tone mapping from the 8th video frame to the 12th video frame. When the 9th video frame needs to be displayed, it obtains the display brightness of the 9th video frame. If the 9th video frame meets the preset condition, that is, the absolute value of the difference between the display brightness of the 9th video frame and the display brightness of the 5th video frame exceeds the brightness threshold, the brightness parameter of the 9th video frame is calculated in real time, and tone mapping is performed from the 9th video frame to the 12th video frame based on the brightness parameter of the 9th video frame. If the 9th video frame does not meet the preset condition, that is, the absolute value of the difference between the display brightness of the 9th video frame and the display brightness of the 5th video frame does not exceed the brightness threshold, the tone mapping is still performed from the 9th video frame to the 12th video frame based on the brightness parameter of the 5th video frame.
[0090] The grayscale parameter can be at least one of the average and maximum grayscale values of all pixels in an image. The grayscale values of video frames also affect the display brightness of the target video. A change in the grayscale value of the first image compared to the second image could be due to a change in the display area size or a change in the displayed content. The second threshold for the change in grayscale value between the first and second images is an empirical value, which is used as a reference to the perceived change in the brightness of the target video. Therefore, the change in the display brightness of the target video can be indirectly judged by the change in the grayscale value of the video frames in the target video.
[0091] In one example, the preset conditions include both of the above. The grayscale parameters include the average grayscale value and the maximum grayscale value of all pixels in the video frame. The second threshold corresponding to the average grayscale value is 15, and the second threshold corresponding to the maximum grayscale value is 30. Figure 5 This is a schematic diagram of a tone mapping process according to an exemplary embodiment, such as... Figure 5 As shown, after the HDR video is decoded by the upper layer, if the HDR content layer is detected to switch from full-screen display to small window display, after a 5-second interval with the second image, the average grayscale value and maximum grayscale value of the first image are obtained, denoted as HDR_Gray_avg_cur and HDR_Gray_max_cur respectively. Then, the average grayscale value and maximum grayscale value of the second image stored on the device are obtained, denoted as HDR_Gray_avg_pre and HDR_Gray_max_pre respectively. If the following conditions are met:
[0092] ∣HDR_Gray_avg_pre-HDR_Gray_avg_cur∣>15
[0093] ∣HDR_Gray_max_pre-HDR_Gray_max_cur∣>30
[0094] If the target video meets the preset conditions, the brightness parameters of the first image are calculated according to the image processing method provided in this embodiment of the present disclosure, and the first image is tone-mapped according to the brightness parameters of the first image; if the above conditions are not met, the first image is tone-mapped according to the brightness parameters of the second image, and the new video frame is compared with the first image after an interval of 5 seconds to determine whether the new video frame meets the above conditions.
[0095] For a detailed implementation of obtaining the reference brightness value, please refer to step S201, which will not be repeated here.
[0096] When the target video meets the preset conditions, the first image is tone-mapped according to the brightness parameters of the first image. This ensures that the display effect of HDR video is consistent under different display window sizes, and avoids the flickering problem that can easily be caused by tone mapping of each frame in real time according to the brightness parameters of the current video frame.
[0097] In step S402, in some possible implementations, the target mapping relationship corresponding to the reference brightness value is determined, including the following two cases:
[0098] The first method is to use the preset mapping relationship corresponding to the first preset brightness value as the target mapping relationship if the reference brightness value is the same as the first preset brightness value among multiple preset brightness values.
[0099] In one example, the preset screen display brightness includes 800 nit, 1200 nit, and 1600 nit. If the reference brightness value is 1200 nit, then the preset mapping relationship corresponding to 1200 nit is determined as the target mapping relationship.
[0100] The second approach is to determine the target mapping relationship based on the preset mapping relationship corresponding to the second preset brightness value if the reference brightness value is different from multiple preset brightness values. The absolute value of the difference between the second preset brightness value and the reference brightness value is the smallest.
[0101] In one example, preset screen display brightness includes 800 nits, 1200 nits, and 1600 nits. If the reference brightness value is 1000 nits, then 800 nits and 1200 nits are the preset screen display brightness with the smallest absolute value of the difference from the reference brightness value. The target mapping relationship is determined based on the preset mapping relationships corresponding to 800 nits and 1200 nits. The average value of the brightness parameter corresponding to each grayscale parameter in the preset mapping relationship corresponding to 800 nits and the brightness parameter corresponding to the same grayscale parameter in the preset mapping relationship corresponding to 1200 nits is taken as the brightness parameter corresponding to each grayscale parameter in the target mapping relationship. For example, the brightness parameter corresponding to grayscale parameter 100 in the preset mapping relationship corresponding to 800 nits is 300 nits, and the brightness parameter corresponding to grayscale parameter 100 in the preset mapping relationship corresponding to 1200 nits is 300 nits. If the corresponding brightness parameter is 500 nit, then the brightness parameter corresponding to grayscale parameter 100 in the target mapping relationship is (300+500) / 2=400 nit; if the reference brightness value is 1100 nit, then 1200 nit is the preset screen display brightness with the smallest absolute value of the difference from the reference brightness value. The target mapping relationship is determined according to the preset mapping relationship corresponding to 1200 nit. The ratio of the brightness parameter corresponding to each grayscale parameter in the preset mapping relationship corresponding to 1200 nit to 1200 nit is calculated. The product of this ratio and 1100 nit is used as the brightness parameter corresponding to each grayscale parameter in the target mapping relationship. For example, if the brightness parameter corresponding to grayscale parameter 100 in the preset mapping relationship corresponding to 1200 nit is 500 nit, then the brightness parameter corresponding to grayscale parameter 100 in the target mapping relationship is 1100×(5 / 12) nit.
[0102] In steps S403 and S404, the grayscale parameters of the first image include a first grayscale value and a second grayscale value. Both the first grayscale value and the second grayscale value are statistical values of the grayscale values of all pixels in the first image, and the first grayscale value and the second grayscale value are different. For example, the first grayscale value and the second grayscale value are one of the average grayscale value and the maximum grayscale value, respectively. The grayscale values of all pixels in the first image are statistically analyzed, the average grayscale value is taken as the average grayscale value, and the maximum grayscale value of all pixels is taken as the maximum grayscale value.
[0103] The average brightness value of the first image is obtained by matching the average grayscale value from the target mapping relationship, and the maximum brightness value of the first image is obtained by matching the maximum grayscale value from the target mapping relationship. Therefore, the brightness parameters of the first image include the average brightness value and the maximum brightness value. In one example, the average grayscale value of the first image is denoted as HDR_Gray_avg, and the maximum grayscale value is denoted as HDR_Gray_max. According to the target mapping relationship, the average brightness value of the first image is Lv_avg, and the maximum brightness value is Lv_max.
[0104] In step S405, the tone mapping region of the first image is determined based on the average brightness value and the maximum brightness value, and tone mapping is performed on the first image based on the tone mapping region of the first image.
[0105] In some implementations, tone mapping is performed on the first image based on a first brightness value and a second brightness value, including the following steps:
[0106] Determine the first hue mapping curve based on the first luminance value;
[0107] Determine the second hue mapping curve based on the second luminance value;
[0108] Determine the target tone mapping curve based on the first tone mapping curve and the second tone mapping curve;
[0109] The first image is tone-mapped according to the target tone mapping curve.
[0110] If the first luminance value is the average luminance value, then the first tone mapping curve is represented as:
[0111] TM_Curve_avg=func(PQ,Lv_avg,gamma)
[0112] Where TM_Curve_avg represents the first tone mapping curve, Lv_avg represents the average brightness value of the first image, PQ represents the PQ curve, and gamma represents the gamma value, which is usually 2.2.
[0113] If the first brightness value is the maximum brightness value, then the second tone mapping curve is represented as:
[0114] TM_Curve_max=func(PQ, Lv_max, gamma)
[0115] Where TM_Curve_max represents the second tone mapping curve, Lv_max represents the maximum brightness value of the first image, PQ represents the PQ curve, and gamma represents the gamma value, which is usually 2.2.
[0116] Based on the first and second tone mapping curves, a target tone mapping curve is determined. Both the first and second tone mapping curves are adapted to the current display window size. The first and second tone mapping curves are interpolated, for example, by linear interpolation, to obtain the target tone mapping curve for the first image. Then, based on the target tone mapping curve, tone mapping is performed on the first image, that is, mapping the brightness of the first image to the brightness range that the electronic device can display.
[0117] In some implementations, tone mapping is performed on the first image based on a first brightness value and a second brightness value, including the following steps:
[0118] Determine the target gamma value based on the target mapping relationship;
[0119] The first image is tone-mapped based on the first luminance value, the second luminance value, and the target gamma value.
[0120] The gamma value of a screen indicates the relationship between the grayscale and brightness of an image displayed on the screen. Therefore, by using the grayscale and brightness of the image to be displayed by the current electronic device, a gamma value that conforms to the hardware brightness characteristics of the current electronic device's screen can be calculated. From the target mapping relationship, any set of corresponding data for grayscale and brightness parameters is selected, and the target gamma value is calculated based on the selected set of corresponding data for grayscale and brightness parameters.
[0121] In one example, the target gamma value is calculated using the following formula:
[0122] gamma_cur=log(Lv / Display_lv_max, Gray / Gray_max)
[0123] Where gamma_cur represents the target gamma value, Lv represents a brightness parameter selected from the target mapping relationship, Gray represents a grayscale parameter selected from the target mapping relationship, and Lv and Gray are a set of corresponding data, Gray_max represents the maximum display grayscale value of the screen, and Display_lv_max is the maximum display brightness value of the screen. For example, when Gray_max is 255 grayscale, Display_lv_max is 100 nits.
[0124] Based on the target gamma value that conforms to the hardware brightness characteristics of the current electronic device screen and the brightness parameters of the first image, tone mapping is performed on the first image. This allows the first image to adapt to the current ambient light, the current display content, and the current real-time display window size, while also taking into account the hardware brightness characteristics of the electronic device screen, thus achieving a more accurate brightness reconstruction effect.
[0125] In one example, when the brightness parameter of the first image includes the maximum brightness value of the first image, the tone mapping curve of the first image is generated based on the maximum brightness value of the first image, the PQ curve, and the target gamma value, as shown below:
[0126] TM_Curve_max=func(PQ, Lv_max, gamma_cur)
[0127] Where TM_Curve_max represents the tone mapping curve of the first image, Lv_max represents the maximum brightness value of the first image, PQ represents the PQ curve, and gamma_cur represents the target gamma value.
[0128] In another example, when the brightness parameters of the first image include the average brightness value and the maximum brightness value, the first tone mapping curve is represented as:
[0129] TM_Curve_avg=func(PQ, Lv_avg, gamma_cur)
[0130] Where TM_Curve_avg represents the first tone mapping curve, Lv_avg represents the average brightness value of the first image, PQ represents the PQ curve, and gamma_cur represents the target gamma value.
[0131] The second-tone mapping curve is represented as follows:
[0132] TM_Curve_max=func(PQ, Lv_max, gamma_cur)
[0133] Where TM_Curve_max represents the tone mapping curve of the first image, Lv_max represents the maximum brightness value of the first image, PQ represents the PQ curve, and gamma_cur represents the target gamma value.
[0134] Both the first tone mapping curve and the second tone mapping curve are tone mapping curves adapted to the current display window size. The first tone mapping curve and the second tone mapping curve are interpolated, for example, by linear interpolation, to obtain the target tone mapping curve of the first image.
[0135] In some embodiments, step S401 in the above embodiments can be replaced by step S201, and steps S201 and S402-S405 are one embodiment; steps S403-S405 in the above embodiments can be replaced by steps S203-S204, and steps S203-S204 and S401-S402 are one embodiment.
[0136] In one example, Figure 6 This is a schematic diagram illustrating an HDR video display according to an exemplary embodiment, such as... Figure 6 As shown, the left image represents a full-screen HDR video, and the right image represents a small-window HDR video. It can be seen that there is no difference in display brightness between full-screen and small-window displays for the same HDR video. The display effect perceived by the user is the same. When the user switches from full-screen to small-window display or vice versa, the user will not perceive any sudden change in display brightness or flickering, which can improve the user's visual experience when watching HDR videos.
[0137] In some embodiments, the above embodiments also include the following step of obtaining a preset mapping relationship:
[0138] When the display mode is high dynamic range display mode and the screen display brightness is the preset screen display brightness, images of different gray levels are displayed respectively, and the display brightness of the images is detected;
[0139] The mapping relationship between the grayscale of an image and the display brightness of the image is used as the preset mapping relationship.
[0140] Because electronic devices cannot trigger HDR display mode when displaying images, they cannot set the screen brightness to a higher preset brightness. Therefore, control commands are needed to force the HDR display mode to be triggered, and simultaneously force the screen brightness of the electronic device to the preset brightness. The brightness value and number of preset screen brightness values can be set according to actual needs, such as the high brightness commonly used in HDR display mode, i.e., 800 nits, 1200 nits, and 1600 nits. After setting the display mode and screen brightness, images of different gray levels are displayed on the electronic device. For ease of operation, gray levels 0-255 in SDR display mode are displayed. Images of each gray level value are displayed sequentially. While displaying each image, the image brightness is detected, for example, using an MP410 color analyzer. After detecting all gray levels under the same preset screen brightness, the screen brightness is adjusted to another preset screen brightness for detection. The display brightness corresponding to each gray level value under different preset screen brightness is recorded sequentially, thus obtaining multiple mapping tables between the image's gray level parameters and the image's brightness parameters, i.e., multiple preset mapping relationships. It should be noted that when the detected image brightness parameter is the brightness in HDR display mode, it can be directly used as the brightness parameter in the mapping table, or it can be converted to the brightness in SDR display mode before being used as the brightness parameter in the mapping table.
[0141] In some embodiments, the above embodiments further include the following steps:
[0142] Based on the grayscale parameters of the target image displayed in the third region and the target mapping relationship, the brightness parameters of the target image are determined. The third region is the area on the display screen other than the first region.
[0143] Tone mapping is performed on the target image based on its brightness parameters.
[0144] The third region is the area on the display screen other than the first region, for example... Figure 6 The image shown on the right represents the display area outside the HDR video display area. The target image is any image displayed in the third region, such as a desktop image. The grayscale parameters of the target image are obtained. These parameters represent the statistical values of the grayscale values of all displayed pixels, such as the average or maximum value. It should be noted that the grayscale values of pixels obscured by the first region are not counted. The brightness parameter corresponding to the grayscale parameters of the target image is matched from the target mapping relationship, and tone mapping is performed on the target image based on this brightness parameter. In some embodiments, a tone mapping curve for the target image is generated based on the brightness parameter, and the target image is mapped to the brightness range that the electronic device can display based on the tone mapping curve.
[0145] While adjusting the target video, the display effect of the third area is also adjusted. When the target video switches from full-screen display to small window display, the brightness of the third area can be prevented from changing abruptly when switching from displaying the target video to displaying the target image, which would affect the user's viewing experience.
[0146] In an exemplary embodiment of this disclosure, an image processing apparatus is provided. Figure 7 This is a block diagram illustrating an image processing apparatus according to an exemplary embodiment, such as... Figure 7 As shown, the image processing apparatus includes:
[0147] The acquisition module 701 is configured to acquire a reference brightness value when the target video is displayed in the first area. The reference brightness value represents the current screen display brightness value.
[0148] The first determining module 702 is configured to determine the target mapping relationship corresponding to the reference brightness value. The target mapping relationship represents the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the reference brightness value.
[0149] The second determining module 703 is configured to determine the brightness parameters of the first image based on the grayscale parameters of the first image and the target mapping relationship, wherein the first image is any video frame in the target video.
[0150] The processing module 704 is configured to perform tone mapping on the first image based on the brightness parameters of the first image.
[0151] In an exemplary embodiment, the grayscale parameters of the first image include a first grayscale value and a second grayscale value, both of which are statistical values of the grayscale values of all pixels in the first image, and the first grayscale value and the second grayscale value are different; the second determining module 703 is further configured to:
[0152] The first brightness value is determined based on the mapping relationship between the first grayscale value and the target.
[0153] The second brightness value is determined based on the mapping relationship between the second grayscale value and the target.
[0154] Processing module 704 is also configured as follows:
[0155] The first image is tone-mapped based on the first brightness value and the second brightness value.
[0156] In one exemplary embodiment, the processing module 704 is further configured to:
[0157] Determine the first hue mapping curve based on the first luminance value;
[0158] Determine the second hue mapping curve based on the second luminance value;
[0159] Determine the target tone mapping curve based on the first tone mapping curve and the second tone mapping curve;
[0160] The first image is tone-mapped according to the target tone mapping curve.
[0161] In one exemplary embodiment, the processing module 704 is further configured to:
[0162] Determine the target gamma value based on the target mapping relationship;
[0163] The first image is tone-mapped based on the first luminance value, the second luminance value, and the target gamma value.
[0164] In one exemplary embodiment, the acquisition module 701 is further configured to:
[0165] When the target video meets the preset conditions, a reference brightness value is obtained. The preset conditions indicate that the change in the display brightness of the target video exceeds the brightness threshold.
[0166] In one exemplary embodiment, the preset conditions include at least one of the following:
[0167] The display area of the target video is switched from the second area to the first area, and the absolute value of the difference between the size of the first area and the size of the second area is greater than the first threshold.
[0168] The absolute value of the difference between the grayscale parameters of the first image and the grayscale parameters of the second image is greater than the second threshold. The second image is a historical video frame of the first image in the target video, and the second image is spaced apart from the first image by a preset time.
[0169] In one exemplary embodiment, the first determining module 702 is further configured to:
[0170] If the reference brightness value is the same as the first preset brightness value among multiple preset brightness values, the preset mapping relationship corresponding to the first preset brightness value shall be used as the target mapping relationship;
[0171] If the reference brightness value is different from multiple preset brightness values, the target mapping relationship is determined according to the preset mapping relationship corresponding to the second preset brightness value, wherein the absolute value of the difference between the second preset brightness value and the reference brightness value is the smallest.
[0172] In one exemplary embodiment, the method further includes:
[0173] The second determining module 703 is further configured to determine the brightness parameters of the target image based on the grayscale parameters of the target image displayed in the third region and the target mapping relationship, wherein the third region is the region in the display screen other than the first region.
[0174] The processing module 704 is also configured to perform tone mapping on the target image based on the brightness parameters of the target image.
[0175] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0176] Figure 8 This is a block diagram illustrating an electronic device 800 according to an exemplary embodiment.
[0177] Reference Figure 8 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0178] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0179] Memory 804 is configured to store various types of data to support the operation of electronic device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0180] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0181] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0182] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0183] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0184] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0185] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0186] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0187] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0188] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform an image processing method, including any of the methods described above.
[0189] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0190] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. An image processing method, characterized in that, The method includes: When displaying the target video in the first area, a reference brightness value is obtained, which represents the current screen display brightness value; Determine the target mapping relationship corresponding to the reference brightness value, wherein the target mapping relationship characterizes the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the reference brightness value; The brightness parameter of the first image is determined based on the grayscale parameters of the first image and the target mapping relationship, wherein the first image is any video frame in the target video; Based on the brightness parameters of the first image, tone mapping is performed on the first image.
2. The image processing method according to claim 1, characterized in that, The grayscale parameters of the first image include a first grayscale value and a second grayscale value, both of which are statistical values of the grayscale values of all pixels in the first image, and the first grayscale value and the second grayscale value are different; determining the brightness parameters of the first image based on the grayscale parameters of the first image and the target mapping relationship includes: Based on the first grayscale value and the target mapping relationship, a first brightness value is determined; The second brightness value is determined based on the second grayscale value and the target mapping relationship; The step of performing tone mapping on the first image based on the brightness parameters of the first image includes: The first image is tone-mapped based on the first brightness value and the second brightness value.
3. The image processing method according to claim 2, characterized in that, The step of performing tone mapping on the first image based on the first brightness value and the second brightness value includes: Based on the first brightness value, determine the first hue mapping curve; Determine the second hue mapping curve based on the second brightness value; Determine the target tone mapping curve based on the first tone mapping curve and the second tone mapping curve; The first image is tone-mapped according to the target tone mapping curve.
4. The image processing method according to claim 2, characterized in that, The step of performing tone mapping on the first image based on the first brightness value and the second brightness value includes: Determine the target gamma value based on the target mapping relationship; The first image is tone-mapped based on the first brightness value, the second brightness value, and the target gamma value.
5. The image processing method according to claim 1, characterized in that, The process of obtaining the reference brightness value includes: When the target video meets the preset conditions, the reference brightness value is obtained, whereby the preset conditions indicate that the change in the display brightness of the target video exceeds a brightness threshold.
6. The image processing method according to claim 5, characterized in that, The preset conditions include at least one of the following: The display area of the target video is switched from the second area to the first area, and the absolute value of the difference between the size of the first area and the size of the second area is greater than a first threshold. The absolute value of the difference between the grayscale parameters of the first image and the grayscale parameters of the second image is greater than a second threshold, the second image is a historical video frame of the first image in the target video, and the second image is spaced apart from the first image by a preset time interval.
7. The image processing method according to claim 1, characterized in that, Determining the target mapping relationship corresponding to the reference brightness value includes: If the reference brightness value is the same as the first preset brightness value among a plurality of preset brightness values, the preset mapping relationship corresponding to the first preset brightness value is taken as the target mapping relationship; If the reference brightness value is different from all of the plurality of preset brightness values, the target mapping relationship is determined according to the preset mapping relationship corresponding to the second preset brightness value, wherein the absolute value of the difference between the second preset brightness value and the reference brightness value is the smallest.
8. The image processing method according to claim 1, characterized in that, The method further includes: Based on the grayscale parameters of the target image displayed in the third region and the target mapping relationship, the brightness parameters of the target image are determined, wherein the third region is the region in the display screen other than the first region; Based on the brightness parameters of the target image, tone mapping is performed on the target image.
9. An image processing apparatus, characterized in that, The device includes: The acquisition module is configured to acquire a reference brightness value when the target video is displayed in the first area, the reference brightness value representing the current screen display brightness value; The first determining module is configured to determine the target mapping relationship corresponding to the reference brightness value, wherein the target mapping relationship characterizes the mapping relationship between the grayscale parameters of the image and the brightness parameters of the image under the reference brightness value; The second determining module is configured to determine the brightness parameter of the first image based on the grayscale parameter of the first image and the target mapping relationship, wherein the first image is any video frame in the target video; The processing module is configured to perform tone mapping on the first image based on the brightness parameters of the first image.
10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to perform the method as described in any one of claims 1-8.
11. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-8.