Video processing method and device, electronic equipment and storage medium
By obtaining the ambient brightness before HDR video playback and applying corresponding color correction parameters to process, the problem of color distortion of HDR video at different ambient brightness is solved, and the stability of the video display effect and the user experience are improved.
Patent Information
- Application Number
- CN202410064847.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-16
- Publication Date
- 2025-07-18
AI Technical Summary
Due to the display performance limitations of the display device, the display effect of HDR video under different ambient brightness is affected, resulting in color distortion and affecting the user experience.
By obtaining the brightness of the current playback environment, selecting the corresponding color correction parameters to process the video to be played, including tone mapping and brightness improvement, ensuring that the video keeps color accurate at different ambient brightness.
Maintain the consistency of the video display effect under different ambient brightness, reduce color distortion, and improve user experience.
Smart Images

Figure CN120343218A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technologies, and in particular, to a video processing method, apparatus, electronic device, and storage medium. Background Art
[0002] High Dynamic Range (HDR) video technology is a major leap in the development of the video industry. By expanding the photoelectric transmission function, it uses high-bit color depth and wide color gamut to reproduce the colors and contrast between the brightest white and the darkest black that can be seen with the naked eye. However, due to the limitations of the display performance of display devices, the brightness range of HDR videos is usually much larger than the brightness display range of display devices. Therefore, the presentation of HDR videos on display devices is a major problem jointly faced by the academic and industrial communities at the present stage.
[0003] Usually, the video signal of the HDR video is processed to play the processed video signal in the display settings to obtain a better display effect. However, when the ambient brightness of the environment where the display device is currently located changes, the display effect of the processed video signal will be affected by the change in ambient brightness, resulting in problems such as color distortion of the HDR video, which affects the user experience. Summary of the Invention
[0004] To overcome the problems in the related art, the present disclosure provides a video processing method, apparatus, electronic device, and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a video processing method, including:
[0006] Responding to a video playback instruction, obtaining a first ambient brightness of the current playback environment;
[0007] Based on the first ambient brightness, obtaining a target color correction parameter corresponding to the first ambient brightness from a plurality of pre-stored color correction parameters; wherein, different color correction parameters correspond to different ambient brightnesses;
[0008] Based on the target color correction parameter, performing color correction processing on the video to be played, and playing the video to be played after the color correction processing.
[0009] Optionally, the method further includes:
[0010] Obtaining tone mapping curves corresponding to a plurality of different ambient brightnesses;
[0011] Based on the tone mapping curves corresponding to the plurality of different ambient brightnesses, determining brightness enhancement parameters of a plurality of color nodes within a preset color node sample at each of the ambient brightnesses;
[0012] Determine second pixel values of the multiple color nodes under multiple different ambient brightness levels based on first pixel values of the multiple color nodes and brightness enhancement parameters corresponding to the color nodes;
[0013] Determine color correction parameters corresponding to multiple different ambient brightness levels based on the first pixel values of the multiple color nodes and the second pixel values of the color nodes under the multiple different ambient brightness levels; the color correction parameters are used to describe a mapping relationship between the first pixel values of the color nodes and the second pixel values of the color nodes under corresponding ambient brightness levels.
[0014] Optionally, the determining second pixel values of the multiple color nodes under multiple different ambient brightness levels based on the first pixel values of the multiple color nodes and the brightness enhancement parameters corresponding to the color nodes includes:
[0015] Determine third pixel values after brightness enhancement of the color nodes based on the brightness enhancement parameters of the color nodes under each of the ambient brightness levels;
[0016] Determine whether the third pixel values of the color nodes are less than or equal to the maximum pixel value allowable for display on the display screen;
[0017] If the third pixel values of the color nodes are less than or equal to the maximum pixel value, determine the third pixel values of the color nodes as the second pixel values of the color nodes under the corresponding ambient brightness levels.
[0018] Optionally, the method further includes:
[0019] If the third pixel values of the color nodes are greater than the maximum pixel value, re-determine the brightness enhancement parameters of the color nodes under the corresponding ambient brightness levels based on the maximum pixel value and the third pixel values of the color nodes;
[0020] Determine the second pixel values of the color nodes under the corresponding ambient brightness levels according to the first pixel values of the color nodes and the brightness enhancement parameters of the color nodes.
[0021] Optionally, the determining brightness enhancement parameters of multiple color nodes within a preset color node sample under each of the ambient brightness levels based on the tone mapping curves corresponding to the multiple different ambient brightness levels includes:
[0022] Determine first chromaticity values corresponding to the multiple color nodes based on the first pixel values of the multiple color nodes;
[0023] Determine the second chromaticity values corresponding to the multiple color nodes at each of the ambient brightness levels based on the first chromaticity values of the multiple color nodes and the multiple tone mapping curves;
[0024] Based on the first chromaticity values of the multiple color nodes and the second chromaticity values of the color nodes at multiple ambient brightness levels, determine the brightness enhancement parameters of the multiple color nodes at each of the ambient brightness levels respectively.
[0025] Optionally, the determining the first chromaticity values corresponding to the multiple color nodes based on the first pixel values of the multiple color nodes includes:
[0026] Perform electro-optical conversion on the first pixel values of the multiple color nodes to obtain the fourth pixel values of the multiple color nodes; convert the fourth pixel values of the multiple color nodes into the first chromaticity values of the multiple color nodes in the XYZ color space;
[0027] The determining the color correction parameters corresponding to multiple different ambient brightness levels based on the first pixel values of the multiple color nodes and the second pixel values of the color nodes at multiple different ambient brightness levels further includes:
[0028] Perform opto-electric conversion on the second pixel values of the color nodes at multiple different ambient brightness levels to obtain the fifth pixel values of the color nodes at multiple different ambient brightness levels;
[0029] Determine the color correction parameters corresponding to multiple different ambient brightness levels according to the first pixel values of the multiple color nodes and the fifth pixel values of the color nodes at multiple different ambient brightness levels.
[0030] Optionally, the method further includes:
[0031] During the playback of the video to be played, detect whether the brightness of the current playback environment changes;
[0032] When it is detected that the brightness of the current playback environment changes, obtain the second ambient brightness;
[0033] Based on the target color correction parameters corresponding to the second ambient brightness, perform color correction processing on multiple video frame images that have not been played in the video to be played;
[0034] And play the multiple video frame images after color correction processing.
[0035] According to the second aspect of the embodiments of the present disclosure, there is provided a video processing apparatus, including:
[0036] A first acquisition module, configured to acquire the first ambient brightness of the current playback environment in response to a video playback instruction;
[0037] A second acquisition module, configured to acquire a target color correction parameter corresponding to the first ambient brightness from a plurality of pre-stored color correction parameters; wherein, different ambient brightnesses correspond to different color correction parameters;
[0038] A processing module, configured to perform color correction processing on a video to be played based on the target color correction parameter, and play the video to be played after the color correction processing.
[0039] Optionally, the processing module is further configured to: acquire tone mapping curves corresponding to a plurality of different ambient brightnesses;
[0040] Based on the tone mapping curves corresponding to the plurality of different ambient brightnesses, determine brightness enhancement parameters of a plurality of color nodes within a preset color node sample at each of the ambient brightnesses;
[0041] Based on the first pixel values of the plurality of color nodes and the brightness enhancement parameters corresponding to the color nodes, determine second pixel values of the plurality of color nodes at a plurality of different ambient brightnesses;
[0042] Based on the first pixel values of the plurality of color nodes and the second pixel values of the color nodes at a plurality of different ambient brightnesses, determine color correction parameters corresponding to the plurality of different ambient brightnesses; the color correction parameters are used to describe the mapping relationship between the first pixel values of the color nodes and the second pixel values of the color nodes at the corresponding ambient brightnesses.
[0043] Optionally, the processing module is further configured to: based on the brightness enhancement parameters of the color nodes at each of the ambient brightnesses, determine third pixel values after brightness enhancement of the color nodes;
[0044] Determine whether the third pixel value of the color node is less than or equal to the maximum pixel value allowed to be displayed by the display screen;
[0045] If the third pixel value of the color node is less than or equal to the maximum pixel value, determine the third pixel value of the color node as the second pixel value of the color node at the corresponding ambient brightness.
[0046] Optionally, the processing module is further configured to:
[0047] If the third pixel value of the color node is greater than the maximum pixel value, re-determine the brightness enhancement parameter of the color node at the corresponding ambient brightness based on the maximum pixel value and the third pixel value of the color node;
[0048] Determine the second pixel value of the color node at the corresponding ambient brightness according to the first pixel value of the color node and the brightness enhancement parameter of the color node.
[0049] Optionally, the processing module is further configured to:
[0050] Determine the first chromaticity value corresponding to the plurality of color nodes based on the first pixel values of the plurality of color nodes;
[0051] Determine the second chromaticity value corresponding to the plurality of color nodes at each ambient brightness based on the first chromaticity values of the plurality of color nodes and the plurality of tone mapping curves;
[0052] Determine the brightness enhancement parameters of the plurality of color nodes at each ambient brightness respectively based on the first chromaticity values of the plurality of color nodes and the second chromaticity values of the color nodes at a plurality of ambient brightnesses.
[0053] Optionally, the processing module is further configured to:
[0054] Perform electro-optical conversion on the first pixel values of the plurality of color nodes to obtain the fourth pixel values of the plurality of color nodes; convert the fourth pixel values of the plurality of color nodes into the first chromaticity values of the plurality of color nodes in the XYZ color space;
[0055] Perform opto-electronic conversion on the second pixel values of the color node at a plurality of different ambient brightnesses to obtain the fifth pixel values of the color node at a plurality of different ambient brightnesses;
[0056] Determine color correction parameters corresponding to a plurality of different ambient brightnesses according to the first pixel values of the plurality of color nodes and the fifth pixel values of the color node at a plurality of different ambient brightnesses.
[0057] Optionally, the first acquisition module is further configured to detect whether the brightness of the current playing environment changes during the playing of the video to be played; when it is detected that the brightness of the current playing environment changes, acquire the second ambient brightness;
[0058] The processing module is further configured to perform color correction processing on a plurality of video frame images that have not been played in the video to be played based on the target color correction parameters corresponding to the second ambient brightness; and play the plurality of video frame images after color correction processing.
[0059] According to the third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
[0060] A memory for storing processor-executable instructions;
[0061] A processor, connected to the memory;
[0062] Wherein, the processor is configured to execute the video processing method according to any one of the embodiments of the first aspect of the present disclosure.
[0063] According to the fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the video processing method according to any one of the embodiments of the first aspect of the present disclosure.
[0064] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
[0065] In the embodiments of the present disclosure, corresponding color correction parameters are respectively set in advance for different ambient brightnesses. Thus, when a user plays a video to be played under different ambient light conditions, the electronic device can detect the ambient brightness of the current playing environment to obtain the color correction parameters corresponding to the ambient brightness, and use the color correction parameters corresponding to the ambient brightness to perform color correction processing on the video to be played, and play the video to be played after color correction processing. In this way, even if the video is played under different ambient brightness conditions, the displayed picture will not be affected by the ambient brightness and have problems such as color distortion and color cast; the difference in the display effect of the video under different ambient brightness conditions is reduced, and the user experience is improved. It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.
[0067] Figure 1 is a flowchart showing a video processing method according to an exemplary embodiment Figure 1 ;
[0068] Figure 2 is a flowchart showing a video processing method according to an exemplary embodiment Figure 2 ;
[0069] Figure 3 is a tone mapping curve composed of multiple characteristic brightness points under different ambient brightnesses according to an exemplary embodiment;
[0070] Figure 4 is a flowchart showing a video processing method according to an exemplary embodiment Figure 3 ;
[0071] Figure 5It is a flowchart showing a video processing method according to an exemplary embodiment Figure 4 ;
[0072] Figure 6 is an image without color correction processing according to an exemplary embodiment;
[0073] Figure 7 is an image subjected to color correction processing based on a LUT corresponding to the ambient brightness according to an exemplary embodiment;
[0074] Figure 8 is a schematic structural diagram of a video processing apparatus according to an exemplary embodiment;
[0075] Figure 9 is a block diagram of an electronic device according to an exemplary embodiment. Detailed implementation manners
[0076] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of apparatuses consistent with some aspects of the present disclosure as detailed in the appended claims.
[0077] The embodiments of the present disclosure provide a video processing method, as Figure 1 shown, Figure 1 is a flowchart showing a video processing method according to an exemplary embodiment Figure 1 . The video processing method includes:
[0078] Step S101, in response to a video playback instruction, obtain a first ambient brightness of the current playback environment;
[0079] Step S102, based on the first ambient brightness, obtain a target color correction parameter corresponding to the first ambient brightness from a plurality of pre-stored color correction parameters; wherein, different color correction parameters correspond to different ambient brightnesses;
[0080] Step S103, based on the target color correction parameter, perform color correction processing on the video to be played, and play the video to be played after the color correction processing.
[0081] The video processing method shown in the embodiments of the present disclosure can be applied to an electronic device, and the electronic device can be, but is not limited to, a computer, a mobile phone, a wearable device, a vehicle-mounted device, a smart home terminal, etc.
[0082] In step S101, in response to a video playback instruction, the electronic device may first obtain a first ambient brightness of the current playback environment.
[0083] Here, the electronic device may be provided with a sensor, and the sensor can be used to detect the ambient brightness of the environment where the electronic device is currently located.
[0084] After receiving the video playback instruction, the electronic device may use the sensor to obtain the first ambient brightness of the current playback environment.
[0085] In some embodiments, in response to a video playback instruction for a target video, obtain the first ambient brightness of the current playback environment.
[0086] Here, the target video may be an HDR video.
[0087] In step S102, based on the obtained first ambient brightness, obtain a target color correction parameter corresponding to the first ambient brightness from a plurality of pre-stored color correction parameters.
[0088] It should be noted that the electronic device may pre-store a plurality of color correction parameters; and the ambient brightness corresponding to each color correction parameter is different.
[0089] In some embodiments, the color correction parameter may be a display look-up table (LUT).
[0090] It should be noted that a display look-up table (LUT) is a color conversion template, and the corresponding output data can be directly queried through the input data. In the embodiments of the present disclosure, the LUT can reflect the mapping relationship between the pixel values displayed by the electronic device and the input pixel values; for the electronic device, the LUT table can be used to perform color correction, color space conversion, and other processing on the image.
[0091] It should be noted that since the production of videos (especially HDR videos) is usually carried out in a controlled viewing environment (such as a dark room), the ambient brightness of this viewing environment is relatively low. When users watch the produced HDR videos on electronic devices such as mobile phones and televisions, the ambient brightness of the viewing environment is usually higher than that of the HDR production environment. Affected by the ambient light, the actual human eye perception curve is completely different from that in a dark room, resulting in a poor display effect of the HDR video.
[0092] Especially for portable electronic devices such as mobile phones, the ambient brightness of their viewing environment is more complex. As a result, even for the same HDR video, the display effect of the video may be different under different ambient light conditions.
[0093] The multiple color correction parameters stored in the electronic device can be determined based on the perception curves of the human eye for the colors of images under multiple different ambient light conditions.
[0094] In step S103, after obtaining the target color correction parameter, the target color correction parameter can be used to perform color correction processing on the video to be played, obtain the processed video to be played, and play the processed video to be played.
[0095] It can be understood that since the target color correction parameter is the color correction parameter corresponding to the ambient brightness of the current playing environment. Processing the video to be played based on the target color correction parameter makes the color of the image perceived by the user's human eye the same as the color of the image perceived by the user's human eye when the video frame image is played in a controlled viewing environment when the processed video to be played is played in the current playing environment. Thus, even if the ambient light conditions of the video playing environment change, color correction of the video can be achieved through the color correction parameter corresponding to the ambient brightness.
[0096] In order to reduce the difference in the display effect of the video under different ambient brightness conditions in the embodiments of the present disclosure, corresponding color correction parameters can be set in advance for different ambient brightnesses; thus, when the user plays the video under different ambient light conditions, the electronic device can detect the ambient brightness of the current playing environment to obtain the color correction parameter corresponding to the ambient brightness, use the color correction parameter corresponding to the ambient brightness to perform color correction processing on the video to be played, obtain the processed video to be played, and play the processed video to be played; in this way, even if the video is played under different ambient brightness conditions, the display screen will not be affected by the ambient brightness and have problems such as color distortion and color cast; the display effects of the video under different ambient brightness conditions can be kept the same, improving the user experience.
[0097] Optionally, as Figure 2 shown, Figure 2 is a flowchart of a video processing method shown according to an exemplary embodiment Figure 2 . The method further includes:
[0098] Step S104, obtaining tone mapping curves corresponding to multiple different ambient brightnesses;
[0099] Step S105, based on the tone mapping curves corresponding to the multiple different ambient brightnesses, determining the brightness enhancement parameters of multiple color nodes in a preset color node sample under each ambient brightness;
[0100] Step S106, based on the first pixel values of the multiple color nodes and the brightness enhancement parameters corresponding to the color nodes, determining the second pixel values of the multiple color nodes under multiple different ambient brightnesses;
[0101] Step S107: Based on the first pixel values of the multiple color nodes and the second pixel values of the color nodes under multiple different ambient brightness levels, determine color correction parameters corresponding to multiple different ambient brightness levels; the color correction parameters are used to describe the mapping relationship between the first pixel values of the color nodes and the second pixel values of the color nodes under the corresponding ambient brightness levels.
[0102] In the embodiments of the present disclosure, the electronic device may pre-acquire hue mapping curves corresponding to multiple different ambient brightness levels.
[0103] It should be noted that before playing a video or an image, the electronic device usually performs hue mapping on the video or the image so that the video or the image conforms to the display capabilities of the electronic device. The electronic device usually performs hue mapping on the video or the image based on the hue mapping curve.
[0104] In some embodiments, the actual input values of multiple characteristic brightness points of the electronic device and the display brightness values corresponding to the actual input values may be acquired according to different ambient brightness levels; based on the actual input values and the display brightness values of the multiple characteristic brightness points, determine the hue mapping curve of the electronic device under different ambient brightness levels.
[0105] As Figure 3 shown, Figure 3 is a hue mapping curve composed of multiple characteristic brightness points under different ambient brightness levels shown according to an exemplary embodiment. Wherein, the X-axis is the actual input value, and the Y-axis is the display brightness value.
[0106] It can be understood that under different ambient light conditions, even if the actual input values of the pixel units of the electronic device are the same, the display brightness values of the pixel units perceived by the user's human eyes may be different. By acquiring the hue mapping curve of the electronic device under different ambient brightness levels, to determine the influence of the ambient brightness on the color display of the image according to the hue mapping curve under different ambient brightness levels.
[0107] After acquiring the hue mapping curves corresponding to multiple different ambient brightness levels, based on the hue mapping curve of each ambient brightness level, determine the brightness enhancement parameters of multiple color nodes within a preset color node sample under the ambient brightness level.
[0108] The preset color node sample may include multiple color nodes. In some embodiments, the color node sample may be a set of color information, such as a set of RGB data. It may be that one pixel point corresponds to one color node; it may also be that multiple pixel points correspond to one color node, or it may be that one display area corresponds to one color node.
[0109] The brightness enhancement parameter can be used to indicate the degree of brightness enhancement of the image display brightness of the electronic device by the ambient brightness.
[0110] In some embodiments, based on the tone mapping curve of each ambient brightness, the brightness values of the color nodes before and after tone mapping at the ambient brightness can be determined; according to the brightness values of the color nodes before and after tone mapping at the ambient brightness, the brightness enhancement parameter can be determined.
[0111] According to the first pixel values of multiple color nodes and the brightness enhancement parameter, the second pixel values of each color node among the multiple color nodes at multiple different ambient brightnesses are determined.
[0112] In some embodiments, the second pixel value of the color node at the corresponding ambient brightness can be determined according to the product between the first pixel value of the color node and the brightness enhancement parameter.
[0113] After obtaining the second pixel values of multiple color nodes at multiple different environments, based on the second pixel values and the first pixel values of the multiple color nodes at each ambient brightness, the color correction parameter corresponding to the ambient brightness is determined.
[0114] It should be noted that the color correction parameter is used to describe the mapping relationship between the first pixel value of the color node and the second pixel value of the color node at the corresponding ambient brightness.
[0115] Embodiments of the present disclosure obtain the tone mapping curves of the electronic device at multiple different ambient brightnesses; determine the brightness enhancement parameter for reflecting the degree of brightness enhancement of the image display brightness of the electronic device at different ambient brightnesses according to the tone mapping curves of multiple different ambient brightnesses; use the brightness enhancement parameter to determine the second pixel value of the first pixel value of the color node at the corresponding ambient brightness; determine the color correction parameter corresponding to the ambient brightness according to the first pixel values of multiple color nodes and the second pixel values of the multiple color nodes at the corresponding ambient brightness; so that in the subsequent use process of the electronic device, the color correction parameter corresponding to the ambient brightness of the playback environment can be directly used for color correction processing.
[0116] Optionally, the determining the second pixel values of the multiple color nodes at multiple different ambient brightnesses based on the first pixel values of the multiple color nodes and the brightness enhancement parameter corresponding to the color nodes includes:
[0117] Based on the brightness enhancement parameter of the color node at each ambient brightness, determine the third pixel value after brightness enhancement of the color node;
[0118] Determine whether the third pixel value of the color node is less than or equal to the maximum pixel value allowed to be displayed on the display screen;
[0119] If the third pixel value of the color node is less than or equal to the maximum pixel value, determine the third pixel value of the color node as the second pixel value of the color node under the corresponding ambient brightness.
[0120] In the embodiments of the present disclosure, the first pixel value of the color node may be first enhanced in brightness according to the brightness enhancement parameter of the color node under each ambient brightness to obtain the third pixel value after the brightness of the color node is enhanced.
[0121] Considering that the display capability of the display screen is limited, after obtaining the third pixel value after the brightness of the color node is enhanced, it is further possible to determine whether the third pixel value after the brightness of the color node is enhanced exceeds the maximum pixel value allowed to be displayed by the display screen, so as to determine whether the brightness enhancement parameter corresponding to the current ambient brightness is appropriate.
[0122] Generally speaking, the maximum pixel value allowed to be displayed by the display screen may be 255; however, due to different actual usage situations of different electronic devices, the maximum pixel value allowed to be displayed by the display screens of different electronic devices may also be different. For example, for an electronic device that has been used for a relatively long time, the maximum pixel value allowed to be displayed by its display screen is 250.
[0123] In the embodiments of the present disclosure, by obtaining the maximum pixel value allowed to be displayed by the display screen of the electronic device, comparing the third pixel value of the color node with the maximum pixel value allowed to be displayed by the display screen, it is determined whether the third pixel value of the color node is less than or equal to the maximum pixel value allowed to be displayed by the display screen, so as to determine whether the display screen can normally display the color node.
[0124] If the third pixel value of the color node is less than or equal to the maximum pixel value, determine the third pixel value of the color node as the second pixel value of the color node under the corresponding ambient brightness.
[0125] In some embodiments, determining whether the third pixel value of the color node is less than or equal to the maximum pixel value allowed to be displayed by the display screen includes;
[0126] Based on the three sub-pixel values of the third pixel value of the color node, determine the maximum sub-pixel value of the color node;
[0127] Determine whether the maximum sub-pixel value of the color node is less than or equal to the maximum pixel value allowed to be displayed by the display screen.
[0128] It can be understood that the third pixel value of the color node may include three sub-pixel values. For example, the third pixel value of the color node may include sub-pixel values on three sub-channels of RGB.
[0129] The maximum sub-pixel value of the color node can be determined according to the three sub-pixel values of the color node.
[0130] By determining whether the maximum sub-pixel value of the color node is less than or equal to the maximum pixel value allowed to be displayed by the display screen, it is determined whether the brightness enhancement parameter corresponding to the current ambient brightness is appropriate.
[0131] After obtaining the brightness enhancement parameter in the embodiment of the present disclosure, based on the brightness enhancement parameter, the third pixel value after the brightness of the color node is enhanced can be determined; and according to whether the third pixel value exceeds the maximum pixel value allowed to be displayed by the display screen, it is determined whether the current brightness enhancement parameter is appropriate. In this way, while determining the brightness enhancement parameters introduced by different ambient brightnesses, the display capabilities of the display screen of the electronic device are considered.
[0132] Optionally, the method further includes:
[0133] If the third pixel value of the color node is greater than the maximum pixel value, based on the maximum pixel value and the third pixel value of the color node, the brightness enhancement parameter of the color node under the corresponding ambient brightness is re-determined;
[0134] According to the first pixel value of the color node and the brightness enhancement parameter of the color node, the second pixel value of the color node under the corresponding ambient brightness is determined.
[0135] In the embodiment of the present disclosure, if the third pixel value after the brightness of the color node is enhanced is greater than the maximum pixel value allowed to be displayed by the display screen, it indicates that the brightness enhancement parameter corresponding to the currently determined ambient brightness is inappropriate. The brightness enhancement parameter of the color node under this ambient brightness can be re-determined according to the maximum pixel value allowed to be displayed by the display screen and the third pixel value of the color node.
[0136] In some embodiments, the brightness enhancement parameter of the color node under the ambient brightness can be re-determined according to the ratio between the maximum pixel value allowed to be displayed by the display screen and the maximum sub-pixel value of the color node.
[0137] It should be noted that limited by the display capabilities of the display screen, even if the third pixel value of the color node exceeds the maximum pixel value allowed to be displayed by the display screen, during the actual display of the color node by the display screen, the pixel value displayed by the display screen will be less than the third pixel value of the color node. Based on this, in the case where it is determined that the third pixel value of the color node is greater than the maximum pixel value allowed to be displayed by the display screen, the brightness enhancement parameter can be re-determined according to the pixel value that the display screen can actually display.
[0138] In an embodiment of the present disclosure, when the third pixel value exceeds the maximum pixel value allowed for display by the display screen, the brightness enhancement parameter is re-determined. In this way, the brightness enhancement parameter can be comprehensively determined according to the display ability of the display screen of the electronic device and the brightness enhancement of the color nodes under the ambient brightness, so that the determined brightness enhancement parameter can better conform to the actual use of the electronic device.
[0139] Optionally, determining the brightness enhancement parameters of multiple color nodes in a preset color node sample at each of the ambient brightness levels based on the tone mapping curves corresponding to the multiple different ambient brightness levels includes:
[0140] Determining the first chromaticity values corresponding to the multiple color nodes based on the first pixel values of the multiple color nodes;
[0141] Determining the second chromaticity values corresponding to the multiple color nodes at each of the ambient brightness levels based on the first chromaticity values of the multiple color nodes and the multiple tone mapping curves;
[0142] Determining the brightness enhancement parameters of the multiple color nodes at each of the ambient brightness levels respectively based on the first chromaticity values of the multiple color nodes and the second chromaticity values of the color nodes at the multiple ambient brightness levels.
[0143] In an embodiment of the present disclosure, a color conversion matrix of the color space can be obtained, and the first chromaticity value corresponding to the color node is determined based on the color conversion matrix and the first pixel value of the color node.
[0144] It should be noted that the color space can refer to any method of associating each color with three numbers. The color conversion matrix is used to describe the association relationship between the chromaticity value and the pixel value in the color space. It should be noted that there are multiple color spaces, for example, the RGB color space, the HSV color space, etc. The color conversion matrix corresponding to each color space may be different.
[0145] After determining the first chromaticity values corresponding to the multiple color nodes, the actual second chromaticity value of the color node at the corresponding ambient brightness level can be determined according to the first chromaticity value of the color node and the tone mapping curve corresponding to each ambient brightness level among the multiple ambient brightness levels.
[0146] Based on each ambient brightness level, the brightness enhancement parameter of the color node at the ambient brightness level can be determined based on the first chromaticity value and the second chromaticity value of the color node.
[0147] In some embodiments, the first luminance component of the color node may be obtained based on the first chromaticity value of the color node; the second luminance component of the color node at each ambient luminance may be obtained based on the second chromaticity value of the color node at each ambient luminance; and the luminance enhancement parameter of the color node at each ambient luminance may be determined according to the ratio between the second luminance component of the color node at each ambient luminance and the first luminance component.
[0148] Optionally, determining the first chromaticity value corresponding to the plurality of color nodes based on the first pixel values of the plurality of color nodes includes:
[0149] Performing electro-optic conversion on the first pixel values of the plurality of color nodes to obtain fourth pixel values of the plurality of color nodes; converting the fourth pixel values of the plurality of color nodes into the first chromaticity values of the plurality of color nodes in the XYZ color space;
[0150] Determining color correction parameters corresponding to a plurality of different ambient luminances based on the first pixel values of the plurality of color nodes and the second pixel values of the color node at a plurality of different ambient luminances further includes:
[0151] Performing opto-electric conversion on the second pixel values of the color node at a plurality of different ambient luminances to obtain fifth pixel values of the color node at a plurality of different ambient luminances;
[0152] Determining color correction parameters corresponding to a plurality of different ambient luminances according to the first pixel values of the plurality of color nodes and the fifth pixel values of the color node at a plurality of different ambient luminances.
[0153] In the embodiments of the present disclosure, before determining the first chromaticity value of the color node, electro-optic conversion may be first performed on the first pixel values of the plurality of color nodes to obtain fourth pixel values of the plurality of color nodes.
[0154] In some embodiments, an electro-optic conversion function may be used to perform electro-optic conversion on the first pixel values of the plurality of color nodes to obtain fourth pixel values of the plurality of color nodes.
[0155] The electro-optic transfer function (EOTF) is a transfer function that takes an image or video signal as input and converts it into the linear light of a display screen.
[0156] The first chromaticity value of the color node in the XYZ color space may be the XYZ tristimulus values.
[0157] It should be noted that the electronic device needs to perform color calibration processing to establish the correspondence between the digital signal of the display channel of the electronic device and the displayed color, where the displayed color needs to be represented by the color perceived by the human eye. The display after color calibration can display accurate colors.
[0158] The XYZ color space is also known as the CIE 1931 color space; the XYZ color space usually gives the tristimulus values of colors and represents them with X, Y, and Z. In the XYZ color space, the tristimulus values do not refer to the responses of the human eye to short, medium, and long wavelengths (S, M, and L), but a set of values called X, Y, and Z, which approximately correspond to red, green, and blue (where the values of X, Y, and Z do not really look red, green, and blue, but are parameters derived from red, green, and blue), and are calculated using the CIE1931 XYZ color matching function.
[0159] When determining the second pixel values of multiple color nodes under different ambient brightnesses, the second pixel values can be subjected to opto - electronic conversion to obtain the fifth pixel values of the multiple color nodes.
[0160] In some embodiments, an opto - electronic conversion function can be used to perform opto - electronic conversion on the second pixel values of multiple color nodes to obtain the fifth pixel values of the multiple color nodes.
[0161] The opto - electronic transfer function (OETF) is a transfer function that takes the scene light as input and converts it into an image or video signal output.
[0162] In some embodiments, after obtaining the fifth pixel values of multiple color nodes, the fifth pixel values of the multiple color nodes can be subjected to gamut conversion.
[0163] Here, the gamut conversion can be from the BT2020 gamut to the P3 gamut. It should be noted that considering the display capabilities of the display screen of the electronic device, the fifth pixel values of multiple color nodes can be subjected to gamut conversion to obtain new fifth pixel values of the multiple color nodes.
[0164] After obtaining the fifth pixel values of the multiple color nodes, a look - up table (LUT) corresponding to multiple different ambient brightnesses can be determined according to the first pixel values of the multiple color nodes and the fifth pixel values of the color nodes under multiple different ambient brightnesses.
[0165] Here, the first pixel values of the multiple color nodes can be used as the input values of the color calibration parameters, and the fifth pixel values of the multiple color nodes under the corresponding ambient brightness can be used as the output values of the color calibration parameters for the corresponding ambient brightness, so as to obtain the color calibration parameters under multiple different ambient brightnesses.
[0166] An electronic device can store color correction parameters under multiple different ambient brightness levels, so that during subsequent video playback, according to the ambient brightness of the playback environment, the color correction parameters corresponding to the ambient brightness can be called to perform color correction processing.
[0167] Optionally, the method further includes:
[0168] During the playback of the video to be played, detecting whether the brightness of the current playback environment changes;
[0169] When it is detected that the brightness of the current playback environment changes, obtaining a second ambient brightness;
[0170] Based on the target color correction parameters corresponding to the second ambient brightness, performing color correction processing on multiple video frame images that have not been played in the video to be played; and playing the multiple video frame images after color correction processing.
[0171] In an embodiment of the present disclosure, during the playback of the video to be played, the electronic device can continuously monitor whether the ambient brightness of the current playback environment changes; when the electronic device detects that the ambient brightness of the current playback environment changes, it can obtain the second ambient brightness.
[0172] It can be understood that since the video to be played is color-corrected based on the color correction parameters corresponding to the ambient brightness (i.e., the first ambient brightness) previously detected by the electronic device; this video to be played can only obtain the best display effect under this ambient brightness. If the ambient brightness of the current playback environment of the electronic device changes during the playback of the video to be played (for example, when the user is playing a video on the mobile phone and the user is moving), it may affect the display effect of the video to be played.
[0173] In some embodiments, in order to reduce the power consumption of the electronic device, during the playback of the video to be played, the ambient brightness of the current playback environment can be periodically obtained to determine whether the ambient brightness of the current playback environment changes.
[0174] In other embodiments, if it is detected that the ambient brightness of the current playback environment changes, the ambient brightness of the current playback environment can be continuously detected within a preset time period after the change in ambient brightness is detected. If the ambient brightness of the current playback environment does not recover within the preset time period, the second ambient brightness can be obtained.
[0175] It should be noted that considering the situation where the ambient brightness detected by the sensor is different from the actual brightness of the current playback environment due to the change in the relative position between the user and the electronic device, or other situations that cause the ambient brightness detected by the sensor in the electronic device to be different from the actual brightness of the current playback environment, in the embodiments of the present disclosure, when it is detected that the ambient brightness of the current playback environment changes, the ambient brightness of the current playback environment can be continuously detected within a preset duration thereafter.
[0176] If the electronic device detects that the ambient brightness of the current playback environment has recovered, it indicates that the previously detected change in ambient brightness may be a false detection, and the video to be played that has been color-corrected based on the color correction parameters corresponding to the first ambient brightness continues to be played.
[0177] If the electronic device detects that the ambient brightness of the current playback environment has not recovered, it indicates that the ambient brightness of the current playback environment of the video to be played has definitely changed. The sensor can be used to detect the second ambient brightness to obtain the target color correction parameters corresponding to the second ambient brightness.
[0178] After obtaining the second ambient brightness, the target color correction parameters corresponding to the second ambient brightness can be obtained based on the second ambient brightness; based on the target color correction parameters corresponding to the second ambient brightness, color correction processing is performed on multiple video frame images that have not been played in the video to be played; and the multiple color-corrected video frame images are played.
[0179] In this way, during the playback of the video to be played, according to the change in the ambient brightness of the current playback environment, the target color correction parameters can be adjusted in real time, so as to perform color correction processing on the video frame images that have not been played in the video to be played by using the target color correction parameters that match the ambient brightness of the current playback environment, so that even in a playback environment with changing ambient brightness, the display effect of the video to be played can be ensured, and the user experience can be improved.
[0180] The embodiments of the present disclosure also provide a video processing method, as Figure 4 shown, Figure 4 is a flowchart of a video processing method shown according to an exemplary embodiment Figure 3 . The method includes:
[0181] Step S201, in response to a playback instruction for a first high dynamic range (HDR) video, obtain the first ambient brightness of the current playback environment;
[0182] It should be noted that after the terminal receives the playback instruction, when it recognizes that the content stream indicated by the playback instruction is HDR10, the light sensor can be used to detect the current environment to obtain the illuminance value of the current environment.
[0183] It should be noted that HDR10 is the most commonly used and widespread HDR format.
[0184] Step S202: Based on the first ambient brightness, obtain a target LUT corresponding to the first ambient brightness from multiple pre-stored display lookup tables (LUTs).
[0185] Here, the ambient brightness corresponding to different LUTs is different.
[0186] It can be understood that multiple specific ambient illuminances (such as 0 Lux, 200 Lux, and 2000 Lux) can be selected, and the LUTs corresponding to the multiple specific ambient illuminances are determined in advance and stored in the electronic device.
[0187] In some embodiments, the method for determining the LUT corresponding to the ambient illuminance includes:
[0188] Step 1: Under a specific ambient illuminance, determine the tone mapping curve of multiple characteristic brightness points under this ambient illuminance.
[0189] It should be noted that the tone mapping curves corresponding to different ambient illuminances can reflect the brightness mapping relationship of the electronic device under different ambient illuminances.
[0190] It should be noted that the characteristic brightness points can be selected according to actual needs, and the embodiments of the present disclosure do not limit this. For example, the characteristic brightness points can be selected according to the hardware nodes of the electronic device.
[0191] Step 2: Determine the standard chromaticity values of all-color nodes.
[0192] The pixel values (R0, G0, B0) of each color node can be obtained, and after EOTF conversion, the pixel values (R1, G1, B1) are obtained.
[0193] Here, the EOFT conversion is shown as the following formula:
[0194]
[0195] Among them, m1 = 0.1593, m2 = 78.8438, c1 = 0.8359, c2 = 18.8516, c3 = 18.6875.
[0196] E' = (R0, G0, B0) can be substituted into formula (1) to obtain E o ′ ut = (R1, G1, B1).
[0197] The pixel values (R1, G1, B1) are converted to the XYZ color space through a color conversion matrix to obtain the standard chromaticity values (X0, Y0, Z0) corresponding to the color nodes.
[0198] Here, the color conversion matrix is converted as shown in the following formula:
[0199]
[0200] Step 3. According to the tone mapping curve, determine the target chromaticity value of the full-color node under the corresponding illuminance, and obtain the brightness increase ratio.
[0201] The target chromaticity value of each color node under the corresponding illuminance is shown in the following formula:
[0202] Y1 = f(Y0) (3)
[0203] Where Y1 is the luminance component of the target chromaticity value, Y0 is the luminance component of the standard chromaticity value, and f(·) is the tone mapping curve corresponding to the illuminance.
[0204] The brightness increase ratio of each color node under the corresponding illuminance is shown in the following formula:
[0205]
[0206] Step 4. Crop the part that exceeds the chromaticity brightness boundary to obtain the new pixel values (R2, G2, B2).
[0207] The pixel value of the color node under the corresponding illuminance can be determined according to the brightness increase ratio; and it can be determined whether the pixel value of the color node under the corresponding illuminance exceeds the chromaticity brightness boundary.
[0208] The pixel value of the color node under the corresponding illuminance can be determined according to the following formula:
[0209] C′ = C × Ratio (5)
[0210] Where C′ is the pixel value of the color node under the corresponding illuminance, and C is the pixel value (R1, G1, B1) of the color node.
[0211] The maximum sub-pixel value of the color node under the corresponding illuminance can be determined according to the following formula:
[0212] C′ max = max(C') (6)
[0213] It can be determined whether the pixel value of the color node under the corresponding illuminance exceeds the chromaticity brightness boundary according to C′ max If C′
[0214] ≤ L max ≤ L max , it is determined that the pixel value of the color node under the corresponding illuminance does not exceed the chromaticity brightness boundary, and the pixel values (R2, G2, B2) of the color node can be determined as:
[0215] R2 = R1 * Ratio, G2 = G1 * Ratio, B2 = B1 * Ratio (7)
[0216] If C′ max > L max Determine that the pixel value of the color node at the corresponding illuminance exceeds the gamut luminance boundary, and determine the luminance increase ratio according to the following formula:
[0217] Ratio = L max / C′ max (8)
[0218] In this way, the pixel values (R2, G2, B2) of the color node can be determined according to the newly determined luminance increase ratio.
[0219] Step 5. Perform gamut conversion on the pixel values (R2, G2, B2) of the color node.
[0220] The inverse EOTF conversion can be performed on the pixel values (R2, G2, B2) of the color node to obtain the pixel values (R3, G3, B3).
[0221] Here, the inverse EOFT conversion is shown as follows:
[0222]
[0223] Among them, m1 = 0.1593, m2 = 78.8438, c1 = 0.8359, c2 = 18.8516, c3 = 18.6875.
[0224] N = (R2, G2, B2) can be substituted into Equation (9) to obtain N o ′ ut = (R3, G3, B3).
[0225] And use the gamut conversion matrix to convert the BT2020 gamut to the P3 gamut to obtain the pixel values (R4, G4, B4).
[0226]
[0227] Step 6. Generate a 3D LUT corresponding to the illuminance.
[0228] A 3D LUT corresponding to the illuminance can be generated according to the pixel values (R0, G0, B0) of all color nodes and the pixel values (R4, G4, B4).
[0229] Among them, the input value of the 3D LUT is the pixel value (R0, G0, B0), and the output value of the 3D LUT is the pixel value (R4, G4, B4).
[0230] Multiple specific environmental illuminances and corresponding LUTs can be generated according to the above method and stored in the electronic device for calling the LUT under the corresponding environmental illuminance.
[0231] Step S203: Based on the target LUT, perform color correction processing on the first HDR video to obtain a second HDR video; play the second HDR video.
[0232] It can be understood that after obtaining the target LUT, the pixel value of each pixel point in the video frame image of the first HDR video can be used as the input value, the corresponding output value can be found in the target LUT, and a new video frame image can be generated based on the output value corresponding to each pixel point in the video frame image; the second HDR video is composed of multiple new video frame images.
[0233] Step S204: During the playback of the second HDR video, detect whether the brightness of the current playback environment changes.
[0234] It can be understood that during the playback of the second HDR video, the environmental illuminance can be continuously monitored using a light sensor to determine whether the environmental illuminance remains at the same level during the playback of the second HDR video.
[0235] If the environmental illuminance remains at the same level during the playback of the second HDR video, the target LUT may not be updated.
[0236] Step S205: When it is detected that the brightness of the current playback environment changes, obtain the second environmental brightness; based on the target LUT corresponding to the second environmental brightness, perform color correction processing on multiple video frame images that have not been played in the second HDR video; and play the multiple video frame images after color correction processing.
[0237] If the environmental illuminance does not remain at the same level during the playback of the second HDR video, the environmental illuminance detected by the light sensor can be obtained; based on the environmental illuminance, the corresponding LUT can be obtained, the target LUT can be updated using this LUT, and color correction processing can be performed based on the updated target LUT.
[0238] Exemplarily, as Figures 5 to 7 shown, Figure 5 is a flowchart showing a video processing method according to an exemplary embodiment Figure 4 . Figure 6 is an image without color correction processing according to an exemplary embodiment; Figure 7 is an image subjected to color correction processing based on the LUT corresponding to the environmental brightness according to an exemplary embodiment. The display effect of the image is significantly improved. The embodiments of the present disclosure provide a video processing device. Figure 8It is a schematic structural diagram of a video processing device shown according to an exemplary embodiment. As Figure 8 shown, the video processing device 200 includes:
[0239] A first acquisition module 201, configured to acquire a first ambient brightness of the current playback environment in response to a video playback instruction;
[0240] A second acquisition module 202, configured to acquire a target color correction parameter corresponding to the first ambient brightness from a plurality of pre-stored color correction parameters based on the first ambient brightness; wherein, different color correction parameters correspond to different ambient brightnesses;
[0241] A processing module 203, configured to perform color correction processing on the video to be played based on the target color correction parameter, and play the video to be played after the color correction processing.
[0242] Optionally, the processing module 203 is further configured to: acquire tone mapping curves corresponding to a plurality of different ambient brightnesses;
[0243] Based on the tone mapping curves corresponding to the plurality of different ambient brightnesses, determine brightness enhancement parameters of a plurality of color nodes within a preset color node sample at each of the ambient brightnesses;
[0244] Based on the first pixel values of the plurality of color nodes and the brightness enhancement parameters corresponding to the color nodes, determine second pixel values of the plurality of color nodes at a plurality of different ambient brightnesses;
[0245] Based on the first pixel values of the plurality of color nodes and the second pixel values of the plurality of color nodes at a plurality of different ambient brightnesses, determine color correction parameters corresponding to the plurality of different ambient brightnesses; the color correction parameters are used to describe the mapping relationship between the first pixel values of the color nodes and the second pixel values of the color nodes at the corresponding ambient brightnesses.
[0246] Optionally, the processing module 203 is further configured to: based on the brightness enhancement parameters of the color nodes at each of the ambient brightnesses, determine third pixel values after brightness enhancement of the color nodes;
[0247] Determine whether the third pixel value of the color node is less than or equal to the maximum pixel value allowed to be displayed by the display screen;
[0248] If the third pixel value of the color node is less than or equal to the maximum pixel value, determine the third pixel value of the color node as the second pixel value of the color node at the corresponding ambient brightness.
[0249] Optionally, the processing module 203 is further configured to:
[0250] If the third pixel value of the color node is greater than the maximum pixel value, based on the maximum pixel value and the third pixel value of the color node, re-determine the brightness enhancement parameter of the color node under the corresponding ambient brightness;
[0251] Determine the second pixel value of the color node under the corresponding ambient brightness according to the first pixel value of the color node and the brightness enhancement parameter of the color node.
[0252] Optionally, the processing module 203 is further configured to:
[0253] Determine the first chromaticity values corresponding to the multiple color nodes based on the first pixel values of the multiple color nodes;
[0254] Determine the second chromaticity values corresponding to the multiple color nodes under each ambient brightness based on the first chromaticity values of the multiple color nodes and the multiple tone mapping curves;
[0255] Determine the brightness enhancement parameters of the multiple color nodes under each ambient brightness respectively based on the first chromaticity values of the multiple color nodes and the second chromaticity values of the color nodes under multiple ambient brightnesses.
[0256] Optionally, the processing module 203 is further configured to:
[0257] Perform electro-optical conversion on the first pixel values of the multiple color nodes to obtain the fourth pixel values of the multiple color nodes; convert the fourth pixel values of the multiple color nodes into the first chromaticity values of the multiple color nodes in the XYZ color space;
[0258] Perform opto-electric conversion on the second pixel values of the color node under multiple different ambient brightnesses to obtain the fifth pixel values of the color node under multiple different ambient brightnesses;
[0259] Determine the color correction parameters corresponding to multiple different ambient brightnesses according to the first pixel values of the multiple color nodes and the fifth pixel values of the color node under multiple different ambient brightnesses.
[0260] Optionally, the first acquisition module 201 is further configured to detect whether the brightness of the current playback environment changes during the playback of the video to be played; when it is detected that the brightness of the current playback environment changes, acquire the second ambient brightness;
[0261] The processing module is further configured to perform color correction processing on multiple unplayed video frame images in the video to be played based on the target color correction parameters corresponding to the second ambient brightness; and play the multiple video frame images after the color correction processing.
[0262] Figure 9 FIG. is a block diagram of an electronic device shown according to an exemplary embodiment. For example, the electronic device may be a smart phone, a tablet computer, etc.
[0263] Referring to Figure 9 , the electronic device 80 may include one or more of the following components: a processing component 83, a memory 84, a power component 85, a multimedia component 86, an audio component 87, an input / output (I / O) interface 88, a sensor component 89, and a communication component 810.
[0264] The processing component 83 generally controls the overall operation of the electronic device 80, such as operations associated with display, telephone call, data communication, camera operation, and recording operation. The processing component 83 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 83 may include one or more modules to facilitate the interaction between the processing component 83 and other components. For example, the processing component 83 may include a multimedia module to facilitate the interaction between the multimedia component 86 and the processing component 83.
[0265] The memory 84 is configured to store various types of data to support the operation of the electronic device 80. Examples of these data include instructions for any application or method operating on the electronic device 80, contact data, phone book data, messages, pictures, videos, etc. The memory 84 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.
[0266] The power component 85 supplies power to various components of the electronic device 80. The power component 85 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 80.
[0267] The multimedia component 86 includes a screen that provides an output interface between the electronic device 80 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 86 includes a front camera and / or a rear camera. When the electronic device 80 is in an operation mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
[0268] The audio component 87 is configured to output and / or input audio signals. For example, the audio component 87 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 80 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 84 or transmitted via the communication component 810. In some embodiments, the audio component 87 further includes a speaker for outputting audio signals.
[0269] The I / O interface 88 provides an interface between the processing component 83 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power button, and a lock button.
[0270] The sensor component 89 includes one or more sensors for providing a status assessment of various aspects of the electronic device 80. For example, the sensor component 89 can detect the on / off state of the electronic device 80, the relative positioning of components, such as the display and the keypad of the electronic device 80. The sensor component 89 can also detect a change in the position of the electronic device 80 or a component of the electronic device 80, the presence or absence of user contact with the electronic device 80, the orientation or acceleration / deceleration of the electronic device 80, and a change in the temperature of the electronic device 80. The sensor component 89 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 89 can also include a light sensor, such as a CMOS or a CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 89 can further include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0271] The communication component 810 is configured to facilitate communication between the electronic device 80 and other devices in a wired or wireless manner. The electronic device 80 can access a communication standard-based wireless network, such as Wi-Fi, 4G, or 5G, or a combination thereof. In an exemplary embodiment, the communication component 810 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 810 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0272] In an exemplary embodiment, the electronic device 80 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above method.
[0273] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 84 including instructions, and the above instructions can be executed by a processor 820 of the electronic device 80 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0274] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only to be considered exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0275] It should be understood that the present disclosure is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A video processing method, characterized in that, The method includes: In response to a video playback instruction, obtaining a first ambient brightness of the current playback environment; Based on the first ambient brightness, obtaining a target color correction parameter corresponding to the first ambient brightness from a plurality of pre-stored color correction parameters; wherein, different ambient brightnesses correspond to different color correction parameters; Based on the target color correction parameter, performing color correction processing on the video to be played, and playing the video to be played after color correction processing.
2. The method according to claim 1, wherein The method further includes: Obtaining tone mapping curves corresponding to a plurality of different ambient brightnesses; Based on the tone mapping curves corresponding to the plurality of different ambient brightnesses, determining brightness enhancement parameters of a plurality of color nodes in a preset color node sample at each of the ambient brightnesses; Based on the first pixel values of the plurality of color nodes and the brightness enhancement parameters corresponding to the color nodes, determining second pixel values of the plurality of color nodes at a plurality of different ambient brightnesses; Based on the first pixel values of the plurality of color nodes and the second pixel values of the color nodes at a plurality of different ambient brightnesses, determining color correction parameters corresponding to the plurality of different ambient brightnesses; the color correction parameters are used to describe the mapping relationship between the first pixel value of the color node and the second pixel value of the color node at the corresponding ambient brightness.
3. The method according to claim 2, wherein The determining the second pixel values of the plurality of color nodes at a plurality of different ambient brightnesses based on the first pixel values of the plurality of color nodes and the brightness enhancement parameters corresponding to the color nodes includes: Based on the brightness enhancement parameter of the color node at each of the ambient brightnesses, determining a third pixel value after brightness enhancement of the color node; Determining whether the third pixel value of the color node is less than or equal to the maximum pixel value allowed to be displayed by the display screen; If the third pixel value of the color node is less than or equal to the maximum pixel value, determining the third pixel value of the color node as the second pixel value of the color node at the corresponding ambient brightness.
4. The method according to claim 3, wherein The method further includes: If the third pixel value of the color node is greater than the maximum pixel value, re-determining the brightness enhancement parameter of the color node at the corresponding ambient brightness based on the maximum pixel value and the third pixel value of the color node; According to the first pixel value of the color node and the brightness enhancement parameter of the color node, determining the second pixel value of the color node at the corresponding ambient brightness.
5. The method according to claim 2, wherein The determining the brightness enhancement parameters of the plurality of color nodes in the preset color node sample at each of the ambient brightnesses based on the tone mapping curves corresponding to the plurality of different ambient brightnesses includes: Based on the first pixel values of the plurality of color nodes, determining first chromaticity values corresponding to the plurality of color nodes; Based on the first chromaticity values of the plurality of color nodes and the plurality of tone mapping curves, determining second chromaticity values corresponding to the plurality of color nodes at each of the ambient brightnesses; Based on the first chromaticity values of the multiple color nodes and the second chromaticity values of the color nodes under multiple ambient brightness levels, respectively determine the brightness enhancement parameters of the multiple color nodes under each of the ambient brightness levels.
6. The method according to claim 5, wherein, The determining of the first chromaticity values corresponding to the multiple color nodes based on the first pixel values of the multiple color nodes includes: Perform electro-optical conversion on the first pixel values of the multiple color nodes to obtain the fourth pixel values of the multiple color nodes; convert the fourth pixel values of the multiple color nodes into the first chromaticity values of the multiple color nodes in the XYZ color space; The determining of the color correction parameters corresponding to multiple different ambient brightness levels based on the first pixel values of the multiple color nodes and the second pixel values of the color nodes under multiple different ambient brightness levels further includes: Perform opto-electric conversion on the second pixel values of the color nodes under multiple different ambient brightness levels to obtain the fifth pixel values of the color nodes under multiple different ambient brightness levels; Determine the color correction parameters corresponding to multiple different ambient brightness levels according to the first pixel values of the multiple color nodes and the fifth pixel values of the color nodes under multiple different ambient brightness levels.
7. The method according to any one of claims 1 to 6, characterized in that The method further includes: During the playback of the video to be played, detect whether the brightness of the current playback environment changes; When it is detected that the brightness of the current playback environment changes, obtain the second ambient brightness; Based on the target color correction parameters corresponding to the second ambient brightness, perform color correction processing on multiple video frame images that have not been played in the video to be played; and play the multiple video frame images after color correction processing.
8. A video processing device, characterized in that, Includes: A first acquisition module, configured to acquire the first ambient brightness of the current playback environment in response to a video playback instruction; A second acquisition module, configured to acquire the target color correction parameter corresponding to the first ambient brightness from a plurality of pre-stored color correction parameters based on the first ambient brightness; wherein, the ambient brightness levels corresponding to different color correction parameters are different; A processing module, configured to perform color correction processing on the video to be played based on the target color correction parameter, and play the video to be played after color correction processing.
9. An electronic device, characterized in that, Includes: A processor; A memory for storing executable instructions; Wherein, the processor is configured to: when executing the executable instructions stored in the memory, implement the video processing method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enable the electronic device to execute the video processing method according to any one of claims 1 to 7.