Video Picture Display Method, Device, Terminal and Storage Medium
By obtaining the original screen parameters of the video frame and adjusting them according to the standard screen parameters, the problem of insufficient targeted video screen processing in the prior art is solved, and a clearer and more natural display effect of the video screen is achieved.
Patent Information
- Application Number
- CN202110777879.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-09
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2041-07-09
AI Technical Summary
In the prior art, in video picture processing, it is difficult to perform targeted picture processing according to the actual situation of the video frame, resulting in the video picture that may be oversaturated, overexposure or overprocessed, affecting the picture quality.
By obtaining the original screen parameters of the video frame, determining the screen adjustment parameters based on the standard screen parameters and the original screen parameters, and performing display effects on the video frames, so that the processed screen parameters are consistent with the standard screen parameters.
It achieves a clearer and more natural display effect of the video image, avoiding the situation of excessively weak or excessive screen processing.
Smart Images

Figure CN113507572B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of video processing, and particularly to a method, device, terminal, and storage medium for displaying video frames. Background Art
[0002] Currently, there are many scenarios in the functions of application programs that require obtaining the user's location information. For example, for photo ID receipts, health code registration, etc., the subsequent operations cannot be carried out until the location information is obtained.
[0003] In related technologies, the common location methods are system location and manual selection or input of location information by the user. However, determining location information based on system location can only be carried out when the user enables the system location permission, and the user cannot be prompted to perform necessary location updates during the period when the location permission is turned off; the operation of manually selecting the location is relatively cumbersome, and the user needs to manually select the current location every time the function is used, reducing the function completion rate. Summary of the Invention
[0004] The embodiments of the present application provide a method, device, terminal, and storage medium for displaying video frames. The technical solutions are as follows:
[0005] On the one hand, the embodiments of the present application provide a method for displaying a video frame, the method including:
[0006] Obtaining the original frame parameters of the nth video frame, where the frame parameters determine the visual effect of the video frame;
[0007] Determining the frame adjustment parameters of the nth video frame based on the standard frame parameters and the original frame parameters;
[0008] Performing display effect processing on the nth video frame according to the frame adjustment parameters, so that the actual frame parameters of the nth video frame after processing are consistent with the standard frame parameters;
[0009] Displaying the processed nth video frame.
[0010] On the other hand, the embodiments of the present application provide a device for displaying a video frame, the device including:
[0011] A first obtaining module, configured to obtain the original frame parameters of the nth video frame, where the frame parameters determine the visual effect of the video frame;
[0012] A first determining module, configured to determine the frame adjustment parameters of the nth video frame based on the standard frame parameters and the original frame parameters;
[0013] The first processing module is configured to perform display effect processing on the nth video frame according to the screen adjustment parameters, so that the actual screen parameters of the processed nth video frame are consistent with the standard screen parameters;
[0014] The first display module is configured to display the processed nth video frame.
[0015] On the other hand, an embodiment of the present application provides a terminal, where the terminal includes a processor and a memory; at least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the video screen display method as described in the above aspect.
[0016] On the other hand, an embodiment of the present application provides a computer-readable storage medium, in which at least one computer program is stored, and the computer program is loaded and executed by a processor to implement the video screen display method as described in the above aspect.
[0017] According to one aspect of the present application, there is provided a computer program product or a computer program, where the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the video screen display method provided in various optional implementation manners of the above aspect.
[0018] The beneficial effects brought by the technical solution provided by the embodiment of the present application at least include:
[0019] In the embodiment of the present application, by setting standard screen parameters and determining the screen adjustment method based on the original screen parameters of the video frame, that is, performing different degrees of screen processing according to the actual situation of the video frame, the final display effect of the video frame can reach an ideal state. Compared with the related art that directly adjusts the screen parameters according to a fixed enhancement degree, the video screen can be made clearer and more natural, and the situation of weak or excessive screen processing effects can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flowchart of a video screen display method provided by an exemplary embodiment of the present application;
[0021] Figure 2 is a flowchart of a video screen display method provided by another exemplary embodiment of the present application;
[0022] Figure 3 is a schematic diagram of a video frame processing process provided by an exemplary embodiment of the present application;
[0023] Figure 4 is a flowchart of a saturation processing procedure provided by another exemplary embodiment of the present application;
[0024] Figure 5 is a flowchart of a contrast processing procedure provided by another exemplary embodiment of the present application;
[0025] Figure 6 is a flowchart of a sharpness processing procedure provided by another exemplary embodiment of the present application;
[0026] Figure 7 is a schematic diagram of a video frame processing procedure provided by another exemplary embodiment of the present application;
[0027] Figure 8 is a flowchart of a method for displaying a video picture provided by another exemplary embodiment of the present application;
[0028] Figure 9 is a block diagram of a structure of a video picture display device provided by an exemplary embodiment of the present application;
[0029] Figure 10 is a block diagram of a structure of a terminal provided by an exemplary embodiment of the present application. Detailed Embodiments
[0030] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0031] As used herein, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0032] In the field of video processing, video processing technologies include video source processing and post-processing. Among them, post-processing refers to performing different post-processings from multiple dimensions such as color, contrast, and clarity to improve the video picture quality. In related technologies, fixed enhancements are used when adjusting the saturation, contrast, and sharpness of a video picture, which easily makes a picture with originally high saturation even more saturated or even over-saturated, resulting in picture distortion, makes the contrast of a picture with originally high contrast stronger, and some display contents are overexposed, or makes a picture that is originally relatively sharp even sharper.
[0033] To solve the above technical problems, the present application provides a method for displaying a video picture. The method is applied to a terminal with video processing and video playing functions, and the terminal can be a smart phone, a tablet computer, an e-book reader, a personal portable computer, a desktop computer, etc. The method provided by the embodiments of the present application can perform display effect processing on a video frame based on the original picture parameters of the video frame, so that the picture parameters of the processed video frame are consistent with the standard picture parameters, thereby making video pictures with different parameters clearer and more natural.
[0034] Figure 1 The flowchart of the method for displaying a video picture provided by an exemplary embodiment of the present application is shown. In this embodiment, it is described by taking the method being used in a terminal with video processing and playing functions as an example. The method includes the following steps:
[0035] Step 101, obtain the original picture parameters of the nth video frame, where the picture parameters determine the visual effect of the video frame.
[0036] In a possible implementation manner, the terminal obtains a video file to be played. After decoding to obtain the nth video frame, before rendering and displaying the nth video frame on the screen, the terminal performs picture processing on the nth video frame to optimize the display effect of the nth video frame during video playback. The terminal first performs corresponding detection, data reading and other processing on the nth video frame to obtain the original picture parameters of the nth video frame, so as to adjust the parameters of the nth video frame based on the original picture parameters.
[0037] Among them, the picture parameters are parameters that can determine the visual effect of the picture. By obtaining the original picture parameters of the nth video frame and adjusting its picture parameters, the terminal realizes the improvement and optimization of the video picture display effect. For example, the picture parameters include at least one of parameters such as saturation, contrast, sharpness, brightness, and resolution.
[0038] Step 102, determine the picture adjustment parameters of the nth video frame based on the standard picture parameters and the original picture parameters.
[0039] In a possible implementation manner, the standard picture parameters are stored in the terminal. The standard picture parameters are benchmarks specified by developers during the program development stage based on the visual effects of a large number of video pictures and can enable different video pictures to achieve better display effects.
[0040] Optionally, the standard picture parameters are fixed, that is, the same standard picture parameters are used for all video frames; or, the standard picture parameters corresponding to different video frames may be different. For example, the standard saturation corresponding to a video frame with the main picture content being a portrait is lower than the standard saturation corresponding to a video frame with the main picture content being food.
[0041] The terminal determines the parameter adjustment amplitude required to optimize the nth video frame, i.e., the picture adjustment parameter, based on the standard picture parameters and the original picture parameters of the nth video frame.
[0042] Step 103: Perform display effect processing on the nth video frame according to the picture adjustment parameter, so that the actual picture parameters of the processed nth video frame are consistent with the standard picture parameters.
[0043] The terminal performs display effect processing on the nth video frame according to the adjustment method indicated by the picture adjustment parameter, so that the picture parameters of the adjusted nth video frame are consistent with or close to the standard picture parameters, so as to ensure that the visual effect of the processed nth video frame can reach the display effect corresponding to the standard picture parameters.
[0044] Illustratively, the original saturation of the nth video frame is 75%, and the original sharpness is 30. The standard saturation corresponding to the nth video frame is 70%, and the standard sharpness is 50. The terminal determines that the nth video frame needs to reduce the saturation by 5% and increase the sharpness by 20 based on the original picture parameters and the standard picture parameters, that is, the picture adjustment saturation is -5%, and the picture adjustment sharpness is 20. Then, the display effect processing is performed on the nth video frame according to the picture adjustment saturation and the picture adjustment sharpness.
[0045] Optionally, when there are at least two picture parameters to be adjusted, the terminal adjusts the picture parameters to be adjusted simultaneously, or, due to the correlation between different parameters, the terminal adjusts the picture parameters in a fixed order. For example, after adjusting the contrast of the nth video frame, the terminal obtains the original saturation and the standard saturation of the nth video frame, and then adjusts the saturation of the nth video frame. The embodiments of the present application do not limit this.
[0046] Step 104: Display the processed nth video frame.
[0047] After the terminal performs display effect processing on the nth video frame, it renders and displays it on the screen, and continues to perform corresponding display effect processing on the video frames to be displayed (i.e., the n + 1th video frame and subsequent video frames).
[0048] In summary, in the embodiments of the present application, by setting the standard picture parameters and determining the picture adjustment method based on the original picture parameters of the video frame, that is, performing picture processing to varying degrees according to the actual situation of the video frame, the final display effect of the video frame can reach the ideal state. Compared with the related art that directly adjusts the picture parameters according to a fixed enhancement degree, the video picture can be made clearer and more natural, and the situation of weak or excessive picture processing effects can be avoided.
[0049] In a possible implementation, the terminal processes the display effect of the video frame based on the basic adjustment parameter. The terminal uses the basic adjustment parameter as the parameter adjustment unit and adjusts the actual picture parameter of the video frame to the standard picture parameter by changing the adjustment ratio of the basic adjustment parameter.
[0050] Figure 2 The flowchart of the display method of the video picture provided by another exemplary embodiment of the present application is shown. This embodiment is described by taking the method being used in a terminal with video processing and playing functions as an example. The method includes the following steps:
[0051] Step 201, obtain the original picture parameter of the nth video frame, where the picture parameter determines the visual effect of the video frame.
[0052] For the specific implementation of step 201, reference can be made to the above step 101, and details are not described herein again in the embodiments of the present application.
[0053] Step 202, determine the parameter difference between the standard picture parameter and the original picture parameter as the picture adjustment parameter.
[0054] In a possible implementation, since the terminal needs to adjust the actual picture parameter of the nth video frame to be consistent with the standard picture parameter, the parameter difference between the standard picture parameter and the original picture parameter is determined as the picture adjustment parameter, and based on the picture adjustment parameter, the picture parameter of the nth video frame is adjusted to the standard picture parameter, avoiding the situation of over-adjustment or under-adjustment.
[0055] Illustratively, if the original saturation of the nth video frame is 60% and the standard saturation is 70%, then the terminal determines that the picture adjustment saturation in the picture adjustment parameter is 10%.
[0056] Step 203, determine the parameter adjustment coefficient based on the picture adjustment parameter and the basic adjustment parameter. The picture adjustment parameter is the product of the basic adjustment parameter and the parameter adjustment coefficient.
[0057] In a possible implementation, the basic adjustment parameter is stored in the terminal. After the terminal determines the picture adjustment parameter of the nth video frame, the parameter adjustment coefficient is determined based on the proportional relationship between the picture adjustment parameter and the basic adjustment parameter.
[0058] Optionally, the basic adjustment parameter is a fixed value, that is, the basic adjustment parameter used by the terminal to process any video frame is the same; or, the basic adjustment parameters corresponding to different video frames may be different. For example, the basic adjustment sharpness corresponding to a portrait is less than the basic adjustment sharpness corresponding to a landscape, etc. The terminal determines the appropriate basic adjustment parameter based on the picture content of the video frame.
[0059] Illustratively, the formula for picture parameter adjustment is as follows:
[0060] X1 = X2 + A * X3
[0061] Among them, X1 is the standard picture parameter, X2 is the original picture parameter, X3 is the basic adjustment parameter, and A is the parameter adjustment coefficient. Therefore, A * X3 is the picture adjustment parameter.
[0062] Based on the example in step 202, the adjusted saturation of the nth video frame is 10%. If the basic adjusted saturation is 5%, the saturation adjustment coefficient is determined to be 2.
[0063] When the original picture parameter is lower than the standard picture parameter, the parameter adjustment coefficient is a positive number; when the original picture parameter is higher than the standard picture parameter, the parameter adjustment coefficient is a negative number. Therefore, regardless of whether the original picture parameter is high or low, the terminal can pull it to the standard picture parameter, avoiding the situation in the related art where the parameters of the original picture are ignored and the adjustment range is determined based on the picture content, resulting in insufficient or excessive picture processing.
[0064] In a possible implementation manner, the basic adjustment parameter is related to the picture content of the video frame. Different picture contents have different adjustment requirements for various parameters. Before the terminal determines the parameter adjustment coefficient, it is necessary to determine the basic adjustment parameter. Before step 203, the following steps are also included:
[0065] Step 1: Perform scene recognition on the nth video frame to determine the target picture content corresponding to the nth video frame.
[0066] In a possible implementation manner, the terminal performs scene recognition on the nth video frame based on the AI algorithm to determine the target picture content corresponding to the nth video frame.
[0067] Optionally, when the video frame contains at least two types of picture content, the terminal determines the target picture content based on the priority of each picture content. For example, when the nth video frame contains two types of picture content, "portrait" and "food", the priority of "portrait" is higher than that of "food", and the terminal determines the target picture content as "portrait"; or, the terminal determines the target picture content based on the proportion of each picture content in the video picture. For example, the picture content with the highest proportion is determined as the target picture content. This application embodiment does not make any limitations in this regard.
[0068] Step 2: Determine the basic adjustment parameter of the nth video frame based on the target picture content.
[0069] Each type of picture content corresponds to a set of basic adjustment parameters. The terminal determines the basic adjustment parameters corresponding to the target picture content based on the correspondence between the picture content and the basic adjustment parameters, and then performs optimization processing on the nth video frame. For example, the basic adjusted saturation corresponding to "portrait" is 2, and the basic adjusted saturation corresponding to "food" is 5.
[0070] Step 204: Perform display effect processing on the nth video frame based on the parameter adjustment coefficient and the basic adjustment parameter.
[0071] Based on the parameter adjustment coefficient and the basic adjustment parameter, the terminal adjusts the picture parameters of the nth video frame to the standard picture parameters, so that the display effect of the nth video frame reaches the display effect of the standard picture parameters.
[0072] Step 205: Display the processed nth video frame.
[0073] For the specific implementation manner of Step 205, reference may be made to the above Step 104, and details are not described herein again in the embodiments of the present application.
[0074] In the embodiments of the present application, the basic adjustment saturation is set, and by adjusting the parameter adjustment coefficient of the basic adjustment saturation, the picture adjustment parameters are made to satisfy the parameter difference between the standard picture parameters and the original picture parameters, so as to pull the picture parameters of the nth video frame to the standard picture parameters, and the display effect of the nth video frame can reach the ideal effect whether the original picture parameters are higher or lower than the standard picture parameters.
[0075] The above embodiments summarize the process of video frame processing. Based on this process, in a possible implementation manner, the embodiments of the present application provide the adjustment processes of three picture parameters: saturation, sharpness, and contrast. As Figure 3 shown, the terminal inputs the original picture into the effect processing module 310 for display effect processing to obtain a post-processed picture, where the effect processing module 310 includes a contrast processing unit 311, a sharpness processing unit 312, and a saturation processing unit 313. Optionally, the above three units are independent of each other, or the same processing unit is responsible for performing the picture processing tasks of the above three units.
[0076] Schematically, Figure 4 shows the adjustment process of the video picture saturation.
[0077] Step 401: Obtain the three-primary color brightness (Red, Green, Blue, RGB) values of the nth video frame.
[0078] Step 402: Perform color space conversion on the RGB values to obtain the original saturation of the nth video frame.
[0079] The saturation of a color refers to the vividness of the color and is also called purity. The terminal cannot directly obtain the saturation of the picture from the video frame, and the RGB color model is a color standard in the industrial field. It obtains various colors through the changes of the three color channels of red (R), green (G), and blue (B) and their superposition with each other. RGB represents the colors of the three channels of red, green, and blue. This standard includes almost all the colors that the human vision can perceive and is one of the most widely used color systems. There is a certain conversion relationship between the RGB value and the saturation, and the RGB value can be correspondingly converted into the hue, saturation, and lightness of the image. Therefore, in a possible implementation, the terminal indirectly obtains the original saturation of the nth video frame based on the color space conversion relationship between the RGB value and the saturation.
[0080] Step 403: Determine the saturation difference between the standard saturation and the original saturation as the saturation for picture adjustment.
[0081] The standard saturation belongs to the standard picture parameters, and the original saturation is the original picture parameters. The terminal needs to adjust the actual saturation of the nth video frame during on-screen display to be consistent with the standard saturation. Therefore, the terminal determines the saturation difference between the standard saturation and the original saturation as the saturation for picture adjustment.
[0082] Illustratively, if the original saturation of the nth video frame is 50% and the standard saturation is 70%, then the saturation for picture adjustment is 20%.
[0083] Step 404: Determine the saturation adjustment coefficient based on the saturation for picture adjustment and the basic adjustment saturation.
[0084] In a possible implementation, the basic adjustment saturation is stored in the terminal. After the terminal determines the saturation for picture adjustment of the nth video frame, it determines the saturation adjustment coefficient based on the proportional relationship between the saturation for picture adjustment and the basic adjustment saturation. Illustratively, the adjustment formula for saturation is as follows:
[0085] S1 = S2 + A1 * S3
[0086] Where, S1 is the standard picture saturation, S2 is the original picture saturation, S3 is the basic adjustment saturation, A1 is the saturation adjustment coefficient, and A1 * S3 is the saturation for picture adjustment.
[0087] Illustratively, based on the example in step 403, if the saturation for picture adjustment of the nth video frame is 20% and the basic adjustment saturation S3 is 5%, then the saturation adjustment coefficient A1 is determined to be 4.
[0088] Step 405: Based on the base saturation adjustment and the saturation adjustment coefficient, adjust the saturation of the nth video frame from the original saturation to the standard saturation.
[0089] Based on the base saturation adjustment S3 and the saturation adjustment coefficient A1, the terminal increases A1 * S3 on the basis of the original saturation S1, so that the actual saturation of the nth video frame is consistent with the standard saturation S1.
[0090] Step 406: Display the processed nth video frame.
[0091] For the specific implementation manner of Step 406, reference may be made to Step 104 above, and details are not described herein again in the embodiments of the present application.
[0092] Schematically, Figure 5 shows the adjustment process of the video picture contrast.
[0093] Step 501: Obtain the image histogram corresponding to the nth video frame.
[0094] Step 502: Obtain the original contrast of the nth video frame based on the image histogram.
[0095] Contrast is a measure of the brightness difference between the bright area and the dark area in a certain scene of an image. The histogram can describe the contrast situation of the image. A wide histogram can reflect that an image has a high contrast, and vice versa, a relatively narrow histogram reflects that an image has a low contrast. The terminal cannot directly obtain the original contrast from the video frame and needs to first convert the video frame to obtain the image histogram corresponding to the nth video frame, and obtain the original contrast of the nth video frame from the image histogram.
[0096] Step 503: Determine the picture adjustment contrast as the contrast difference between the standard contrast and the original contrast.
[0097] In a possible implementation manner, since the terminal needs to adjust the actual contrast of the nth video frame to be consistent with the standard contrast, the contrast difference between the standard contrast and the original contrast is determined as the picture adjustment contrast, and based on the picture adjustment contrast, the contrast of the nth video frame is adjusted to the standard contrast, avoiding over-adjustment or under-adjustment.
[0098] Schematically, if the original contrast of the nth video frame is 90 and the standard contrast is 80, the terminal determines the picture adjustment contrast to be -10.
[0099] Step 504: Determine the contrast adjustment coefficient based on the picture adjustment contrast and the base adjustment contrast.
[0100] In a possible implementation, the terminal stores a basic adjusted contrast. By increasing or decreasing the basic adjusted contrast by a corresponding ratio, the contrast of the video frame is adjusted to the standard contrast. After the terminal determines the picture adjusted contrast of the nth video frame, based on the proportional relationship between the picture adjusted contrast and the basic adjusted contrast, the contrast adjustment coefficient is determined.
[0101] Schematically, the adjustment formula for contrast is as follows:
[0102] CON1 = CON2 + A2 * CON3
[0103] Where CON1 is the standard contrast, CON2 is the original contrast of the nth video frame, CON3 is the basic adjusted contrast, A2 is the contrast adjustment coefficient, and A2 * CON3 is the picture adjusted contrast.
[0104] Schematically, based on the example in step 503, the picture adjusted contrast of the nth video frame is -10. If the basic adjusted contrast is 2, then the contrast adjustment coefficient is determined to be -5.
[0105] Step 505, based on the basic adjusted contrast and the contrast adjustment coefficient, adjust the contrast of the nth video frame from the original contrast to the standard contrast.
[0106] The terminal, based on the basic adjusted contrast S3 and the contrast adjustment coefficient A2, increases A2 * S3 on the basis of the original contrast S2, so that the actual contrast of the nth video frame is consistent with the standard contrast S1.
[0107] Step 506, display the processed nth video frame.
[0108] For the specific implementation manner of step 506, reference may be made to the above step 104, and details are not described herein again in the embodiments of the present application.
[0109] Schematically, Figure 6 shows the adjustment process of the sharpness of the video picture.
[0110] Step 601, perform sharpness detection on the nth video frame to obtain the original sharpness of the nth video frame.
[0111] Schematically, the terminal performs sharpness detection on the nth video frame based on detection methods such as the Modulation Transfer Function (MTF) or the Spatial Frequency Response (SFR) algorithm to obtain the original sharpness.
[0112] Step 602, determine the sharpness difference between the standard sharpness and the original sharpness as the picture adjusted sharpness.
[0113] The standard sharpness belongs to the standard picture parameters, and the original sharpness is the original picture parameter. The terminal needs to adjust the actual sharpness of the nth video frame when it is displayed on the screen to be consistent with the standard sharpness. Therefore, the terminal determines the sharpness difference between the standard sharpness and the original sharpness as the picture adjustment sharpness.
[0114] Illustratively, if the original sharpness of the nth video frame is 20 and the standard sharpness is 35, then the picture adjustment sharpness is 15.
[0115] Since there are multiple resolutions for videos, and different resolutions of video frames require corresponding different parameters for processing such as blurring, noise, and downsampling. If the dimension of resolution is not considered, it may lead to the improvement of the clarity of some video frames and the deterioration of the clarity of some video frames after the sharpness of the video frames is optimized. Therefore, in a possible implementation manner, in order to ensure that the video picture after optimizing the sharpness is clearer than before optimizing, before step 602, the following steps are further included:
[0116] Step three, obtain the target resolution of the nth video frame.
[0117] Step four, based on the corresponding relationship between the resolution and the sharpness, determine the standard sharpness corresponding to the target resolution, and the resolution and the sharpness are in a positive correlation relationship.
[0118] In a possible implementation manner, the terminal stores the corresponding relationship between the resolution and the sharpness. The terminal obtains the target resolution of the nth video frame, and based on the above corresponding relationship, determines the sharpness corresponding to the target resolution as the standard sharpness of the nth video frame.
[0119] Illustratively, the resolution and the sharpness are in a positive correlation relationship. For example, for video frames of 1080P and above, the standard sharpness is set within the range of 40 to 50, and for video frames of 720P to 1080P, the standard sharpness is set within the range of 30 to 40.
[0120] Step 603, determine the sharpness adjustment coefficient based on the picture adjustment sharpness and the basic adjustment sharpness.
[0121] In a possible implementation manner, the terminal stores the basic adjustment sharpness. After the terminal determines the picture adjustment sharpness of the nth video frame, based on the proportional relationship between the picture adjustment sharpness and the basic adjustment sharpness, the sharpness adjustment coefficient is determined. Illustratively, the adjustment formula for sharpness is as follows:
[0122] sh1 = sh2 + A3 * sh3
[0123] Among them, sh1 is the standard picture sharpness, sh2 is the original picture sharpness, sh3 is the basic adjusted sharpness, A3 is the sharpness adjustment coefficient, and A3*sh3 is the picture adjusted sharpness.
[0124] Illustratively, based on the example in step 602, the picture adjusted sharpness of the nth video frame is 15. If the basic adjusted sharpness sh3 is 5, then the sharpness adjustment coefficient A3 is determined to be 3.
[0125] Step 604: Based on the basic adjusted sharpness and the sharpness adjustment coefficient, adjust the sharpness of the nth video frame from the original sharpness to the standard sharpness.
[0126] The terminal, based on the basic adjusted sharpness sh3 and the sharpness adjustment coefficient A3, increases by A3*sh3 on the basis of the original sharpness sh1, so that the actual sharpness of the nth video frame is consistent with the standard sharpness sh1.
[0127] Step 605: Display the processed nth video frame.
[0128] For the specific implementation manner of step 605, reference may be made to the above step 104, and details are not described herein again in the embodiments of the present application.
[0129] In the embodiments of the present application, by obtaining the original saturation, original contrast, and original sharpness of the video frame, the gap between the display effect of the video frame and the standard display effect is determined. Then, the saturation, contrast, and sharpness are optimized respectively according to the standard picture parameters, so that the actual saturation, actual contrast, and actual sharpness of the optimized video frame are respectively consistent with the standard saturation, standard contrast, and standard sharpness, which can make the display effects of video pictures with different saturations, contrasts, and sharpnesses reach a natural and clear state, and prevent the occurrence of over-saturation, over-exposure, over-sharpness, or under-saturation, poor contrast, and poor sharpness.
[0130] Optionally, after the above three embodiments are combined, the terminal performs saturation, contrast, and sharpness optimization processing on the same video frame. During this processing, the terminal can process in a fixed order in sequence, or the three processes can be performed synchronously. Figure 7 Shows a schematic diagram of the optimization process of the terminal for the contrast, sharpness, and saturation of the nth video frame. After the terminal obtains the original picture of the nth video frame, the following steps are executed: Step 701: Obtain the histogram; Step 702: Adjust the contrast; Step 703: Obtain the image edge; Step 704: Adjust the sharpness; Step 705: Obtain RGB; Step 706: Adjust the saturation. Specifically, the above steps are executed by the algorithm processing module in the effect processing module, and finally the post-processed picture is obtained.
[0131] Figure 8The flowchart of the display method of the video picture provided by another exemplary embodiment of the present application is shown. In this embodiment, it is described by taking the method being used in a terminal with video processing and playing functions as an example. The method includes the following steps:
[0132] Step 801, obtain the original picture parameters of the nth video frame, where the picture parameters determine the visual effect of the video frame.
[0133] For the specific implementation manner of step 801, reference can be made to step 101 above, and the embodiments of the present application will not elaborate here.
[0134] Step 802, perform scene recognition on the nth video frame to determine the target picture content corresponding to the nth video frame.
[0135] In a possible implementation manner, the picture parameters corresponding to different picture contents are different. For example, compared with food and scenery, a portrait requires lower saturation and sharpness. Therefore, before determining the standard picture parameters, the terminal needs to perform scene recognition on the nth video frame to determine the target picture content of the nth video frame.
[0136] Optionally, when the video frame contains at least two kinds of picture contents, the terminal determines the target picture content based on the priority of each picture content. For example, when the nth video frame contains two kinds of picture contents, "portrait" and "food", and the priority of "portrait" is higher than that of "food", the terminal determines the target picture content as "portrait"; or, the terminal determines the target picture content based on the proportion of each picture content in the video picture. For example, the picture content with the highest proportion is determined as the target picture content. The embodiments of the present application do not limit this.
[0137] Step 803, based on the correspondence between the picture content and the picture parameters, determine the standard picture parameters corresponding to the target picture content.
[0138] In a possible implementation manner, the terminal stores the correspondence between the picture content and the picture parameter range. Based on the above correspondence, the terminal determines the picture parameters corresponding to the target picture content as the standard picture parameters.
[0139] Step 804, based on the standard picture parameters and the original picture parameters, determine the picture adjustment parameters of the nth video frame.
[0140] Step 805, perform display effect processing on the nth video frame according to the picture adjustment parameters, so that the actual picture parameters of the processed nth video frame are consistent with the standard picture parameters.
[0141] Step 806, display the processed nth video frame.
[0142] For the specific implementation manners of steps 804 to 806, reference may be made to the above steps 102 to 104, and details are not described herein again in the embodiments of the present application.
[0143] Step 807: Process the display effects of the (n + 1)-th video frame to the (n + m)-th video frame according to the picture adjustment parameters of the n-th video frame, where m is a positive integer.
[0144] In a possible implementation manner, the terminal performs the above optimization processing on each video frame. However, since the content between most adjacent video frames in the video is continuous and similar, the corresponding standard picture parameters are the same or similar. To improve the display efficiency of the video picture and save video processing resources, in another possible implementation manner, the terminal processes the display effects of the consecutive m video frames after the n-th video frame by using the picture adjustment parameters of the n-th video frame, that is, the picture adjustment parameters corresponding to every m + 1 video frames are the same, and the terminal can directly process the pictures of the (n + 1)-th to the (n + m)-th video frames.
[0145] Illustratively, if m is 4, the terminal executes the above steps to determine the picture adjustment parameters of the first video frame, and processes the display effects of the first video frame to the fifth video frame according to the picture adjustment parameters of the first video frame, re-determines the picture adjustment parameters of the sixth video frame, and processes the display effects of the sixth video frame to the tenth video frame according to the picture adjustment parameters of the sixth video frame, and so on until all video frames are processed.
[0146] Step 808: Display the processed (n + 1)-th video frame to the (n + m)-th video frame.
[0147] Optionally, the terminal immediately performs rendering and screen display processing on each processed video frame, or the terminal performs screen display processing on all m video frames according to the timestamps after all optimizations are completed. The embodiments of the present application do not make any limitations thereto.
[0148] In the embodiments of the present application, the terminal performs content recognition on video frames, determines standard picture parameters based on the target picture content, so that video frames with different picture contents can be optimized to meet the corresponding display effect requirements; for consecutive multiple video frames, the same picture adjustment parameters are used for display effect processing, which improves the processing efficiency of video frames while optimizing the video picture and avoids playback jams.
[0149] Figure 9 The block diagram of a display device for a video picture provided by an exemplary embodiment of the present application is shown. The device includes:
[0150] A first acquisition module 901, configured to acquire the original picture parameters of the n-th video frame, where the picture parameters determine the visual effect of the video frame;
[0151] A first determination module 902, configured to determine a picture adjustment parameter of the nth video frame based on a standard picture parameter and the original picture parameter;
[0152] A first processing module 903, configured to perform display effect processing on the nth video frame according to the picture adjustment parameter, so that the actual picture parameter of the processed nth video frame is consistent with the standard picture parameter;
[0153] A first display module 904, configured to display the processed nth video frame.
[0154] Optionally, the first determination module 902 includes:
[0155] A first determination unit, configured to determine a parameter difference between the standard picture parameter and the original picture parameter as the picture adjustment parameter;
[0156] The first processing module 903 includes:
[0157] A second determination unit, configured to determine a parameter adjustment coefficient based on the picture adjustment parameter and a basic adjustment parameter, where the picture adjustment parameter is a product of the basic adjustment parameter and the parameter adjustment coefficient;
[0158] A processing unit, configured to perform display effect processing on the nth video frame based on the parameter adjustment coefficient and the basic adjustment parameter.
[0159] Optionally, the original picture parameter includes an original saturation;
[0160] The first acquisition module 901 includes:
[0161] A first acquisition unit, configured to acquire RGB values of the three primary colors of the nth video frame;
[0162] A conversion unit, configured to perform color space conversion on the RGB values to obtain the original saturation of the nth video frame;
[0163] The first determination unit is further configured to:
[0164] Determine a saturation difference between the standard saturation and the original saturation as a picture adjustment saturation;
[0165] The second determination unit is further configured to:
[0166] Determine a saturation adjustment coefficient based on the picture adjustment saturation and a basic adjustment saturation;
[0167] The processing unit is further configured to:
[0168] Based on the saturation adjusted by the base and the saturation adjustment coefficient, adjust the saturation of the nth video frame from the original saturation to the standard saturation.
[0169] Optionally, the original picture parameters include the original contrast;
[0170] The first acquisition module 901 includes:
[0171] A second acquisition unit for acquiring the image histogram corresponding to the nth video frame;
[0172] A third acquisition unit for acquiring the original contrast of the nth video frame based on the image histogram;
[0173] The first determination unit is further configured to:
[0174] Determine the contrast difference between the standard contrast and the original contrast as the picture adjustment contrast;
[0175] The second determination unit is further configured to:
[0176] Determine the contrast adjustment coefficient based on the picture adjustment contrast and the base adjustment contrast;
[0177] The processing unit is further configured to:
[0178] Based on the base adjustment contrast and the contrast adjustment coefficient, adjust the contrast of the nth video frame from the original contrast to the standard contrast.
[0179] Optionally, the original picture parameters include the original sharpness;
[0180] The first acquisition module 901 includes:
[0181] A fourth acquisition unit for performing sharpness detection on the nth video frame to acquire the original sharpness of the nth video frame;
[0182] The first determination unit is further configured to:
[0183] Determine the sharpness difference between the standard sharpness and the original sharpness as the picture adjustment sharpness;
[0184] The second determination unit is further configured to:
[0185] Determine the sharpness adjustment coefficient based on the picture adjustment sharpness and the base adjustment sharpness;
[0186] The processing unit is further configured to:
[0187] Based on the base sharpness and the sharpness adjustment coefficient, adjust the sharpness of the nth video frame from the original sharpness to the standard sharpness.
[0188] Optionally, the device further includes:
[0189] A second acquisition module, configured to acquire the target resolution of the nth video frame;
[0190] A second determination module, configured to determine the standard sharpness corresponding to the target resolution based on the correspondence between the resolution and the sharpness, where the resolution and the sharpness are in a positive correlation relationship.
[0191] Optionally, the device further includes:
[0192] A first recognition module, configured to perform scene recognition on the nth video frame to determine the target picture content corresponding to the nth video frame;
[0193] A third determination module, configured to determine the base adjustment parameter of the nth video frame based on the target picture content.
[0194] Optionally, the device further includes:
[0195] A second recognition module, configured to perform scene recognition on the nth video frame to determine the target picture content corresponding to the nth video frame;
[0196] A fourth determination module, configured to determine the standard picture parameter corresponding to the target picture content based on the correspondence between the picture content and the picture parameter.
[0197] Optionally, the device further includes:
[0198] A second processing module, configured to perform display effect processing on the (n + 1)th video frame to the (n + m)th video frame according to the picture adjustment parameter of the nth video frame, where m is a positive integer;
[0199] A second display module, configured to display the processed (n + 1)th video frame to the (n + m)th video frame.
[0200] Please refer to Figure 10 , which shows a structural block diagram of a terminal 1000 provided by an exemplary embodiment of the present application. The terminal 1000 may be an electronic device such as a smart phone, a tablet computer, an e-book, or a portable personal computer installed with and running an application program. The terminal 1000 in the present application may include one or more of the following components: a processor 1020, a memory 1010, and a screen 1030.
[0201] The processor 1020 may include one or more processing cores. The processor 1020 connects various parts within the entire terminal 1000 using various interfaces and lines. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 1010, and by invoking the data stored in the memory 1010, it performs various functions of the terminal 1000 and processes data. Optionally, the processor 1020 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 1020 may integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing the content to be displayed on the screen 1030; the modem is used to process wireless communication. It can be understood that the above modem may not be integrated into the processor 1020 and may be implemented separately through a communication chip.
[0202] The memory 1010 may include random access memory (RAM) and may also include read-only memory (ROM). Optionally, the memory 1010 includes a non-transitory computer-readable storage medium. The memory 1010 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1010 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above various method embodiments, etc. The operating system may be the Android system (including systems developed based on the Android system in depth), the IOS system developed by Apple Inc. (including systems developed based on the IOS system in depth), or other systems. The data storage area may also store the data created during the use of the terminal 1000 (such as phone book, audio and video data, chat record data, etc.).
[0203] The screen 1030 can be a capacitive touch display screen, which is used to receive touch operations of a user on or near it with any suitable object such as a finger or a stylus, and to display the user interfaces of various application programs. The touch display screen is usually arranged on the front panel of the terminal 1000. The touch display screen can be designed as a full-screen, a curved screen or a special-shaped screen. The touch display screen can also be designed as a combination of a full-screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of the present application.
[0204] In addition, those skilled in the art can understand that the structure of the terminal 1000 shown in the above drawings does not constitute a limitation on the terminal 1000. The terminal may include more or fewer components than those shown in the drawings, or combine certain components, or have different component arrangements. For example, the terminal 1000 further includes components such as a radio frequency circuit, a shooting component, a sensor, an audio circuit, a Wireless Fidelity (WiFi) component, a power supply, and a Bluetooth component, which will not be elaborated here.
[0205] The embodiments of the present application further provide a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the video picture display method described in each of the above embodiments.
[0206] According to one aspect of the present application, there is provided a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the video picture display method provided in various optional implementation manners of the above aspect.
[0207] Those skilled in the art should be able to realize that in the above one or more examples, the functions described in the embodiments of the present application can be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. The computer-readable storage medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0208] The above are only optional embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for displaying a video picture, characterized in that, the method includes: Obtain the original picture parameters of the nth video frame, where the picture parameters determine the visual effect of the video frame; Perform scene recognition on the nth video frame to determine the target picture content corresponding to the nth video frame, where the target picture content is the highest-priority picture content included in the nth video frame, or the picture content with the highest proportion in the video picture of the nth video frame; Based on the correspondence between the picture content and the picture parameters, determine the standard picture parameters corresponding to the target picture content, where, when the standard picture parameters are the standard sharpness, the standard sharpness is also determined based on the target resolution of the nth video frame and the correspondence between the resolution and the sharpness, and the resolution and the sharpness are in a positive correlation; Determine the parameter difference between the standard picture parameters and the original picture parameters as the picture adjustment parameters of the nth video frame; Determine the basic adjustment parameters of the nth video frame based on the target picture content, where the basic adjustment parameters are parameter adjustment units, and different picture contents correspond to different basic adjustment parameters; Determine the parameter adjustment coefficient based on the picture adjustment parameters and the basic adjustment parameters, and the picture adjustment parameters are the product of the basic adjustment parameters and the parameter adjustment coefficient; In the case where at least two picture parameters need to be adjusted, based on the parameter adjustment coefficient, the basic adjustment parameters, and the correlation between the at least two picture parameters, perform display effect processing on the nth video frame in a fixed order so that the actual picture parameters of the nth video frame after processing are consistent with the standard picture parameters, where, when the at least two picture parameters include saturation, sharpness, and contrast, the fixed order is contrast, sharpness, and saturation in sequence; Display the processed nth video frame.
2. The method according to claim 1, characterized in that, the original picture parameters include the original saturation; The obtaining of the original picture parameters of the nth video frame includes: Obtain the RGB values of the three primary color brightness values of the nth video frame; Perform color space conversion on the RGB values to obtain the original saturation of the nth video frame; The determining of the parameter difference between the standard picture parameters and the original picture parameters as the picture adjustment parameters of the nth video frame includes: Determine the saturation difference between the standard saturation and the original saturation as the picture adjustment saturation; The determining of the parameter adjustment coefficient based on the picture adjustment parameters and the basic adjustment parameters includes: Determine the saturation adjustment coefficient based on the picture adjustment saturation and the basic adjustment saturation; The performing of display effect processing on the nth video frame based on the parameter adjustment coefficient and the basic adjustment parameters includes: Based on the basic adjustment saturation and the saturation adjustment coefficient, adjust the saturation of the nth video frame from the original saturation to the standard saturation.
3. The method according to claim 1, characterized in that, the original picture parameters include the original contrast; Obtaining the original picture parameters of the nth video frame includes: Obtaining the image histogram corresponding to the nth video frame; Obtaining the original contrast of the nth video frame based on the image histogram; Determining the parameter difference between the standard picture parameters and the original picture parameters as the picture adjustment parameter of the nth video frame includes: Determining the contrast difference between the standard contrast and the original contrast as the picture adjustment contrast; Determining the parameter adjustment coefficient based on the picture adjustment parameter and the basic adjustment parameter includes: Determining the contrast adjustment coefficient based on the picture adjustment contrast and the basic adjustment contrast; Performing display effect processing on the nth video frame based on the parameter adjustment coefficient and the basic adjustment parameter includes: Adjusting the contrast of the nth video frame from the original contrast to the standard contrast based on the basic adjustment contrast and the contrast adjustment coefficient.
4. The method according to claim 1, wherein, the original picture parameters include original sharpness; Obtaining the original picture parameters of the nth video frame includes: Performing sharpness detection on the nth video frame to obtain the original sharpness of the nth video frame; Determining the parameter difference between the standard picture parameters and the original picture parameters as the picture adjustment parameter of the nth video frame includes: Determining the sharpness difference between the standard sharpness and the original sharpness as the picture adjustment sharpness; Determining the parameter adjustment coefficient based on the picture adjustment parameter and the basic adjustment parameter includes: Determining the sharpness adjustment coefficient based on the picture adjustment sharpness and the basic adjustment sharpness; Performing display effect processing on the nth video frame based on the parameter adjustment coefficient and the basic adjustment parameter includes: Adjusting the sharpness of the nth video frame from the original sharpness to the standard sharpness based on the basic adjustment sharpness and the sharpness adjustment coefficient.
5. The method according to any one of claims 1 to 4, wherein, after displaying the processed nth video frame, the method further includes: Performing display effect processing on the (n + 1)th to (n + m)th video frames according to the picture adjustment parameter of the nth video frame, where m is a positive integer; Displaying the processed (n + 1)th to (n + m)th video frames.
6. A display device for video pictures, wherein, the device includes: A first acquisition module for acquiring the original picture parameters of the nth video frame, where the picture parameters determine the visual effect of the video frame; A first recognition module for performing scene recognition on the nth video frame to determine the target picture content corresponding to the nth video frame, where the target picture content is the highest-priority picture content included in the nth video frame, or, the picture content that occupies the largest proportion of the video picture in the nth video frame; A fourth determination module, configured to determine a standard picture parameter corresponding to the target picture content based on the correspondence between the picture content and the picture parameter. Wherein, when the standard picture parameter is the standard sharpness, the standard sharpness is further determined based on the target resolution of the nth video frame and the correspondence between the resolution and the sharpness, and there is a positive correlation between the resolution and the sharpness; A first determination module, configured to determine the parameter difference between the standard picture parameter and the original picture parameter as the picture adjustment parameter of the nth video frame; A third determination module, configured to determine the basic adjustment parameter of the nth video frame based on the target picture content, where the basic adjustment parameter is a parameter adjustment unit, and different picture contents correspond to different basic adjustment parameters; A first processing module, configured to determine a parameter adjustment coefficient based on the picture adjustment parameter and the basic adjustment parameter, where the picture adjustment parameter is the product of the basic adjustment parameter and the parameter adjustment coefficient; When there are at least two picture parameters to be adjusted, perform display effect processing on the nth video frame in a fixed order based on the parameter adjustment coefficient, the basic adjustment parameter, and the correlation between the at least two picture parameters, so that the actual picture parameter of the nth video frame after processing is consistent with the standard picture parameter. Wherein, when the at least two picture parameters include saturation, sharpness, and contrast, the fixed order is contrast, sharpness, and saturation in sequence; A first display module, configured to display the processed nth video frame.
7. A terminal, characterized in that, the terminal includes a processor and a memory; at least one instruction, at least one program segment, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program segment, the code set or the instruction set is loaded and executed by the processor to implement the video picture display method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, at least one computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by the processor to implement the video picture display method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Video processing method and device, electronic equipment and computer-readable medium
CN109525901A