Video definition detection method, device and equipment and readable storage medium
By downsampling and interpolating the video frame set and combining it with similarity analysis, the problem of low efficiency in video sharpness detection is solved, and efficient and accurate video sharpness recognition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MIGU VIDEO TECH CO LTD
- Filing Date
- 2023-01-28
- Publication Date
- 2026-04-21
AI Technical Summary
Current video clarity detection methods are inefficient, especially for large-scale video data, where the recognition rate is slow, resulting in low detection efficiency.
By determining the set of video frames to be detected, including keyframes and scene change frames, downsampling and interpolation are performed to obtain the target video frames for the target sharpness, and the sharpness is determined based on the similarity between video frames.
It significantly reduces the number of video frames to be identified, improves the efficiency and accuracy of video clarity detection, and can accurately identify ultra-high-definition videos, thus enhancing recognition efficiency and accuracy.
Smart Images

Figure CN116109976B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video clarity detection technology, and more particularly to a method, apparatus, device, and readable storage medium for video clarity detection. Background Technology
[0002] The ultra-high-definition (UHD) video industry is currently in its early stages of development. While a small number of UHD videos have appeared on the market, there are also many fake UHD videos. The current method for distinguishing between genuine and fake UHD videos and assessing their quality largely involves a forward-thinking approach: extracting the characteristics of the video to be judged and comparing them with standard UHD video characteristics (such as resolution). If the video meets the UHD video characteristics, it is judged as genuine UHD; otherwise, it is judged as fake UHD.
[0003] However, when performing video clarity detection, most methods use single-machine frame-by-frame detection, which takes a very long time. For videos with large amounts of data, the recognition rate is slow, resulting in low efficiency in video clarity (resolution) detection. Summary of the Invention
[0004] The main objective of this invention is to provide a method, apparatus, device, and readable storage medium for detecting video clarity, aiming to solve the technical problem of low efficiency in existing video clarity detection.
[0005] To achieve the above objectives, the present invention provides a method for detecting video sharpness, comprising:
[0006] Determine the set of video frames to be detected corresponding to the video to be detected, wherein the set of video frames to be detected includes keyframes and scene change frames;
[0007] The set of video frames to be detected is downsampled and interpolated to obtain the target video frame with the target sharpness.
[0008] Based on the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame, it is determined whether the clarity of the video to be detected is the target clarity.
[0009] Further, the step of determining whether the sharpness of the video to be detected is the target sharpness based on the similarity between each video frame of the video to be detected and the corresponding video frames of the target video frame includes:
[0010] Obtain the first image parameters corresponding to the encoding units of each video frame in the set of video frames to be detected, and the second image parameters corresponding to the encoding units of each video frame in the target video frame;
[0011] Based on the first image parameters and the second image parameters, the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame is determined.
[0012] Based on the similarity, it is determined whether the resolution of the video to be detected is the target resolution.
[0013] Further, the step of determining the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame based on the first image parameters and the second image parameters includes:
[0014] For each video frame to be processed in the set of video frames to be detected, determine the associated video frame corresponding to the video frame to be processed in the target video frame.
[0015] A first feature vector is determined based on the first parameter corresponding to the video frame to be processed in the first image parameters, and a second feature vector is determined based on the second parameter corresponding to the associated video frame in the second image parameters, wherein the elements of the first feature vector are each of the parameters in the first parameters, and the elements of the second feature vector are each of the parameters in the second parameters;
[0016] Based on the first feature vector and the second feature vector, the similarity between the video frame to be processed and the associated video frame is determined.
[0017] Further, the step of determining the similarity between the video frame to be processed and the associated video frame based on the first feature vector and the second feature vector includes:
[0018] Based on the first parameter, a first weight vector corresponding to the video frame to be processed is obtained, and based on the second parameter, a second weight vector corresponding to the associated video frame is obtained. The elements of the first weight vector are the weight values of each element in the first feature vector, and the elements of the second weight vector are the weight values of each element in the second feature vector.
[0019] The dot product between the first weight vector and the transpose of the first feature vector is used as the first intermediate parameter, and the dot product between the second weight vector and the transpose of the second feature vector is used as the second intermediate parameter.
[0020] Based on the first intermediate parameter and the second intermediate parameter, the similarity between the video frame to be processed and the associated video frame is determined.
[0021] Further, the step of determining the similarity between the video frame to be processed and the associated video frame based on the first intermediate parameter and the second intermediate parameter includes:
[0022] Obtain the first number of encoding units corresponding to the length direction of the video frame to be processed, and the second number of encoding units corresponding to the width direction of the video frame to be processed;
[0023] The parameter difference between each of the first intermediate parameters and the corresponding second intermediate parameters is obtained, and the sum of the squares of each parameter difference is accumulated.
[0024] Obtain the first product between the first quantity and the second quantity, and obtain the second product between the product and the sum of squares;
[0025] The similarity between the video frame to be processed and the associated video frame is determined based on the reciprocal of the second product.
[0026] Furthermore, the step of determining whether the video to be detected is an ultra-high-definition video based on the similarity includes:
[0027] Determine the number of target similarities that are less than or equal to the similarity threshold among the aforementioned similarities;
[0028] Based on the number of similarities and the total number of similarities, the similarity ratio is determined;
[0029] Determine whether the similarity ratio is greater than a preset value. If the similarity ratio is greater than the preset value, then determine the clarity of the video to be detected as the target clarity.
[0030] Furthermore, the step of determining the set of video frames to be detected corresponding to the video to be detected includes:
[0031] The video to be detected is input into the encoder to obtain the video sequence, and based on the video sequence, the set of video frames to be detected corresponding to the video to be detected is obtained.
[0032] Obtain the number of frames with scene changes in the set of video frames to be detected, and determine the similarity threshold based on the number of frames.
[0033] Furthermore, to achieve the above objectives, the present invention also provides a video clarity detection device, the video clarity detection device comprising:
[0034] The first determining module is used to determine the set of video frames to be detected corresponding to the video to be detected, wherein the set of video frames to be detected includes keyframes and scene change frames.
[0035] The processing module is used to perform downsampling and interpolation processing on the set of video frames to be detected to obtain the target video frames with the target clarity.
[0036] The second determining module is used to determine whether the clarity of the video to be detected is the target clarity based on the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame.
[0037] In addition, to achieve the above objectives, the present invention also provides a video clarity detection device, the video clarity detection device comprising: a memory, a processor, and a video clarity detection program stored in the memory and executable on the processor, wherein the video clarity detection program, when executed by the processor, implements the steps of the aforementioned video clarity detection method.
[0038] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a video clarity detection program, wherein the video clarity detection program, when executed by a processor, implements the steps of the aforementioned video clarity detection method.
[0039] This invention determines a set of video frames to be detected corresponding to the video to be detected, wherein the set of video frames to be detected includes keyframes and scene change frames; then, it performs downsampling and interpolation processing on the set of video frames to be detected to obtain target video frames with the target resolution; then, based on the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frames, it determines whether the resolution of the video to be detected meets the target resolution. This allows for the identification of the resolution of the video to be detected through the set of video frames to be detected, significantly reducing the number of video frames to be identified compared to frame-by-frame identification, thereby improving the efficiency of video resolution detection. By comparing the target video frames obtained through downsampling and interpolation processing with the set of video frames to be detected, the resolution of the video to be detected can be accurately identified, improving the accuracy of video resolution detection. Furthermore, when the target resolution is ultra-high definition, it can accurately identify whether the video to be detected is ultra-high definition, thereby improving the efficiency and accuracy of ultra-high definition video recognition. Attached Figure Description
[0040] Figure 1 This is a schematic diagram of an embodiment of a video clarity detection device in a hardware operating environment involved in the present invention.
[0041] Figure 2 This is a flowchart illustrating the first embodiment of the video clarity detection method of the present invention;
[0042] Figure 3 This is a schematic diagram of the functional modules of an embodiment of the video clarity detection device of the present invention.
[0043] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0044] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0045] Figure 1 This is a schematic diagram of an embodiment of a video clarity detection device in a hardware operating environment involved in the present invention.
[0046] The video clarity detection device in this embodiment of the invention can be a PC, or a smartphone, tablet computer, e-book reader, MP3 (Moving Picture Experts Group Audio Layer III) player, MP4 (Moving Picture Experts Group Audio Layer IV) player, portable computer, or other portable terminal devices with display functions.
[0047] like Figure 1 As shown, the video clarity detection device may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM or a non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0048] Optionally, the video clarity detection device may also include a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, Wi-Fi module, etc.
[0049] Those skilled in the art will understand that Figure 1 The terminal structure shown does not constitute a limitation on the video clarity detection device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0050] like Figure 1As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a video clarity detection program.
[0051] exist Figure 1 In the video clarity detection device shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the client (user terminal) and communicate data with the client; and the processor 1001 can be used to call the video clarity detection program stored in the memory 1005.
[0052] In this embodiment, the video clarity detection device includes: a memory 1005, a processor 1001, and a video clarity detection program stored in the memory 1005 and executable on the processor 1001. When the processor 1001 calls the video clarity detection program stored in the memory 1005, it executes the steps of the video clarity detection method in the following embodiments.
[0053] This invention also provides a method for detecting video clarity, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the video clarity detection method of the present invention.
[0054] Step S101: Determine the set of video frames to be detected corresponding to the video to be detected, wherein the set of video frames to be detected includes keyframes and scene change frames.
[0055] In this embodiment, the video to be detected (the video to be identified) is first obtained, then the video sequence corresponding to the video to be detected is obtained, and the set of video frames to be detected corresponding to the video to be detected is determined based on the video sequence. Specifically, it may include key frames and scene change frames of the video to be detected. Specifically, the video sequence can be input into the detection program or software corresponding to the key frames and scene change frames, and the video sequence can be detected by the program or software to output the set of video frames to be detected. The program or software can be Ffmpeg.
[0056] Step S102: Perform downsampling and interpolation processing on the set of video frames to be detected to obtain the target video frame with the target clarity.
[0057] In this embodiment, when the set of video frames to be detected is obtained, downsampling and interpolation processing are performed on the set of video frames to be detected. Specifically, each video frame in the set of video frames to be detected is downsampled to obtain downsampled video frames. It is then determined whether the downsampled video frames meet the preset conditions corresponding to a preset resolution, such as 2K resolution (2560x1440 size). If they meet the preset conditions, the downsampled video frames are used as the sampled video frames. If they do not meet the preset conditions, the downsampled video frames are used as the set of video frames to be detected, and the process continues to return to the step of downsampling each video frame in the set of video frames to be detected to obtain downsampled video frames, until the downsampled video frames meet the preset conditions corresponding to the preset resolution. That is, the sampled video frames are video frames of the preset resolution. Of course, the preset resolution can also be any other image resolution.
[0058] Next, interpolation processing is performed on the sampled video frames to obtain the target video frame with the desired sharpness. Specifically, the interpolation algorithm is traversed to predict the value of each pixel in the sampled video frame based on the information of the surrounding pixels, resulting in the interpolated keyframe and scene transition frame (target video frame). For example, for two adjacent pixels in the keyframe of the first video frame, the interpolation algorithm is traversed and the pixel values of the two adjacent pixels are used to predict the value of the pixel, so that a pixel is added between the two adjacent pixels. The resolution corresponding to the target sharpness is greater than the preset resolution, such as 2K resolution, 4K resolution, etc.
[0059] Step S103: Based on the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame, determine whether the clarity of the video to be detected is the target clarity.
[0060] In this embodiment, when a target video frame is obtained, the similarity between each video frame of the video to be detected and the corresponding video frame in the target video frame is obtained. That is, for each video frame to be processed in the set of video frames to be detected, the similarity between the video frame to be processed and the video frame after downsampling and interpolation of the video frame to be processed is obtained. Then, based on each similarity, it is determined whether the clarity of the video to be detected is the target clarity.
[0061] The video sharpness detection method proposed in this embodiment determines a set of video frames to be detected, including keyframes and scene change frames. Then, it performs downsampling and interpolation on the set of video frames to obtain target video frames with the target sharpness. Next, based on the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frames, it determines whether the sharpness of the video to be detected meets the target sharpness. This method can identify the sharpness of the video to be detected using the set of video frames, significantly reducing the number of video frames to be identified compared to frame-by-frame identification, thereby improving the efficiency of video sharpness detection. By comparing the target video frames obtained through downsampling and interpolation with the set of video frames to be detected, accurate identification of video sharpness can be achieved, improving the accuracy of video sharpness detection. Furthermore, when the target sharpness is ultra-high definition resolution, it can accurately identify whether the video to be detected is ultra-high definition video, thereby improving the efficiency and accuracy of ultra-high definition video recognition.
[0062] Based on the first embodiment, a second embodiment of the video clarity detection method of the present invention is proposed. In this embodiment, step S103 includes:
[0063] Step S201: Obtain the first image parameters corresponding to the encoding units of each video frame in the set of video frames to be detected, and the second image parameters corresponding to the encoding units of each video frame in the target video frame.
[0064] Step S202: Based on the first image parameters and the second image parameters, determine the similarity between each video frame in the set of video frames to be detected and the corresponding video frames in the target video frame;
[0065] Step S203: Determine whether the resolution of the video to be detected is the target resolution based on the similarity.
[0066] In this embodiment, the first image parameters corresponding to the coding units of each video frame in the set of video frames to be detected are obtained. Specifically, the first image parameters include multiple indicators such as CTU (coding tree unit) length, CTU width, bit width, HDR (High-Dynamic Range) information, color gamut, color conversion matrix, and frame rate for each coding unit in the set of video frames to be detected. That is, the first image parameters are the CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate of each coding unit in each coding unit of the set of video frames to be detected. At the same time, the second image parameters corresponding to the coding units of each video frame in the target video frame are obtained. The second image parameters are the CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate of each coding unit in each coding unit of the target video frame.
[0067] When the first image parameters and the second image parameters are obtained, the similarity between each video frame in the set of video frames to be detected and each video frame in the corresponding target video frame is determined based on the first image parameters and the second image parameters. Specifically, for each video frame to be processed in the set of video frames to be detected, the associated video frame corresponding to the video frame to be processed in the target video frame is determined. The associated video frame is the video frame obtained after downsampling and interpolation processing of the video frame to be processed. The image parameters to be processed of the video frame to be processed are obtained from the first image parameters, and the associated image parameters of the associated video frame are obtained from the second image parameters. The similarity between the video frame to be processed and the associated video frame is determined based on the image parameters to be processed and the associated image parameters.
[0068] Then, based on the similarity, it is determined whether the clarity of the video to be detected is the target clarity. Specifically, a similarity threshold corresponding to the video to be detected is obtained, and based on the similarity and the similarity threshold, it is determined whether the clarity of the video to be detected is the target clarity.
[0069] The video sharpness detection method proposed in this embodiment obtains the first image parameters corresponding to the encoding units of each video frame in the set of video frames to be detected, and the second image parameters corresponding to the encoding units of each video frame in the target video frame; then, based on the first image parameters and the second image parameters, it determines the similarity between each video frame of the video to be detected and the corresponding video frame in the target video frame; and then, based on the similarity, it determines whether the sharpness of the video to be detected is the target sharpness. This method can accurately obtain the similarity between the set of video frames to be detected and the target video frame according to the first image parameters and the second image parameters, further improving the accuracy of video sharpness detection.
[0070] Based on the second embodiment, a third embodiment of the video clarity detection method of the present invention is proposed. In this embodiment, step S202 includes:
[0071] Step S301: For each video frame to be processed in the set of video frames to be detected, determine the associated video frame corresponding to the video frame to be processed in the target video frame.
[0072] Step S302: Determine a first feature vector based on the first parameter corresponding to the video frame to be processed in the first image parameters, and determine a second feature vector based on the second parameter corresponding to the associated video frame in the second image parameters, wherein the elements of the first feature vector are each of the parameters in the first parameters, and the elements of the second feature vector are each of the parameters in the second parameters;
[0073] Step S303: Based on the first feature vector and the second feature vector, determine the similarity between the video frame to be processed and the associated video frame.
[0074] In this embodiment, for each video frame to be processed in the set of video frames to be detected, the associated video frame corresponding to the video frame to be processed in the target video frame is determined. The associated video frame is the video frame obtained after downsampling and interpolation of the video frame to be processed.
[0075] Next, a first feature vector is determined based on the first parameter corresponding to the video frame to be processed in the first image parameters, and a second feature vector is determined based on the second parameter corresponding to the associated video frame in the second image parameters. Specifically, the first parameter of the video frame to be processed is obtained from the first image parameters to determine the first feature vector, and the second feature vector is determined based on the second parameter. The elements of the first feature vector are each of the parameters in the first parameters, and the elements of the second feature vector are each of the parameters in the second parameters. For each coding unit in the video frame to be processed, each coding unit corresponds to a first feature vector. For each coding unit in the video frame to be processed, the first feature vector includes multiple of the following: CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate of the coding unit. For each coding unit in the associated video frame, each coding unit corresponds to a second feature vector. For each coding unit in the associated video frame, the second feature vector includes multiple of the following: CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate of the coding unit. Furthermore, the parameters in the first feature vector are the same as the parameters in the second feature vector.
[0076] Then, based on the first feature vector and the second feature vector, the similarity between the video frame to be processed and the associated video frame is determined.
[0077] The video clarity detection method proposed in this embodiment determines the associated video frame in the target video frame for each video frame to be processed in the set of video frames to be detected; then, it determines a first feature vector based on the first parameter corresponding to the video frame to be processed in the first image parameters, and determines a second feature vector based on the second parameter corresponding to the associated video frame in the second image parameters; then, it determines the similarity between the video frame to be processed and the associated video frame based on the first feature vector and the second feature vector. This method can accurately obtain the similarity between the video frame to be processed and the associated video frame through the first feature vector and the second feature vector, further improving the detection efficiency and accuracy of video clarity.
[0078] Based on the third embodiment, a fourth embodiment of the video clarity detection method of the present invention is proposed. In this embodiment, step S303 includes:
[0079] Step S401: Obtain the first weight vector corresponding to the video frame to be processed based on the first parameter, and obtain the second weight vector corresponding to the associated video frame based on the second parameter, wherein the elements of the first weight vector are the weight values of each element in the first feature vector, and the elements of the second weight vector are the weight values of each element in the second feature vector.
[0080] Step S402: Use the dot product between the first weight vector and the transpose of the first feature vector as a first intermediate parameter, and use the dot product between the second weight vector and the transpose of the second feature vector as a second intermediate parameter.
[0081] Step S403: Based on the first intermediate parameter and the second intermediate parameter, determine the similarity between the video frame to be processed and the associated video frame.
[0082] In this embodiment, when the first feature vector and the second feature vector are obtained, a first weight vector corresponding to the video frame to be processed is obtained based on the first parameter, and a second weight vector corresponding to the associated video frame is obtained based on the second parameter. The elements of the first weight vector are the weight values of each element in the first feature vector, and the elements of the second weight vector are the weight values of each element in the second feature vector. Specifically, the first weight vector is the weight value of multiple parameters among CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate corresponding to the video frame to be processed, and the second weight vector is the weight value of multiple parameters among CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate corresponding to the associated video frame. The weight values of each parameter can be reasonably set according to their influence on the ultra-high-definition video. The sum of each element in the first weight vector is 1, and the sum of each element in the second weight vector is 1.
[0083] Next, the dot product between the first weight vector and the transpose of the first feature vector is used as a first intermediate parameter, and the dot product between the second weight vector and the transpose of the second feature vector is used as a second intermediate parameter; for example, if the first parameter includes the color gamut and frame rate corresponding to the video frame to be processed, then the second parameter includes the color gamut and frame rate corresponding to the associated video frame, and the first feature vector is... The weights for color gamut and frame rate are α and β, respectively, and the first weight vector is... but The formula for the first intermediate parameter f(i,j) is:
[0084]
[0085] The formula for the second intermediate parameter is similar to that for the first intermediate parameter, and will not be repeated here. Upon obtaining the first and second intermediate parameters, the similarity between the video frame to be processed and the associated video frame is determined based on the first and second intermediate parameters. Specifically, in one embodiment, step S403 includes:
[0086] Step a: Obtain the first number of coding units corresponding to the length direction of the video frame to be processed, and the second number of coding units corresponding to the width direction of the video frame to be processed.
[0087] Step b: Obtain the parameter difference between each of the first intermediate parameters and the corresponding second intermediate parameters, and accumulate the sum of the squares of each parameter difference;
[0088] Step c: Obtain the first product between the first quantity and the second quantity, and obtain the second product between the product and the sum of squares;
[0089] Step d: Based on the reciprocal of the second product, determine the similarity between the video frame to be processed and the associated video frame.
[0090] In this embodiment, when the first intermediate parameter and the second intermediate parameter are obtained, the first number of coding units corresponding to the length direction of the video frame to be processed and the second number of coding units corresponding to the width direction of the video frame to be processed are obtained. That is, the first number is the number of coding units that can be divided into in the length direction of the video frame to be processed, and the second number is the number of coding units that can be divided into in the width direction of the video frame to be processed. The associated video frame is the same as the video frame to be processed, that is, the number of coding units corresponding to the length direction in the associated video frame is also the first number, and the number of coding units corresponding to the width direction in the associated video frame is also the second number.
[0091] Next, the parameter differences between each of the first intermediate parameters and the corresponding second intermediate parameters are obtained, and the sum of the squares of each parameter difference is accumulated. For each first intermediate parameter, the corresponding second intermediate parameter is determined, and the parameter difference between the first intermediate parameter and the corresponding second intermediate parameter is calculated. Each coding unit of the video frame to be processed corresponds one-to-one with each coding unit of the associated video frame, and thus the first intermediate parameter and the second intermediate parameter also correspond one-to-one, allowing for accurate determination of the second intermediate parameter corresponding to each first intermediate parameter. Then, the first product between the first quantity and the second quantity is obtained, and the second product between the product and the sum of squares is obtained. This first product represents the total number of coding units in the video frame to be processed.
[0092] Finally, based on the reciprocal of the second product, the similarity between the video frame to be processed and the associated video frame is determined. For example, the reciprocal of the second product can be directly used as the similarity, where the formula for the similarity is:
[0093]
[0094] Where Error is the similarity, f(i,j) is the first intermediate parameter, f'(i,j) is the second intermediate parameter, M is the first quantity, N is the second quantity, MxN is the first product, f(i,j)-f'(i,j) is the parameter difference, and the denominator in the formula is the second product.
[0095] In this embodiment, the similarity can be accurately obtained based on the first quantity, the second quantity, the first intermediate parameter, and the second intermediate parameter, further improving the efficiency and accuracy of ultra-high-definition video recognition.
[0096] The video clarity detection method proposed in this embodiment obtains a first weight vector corresponding to the video frame to be processed based on the first parameter, and obtains a second weight vector corresponding to the associated video frame based on the second parameter. Then, the dot product between the first weight vector and the transpose of the first feature vector is used as a first intermediate parameter, and the dot product between the second weight vector and the transpose of the second feature vector is used as a second intermediate parameter. Then, based on the first intermediate parameter and the second intermediate parameter, the similarity between the video frame to be processed and the associated video frame is determined. The similarity can be accurately obtained according to the first intermediate parameter and the second intermediate parameter, which further improves the detection efficiency and accuracy of video clarity.
[0097] Based on the second embodiment, a fifth embodiment of the video clarity detection method of the present invention is proposed. In this embodiment, step S202 includes:
[0098] Step S501: Determine the number of target similarities that are less than or equal to the similarity threshold in the similarity;
[0099] Step S502: Determine the similarity ratio based on the number of similarities and the total number of similarities;
[0100] Step S503: Determine whether the similarity ratio is greater than a preset value. If the similarity ratio is greater than the preset value, then the clarity of the video to be detected is determined to be the target clarity.
[0101] In this embodiment, when the similarity between each video frame in the set of video frames to be detected and each video frame in the corresponding target video frame is obtained, each similarity is compared with a similarity threshold to determine the number of target similarities that are less than or equal to the similarity threshold. Then, based on the number of similarities and the total number of similarities, the similarity ratio is determined. This similarity ratio is the number of similarities / the total number of similarities.
[0102] Next, it is determined whether the similarity ratio is greater than a preset value. If the similarity ratio is greater than the preset value, the clarity of the video to be detected is determined to be the target clarity.
[0103] The video clarity detection method proposed in this embodiment determines the number of similarities of target similarities that are less than or equal to a similarity threshold; then, based on the number of similarities and the total number of similarities, it determines the similarity ratio; and then determines whether the similarity ratio is greater than a preset value. If the similarity ratio is greater than the preset value, the clarity of the video to be detected is determined to be the target clarity. This method can accurately determine whether the video to be detected is an ultra-high-definition video based on the similarity ratio, further improving the accuracy of video clarity detection.
[0104] Based on the above embodiments, a sixth embodiment of the video clarity detection method of the present invention is proposed. In this embodiment, step S101 includes:
[0105] Step S601: Input the video to be detected into the encoder to obtain the video sequence, and obtain the set of video frames to be detected corresponding to the video to be detected based on the video sequence;
[0106] Step S602: Obtain the number of frames with scene changes in the set of video frames to be detected, and determine the similarity threshold based on the number of frames.
[0107] In this embodiment, the video to be detected (the video to be identified) is first obtained, and then the video sequence corresponding to the video to be detected is obtained. Specifically, the video to be detected is input into an encoder such as H.26X series or AVS. The output of the encoder is the video sequence. Then, the video sequence is input into the detection program or software corresponding to the key frames and scene change frames. The video sequence is detected by the program or software, and the set of video frames to be detected is output. The program or software can be Ffmpeg.
[0108] Then, the number of scene-changing frames in the set of video frames to be detected is obtained, and the similarity threshold is determined based on the number of frames. In this embodiment, the similarity threshold is larger for videos with more complex scenes and more scene-changing frames, and smaller for videos with simpler and smoother scenes. Therefore, a preset similarity threshold corresponding to the number of scene-changing frames (the number of frames of scene-changing frames) can be preset. When the number of frames is obtained, the similarity threshold of the video to be detected is determined based on the number of frames within the preset similarity threshold. Alternatively, a preset similarity threshold corresponding to the range of the number of scene-changing frames can be preset. When the number of frames is obtained, the range to which the number of frames belongs is determined, and the preset similarity threshold corresponding to the range to which the number of frames belongs is used as the similarity threshold of the video to be detected.
[0109] The video sharpness detection method proposed in this embodiment obtains the video sequence by inputting the video to be detected into an encoder, and obtains the set of video frames to be detected corresponding to the video to be detected based on the video sequence. Then, it obtains the number of frames with scene changes in the set of video frames to be detected, and determines the similarity threshold based on the number of frames. This method can accurately obtain the set of video frames to be detected for the video to be detected, and accurately obtain the similarity threshold of the video to be detected based on the number of frames with scene changes, thereby further improving the efficiency and accuracy of video sharpness detection.
[0110] The present invention also provides a video clarity detection device, applied to user equipment, with reference to... Figure 3 The video clarity detection device includes:
[0111] The first determining module 10 is used to determine the set of video frames to be detected corresponding to the video to be detected, wherein the set of video frames to be detected includes key frames and scene change frames.
[0112] Processing module 20 is used to perform downsampling and interpolation processing on the set of video frames to be detected to obtain target video frames with target clarity;
[0113] The second determining module 30 is used to determine whether the clarity of the video to be detected is the target clarity based on the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame.
[0114] Furthermore, the second determining module 40 is also used for:
[0115] Obtain the first image parameters corresponding to the encoding units of each video frame in the set of video frames to be detected, and the second image parameters corresponding to the encoding units of each video frame in the target video frame;
[0116] Based on the first image parameters and the second image parameters, the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame is determined.
[0117] Based on the similarity, it is determined whether the resolution of the video to be detected is the target resolution.
[0118] Furthermore, the second determining module 40 is also used for:
[0119] For each video frame to be processed in the set of video frames to be detected, determine the associated video frame corresponding to the video frame to be processed in the target video frame.
[0120] A first feature vector is determined based on the first parameter corresponding to the video frame to be processed in the first image parameters, and a second feature vector is determined based on the second parameter corresponding to the associated video frame in the second image parameters, wherein the elements of the first feature vector are each of the parameters in the first parameters, and the elements of the second feature vector are each of the parameters in the second parameters;
[0121] Based on the first feature vector and the second feature vector, the similarity between the video frame to be processed and the associated video frame is determined.
[0122] Furthermore, the second determining module 40 is also used for:
[0123] Based on the first parameter, a first weight vector corresponding to the video frame to be processed is obtained, and based on the second parameter, a second weight vector corresponding to the associated video frame is obtained. The elements of the first weight vector are the weight values of each element in the first feature vector, and the elements of the second weight vector are the weight values of each element in the second feature vector.
[0124] The dot product between the first weight vector and the transpose of the first feature vector is used as the first intermediate parameter, and the dot product between the second weight vector and the transpose of the second feature vector is used as the second intermediate parameter.
[0125] Based on the first intermediate parameter and the second intermediate parameter, the similarity between the video frame to be processed and the associated video frame is determined.
[0126] Furthermore, the second determining module 40 is also used for:
[0127] Obtain the first number of coding units in the video frame to be processed, and the second number of coding units in the associated video frame;
[0128] Obtain the first number of encoding units corresponding to the length direction of the video frame to be processed, and the second number of encoding units corresponding to the width direction of the video frame to be processed;
[0129] The parameter difference between each of the first intermediate parameters and the corresponding second intermediate parameters is obtained, and the sum of the squares of each parameter difference is accumulated.
[0130] Obtain the first product between the first quantity and the second quantity, and obtain the second product between the product and the sum of squares;
[0131] The similarity between the video frame to be processed and the associated video frame is determined based on the reciprocal of the second product.
[0132] Furthermore, the second determining module 40 is also used for:
[0133] Determine the number of target similarities that are less than or equal to the similarity threshold among the aforementioned similarities;
[0134] Based on the number of similarities and the total number of similarities, the similarity ratio is determined;
[0135] Determine whether the similarity ratio is greater than a preset value. If the similarity ratio is greater than the preset value, then determine the clarity of the video to be detected as the target clarity.
[0136] Furthermore, the first determining module 10 is also used for:
[0137] The video to be detected is input into the encoder to obtain the video sequence, and based on the video sequence, the set of video frames to be detected corresponding to the video to be detected is obtained.
[0138] Obtain the number of frames with scene changes in the set of video frames to be detected, and determine the similarity threshold based on the number of frames.
[0139] The methods executed by the above-mentioned program units can be referred to in the various embodiments of the video clarity detection method of the present invention, and will not be repeated here.
[0140] The present invention also provides a computer-readable storage medium.
[0141] The present invention provides a video clarity detection program stored on a computer-readable storage medium, which, when executed by a processor, implements the steps of the video clarity detection method described above.
[0142] The method implemented when the video clarity detection program running on the processor is executed can be referred to in various embodiments of the video clarity detection method of the present invention, and will not be repeated here.
[0143] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0144] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0145] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0146] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for detecting video sharpness, characterized in that, include: Determine the set of video frames to be detected corresponding to the video to be detected, wherein the set of video frames to be detected includes keyframes and scene change frames; The set of video frames to be detected is downsampled and interpolated to obtain the target video frame with the target sharpness. Based on the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame, it is determined whether the clarity of the video to be detected is the target clarity. The step of determining whether the resolution of the video to be detected is the target resolution based on the similarity between each video frame of the video to be detected and the corresponding video frames of the target video frame includes: The first image parameters corresponding to the encoding units of each video frame in the set of video frames to be detected, and the second image parameters corresponding to the encoding units of each video frame in the target video frame are obtained. The first image parameters include the CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate of each encoding unit in each video frame. The second image parameters include the CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate of each encoding unit in each target video frame. Based on the first image parameters and the second image parameters, the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame is determined. Based on the similarity, it is determined whether the resolution of the video to be detected is the target resolution.
2. The video clarity detection method as described in claim 1, characterized in that, The step of determining the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame based on the first image parameters and the second image parameters includes: For each video frame to be processed in the set of video frames to be detected, determine the associated video frame corresponding to the video frame to be processed in the target video frame. A first feature vector is determined based on the first parameter corresponding to the video frame to be processed in the first image parameters, and a second feature vector is determined based on the second parameter corresponding to the associated video frame in the second image parameters, wherein the elements of the first feature vector are each of the parameters in the first parameters, and the elements of the second feature vector are each of the parameters in the second parameters; Based on the first feature vector and the second feature vector, the similarity between the video frame to be processed and the associated video frame is determined.
3. The video clarity detection method as described in claim 2, characterized in that, The step of determining the similarity between the video frame to be processed and the associated video frame based on the first feature vector and the second feature vector includes: Based on the first parameter, a first weight vector corresponding to the video frame to be processed is obtained, and based on the second parameter, a second weight vector corresponding to the associated video frame is obtained. The elements of the first weight vector are the weight values of each element in the first feature vector, and the elements of the second weight vector are the weight values of each element in the second feature vector. The dot product between the first weight vector and the transpose of the first feature vector is used as the first intermediate parameter, and the dot product between the second weight vector and the transpose of the second feature vector is used as the second intermediate parameter. Based on the first intermediate parameter and the second intermediate parameter, the similarity between the video frame to be processed and the associated video frame is determined.
4. The video clarity detection method as described in claim 3, characterized in that, The step of determining the similarity between the video frame to be processed and the associated video frame based on the first intermediate parameter and the second intermediate parameter includes: Obtain the first number of encoding units corresponding to the length direction of the video frame to be processed, and the second number of encoding units corresponding to the width direction of the video frame to be processed; The parameter difference between each of the first intermediate parameters and the corresponding second intermediate parameters is obtained, and the sum of the squares of each parameter difference is accumulated. Obtain the first product between the first quantity and the second quantity, and obtain the second product between the first product and the sum of squares; The similarity between the video frame to be processed and the associated video frame is determined based on the reciprocal of the second product.
5. The video clarity detection method as described in claim 1, characterized in that, The step of determining whether the resolution of the video to be detected is the target resolution based on the similarity includes: Determine the number of target similarities that are less than or equal to the similarity threshold among the aforementioned similarities; Based on the number of similarities and the total number of similarities, the similarity ratio is determined; Determine whether the similarity ratio is greater than a preset value. If the similarity ratio is greater than the preset value, then determine the clarity of the video to be detected as the target clarity.
6. The video sharpness detection method according to any one of claims 1 to 5, characterized in that, The step of determining the set of video frames to be detected corresponding to the video to be detected includes: The video to be detected is input into the encoder to obtain the video sequence, and based on the video sequence, the set of video frames to be detected corresponding to the video to be detected is obtained. Obtain the number of frames with scene changes in the set of video frames to be detected, and determine the similarity threshold based on the number of frames.
7. A device for detecting video clarity, characterized in that, The video clarity detection device includes: The first determining module is used to determine the set of video frames to be detected corresponding to the video to be detected, wherein the set of video frames to be detected includes keyframes and scene change frames. The processing module is used to perform downsampling and interpolation processing on the set of video frames to be detected to obtain the target video frames with the target clarity. The second determining module is used to determine whether the clarity of the video to be detected is the target clarity based on the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame; The second determining module is further configured to: The first image parameters corresponding to the encoding units of each video frame in the set of video frames to be detected, and the second image parameters corresponding to the encoding units of each video frame in the target video frame are obtained. The first image parameters include the CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate of each encoding unit in each video frame. The second image parameters include the CTU length, CTU width, bit width, HDR information, color gamut, color conversion matrix, and frame rate of each encoding unit in each target video frame. Based on the first image parameters and the second image parameters, the similarity between each video frame of the video to be detected and the corresponding video frames in the target video frame is determined. Based on the similarity, it is determined whether the resolution of the video to be detected is the target resolution.
8. A video resolution detection device, characterized in that, The video clarity detection device includes: a memory, a processor, and a video clarity detection program stored in the memory and executable on the processor. When the video clarity detection program is executed by the processor, it implements the steps of the video clarity detection method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a video clarity detection program, which, when executed by a processor, implements the steps of the video clarity detection method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Video frame definition detection method based on sliding window gradient entropy
CN113411571A