Image quality adjustment method, device and computer equipment
Patent Information
- Application Number
- CN202511404876.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2045-09-28
AI Technical Summary
[0004]然而,在上述传统技术中,由于视频流中各视频帧之间的画面动态变化,往往会导致连续几帧视频帧的画面场景频繁变化,进而导致播放终端的画质参数在该连续几帧视频帧的播放过程中反复切换,使得播放终端所播放的视频帧画质稳定性较差,影响用户视觉体验
[0033]上述画质调整方法、装置及计算机设备,在播放终端播放视频流的过程中,确定播放终端所播放的当前视频帧的第一画面场景,进而在该第一画面场景与当前视频帧的上一视频帧的历史画面场景不同的情况下,对播放终端在当前视频帧之后所播放的各播放视频帧进行采集,并在采集到每一播放视频帧后,确定该播放视频帧的第二画面场景,并确定该第二画面场景与上述第一画面场景是否相同。其中,若上述第二画面场景与上述第一画面场景相同,则进一步确定该播放视频帧在第一场景画面下的第一置信度和在历史画面场景下的第二置信度,并确定上述第一置信度与第二置信度的数值大小关系,以在上述第一置信度大于第二置信度的情况下,根据上述第一画面场景,调整播放终端的画质参数。这样,一方面,在检测到当前视频帧的画面场景切换的情况下,并不直接调整播放终端的画质参数,而通过对当前视频帧之后所连续播放的各视频帧进行画面场景分析,以在包括当前视频帧在内的连续多帧视频帧的画面场景均切换至同一画面场景的情况下,调整播放终端的画质参数,从而可以解决视频帧画面场景的跳变问题,避免视频帧画面场景频繁变化导致的播放终端画质参数反复切换,提高所播放视频帧画质稳定性,提升用户视觉体验;另一方面,可以通过简单分类模型确定视频帧的画面场景,而无需设计复杂度更高的模型,从而,不会带来设备功耗和内存占用的增加。
Smart Images

Figure CN121309903B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image quality adjustment method, apparatus, and computer equipment. Background Technology
[0002] With the development of image processing technology, AIPQ (Artificial Intelligence Picture Quality) technology has emerged. It can adjust the picture quality (PQ) parameters such as brightness and contrast of the playback terminal as the video stream is played, so as to improve the picture quality of the played video frames and enhance the user's visual experience.
[0003] In traditional technology, during the playback of a video stream on a playback terminal, the current video frame being played is captured, and the scene of the current video frame is determined through a scene classification model. Then, based on the scene of the current video frame, the image quality parameters of the playback terminal are adjusted to enhance the display effect of the playback terminal.
[0004] However, in the aforementioned traditional technologies, due to the dynamic changes in the images between video frames in the video stream, the scene of several consecutive video frames often changes frequently. This causes the image quality parameters of the playback terminal to switch repeatedly during the playback of these consecutive video frames, resulting in poor image quality stability of the video frames played by the playback terminal and affecting the user's visual experience. Summary of the Invention
[0005] Therefore, it is necessary to provide a method, apparatus, and computer device for adjusting image quality to address the aforementioned technical problems. This can prevent the playback terminal from repeatedly switching image quality parameters due to frequent changes in the scene of video frames during video streaming, thereby improving the stability of the image quality of the played video frames and enhancing the user's visual experience.
[0006] Firstly, this application provides a method for adjusting image quality, including:
[0007] During the playback of a video stream on the playback terminal, if the scene of the first frame of the current video frame is different from the historical scene of the previous video frame, the playback video frames after the current video frame are captured.
[0008] After acquiring each playback video frame, if the second scene of the playback video frame is detected to be the same as the first scene, then the first confidence level of the playback video frame under the first scene scene and the second confidence level under the historical scene scene are determined; and,
[0009] If the first confidence level of the video frame being played is greater than the second confidence level, the image quality parameters of the playback terminal are adjusted according to the scene of the first frame.
[0010] In one embodiment, when it is detected that the first scene of the current video frame is different from the historical scene of the previous video frame, the image quality adjustment method further includes:
[0011] Determine the first confidence level of the current video frame in the first-view scene and the second confidence level in the historical scene scene;
[0012] Determine the first confidence level of the played video frame in the first scene and the second confidence level in the historical scene, including:
[0013] Based on the first confidence level of the previous video frame in the first scene and the second confidence level in the historical scene, the first confidence level of the video frame being played is determined.
[0014] In one embodiment, determining the first confidence level of the current video frame in the first scene and the second confidence level in the historical scene includes:
[0015] Based on the current confidence level of the current video frame in the first-view scene and the first historical confidence level of the first-view scene, the first confidence level of the current video frame in the first-view scene is determined; wherein, the current confidence level of the current video frame in the first-view scene is a first value, and the first historical confidence level of the first-view scene is a second value, and the first value is greater than the second value; based on the current confidence level of the current video frame in the historical scene and the first historical confidence level of the historical scene, the second confidence level of the current video frame in the historical scene is determined; wherein, the current confidence level of the current video frame in the historical scene is a second value, and the first historical confidence level of the historical scene is a first value.
[0016] In one embodiment, determining the first confidence level of the played video frame in the first scene scene and the second confidence level in the historical scene scene based on the first confidence level of the previous video frame in the first scene scene and the second confidence level in the historical scene scene includes:
[0017] Based on the current confidence level of the played video frame in the first-view scene and the second historical confidence level of the first-view scene, a first confidence level of the played video frame in the first-view scene is determined; wherein, the current confidence level of the played video frame in the first-view scene is a first value, and the second historical confidence level of the first-view scene is the first confidence level of the previous video frame in the first-view scene; based on the current confidence level of the played video frame in the historical scene and the second historical confidence level of the historical scene, a second confidence level of the played video frame in the historical scene is determined; wherein, the current confidence level of the played video frame in the historical scene is a second value, and the second historical confidence level of the historical scene is the second confidence level of the previous video frame in the historical scene, and the first value is greater than the second value.
[0018] In one embodiment, determining the first confidence level of the played video frame in the first scene based on the current confidence level of the played video frame in the first scene and the second historical confidence level of the first scene includes:
[0019] A first weighted confidence level is obtained by weighting the second historical confidence level of the first scene using a first weighted coefficient; and a second weighted confidence level is obtained by weighting the current confidence level of the played video frame in the first scene using a second weighted coefficient; wherein the sum of the first weighted coefficient and the second weighted coefficient is a preset number of smoothed frames; the first weighted confidence level and the second weighted confidence level are summed to obtain a first sum, and the first confidence level of the played video frame in the first scene is determined based on the ratio of the first sum to the preset number of smoothed frames.
[0020] In one embodiment, determining the second confidence level of the played video frame in the historical scene based on the current confidence level of the played video frame in the historical scene and the second historical confidence level of the historical scene includes:
[0021] A first weighting coefficient is used to weight the second historical confidence level in the historical scene to obtain a third weighted confidence level; and a second weighting coefficient is used to weight the current confidence level of the played video frame in the historical scene to obtain a fourth weighted confidence level; wherein the sum of the first weighting coefficient and the second weighting coefficient is a preset smoothing frame number; the third weighted confidence level and the fourth weighted confidence level are summed to obtain a second sum value, and the second confidence level of the played video frame in the historical scene is determined according to the ratio of the second sum value to the preset smoothing frame number.
[0022] In one embodiment, when it is detected that the first scene of the current video frame is different from the historical scene of the previous video frame, before capturing subsequent video frames, the image quality adjustment method further includes:
[0023] The current video frame is input into the scene classification model, and the scene scene of the current video frame output by the scene classification model is the classification confidence of each preset scene scene. From each preset scene scene, the target scene scene with a classification confidence greater than the corresponding confidence threshold is selected, and the first scene scene of the current video frame is determined based on the target scene scene.
[0024] In one embodiment, determining the first scene of the current video frame based on the target scene includes:
[0025] When there are multiple target scene scenes, the scene scene with the highest priority among the multiple target scene scenes is selected to obtain candidate scene scenes; when there is only one candidate scene scene, the candidate scene scene is determined as the first scene scene of the current video frame; when there are multiple candidate scene scenes, the scene scene with the highest classification confidence among the candidate scene scenes is selected to obtain the first scene scene of the current video frame.
[0026] Secondly, this application also provides an image quality adjustment device, comprising:
[0027] The video frame acquisition module is used to acquire subsequent video frames when the scene of the first frame of the current video frame is different from the scene of the previous video frame during the playback of the video stream on the playback terminal.
[0028] The first determining module is used to determine the first confidence level of the video frame in the first scene and the second confidence level in the historical scene if the second scene of the video frame is detected to be the same as the first scene after each video frame is acquired.
[0029] The image quality adjustment module is used to adjust the image quality parameters of the playback terminal according to the scene of the first frame when the first confidence level of the video frame is greater than the second confidence level.
[0030] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the various method embodiments of the first aspect described above.
[0031] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method embodiments of the first aspect described above.
[0032] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the method embodiments of the first aspect described above.
[0033] The aforementioned image quality adjustment method, apparatus, and computer equipment, during the playback of a video stream on a playback terminal, determine the first scene of the current video frame played by the playback terminal. If the first scene differs from the historical scene of the previous video frame, the playback terminal captures each video frame played after the current video frame. After capturing each video frame, it determines the second scene of that video frame and whether the second scene is the same as the first scene. If the second scene is the same as the first scene, it further determines a first confidence level of the video frame under the first scene and a second confidence level under the historical scene, and determines the numerical relationship between the first and second confidence levels. If the first confidence level is greater than the second confidence level, the image quality parameters of the playback terminal are adjusted according to the first scene. In this way, on the one hand, when a scene change is detected in the current video frame, the playback terminal's image quality parameters are not directly adjusted. Instead, scene analysis is performed on each video frame played consecutively after the current video frame. When the scene of multiple consecutive video frames, including the current video frame, switches to the same scene, the playback terminal's image quality parameters are adjusted. This solves the problem of scene jumps in video frames, avoids repeated switching of playback terminal image quality parameters caused by frequent changes in video frame scene, improves the stability of the played video frame image quality, and enhances the user's visual experience. On the other hand, the scene of a video frame can be determined by a simple classification model, without the need to design a more complex model, thus avoiding an increase in device power consumption and memory usage. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This application provides an illustration of the application environment for the image quality adjustment method provided in some embodiments of this application.
[0036] Figure 2 A flowchart illustrating the image quality adjustment method provided in some embodiments of this application;
[0037] Figure 3 A flowchart illustrating the image quality adjustment method provided in other embodiments of this application;
[0038] Figure 4 A flowchart illustrating the process of determining the first confidence level of the current video frame in a first-view scene and the second confidence level in a historical-view scene, provided for some embodiments of this application;
[0039] Figure 5 A flowchart illustrating the process of determining a first confidence level in a first-view scene and a second confidence level in a historical scene, provided for some embodiments of this application;
[0040] Figure 6 A flowchart illustrating the process of determining the first confidence level of a video frame in a first-screen scene, as provided in some embodiments of this application;
[0041] Figure 7 This is a flowchart illustrating the process of determining the second confidence level of a video frame in a historical scene, as provided in some embodiments of this application.
[0042] Figure 8 A flowchart illustrating the process of determining the first scene of the current video frame according to some embodiments of this application;
[0043] Figure 9 A flowchart illustrating the image quality adjustment method provided in some embodiments of this application;
[0044] Figure 10 Structural block diagram of an image quality adjustment device provided in some embodiments of this application;
[0045] Figure 11 Internal structural diagrams of a computer device provided in some embodiments of this application;
[0046] Figure 12 Internal structural diagrams of a computer device provided for other embodiments of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0048] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments or any combination of multiple embodiments.
[0049] In traditional technology, during the playback of a video stream on a playback terminal, the current video frame being played is captured, and the scene of the current video frame is determined through a scene classification model. Then, based on the scene of the current video frame, the image quality parameters of the playback terminal are adjusted to enhance the display effect of the playback terminal.
[0050] However, in the aforementioned traditional technologies, due to the dynamic changes in the images between video frames in the video stream, the scene of several consecutive video frames often changes frequently. This causes the image quality parameters of the playback terminal to switch repeatedly during the playback of these consecutive video frames, resulting in poor image quality stability of the video frames played by the playback terminal and affecting the user's visual experience.
[0051] In view of this, and to solve the above-mentioned technical problems, an exemplary embodiment provides a method for adjusting image quality. This method can be applied to a computer device, which can be a server or a playback terminal. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The playback terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, smart TVs, smart in-vehicle devices, projection devices, etc.
[0052] In one exemplary embodiment, the image quality adjustment method provided in this application can be applied to, for example, Figure 1 In the application environment shown, the playback terminal 102 communicates with the server 104 via a network. The data storage system can store data that the server 104 needs to process, such as the correspondence between scene images and image quality parameters. The data storage system can be integrated onto the server 104 or located in the cloud or on another network server. The playback terminal 102 stores the scene image of the current video frame in the data storage system, and then the server 104 retrieves the scene image of the current video frame from the data storage system to execute the image quality adjustment method provided in this embodiment.
[0053] In one exemplary embodiment, such as Figure 2 As shown, an image quality adjustment method is provided, which can be applied to... Figure 1 Taking the playback terminal 102 as an example, the following steps may be included:
[0054] S201, during the playback of a video stream on the playback terminal, if it is detected that the first scene of the current video frame is different from the historical scene of the previous video frame, the playback video frames after the current video frame are captured.
[0055] The so-called scene of a video frame refers to the specific scene category or scene attribute to which the video frame belongs, determined by analyzing the content of the video frame (such as objects, environment, etc.), such as night, buildings, food, etc.
[0056] During the playback of a video stream on the playback terminal, the video frame currently being played by the playback terminal is the current video frame. Thus, the current video frame can be captured to determine the scene of the current video frame as the first scene. Then, when the playback terminal plays the next video frame, the next video frame becomes the new current video frame, and the first scene of each video frame played before the next video frame can be used as the historical scene.
[0057] For example, if the playback terminal is currently playing the Nth video frame, then the Nth video frame is the current video frame, and the first scene of the Nth video frame can be determined as scene 1; then the playback terminal plays the N+1th video frame, then the N+1th video frame is the current video frame, and the first scene of the N+1th video frame can be determined as scene 2. Therefore, scene 1 of the Nth video frame can be used as the historical scene of the previous video frame (i.e., the Nth video frame) of the N+1th video frame.
[0058] Optionally, after acquiring each current video frame, the pixel features of that video frame, such as brightness and color distribution, edge detection, etc., are extracted. Based on these extracted pixel features, the first scene of the current video frame is determined. For example, if the edge detection results indicate fewer and more regular edges, the first scene of the current video frame can be determined to be indoors; while if the edge detection results indicate more and more irregular edges, the first scene of the current video frame can be determined to be a street. Similarly, higher brightness and more vibrant colors can determine that the first scene of the current video frame is outdoors during the day, while lower brightness and cooler colors can determine that the first scene of the current video frame is at night, and so on.
[0059] Optionally, during the playback of the video stream on the playback terminal, a screenshot of the display screen on the playback terminal is taken to obtain the current video frame. Alternatively, the running status of the multimedia player in the playback terminal is detected, and if the multimedia player is detected to have started playing the video stream, the video frame currently displayed on the playback terminal is captured to obtain the current video frame; wherein, the aforementioned multimedia player can be a hardware multimedia player such as a TV box, or a software multimedia player such as a streaming media app (application).
[0060] During the playback of a video stream on the playback terminal, starting from the second video frame, after determining the first scene of the current video frame, it is checked whether the first scene of the current video frame is the same as the historical scene of the previous video frame; that is, the current video frame is not the first video frame in the playback video stream. Furthermore, if the first scene of the current video frame is different from the historical scene of the previous video frame, it indicates that there may be a change in the scene between two consecutive video frames (the current video frame and the previous video frame), which may require adjustment of the playback terminal's image quality parameters. Therefore, each video frame played after the current video frame can be called a playback video frame, and each playback video frame is captured.
[0061] In one optional embodiment, if the first scene of the current video frame is the same as the historical scene of the previous video frame, it indicates that there has been no change in the scene between the two consecutive video frames (the current video frame and the previous video frame), and no adjustment of the playback terminal's image quality parameters is required. In this case, subsequent video frames played after the current video frame can be captured as the current video frame, and the actions of determining the first scene of the current video frame and checking whether the first scene of the current video frame is the same as the historical scene of the previous video frame are repeated. This process is repeated until the video stream playback ends.
[0062] S202, after acquiring each video frame, if it is detected that the second scene of the video frame is the same as the first scene, then the first confidence level of the video frame in the first scene and the second confidence level in the historical scene are determined.
[0063] Confidence level is a core indicator in statistics for measuring the reliability of conclusions and the stability of results. Therefore, the first confidence level of a video frame in the first-view scene is used to measure the reliability of the actual scene being played as the first-view scene, while the second confidence level of a video frame in historical scene scenes is used to measure the reliability of the actual scene being played as the historical scene scene.
[0064] If the first scene of the current video frame is detected to be different from the historical scene of the previous video frame, after acquiring each playback video frame after the current video frame, the scene of that playback video frame is determined as the second scene of that playback video frame, and it is checked whether the second scene of the playback video frame is the same as the first scene. If the second scene of the playback video frame is the same as the first scene, it indicates that the scene of multiple consecutive video frames (the current video frame and all currently acquired playback video frames) may change to the first scene relative to the historical scene of the previous video frame. This increases the likelihood that the playback terminal needs to adjust its image quality parameters. To further determine whether the playback terminal needs to adjust its image quality parameters, a first confidence level for the playback video frame in the first scene and a second confidence level in the historical scene can be determined.
[0065] Among them, the first confidence level of the video frame in the first scene and the second confidence level in the historical scene can be used as the first confidence level and the second confidence level corresponding to the video frame.
[0066] Optionally, the similarity between the playing video frame and the current video frame is determined as the first confidence level of the playing video frame in the first scene, and the similarity between the playing video frame and the previous video frame of the current video frame is determined as the first confidence level of the playing video frame in the first scene.
[0067] In one optional embodiment, after acquiring each playback video frame after the current video frame, if the second scene of the playback video frame is different from the first scene, then the playback video frames before the current video frame and the historical scene of the current video frame are determined as the historical scene of the previous video frame of the current video frame. Without adjusting the image quality parameters of the playback terminal, the playback video frame is taken as the new current video frame, and the process returns to step S201.
[0068] S203: After acquiring each video frame, if the first confidence level corresponding to the video frame is greater than the second confidence level, adjust the image quality parameters of the playback terminal according to the first scene.
[0069] For each captured video frame, after obtaining the first confidence level of the video frame in the first scene and the second confidence level in the historical scene, the numerical relationship between the first and second confidence levels can be further detected. If the first confidence level of the video frame is greater than the second confidence level, it can be determined that the reliability of the actual scene of the video frame being the first scene is greater than the reliability of the actual scene being a historical scene. Therefore, it can be determined that, relative to the historical scene of the previous video frame, the scene of multiple consecutive video frames (the current video frame and all currently captured video frames) has indeed changed to the first scene. Thus, the image quality parameters of the playback terminal need to be adjusted. Based on this, the image quality parameters of the playback terminal can be adjusted according to the first scene. In other words, the image quality parameters of the playback terminal will only be adjusted when the scene of multiple consecutive video frames is the same changed scene, effectively avoiding repeated scene conditions between consecutive video frames and thus avoiding affecting the user's visual experience.
[0070] Optionally, a preset correspondence between scene and image quality parameters is provided. This allows the system to find the target image quality parameters corresponding to the first scene from this preset relationship and adjust the current image quality parameters of the playback terminal to the found target image quality parameters. The aforementioned correspondence can be set based on empirical values, experimental values from multiple trials, and the type, content, frequency of scene content changes, and video frame quality of the video stream in the actual application scenario. No specific limitations are imposed on this.
[0071] The specific types of image quality parameters can be set based on empirical values, experimental values from multiple trials, and the type, content, frequency of image content changes, and video frame quality of the video stream played on the playback terminal in the actual application scenario. There are no specific limitations on these parameters. For example, they may include one or more of the following: brightness, transparency, HDR (High Dynamic Range), color temperature, saturation / gain, white balance, sharpness, noise reduction, resolution, refresh rate, and motion compensation. Other parameters may also be included.
[0072] Furthermore, the playback video frame corresponding to the first confidence level being greater than the second confidence level can be referred to as the target playback video frame. Thus, when the playback terminal plays the current video frame and the playback video frames before the target playback video frame, the image quality parameters used are all image quality parameters determined based on the historical scene. That is, the playback terminal actually determines the real scene of the current video frame and the playback video frames before the target playback video frame as the historical scene.
[0073] In one optional embodiment, after each video frame is acquired, if the first confidence level corresponding to the video frame is not greater than the second confidence level, the next video frame is acquired without adjusting the image quality parameters of the playback terminal, and the process returns to S202 above.
[0074] In another optional embodiment, after adjusting the image quality parameters of the playback terminal according to the first scene described above, the next video frame played by the playback terminal will be collected as the new current video frame, and the process will return to S201.
[0075] In the aforementioned image quality adjustment method, during the playback of a video stream on the playback terminal, the first scene of the current video frame played by the playback terminal is determined. If this first scene differs from the historical scene of the previous video frame, each video frame played after the current video frame is captured. After capturing each video frame, the second scene of that video frame is determined, and it is determined whether the second scene is the same as the first scene. If the second scene is the same as the first scene, a first confidence level and a second confidence level of the video frame under the first scene are further determined, and the numerical relationship between the first and second confidence levels is determined. If the first confidence level is greater than the second confidence level, the image quality parameters of the playback terminal are adjusted according to the first scene. In this way, on the one hand, when a scene change is detected in the current video frame, the playback terminal's image quality parameters are not directly adjusted. Instead, scene analysis is performed on each video frame played consecutively after the current video frame. When the scene of multiple consecutive video frames, including the current video frame, switches to the same scene, the playback terminal's image quality parameters are adjusted. This solves the problem of scene jumps in video frames, avoids repeated switching of playback terminal image quality parameters caused by frequent changes in video frame scene, improves the stability of the played video frame image quality, and enhances the user's visual experience. On the other hand, the scene of a video frame can be determined by a simple classification model, without the need to design a more complex model, thus avoiding an increase in device power consumption and memory usage.
[0076] Based on the above embodiments, in an exemplary embodiment, such as Figure 3 As shown, this image quality adjustment method may include the following steps:
[0077] S301, during the playback of a video stream on the playback terminal, if it is detected that the first scene of the current video frame is different from the historical scene of the previous video frame, the first confidence level of the current video frame under the first scene and the second confidence level under the historical scene are determined, and the playback video frames after the current video frame are collected.
[0078] If the first scene of the current video frame is different from the historical scene of the previous video frame, the first confidence level of the current video frame in the first scene and the second confidence level in the historical scene can be determined firstly to determine the first confidence level and second confidence level of the candidate video frame to be played.
[0079] Similar to the first and second confidence scores corresponding to the video frames being played, the first confidence score of the current video frame in the first scene is used to measure the reliability that the real scene of the current video frame is the first scene, and the second confidence score of the current video frame in the historical scene is used to measure the reliability that the real scene of the current video frame is the historical scene.
[0080] Optionally, the first confidence level of the current video frame in the first scene scenario is set as the first value, and the second confidence level of the current video frame in the historical scene scenarios is set as the second value. Since the scene scenario of the current video frame is initially determined to be the first scene scenario after acquisition, it can be considered that the reliability of the current video frame's actual scene scenario being the first scene scenario is higher than that of the historical scene scenarios. Therefore, the first value is greater than the second value. The first and second values can be set based on empirical values, experimental values from multiple trials, and the image quality parameter adjustment requirements in actual application scenarios, and are not specifically limited thereto. For example, the first value could be 1000, and the second value could be 0.
[0081] Among them, the first confidence level of the current video frame in the first scene and the second confidence level in the historical scene can be used as the first confidence level and the second confidence level corresponding to the current video frame.
[0082] S302, after acquiring each video frame, if it is detected that the second scene of the video frame is the same as the first scene, then based on the first confidence level of the previous video frame in the first scene and the second confidence level in the historical scene, determine the first confidence level of the video frame in the first scene and the second confidence level of the previous video frame in the historical scene.
[0083] Furthermore, after acquiring each video frame, if it is detected that the second scene of the video frame is the same as the first scene, the first confidence level of the video frame in the first scene and the second confidence level in the historical scene can be determined based on the first confidence level of the previous video frame in the first scene and the second confidence level in the historical scene.
[0084] Optionally, the first confidence level of the played video frame in the first scene is determined based on the first confidence level of the previous video frame in the first scene scene, and the second confidence level of the played video frame in the historical scene scene is determined based on the second confidence level of the previous video frame in the historical scene scene.
[0085] Specifically, if the video frame being played is the first video frame captured after the current video frame, then the previous video frame is the current video frame. If the video frame being played is not the first video frame captured after the current video frame, then the previous video frame is the most recently captured video frame before the current video frame, i.e., the previous video frame.
[0086] S303, after acquiring each video frame, if the first confidence level corresponding to the video frame is greater than the second confidence level, adjusts the image quality parameters of the playback terminal according to the first scene.
[0087] The specific implementation of S303 is the same as that of S203, and will not be repeated here.
[0088] In this embodiment, for each video frame being played, the first and second confidence levels corresponding to that video frame are determined based on the first and second confidence levels corresponding to the previous video frame. This fully considers the impact of dynamic image changes between consecutive video frames on the determination of the scene between them. As a result, the accuracy of the determined first and second confidence levels corresponding to each video frame being played can be improved, thereby improving the accuracy of adjusting the image quality parameters of the playback terminal. This allows the image quality parameters of the playback terminal to be adjusted at a more appropriate playback time, further avoiding repeated switching of the image quality parameters of the playback terminal caused by frequent changes in the scene of the video frame, improving the image quality stability of the played video frames, and enhancing the user's visual experience.
[0089] On the basis of the above embodiments, in an exemplary embodiment, the determination of the first confidence level of the current video frame under the first picture scene and the second confidence level under the historical picture scene in the above S301 is further refined. Optionally, as shown in Figure 4 , the following steps may be included:
[0090] S401: Determine the first confidence level of the current video frame under the first picture scene according to the current confidence level of the current video frame under the first picture scene and the first historical confidence level of the first picture scene.
[0091] Wherein, the current confidence level of the current video frame under the first picture scene is a first value, and the first historical confidence level of the first picture scene is a second value, and the first value is greater than the second value.
[0092] The so-called first historical confidence level of the first picture scene is used to measure the reliability that the real picture scene of the previous video frame of the current video frame is the first picture scene, which can be set as the second value; while the current confidence level of the current video frame under the first picture scene is used to measure the reliability that the determined picture scene of the current video frame is the first picture scene, which can be set as the first value, where the first value is greater than the second value.
[0093] Thus, according to the current confidence level (the first value) of the current video frame under the first picture scene and the first historical confidence level (the second value) of the first picture scene, the first confidence level of the current video frame under the first picture scene, which is used to measure the reliability that the real picture scene of the current video frame is the first picture scene, is determined.
[0094] Optionally, the first confidence level of the current video frame under the first picture scene is determined by the following formula:
[0095] P1=(A*Ppre1+(N-A)*Pcur1) / N
[0096] Wherein, P1 is the first confidence level of the current video frame under the first picture scene, Ppre1 is the first historical confidence level (the second value) of the first picture scene, Pcur1 is the current confidence level (the first value) of the current video frame under the first picture scene, N is the preset number of smoothing frames (that is, N is a positive integer), A is the first weighting coefficient, N-A is the second weighting coefficient, and 0<A<N. In addition, N and A can be set according to empirical values, test values of multiple tests, and adjustment requirements for image quality parameters in actual application scenarios, which is not specifically limited herein. For example, N=10 and A=8.
[0097] S402, based on the current confidence level of the current video frame in the historical scene and the first historical confidence level of the historical scene, determine the second confidence level of the current video frame in the historical scene.
[0098] Among them, the current confidence level of the current video frame in the historical scene is the second value, and the first historical confidence level of the historical scene is the first value.
[0099] The so-called first historical confidence score of a historical scene is used to measure the reliability of the actual scene of the previous video frame as a historical scene, and it can be set to a first value. The current confidence score of the current video frame under the historical scene is used to measure the reliability of the determined scene of the current video frame as a historical scene, and it can be set to a second value. The first value is greater than the second value.
[0100] Therefore, based on the current confidence level (second value) of the current video frame in the historical scene and the first historical confidence level (first value) of the historical scene, the second confidence level of the current video frame in the historical scene is determined to measure the reliability that the real scene of the current video frame is the historical scene.
[0101] Optionally, the second confidence level of the current video frame in the historical scene can be determined using the following formula:
[0102] P2=(A*Ppre2+(NA)*Pcur2) / N
[0103] Wherein, P2 is the second confidence level of the current video frame in the historical scene, Ppre2 is the first historical confidence level (first value) of the historical scene, and Pcur2 is the current confidence level (second value) of the current video frame in the historical scene.
[0104] In this embodiment, when determining the first confidence level and the second confidence level corresponding to the current video frame, the influence of the previous video frame on the scene determination of the current video frame is fully considered. This improves the accuracy of the determined first confidence level and the second confidence level corresponding to the current video frame, thereby improving the first confidence level and the second confidence level corresponding to the subsequently determined playback video frames. Ultimately, this improves the accuracy of adjusting the image quality parameters of the playback terminal, thereby improving the image quality stability of the playback video frames and enhancing the user's visual experience.
[0105] Based on the above embodiments, in an exemplary embodiment, the determination of the first confidence level of the played video frame in the first scene scenario and the second confidence level in the historical scene scenario in S302 is further refined. Optionally, as... Figure 5 As shown, the following steps may be included:
[0106] S501, based on the current confidence level of the video frame in the first scene and the second historical confidence level of the first scene, determine the first confidence level of the video frame in the first scene.
[0107] Among them, the current confidence level of the video frame in the first scene is the first value, and the second historical confidence level of the first scene is the first confidence level of the previous video frame in the first scene.
[0108] The so-called second historical confidence of the first scene is used to measure the reliability of the real scene of the previous video frame of the played video frame as the first scene scene. It can be represented by the first confidence of the previous video frame of the played video frame under the first scene scene. The current confidence of the played video frame under the first scene scene is used to measure the reliability of the determined scene scene of the played video frame as the first scene scene. It can be set to the first value.
[0109] Therefore, based on the current confidence level (first value) of the played video frame in the first scene and the second historical confidence level of the first scene (the first confidence level of the previous video frame in the first scene), the first confidence level of the played video frame in the first scene is determined to measure the reliability that the real scene of the played video frame is the first scene.
[0110] Optionally, a first weight is preset for the current confidence level (first value) of the played video frame in the first scene, and a second weight is preset for the second historical confidence level of the first scene (the first confidence level of the previous video frame in the first scene). Then, the product of the first weight and the current confidence level (first value) of the played video frame in the first scene is determined as the first product, and the product of the second weight and the second historical confidence level of the first scene (the first confidence level of the previous video frame in the first scene) is determined as the second product. Finally, the sum of the first and second products is taken as the first confidence level of the played video frame in the first scene. The first and second weights can be set based on empirical values, experimental values from multiple trials, and the image quality parameter adjustment requirements in actual application scenarios; no specific limitations are imposed.
[0111] S502, determine the second confidence level of the video frame in the historical scene based on the current confidence level of the video frame in the historical scene and the second historical confidence level of the historical scene.
[0112] Among them, the current confidence level of the video frame in the historical scene is the second value, and the second historical confidence level of the historical scene is the second confidence level of the previous video frame in the historical scene.
[0113] The so-called second historical confidence score of a historical scene is used to measure the reliability of the actual scene of the previous video frame being a historical scene. It can be represented by the second confidence score of the previous video frame under the historical scene. The current confidence score of the video frame under the historical scene is used to measure the reliability of the determined scene of the video frame being a historical scene, and it can be set to a second value. The second value is less than the first value mentioned above.
[0114] Therefore, based on the current confidence level (second value) of the played video frame in the historical scene and the second historical confidence level of the historical scene (the second confidence level of the previous video frame in the historical scene), the second confidence level of the played video frame in the historical scene is determined to measure the reliability that the real scene of the played video frame is the historical scene.
[0115] Optionally, a third weight is pre-set for the current confidence level (second value) of the played video frame in the historical scene, and a fourth weight is pre-set for the second historical confidence level of the historical scene (the second confidence level of the previous video frame in the historical scene). Then, the product of the third weight and the current confidence level (second value) of the played video frame in the historical scene is determined as the third product, and the product of the fourth weight and the second historical confidence level of the historical scene (the second confidence level of the previous video frame in the historical scene) is determined as the fourth product. Finally, the sum of the third and fourth products is taken as the second confidence level of the played video frame in the historical scene. The third and fourth weights can be set based on empirical values, experimental values from multiple trials, and the image quality parameter adjustment requirements in actual application scenarios; no specific limitations are imposed. Optionally, the first weight is equal to the third weight, and the second weight is equal to the fourth weight.
[0116] In this embodiment, for each video frame being played, the determination of the first and second confidence levels corresponding to that video frame fully considers the reliability of the scene in the video frame and the reliability of the scene actually determined for that video frame, as well as the impact on the reliability of the determination of the real scene in the video frame. This improves the accuracy of the first and second confidence levels corresponding to the video frame, thereby improving the accuracy of adjusting the image quality parameters of the playback terminal, improving the image quality stability of the video frame being played, and enhancing the user's visual experience.
[0117] Based on the above embodiments, in an exemplary embodiment, the determination of the first confidence level of the played video frame in the first scene in S501 is further refined. Optionally, as... Figure 6 As shown, the following steps may be included:
[0118] S601, using the first weighting coefficient, the second historical confidence of the first scene is weighted to obtain the first weighted confidence.
[0119] S602, using the second weighting coefficient, the current confidence of the video frame in the first scene is weighted to obtain the second weighted confidence.
[0120] The sum of the first weighting coefficient and the second weighting coefficient is the preset number of smoothing frames.
[0121] First, a preset smoothing frame count is set. This preset balanced frame count is the number of video frames required for a smooth transition in the scene of a video stream. It can be understood as the number of playback video frames needed to adjust the playback terminal's image quality parameters based on the first scene scene, assuming the first scene scene of the current video frame differs from the historical scene scene of the previous video frame. Typically, this number can be set based on experience, experimental results from multiple trials, and the image quality parameter adjustment requirements in the actual application scenario; no specific limitations are imposed. However, in practice, the actual number of playback video frames captured is often less than the preset balanced frame count. Next, the preset balanced frame count is broken down into a first weighting coefficient and a second weighting coefficient. Similarly, the first and second weighting coefficients can also be set based on experience, experimental results from multiple trials, and the image quality parameter adjustment requirements in the actual application scenario; again, no specific limitations are imposed, as long as the sum of the first and second weighting coefficients equals the preset smoothing frame count.
[0122] Thus, given the first weighting coefficient and the second weighting coefficient, the product of the first weighting coefficient and the second historical confidence level of the first scene can be determined as the first weighted confidence level, and the product of the second weighting coefficient and the current confidence level of the video frame in the first scene can be determined as the second weighted confidence level.
[0123] S603, sum the first weighted confidence and the second weighted confidence to obtain the first sum value, and determine the first confidence of the video frame in the first scene based on the ratio of the first sum value to the preset smoothed frame number.
[0124] After obtaining the first weighted confidence level and the second weighted confidence level, the sum of the first weighted confidence level and the second weighted confidence level can be determined as the first sum. Then, the ratio of the first sum to the preset smoothed frame number can be determined as the first confidence level of the video frame in the first scene.
[0125] Optionally, the first confidence level of the played video frame in the first-frame scene can be determined using the following formula:
[0126] P3=(A*Ppre3+(NA)*Pcur3) / N
[0127] Wherein, P3 is the first confidence level of the video frame in the first scene, Ppre3 is the second historical confidence level of the first scene, Pcur3 is the current confidence level of the video frame in the first scene, N is the preset smoothing frame number, A is the first weighting coefficient, and NA is the second weighting coefficient.
[0128] In this embodiment, by setting a preset number of smooth frames, as well as a first weighting coefficient and a second weighting coefficient, and through explicit mathematical calculations, the accuracy of the first confidence level and the second confidence level corresponding to the current video frame can be further improved, thereby improving the accuracy of adjusting the image quality parameters of the playback terminal, improving the image quality stability of the played video frames, and enhancing the user's visual experience.
[0129] Based on the above embodiments, in an exemplary embodiment, the determination of the second confidence level of the played video frame in the historical scene in S502 is further refined. Optionally, as... Figure 7 As shown, the following steps may be included:
[0130] S701 uses the first weighting coefficient to weight the second historical confidence level under the historical scene to obtain the third weighted confidence level.
[0131] S702, using the second weighting coefficient, weights the current confidence of the played video frame in the historical scene to obtain the fourth weighted confidence.
[0132] The sum of the first weighting coefficient and the second weighting coefficient is the preset number of smoothing frames.
[0133] As mentioned earlier, the preset number of smoothed frames is divided into a first weighting coefficient and a second weighting coefficient. Thus, given the third and fourth weighting coefficients, the product of the first weighting coefficient and the second historical confidence level in the historical scene can be determined as the third weighted confidence level, and the product of the second weighting coefficient and the current confidence level of the played video frame in the historical scene can be determined as the fourth weighted confidence level.
[0134] S703, sum the third weighted confidence and the fourth weighted confidence to obtain the second sum, and determine the second confidence of the video frame in the historical scene based on the ratio of the second sum to the preset smoothed frame number.
[0135] After obtaining the third and fourth weighted confidence levels, the sum of the third and fourth weighted confidence levels can be determined as the second sum. Then, the ratio of the second sum to the preset number of smoothed frames can be determined as the second confidence level of the video frame in the historical scene.
[0136] Optionally, the second confidence level of the played video frame in the historical scene can be determined using the following formula:
[0137] P4=(A*Ppre4+(NA)*Pcur4) / N
[0138] Wherein, P4 is the second confidence level of the video frame in the historical scene, Ppre4 is the second historical confidence level of the historical scene, Pcur4 is the current confidence level of the video frame in the historical scene, N is the preset smoothing frame number, A is the first weighting coefficient, and NA is the second weighting coefficient.
[0139] In this embodiment, by setting a preset number of smooth frames, as well as a first weighting coefficient and a second weighting coefficient, and through explicit mathematical calculations, the accuracy of the first confidence level and the second confidence level corresponding to the determined video frame can be further improved, thereby improving the accuracy of adjusting the image quality parameters of the playback terminal, improving the image quality stability of the played video frame, and enhancing the user's visual experience.
[0140] Based on the above embodiments, in an exemplary embodiment, the determination of the first scene of the current video frame in S201 is further refined. Optionally, such as Figure 8 As shown, the following steps may be included:
[0141] S801, input the current video frame into the scene classification model, and obtain the classification confidence of the current video frame as the scene scene of each preset scene scene output by the scene classification model.
[0142] The so-called classification confidence score refers to the "confidence level" that a scene classification model assigns to its output "class prediction results".
[0143] The current video frame is input into a scene classification model. The model determines and outputs the classification confidence score of the current video frame's scene as different preset scene scenes. The classification confidence score of the current video frame's scene as each preset scene scene measures the reliability of that preset scene scene as the first scene scene of the current video frame. A higher classification confidence score indicates greater reliability of the preset scene scene as the first scene scene of the current video frame, making it more likely that the first scene scene of the current video frame is that preset scene scene. Each preset scene scene can be set based on empirical values, experimental results from multiple trials, and the type and content of the video stream in the actual application scenario; no specific limitations are imposed on this.
[0144] In one optional embodiment, the current video frame is preprocessed to obtain a video frame to be identified whose size meets the requirements of the scene classification model. This video frame is then input into the scene classification model to obtain the classification confidence scores of the current video frame's scene as each preset scene. Optionally, if the aspect ratio of the current video frame is less than or equal to 4:3, the current video frame is scaled to make its size meet the requirements of the scene classification model, and the scaled current video frame is used as the video frame to be identified. Alternatively, if the aspect ratio of the current video frame is greater than 4:3, regions of size ((w-4h / 3) / 2)*h are cropped from both the left and right ends of the current video frame to obtain cropped video frames. These cropped video frames are then scaled to obtain a video frame to be identified whose size meets the requirements of the scene classification model, where w is the width of the current video frame and h is the height of the current video frame.
[0145] In one optional embodiment, after obtaining various preset scene scenarios, there may be different preset scene scenarios that will not appear simultaneously due to mutual exclusion. For example, the preset scene scenario of blue sky and the preset scene scenarios of sunrise and sunset will not appear simultaneously. Therefore, the preset scene scenarios can be divided into multiple training tasks. Preset scene scenarios within the same training task will not appear simultaneously, while preset scene scenarios within different training tasks can appear simultaneously. Thus, by inputting the current video frame into the scene classification model, the classification confidence of the current video frame's scene scenario in different training tasks can be obtained. For example, if 13 preset scene scenarios—"blue sky, sunrise and sunset, night, fireworks, snow scene, green plants, flowers, food, buildings, animals, text, animation, and portraits"—are divided into 10 training tasks, then inputting the current video frame into the scene classification model will yield the classification confidence of the 10 preset scene scenarios output by the scene classification model, where different preset scene scenarios belong to different training tasks.
[0146] Optionally, the scene classification model can be any type of model, such as a neural network model or a machine learning model; there are no specific limitations on this.
[0147] S802: Select a target scene from each preset scene scene whose classification confidence is greater than the corresponding confidence threshold, and determine the first scene scene of the current video frame based on the target scene scene.
[0148] For each preset scene, a confidence threshold can be pre-set. Therefore, for each preset scene, the first scene of the current video frame can only be determined as that preset scene if the classification confidence of that preset scene is greater than the corresponding confidence threshold. Then, from all preset scene types, a target scene with a classification confidence greater than the corresponding confidence threshold is selected, and based on the target scene, the first scene of the current video frame is determined.
[0149] The confidence thresholds for different preset scene scenarios can be the same or different. Furthermore, the confidence thresholds for each preset scene scenario can be set based on empirical values, experimental values from multiple trials, the type and content of the video stream in the actual application scenario, and the image quality parameter adjustment requirements in the actual application scenario. No specific limitations are imposed on this.
[0150] In one optional embodiment, if there is only one target scene, the target scene is determined as the first scene of the current video frame.
[0151] In another optional embodiment, S802 may include: when there are multiple target scene scenes, selecting the scene scene with the highest priority among the multiple target scene scenes to obtain a candidate scene scene; when there is only one candidate scene scene, determining the candidate scene scene as the first scene scene of the current video frame; when there are multiple candidate scene scenes, selecting the scene scene scene with the highest classification confidence among the candidate scene scenes to obtain the first scene scene of the current video frame.
[0152] Understandably, in some cases, among different preset scene scenarios, there may be multiple preset scene scenarios with classification confidence scores greater than their corresponding confidence thresholds, thus allowing the selection of multiple target scene scenarios. Therefore, in order to select a suitable first scene scenario from multiple target scene scenarios, the priorities of different preset scene scenarios can be pre-set. The priorities of different preset scene scenarios are not entirely the same, and the priorities of each preset scene scenario can be based on empirical values, experimental values from multiple trials, and the type and content of the video stream in the actual application scenario; no specific limitations are imposed on these factors.
[0153] Thus, when multiple target scene scenes are selected, the scene scene with the highest priority among them can be chosen to obtain candidate scene scenes. Then, if there is only one candidate scene scene, it is determined as the first scene scene of the current video frame. If there are multiple candidate scene scenes, the scene scene with the highest classification confidence among them is selected. Specifically, if there is only one candidate scene scene with the highest classification confidence, that scene scene is determined as the first scene scene of the current video frame. Optionally, if there are multiple candidate scene scenes with the highest classification confidence, a scene scene is randomly selected from these multiple candidate scene scenes as the first scene scene of the current video frame.
[0154] Furthermore, the method for determining the second scene of the aforementioned video frame is the same as the method for determining the first scene of the current video frame, and will not be repeated here.
[0155] In this embodiment, the scene classification model is used to determine the first scene of the current video frame, which can improve the accuracy and speed of determining the first scene. This improves the accuracy of adjusting the image quality parameters of the playback terminal, enhances the stability of the image quality of the played video frame, and improves the efficiency of adjusting the image quality parameters of the playback terminal, thereby enhancing the user's visual experience from multiple dimensions.
[0156] Based on the above embodiments, in an exemplary embodiment, such as Figure 9 As shown, this image quality adjustment method may include the following steps:
[0157] S901, during the playback of the video stream on the playback terminal, the current video frame is input to the scene classification model to obtain the classification confidence of each preset scene scene of the current video frame output by the scene classification model, and from each preset scene scene, a target scene scene with a classification confidence greater than the corresponding confidence threshold is selected, and the first scene scene of the current video frame is determined based on the target scene scene.
[0158] S902, if it is detected that the first scene of the current video frame is different from the historical scene of the previous video frame, the first confidence of the current video frame in the first scene is determined based on the current confidence of the current video frame in the first scene and the first historical confidence of the first scene; and the second confidence of the current video frame in the historical scene is determined based on the current confidence of the current video frame in the historical scene and the first historical confidence of the historical scene; and the playback video frames after the current video frame are collected.
[0159] S903, after acquiring each video frame, if it is detected that the second scene of the video frame is the same as the first scene, the first confidence of the video frame in the first scene is determined based on the current confidence of the video frame in the first scene and the second historical confidence of the first scene; and the second confidence of the video frame in the historical scene is determined based on the current confidence of the video frame in the historical scene and the second historical confidence of the historical scene.
[0160] S904, after acquiring each video frame, adjusts the image quality parameters of the playback terminal according to the first scene if the first confidence level of the video frame is greater than the second confidence level.
[0161] The specific implementation methods of S901-S904 are the same as those in the above method embodiments, and will not be repeated here.
[0162] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0163] Based on the same inventive concept, this application also provides an image quality adjustment device for implementing the image quality adjustment method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more image quality adjustment device embodiments provided below can be found in the limitations of the image quality adjustment method described above, and will not be repeated here.
[0164] In one exemplary embodiment, such as Figure 10 As shown, an image quality adjustment device is provided, including: a video frame acquisition module 1010, a first determination module 1020, and an image quality adjustment module 1030, wherein:
[0165] The video frame acquisition module 1010 is used to acquire the playback video frames after the current video frame when the scene of the first frame of the current video frame is different from the historical scene of the previous video frame during the playback of the video stream on the playback terminal.
[0166] The first determining module 1020 is used to determine the first confidence level of the video frame in the first scene and the second confidence level in the historical scene if the second scene of the video frame is detected to be the same as the first scene after each video frame is acquired.
[0167] The image quality adjustment module 1030 is used to adjust the image quality parameters of the playback terminal according to the first scene scene when the first confidence level corresponding to the video frame is greater than the second confidence level.
[0168] In one exemplary embodiment, the image quality adjustment device further includes:
[0169] The second determining module is used to determine the first confidence level of the current video frame in the first scene and the second confidence level in the historical scene when the first scene scene of the current video frame is detected to be different from the historical scene scene of the previous video frame.
[0170] The first determining module 1020 is specifically used to: determine the first confidence level of the video frame being played in the first scene scene and the second confidence level in the historical scene scene based on the first confidence level of the previous video frame in the first scene scene and the second confidence level in the historical scene scene.
[0171] In an exemplary embodiment, the second determining module is specifically configured to: determine the first confidence level of the current video frame in the first scene based on the current confidence level of the current video frame in the first scene scene and the first historical confidence level of the first scene scene; wherein the current confidence level of the current video frame in the first scene scene is a first value, and the first historical confidence level of the first scene scene is a second value, and the first value is greater than the second value; and determine the second confidence level of the current video frame in the historical scene scene based on the current confidence level of the current video frame in the historical scene scene and the first historical confidence level of the historical scene scene; wherein the current confidence level of the current video frame in the historical scene scene is the second value, and the first historical confidence level of the historical scene scene is the first value.
[0172] In one exemplary embodiment, the first determining module 1020 includes:
[0173] The first determining unit is used to determine the first confidence level of the video frame in the first scene based on the current confidence level of the video frame in the first scene and the second historical confidence level of the first scene; wherein, the current confidence level of the video frame in the first scene is a first value, and the second historical confidence level of the first scene is the first confidence level of the previous video frame in the first scene.
[0174] The second determining unit is used to determine the second confidence level of the video frame in the historical scene based on the current confidence level of the video frame in the historical scene and the second historical confidence level of the historical scene; wherein, the current confidence level of the video frame in the historical scene is the second value, and the second historical confidence level of the historical scene is the second confidence level of the previous video frame in the historical scene; the first value is greater than the second value.
[0175] In an exemplary embodiment, the first determining unit is specifically configured to: use a first weighting coefficient to weight the second historical confidence of the first scene to obtain a first weighted confidence; and use a second weighting coefficient to weight the current confidence of the played video frame in the first scene to obtain a second weighted confidence; wherein the sum of the first weighting coefficient and the second weighting coefficient is a preset smoothing frame number; the first weighted confidence and the second weighted confidence are summed to obtain a first sum, and the first confidence of the played video frame in the first scene is determined according to the ratio of the first sum to the preset smoothing frame number.
[0176] In an exemplary embodiment, the second determining unit is specifically configured to: use a first weighting coefficient to weight the second historical confidence level in the historical scene to obtain a third weighted confidence level; and use a second weighting coefficient to weight the current confidence level of the played video frame in the historical scene to obtain a fourth weighted confidence level; wherein the sum of the first weighting coefficient and the second weighting coefficient is a preset smoothing frame number; the third weighted confidence level and the fourth weighted confidence level are summed to obtain a second sum, and the second confidence level of the played video frame in the historical scene is determined according to the ratio of the second sum to the preset smoothing frame number.
[0177] In one exemplary embodiment, the image quality adjustment module further includes:
[0178] The model input module is used to input the current video frame into the scene classification model before acquiring subsequent video frames when the scene of the first frame of the current video frame is different from the historical scene of the previous video frame. The scene classification model outputs the scene scene of the current video frame as the classification confidence of each preset scene scene.
[0179] The scene determination module is used to select target scene scenes with a classification confidence level greater than the corresponding confidence level threshold from each preset scene scene, and determine the first scene scene of the current video frame based on the target scene scene.
[0180] In an exemplary embodiment, the scene determination module is specifically used to: when there are multiple target scene scenes, select the scene scene with the highest priority among the multiple target scene scenes to obtain a candidate scene scene; when there is only one candidate scene scene, determine the candidate scene scene as the first scene scene of the current video frame; when there are multiple candidate scene scenes, select the scene scene scene with the highest classification confidence among the candidate scene scenes to obtain the first scene scene of the current video frame.
[0181] Each module in the aforementioned image quality adjustment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0182] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data such as the correspondence between scene data and image quality parameters. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When the computer program is executed by the processor, it implements an image quality adjustment method.
[0183] In one exemplary embodiment, a computer device is provided, which may be a playback terminal, and its internal structure diagram may be as follows. Figure 12As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements an image quality adjustment method. The display unit of the computer device is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0184] Those skilled in the art will understand that Figure 11 and 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0185] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the various method embodiments of the above-described image quality adjustment method.
[0186] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the various method embodiments of the above-described image quality adjustment method.
[0187] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the various method embodiments of the above-described image quality adjustment method.
[0188] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0189] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0190] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for adjusting image quality, characterized in that, The method includes: During the playback of a video stream on the playback terminal, if it is detected that the first scene of the current video frame is different from the historical scene of the previous video frame, the playback video frames after the current video frame are captured. After acquiring each video frame, if the second scene of the video frame is detected to be the same as the first scene, then based on the current confidence level of the video frame in the first scene and the second historical confidence level of the first scene, a first confidence level of the video frame in the first scene is determined; and based on the current confidence level of the video frame in the historical scene and the second historical confidence level of the historical scene, a second confidence level of the video frame in the historical scene is determined; wherein, the current confidence level of the video frame in the first scene is a first value, and the second historical confidence level of the first scene is the first confidence level of the previous video frame of the video frame in the first scene; the current confidence level of the video frame in the historical scene is a second value, and the second historical confidence level of the historical scene is the second confidence level of the previous video frame of the video frame in the historical scene; the first value is greater than the second value; If the first confidence level corresponding to the video frame being played is greater than the second confidence level, the image quality parameters of the playback terminal are adjusted according to the first scene.
2. The method according to claim 1, characterized in that, If the first scene of the current video frame is detected to be different from the historical scene of the previous video frame, the method further includes: Determine the first confidence level of the current video frame in the first scene scenario and the second confidence level in the historical scene scenario.
3. The method according to claim 2, characterized in that, Determining the first confidence level of the current video frame in the first scene and the second confidence level in the historical scene includes: Based on the current confidence level of the current video frame in the first scene and the first historical confidence level of the first scene, a first confidence level of the current video frame in the first scene is determined; wherein, the current confidence level of the current video frame in the first scene is a first value, and the first historical confidence level of the first scene is a second value, the first value being greater than the second value; the first historical confidence level of the first scene is used to measure the reliability that the real scene of the previous video frame of the current video frame is the first scene. Based on the current confidence level of the current video frame in the historical scene and the first historical confidence level of the historical scene, a second confidence level of the current video frame in the historical scene is determined; wherein, the current confidence level of the current video frame in the historical scene is the second value, and the first historical confidence level of the historical scene is the first value; the so-called first historical confidence level of the historical scene is used to measure the reliability that the real scene of the previous video frame of the current video frame is the historical scene.
4. The method according to claim 1, characterized in that, Determining the first confidence level of the played video frame in the first scene based on the current confidence level of the played video frame in the first scene scene and the second historical confidence level of the first scene scene includes: The second historical confidence score of the first scene is weighted using a first weighting coefficient to obtain a first weighted confidence score; and... A second weighting coefficient is used to weight the current confidence of the played video frame in the first scene to obtain a second weighted confidence; wherein, the sum of the first weighting coefficient and the second weighting coefficient is a preset number of smoothed frames; The first weighted confidence score and the second weighted confidence score are summed to obtain a first sum value. Based on the ratio of the first sum value to the preset smoothed frame number, the first confidence score of the played video frame in the first scene is determined.
5. The method according to claim 1, characterized in that, The step of determining the second confidence level of the played video frame in the historical scene based on the current confidence level of the played video frame in the historical scene and the second historical confidence level of the historical scene includes: The second historical confidence score under the aforementioned historical scene is weighted using a first weighting coefficient to obtain a third weighted confidence score; and, A second weighting coefficient is used to weight the current confidence of the played video frame in the historical scene to obtain a fourth weighted confidence; wherein, the sum of the first weighting coefficient and the second weighting coefficient is a preset number of smoothed frames; The third weighted confidence level and the fourth weighted confidence level are summed to obtain a second sum value. Based on the ratio of the second sum value to the preset smoothed frame number, the second confidence level of the played video frame in the historical scene is determined.
6. The method according to any one of claims 1-5, characterized in that, Before capturing subsequent video frames after the current video frame, when the detected first scene of the current video frame differs from the historical scene of the previous video frame, the method further includes: The current video frame is input into the scene classification model, and the scene scene of the current video frame output by the scene classification model is the classification confidence of each preset scene scene. From each preset scene, select a target scene with a classification confidence level greater than the corresponding confidence level threshold, and determine the first scene of the current video frame based on the target scene.
7. The method according to claim 6, characterized in that, Determining the first scene of the current video frame based on the target scene includes: When there are multiple target scene scenes, the scene scene with the highest priority among the multiple target scene scenes is selected to obtain candidate scene scenes; When the number of candidate scene scenes is one, the candidate scene scene is determined to be the first scene scene of the current video frame; When there are multiple candidate scene scenes, the scene scene with the highest classification confidence among the candidate scene scenes is selected to obtain the first scene scene of the current video frame.
8. An image quality adjustment device, characterized in that, The device includes: The video frame acquisition module is used to acquire subsequent video frames during the playback of a video stream on the playback terminal when the scene of the first frame of the current video frame is different from the historical scene of the previous video frame. The first determining module is configured to, after acquiring each playback video frame, if it is detected that the second scene of the playback video frame is the same as the first scene, determine the first confidence level of the playback video frame in the first scene and the second confidence level in the historical scene; wherein, the first determining module includes a first determining unit and a second determining unit; the first determining unit is configured to determine the first confidence level of the playback video frame in the first scene based on the current confidence level of the playback video frame in the first scene and the second historical confidence level of the first scene; the second determining unit is configured to determine the first confidence level of the playback video frame in the first scene based on the current confidence level of the playback video frame in the first scene and the second historical confidence level of the first scene; The current confidence level of the played video frame in the historical scene and the second historical confidence level of the historical scene are used to determine the second confidence level of the played video frame in the historical scene; the current confidence level of the played video frame in the first scene is a first value, and the second historical confidence level of the first scene is the first confidence level of the previous video frame of the played video frame in the first scene; the current confidence level of the played video frame in the historical scene is a second value, and the second historical confidence level of the historical scene is the second confidence level of the previous video frame of the played video frame in the historical scene; the first value is greater than the second value; The image quality adjustment module is used to adjust the image quality parameters of the playback terminal according to the first scene scene when the first confidence level corresponding to the played video frame is greater than the second confidence level.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Video image bright and dark scene identification control method
CN110225403A
Video scene processing method and device, equipment and medium
CN112906492A