Video transition recognition method, apparatus, computing device, and computer storage medium

By determining the correlation differences and image content from the first N video frames of the target frame, the problem of inaccurate soft transition recognition in the prior art is solved, and high-precision video transition recognition and pattern differentiation are achieved, which is suitable for real-time video processing.

CN116258995BActive Publication Date: 2026-01-02SHANGHAI BILIBILI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310323901.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2026-01-02
Estimated Expiration
2043-03-29

AI Technical Summary

Technical Problem

Existing video transition recognition methods cannot accurately identify soft transitions and are prone to misidentifying camera movement as a transition, resulting in low recognition accuracy.

Method used

By identifying the first and second preceding frames from the N preceding video frames of the target frame, calculating the correlation difference, and combining the image content and grayscale histogram correlation, it is determined whether the target frame is a transition frame, and soft transitions, hard transitions, and fast camera movement modes are distinguished.

Benefits of technology

It improves the accuracy and efficiency of video transition recognition, accurately identifies soft transitions and distinguishes different transition modes, and is suitable for real-time video segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116258995B_ABST
    Figure CN116258995B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a video transition identification method and device, a computing device and a computer storage medium. The method comprises: determining a first previous frame and a second previous frame of a target frame from N previous video frames of the target frame; wherein the first previous frame of the target frame is a previous video frame of the target frame, and the second previous frame of the target frame is a video frame other than the first previous frame in the N previous video frames; calculating a first correlation degree between the target frame and the first previous frame, and calculating a second correlation degree between the target frame and each second previous frame; and determining whether the target frame is a transition frame according to the difference between the first correlation degree and each second correlation degree. By using the present scheme, it can be accurately determined whether a soft transition has occurred, and the video transition identification precision is improved. Moreover, the present scheme is simple and easy to implement, and has high execution efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of video processing, and particularly relate to a video transition recognition method and device, a computing device, and a computer storage medium. BACKGROUND

[0002] A scene transition often occurs in a video, and the process in which a video scene transitions or changes to another video scene is referred to as a video transition. The recognition of a video transition can provide a basis for video processing such as video segmentation and reorganization, and thus the video transition recognition is of great significance in the field of video processing.

[0003] A commonly used video transition recognition method in the prior art is a similarity recognition method based on adjacent frames. This method calculates the similarity of two adjacent frames, and determines that a video transition occurs between the two frames when the similarity is lower than a set threshold.

[0004] However, the inventors have found in the implementation process that the prior art has the following defects: The existing video transition usually includes two modes of hard transition and soft transition. The hard transition refers to a video processing mode in which two different scenes are directly connected without processing. The soft transition refers to a video processing mode in which two different scenes are transitioned (such as overlap processing, fade-in and fade-out processing, etc.). In the soft transition, the similarity of the two adjacent frames is high, and the video transition recognition method in the prior art cannot accurately recognize the soft transition, resulting in low video transition recognition accuracy. At the same time, in the same video scene segment, the similarity of the two adjacent frames may be low due to factors such as camera movement, and the existing technology may be misrecognized as a transition. SUMMARY

[0005] In view of the technical problem of low video transition recognition accuracy in the prior art, the embodiments of the present application are proposed to provide a video transition recognition method, device, computing device, and computer storage medium that overcome the above problems or at least partially solve the above problems.

[0006] According to a first aspect of the embodiments of the present application, a video transition recognition method is provided, comprising:

[0007] determining a first previous frame and a second previous frame of a target frame from the first N video frames before the target frame; wherein the first previous frame of the target frame is a previous video frame of the target frame, and the second previous frame of the target frame is a video frame other than the first previous frame in the first N video frames;

[0008] calculating a first correlation degree of the target frame and the first previous frame, and calculating a second correlation degree of the target frame and each second previous frame;

[0009] According to the difference between the first correlation degree and each second correlation degree, it is determined whether the target frame is a transition frame.

[0010] In an alternative implementation, the determining whether the target frame is a transition frame according to the difference between the first correlation degree and each second correlation degree further comprises:

[0011] calculating the difference between the first correlation degree and each second correlation degree,

[0012] determining a maximum difference value, and determining whether the target frame is a transition frame based on the maximum difference value.

[0013] In an alternative implementation, the determining whether the target frame is a transition frame based on the maximum difference value further comprises:

[0014] if the maximum difference value is greater than a first preset threshold, determining that the target frame is a transition frame.

[0015] In an alternative implementation, the determining whether the target frame is a transition frame based on the maximum difference value further comprises:

[0016] determining a target second previous frame corresponding to the maximum difference value;

[0017] if the image content correlation degree between the target frame and the target second previous frame is less than a second preset threshold, and the gray histogram correlation degree between the target frame and the target second previous frame is less than a third preset threshold, determining that the target frame is a transition frame.

[0018] In an alternative implementation, the determining whether the target frame is a transition frame based on the maximum difference value further comprises:

[0019] determining a target second previous frame corresponding to the maximum difference value;

[0020] if the gray histogram correlation degree between the target frame and the target second previous frame is less than a fourth preset threshold, determining that the target frame is a transition frame.

[0021] In an alternative implementation, the determining whether the target frame is a transition frame according to the difference between the first correlation degree and each second correlation degree further comprises:

[0022] determining whether the target frame is a transition frame in a soft transition mode according to the difference between the first correlation degree and each second correlation degree.

[0023] In an alternative implementation, the method further comprises:

[0024] calculating a third correlation degree between a previous video frame of the first previous frame and the first previous frame;

[0025] calculating the difference between the third correlation degree and the first correlation degree;

[0026] If the difference between the third correlation degree and the first correlation degree is greater than a fifth preset threshold, it is determined that the target frame is a transition frame.

[0027] In an optional implementation, the method further includes, if the difference between the third correlation degree and the first correlation degree is greater than the fifth preset threshold, determining that the target frame is a transition frame in a hard transition mode.

[0028] If the difference between the third correlation degree and the first correlation degree is greater than a fifth preset threshold, it is determined that the target frame is a transition frame in a hard transition mode.

[0029] In an optional implementation, after determining that the target frame is a transition frame, the method further includes:

[0030] calculating a first frame number difference between the target frame and the nearest real transition frame;

[0031] If the first frame number difference is greater than a first preset frame number threshold, it is determined that the target frame is a real transition frame.

[0032] If the first frame number difference is less than or equal to the first preset frame number threshold, it is determined that the target frame is a buffer transition frame.

[0033] In an optional implementation, the method further includes:

[0034] calculating a second frame number difference between the target frame and the nearest buffer transition frame;

[0035] If the second frame number difference is greater than a second preset frame number threshold, it is determined that the target frame is a real transition frame.

[0036] If the second frame number difference is less than or equal to the second preset frame number threshold, it is determined that the target frame is a buffer transition frame.

[0037] In an optional implementation, the buffer transition frame is a transition frame in a fast motion mode.

[0038] In an optional implementation, before determining the first previous frame and the second previous frame of the target frame from the first N video frames before the target frame, the method further includes: buffering N continuous video frames in a buffer area; and taking a next video frame of a video frame with a maximum frame number in the buffer area as the target frame.

[0039] The determining the first previous frame and the second previous frame of the target frame from the first N video frames before the target frame further includes: determining the first previous frame and the second previous frame of the target frame from the N video frames buffered in the buffer area.

[0040] According to a second aspect of an embodiment of the present application, a video transition recognition device is provided, which includes:

[0041] The first determining module is configured to determine a first previous frame and a second previous frame of the target frame from the first N video frames before the target frame, wherein the first previous frame of the target frame is a previous video frame of the target frame, and the second previous frame of the target frame is a video frame other than the first previous frame in the first N video frames;

[0042] The calculating module is configured to calculate a first correlation degree between the target frame and the first previous frame, and calculate second correlation degrees between the target frame and each second previous frame;

[0043] The second determining module is configured to determine whether the target frame is a transition frame according to a difference between the first correlation degree and each second correlation degree.

[0044] In an optional implementation, the second determining module is configured to: calculate a difference between the first correlation degree and each second correlation degree,

[0045] determine a maximum difference value, and determine whether the target frame is a transition frame based on the maximum difference value.

[0046] In an optional implementation, the second determining module is configured to: if the maximum difference value is greater than a first preset threshold, determine that the target frame is a transition frame.

[0047] In an optional implementation, the second determining module is configured to: determine a target second previous frame corresponding to the maximum difference value.

[0048] If an image content correlation degree between the target frame and the target second previous frame is less than a second preset threshold, and a gray histogram correlation degree between the target frame and the target second previous frame is less than a third preset threshold, it is determined that the target frame is a transition frame.

[0049] In an optional implementation, the second determining module is configured to: determine a target second previous frame corresponding to the maximum difference value.

[0050] If a gray histogram correlation degree between the target frame and the target second previous frame is less than a fourth preset threshold, it is determined that the target frame is a transition frame.

[0051] In an optional implementation, the second determining module is configured to: determine whether the target frame is a transition frame in a soft transition mode according to a difference between the first correlation degree and each second correlation degree.

[0052] In an optional implementation, the calculating module is configured to: calculate a third correlation degree between a previous video frame of the first previous frame and the first previous frame; and calculate a difference between the third correlation degree and the first correlation degree.

[0053] The second determining module is configured to: if the difference between the third correlation degree and the first correlation degree is greater than a fifth preset threshold, determine that the target frame is a transition frame.

[0054] In an optional implementation, the second determining module is configured to determine the target frame as a transition frame in a hard transition mode if a difference between the third correlation degree and the first correlation degree is greater than a fifth preset threshold.

[0055] In an optional implementation, the calculating module is configured to calculate a first frame number difference between the target frame and a nearest real transition frame.

[0056] The second determining module is configured to determine the target frame as a real transition frame if the first frame number difference is greater than a first preset frame number threshold, and determine the target frame as a buffer transition frame if the first frame number difference is less than or equal to the first preset frame number threshold.

[0057] In an optional implementation, the calculating module is configured to calculate a second frame number difference between the target frame and a nearest buffer transition frame.

[0058] The second determining module is configured to determine the target frame as a real transition frame if the second frame number difference is greater than a second preset frame number threshold, and determine the target frame as a buffer transition frame if the second frame number difference is less than or equal to the second preset frame number threshold.

[0059] In an optional implementation, the buffer transition frame is a transition frame in a fast motion mode.

[0060] In an optional implementation, the first determining module is configured to cache N continuous video frames in a cache area, and determine a next video frame of a video frame with a maximum frame number in the cache area as the target frame.

[0061] The first previous frame and the second previous frame of the target frame are determined from the N video frames cached in the cache area.

[0062] According to a third aspect of the embodiments of the present application, a computing device is provided, which comprises a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete communication with each other through the communication bus.

[0063] The memory is configured to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the video transition identification method.

[0064] According to a fourth aspect of the embodiments of the present application, a computer storage medium is provided, and the storage medium stores at least one executable instruction, and the executable instruction causes a processor to perform operations corresponding to the video transition identification method.

[0065] The embodiment of the present application takes the first N video frames of a target frame as data basis, divides the first N video frames into a first previous frame and a second previous frame of the target frame according to the proximity to the target frame, calculates a first correlation degree of the target frame and the first previous frame, and calculates a second correlation degree of the target frame and each second previous frame; determines whether the target frame is a transition frame according to the difference between the first correlation degree and each second correlation degree. By using the present scheme, it can be accurately identified whether a soft transition occurs, and the video transition recognition precision is improved; moreover, the implementation process of the present scheme is simple and easy to implement, and the execution efficiency is high.

[0066] The embodiment of the present application calculates the difference between the first correlation degree and each second correlation degree, determines whether the target frame is a transition frame based on the maximum difference, so that the transition frame in the soft transition can be accurately identified.

[0067] The embodiment of the present application determines whether the target frame is a transition frame according to the comparison result of the maximum difference and the first preset threshold, so that in the case of a very large maximum difference, the target frame is determined to be a transition frame, and the recognition efficiency of the transition frame is improved.

[0068] The embodiment of the present application determines the target second previous frame corresponding to the maximum difference, determines whether the target frame is a transition frame according to the image content correlation degree and the gray histogram correlation degree of the target frame and the target second previous frame, so that the recognition precision of the transition frame is improved.

[0069] The embodiment of the present application determines the target second previous frame corresponding to the maximum difference, determines whether the target frame is a transition frame according to the gray histogram correlation degree of the target frame and the target second previous frame, so that the recognition efficiency of the transition frame is improved.

[0070] The embodiment of the present application calculates a third correlation degree of a previous video frame of the first previous frame and the first previous frame, determines whether the target frame is a transition frame according to the difference between the third correlation degree and the first correlation degree, so that the transition frame in the hard transition mode can be accurately identified, and the video transition recognition precision is improved.

[0071] The embodiment of the present application determines whether the target frame is a transition frame in the soft transition mode according to the difference between the first correlation degree and each second correlation degree, and determines whether the target frame is a transition frame in the hard transition mode according to the difference between the third correlation degree and the first correlation degree, so that the type of the transition frame can be determined on the basis of the identified transition frame, and the transition frames in the soft transition mode and the hard transition mode are distinguished.

[0072] The embodiment of the present application calculates a first frame number difference between the target frame and the nearest real transition frame after determining that the target frame is a transition frame, determines whether the target frame is a real transition frame or a buffer transition frame according to the comparison result of the first frame number difference and a first preset frame number threshold, so that the transition frames in the soft transition mode, the hard transition mode and the fast panning mode can be distinguished.

[0073] After determining that the target frame is a transition frame, the embodiment of the present application calculates a second frame number difference between the target frame and the nearest buffered transition frame, and determines whether the target frame is a real transition frame or a buffered transition frame according to a comparison result of the second frame number difference and a second preset frame number threshold, so that the transition frames in a soft transition mode, a hard transition mode and a fast dolly mode can be distinguished.

[0074] The embodiment of the present application is provided with a cache area, N continuous video frames are cached in the cache area, and a next video frame of a video frame with a maximum frame number in the cache area is taken as a target frame, so that when the current frame is identified, the video frames in the cache area are directly compared as a basis to improve the identification efficiency. Moreover, through the setting of the cache area, the video stream and other high real-time videos can be quickly divided, thereby providing a basis for real-time video division.

[0075] The above description is only a summary of the technical scheme of the embodiment of the present application, in order to more clearly understand the technical means of the embodiment of the present application, and can be implemented according to the content of the specification, and in order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the following specific embodiments of the embodiment of the present application are described. BRIEF DESCRIPTION OF DRAWINGS

[0076] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of illustrating the preferred embodiments and are not considered as limiting the embodiments of the present application. Moreover, the same reference numerals are used to represent the same parts throughout the drawings. In the drawings:

[0077] Figure 1 A flowchart of a video transition identification method provided by the embodiment of the present application is shown;

[0078] Figure 2 A previous frame diagram provided by the embodiment of the present application is shown;

[0079] Figure 3 A flowchart of another video transition identification method provided by the embodiment of the present application is shown;

[0080] Figure 4 A flowchart of still another video transition identification method provided by the embodiment of the present application is shown;

[0081] Figure 5 A structural diagram of a video transition identification device provided by the embodiment of the present application is shown;

[0082] Figure 6 A structural diagram of a computing device provided by the embodiment of the present application is shown. DETAILED DESCRIPTION

[0083] Exemplary embodiments of the present embodiments will be described herein below with reference to the accompanying drawings. While exemplary embodiments of the present embodiments are illustrated, it is to be understood that the present embodiments can be carried out in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the present embodiments to those skilled in the art.

[0084] Figure 1 A flowchart of a video transition identification method provided by the present embodiments is shown. In this embodiment, the video transition identification method provided by the present embodiments can be executed by a preset computing device or the like.

[0085] Specifically, as shown in the method includes the following steps: Figure 1

[0086] Step S110, determining a first previous frame and a second previous frame of a target frame from the first N video frames before the target frame; wherein the first previous frame of the target frame is the previous video frame of the target frame, and the second previous frame of the target frame is a video frame other than the first previous frame in the first N video frames.

[0087] When identifying the video transition, the identification can be performed in units of video frames to determine whether the video frame is a transition frame in the video, and the video frame to be identified is the target frame. Generally, the first M video frames in the video will not have a video transition, and thus the target frame in the present embodiments can be any video frame after the Mth video frame in the video.

[0088] Unlike the prior art which only compares two adjacent frames, the present embodiments determine the first N video frames of the target frame, where N is greater than or equal to 2. The first N video frames are N video frames in the same video as the target frame, have frame numbers less than the target frame, and can form a continuous frame sequence with the target frame. The first N video frames can also be referred to as the first N previous frames. For example, if the target frame is the Tth frame of the video X, then the first N video frames of the target frame are the (T-1)th, (T-2)th,..., and (T-N)th frames of the video X.

[0089] ​Further, according to the proximity relationship between the target frame and the first N video frames, the first N video frames are divided into a first previous frame and second previous frames. The first previous frame of the target frame is a previous frame of the target frame, and the first previous frame is the closest previous frame to the target frame. The first previous frame is usually one. The second previous frames of the target frame are other video frames in the first N video frames except the first previous frame. The second previous frames of the target frame can be one or more. For example, if the target frame is the Tth frame of a video X, the (T-1)th frame of the video X is the first previous frame of the target frame, and the (T-2)th,..., (T-N)th frames of the video X are the second previous frames of the target frame.

[0090] In an optional embodiment, in order to improve the determination efficiency of the first previous frame and the second previous frame and improve the video transition recognition efficiency, a cache area is arranged in the embodiment, and a plurality of video frames can be cached in the cache area. Specifically, N continuous video frames are cached in the cache area. A next video frame of a video frame with the largest frame number in the cache area is taken as a target frame, and the first previous frame and the second previous frames of the target frame are determined from the N video frames cached in the cache area. For example, the target frame is the Tth frame of a video X, and the (T-1)th, (T-2)th,..., (T-N)th frames of the video X are cached in the cache area. Therefore, when the current frame (i.e., the Tth frame) is recognized, the video frames in the cache area are directly taken as a basis for comparison, and the recognition efficiency is improved. Moreover, based on the improvement of the transition recognition efficiency, the cache area can be used for quick splitting of a video stream and other high real-time videos, and provides a basis for real-time splitting of the video.

[0091] Further, after the target frame is analyzed, the target frame is stored in the cache area, and a video frame with the smallest frame number in the original cache area is deleted, so that the number of video frames stored in the cache area is N. For example, after it is determined that the Tth frame is a transition frame or is not a transition frame, the Tth frame is stored in the cache area, and the (T-N)th frame in the cache area is deleted, and the (T+1)th frame is taken as a new target frame for recognition and analysis.

[0092] In step S120, a first correlation degree between the target frame and the first previous frame is calculated, and a second correlation degree between the target frame and each second previous frame is calculated.

[0093] The correlation between the target frame and the previous N previous frames can be determined according to the image content similarity, the gray histogram similarity, and / or the brightness similarity between the target frame and the previous frames, etc. For example, the image content similarity between the target frame and the previous frames can be obtained by using the CORR (Correlation Coefficient) correlation algorithm, the gray histogram similarity between the target frame and the previous frames can be calculated by using the Manhattan distance, the Euclidean distance, the Hausdorff distance, the central moment method, the X2 statistical distance algorithm, etc., the brightness similarity between the target frame and the previous frames can be calculated by using the corresponding algorithm, etc. The specific correlation calculation algorithm is not limited in the embodiments of the present application. As shown in Figure 2 The correlation R T_T-N between the target frame Tth frame and the previous frame T-Nth frame is calculated. T_T-N+1 The correlation R T_T-2 between the target frame Tth frame and the previous frame T-2th frame is calculated. T_T-1 The correlation R T_T-1 between the target frame Tth frame and the previous frame T-1th frame is calculated. T_T-N

[0094] The correlation between the target frame and the first previous frame is the first correlation, and the correlation between the target frame and the second previous frame is the second correlation. Since the first previous frame is usually one, the first correlation obtained by the step is one; and the target frame has a corresponding second correlation for each second previous frame, so the number of the second correlations obtained by the step is consistent with the number of the second previous frames. As shown in Figure 2 The correlation R T_T-1 between the target frame Tth frame and the previous frame T-1th frame is the first correlation, and R T_T-N , R T_T-N+1 , …, R T_T-2 are the second correlations.

[0095] In step S130, whether the target frame is a transition frame is determined according to the difference between the first correlation and each second correlation.

[0096] Specifically, the difference between the first correlation and each second correlation is calculated, and whether the target frame is a transition frame is determined according to each difference. The difference is the absolute value of the difference between the first correlation and the second correlation. If it is determined that the target frame is a transition frame, it indicates that the next video scene starts from the target frame.

[0097] In an optional embodiment, whether the target frame is a transition frame in the soft transition mode is determined according to the difference between the first correlation and each second correlation. That is, when it is determined that the target frame is a transition frame according to the difference between the first correlation and each second correlation, the transition frame is usually a transition frame in the soft transition mode.

[0098] In yet another optional implementation, in the soft transition mode, the video frames in the previous video scene and the video frames in the next video scene are usually connected by superimposition, fade-in, fade-out, etc. The number of frames for the connection can be a single frame or multiple frames. Thus, the similarity between the transition frame and the connection frame before the transition frame is high, while the similarity between the transition frame and the video frame in the previous video scene before the connection frame is low. In view of this, in the present implementation, after calculating the difference between the first correlation degree and each second correlation degree, the maximum value in each difference value is determined, which is the maximum difference value, and then whether the target frame is a transition frame is determined based on the maximum difference value.

[0099] Further optionally, whether the target frame is a transition frame can be determined based on the maximum difference value by combining one or more of the following ways:

[0100] Method one: comparing the maximum difference value with a first preset threshold value, if the maximum difference value is greater than the first preset threshold value, it is determined that the target frame is a transition frame. The first preset threshold value can be 0.8, etc. Specifically, in the case where the maximum difference value exceeds a certain threshold value, it indicates that the target frame is closely related to the first previous frame, while the second previous frame corresponding to the maximum difference value is little related to the target frame. Thus, it is determined that a soft transition occurs, and the target frame is a transition frame. In the present method, in the case where the maximum difference value is extremely large, it is determined that the target frame is a transition frame, which improves the recognition efficiency of the transition frame.

[0101] Method two: determining the target second previous frame corresponding to the maximum difference value, if the image content correlation degree between the target frame and the target second previous frame is less than a second preset threshold value, and the gray histogram correlation degree between the target frame and the target second previous frame is less than a third preset threshold value, it is determined that the target frame is a transition frame. In the present method, the second previous frame corresponding to the maximum difference value is the target second previous frame. The image content correlation degree between the target frame and the target second previous frame is calculated, for example, the CORR correlation algorithm can be used to obtain the image content correlation degree, and the correlation degree of the gray histogram between the target frame and the target second previous frame (i.e. the gray histogram correlation degree) is calculated. In the case where both the image content correlation degree and the gray histogram correlation degree are less than the corresponding threshold value, it is determined that the target frame and the target second previous frame are quite different, thereby determining that the target frame is a transition frame. The second preset threshold value can be 0.3, and the third preset threshold value can be 0.8. In the present method, the image content correlation degree and the gray histogram correlation degree are used to comprehensively identify the transition frame, thereby improving the recognition accuracy of the transition frame.

[0102] The third mode is: determining a target second previous frame corresponding to the maximum difference; and determining the target frame as a transition frame if a gray histogram correlation degree between the target frame and the target second previous frame is less than a fourth preset threshold. The fourth preset threshold is less than the third preset threshold, for example, the fourth preset threshold can be 0.2, and the like. In the third mode, in the case that the gray histogram correlation degree between the target frame and the target second previous frame is extremely small, the target frame is determined as a transition frame, and the identification efficiency of the transition frame is improved.

[0103] In addition, in another optional embodiment, after the target frame is determined as a transition frame in the soft transition mode, the target second previous frame corresponding to the maximum difference can be determined, and the video frames between the target second previous frame and the target frame are determined as soft transition connection frames or soft transition transition frames. Subsequently, when video segmentation is performed, a segmentation point can be set between the transition frame and the frame before the transition frame, so that the transition frame is used as the starting point of a video segment corresponding to a video scene; or in addition to setting the segmentation point between the transition frame and the frame before the transition frame, a segmentation point is further set between the target second previous frame and the frame after the target second previous frame, so that the target second previous frame is used as the ending point of a video segment corresponding to a previous video scene, and a video segment composed of the connection frames between the target second previous frame and the transition frame is additionally obtained.

[0104] As can be seen, in the embodiment of the application, the first previous frame and the second previous frame of the target frame are divided according to the proximity to the target frame based on the first N video frames of the target frame, the first correlation degree between the target frame and the first previous frame is calculated, and the second correlation degree between the target frame and each second previous frame is calculated; and whether the target frame is a transition frame is determined according to the difference between the first correlation degree and each second correlation degree. By using the scheme, whether a soft transition occurs can be accurately identified, and the video transition identification precision is improved. Moreover, the implementation process of the scheme is simple and easy to implement, and the execution efficiency is high.

[0105] Figure 3 A flowchart of another video transition identification method provided by an embodiment of the application is shown. In the embodiment, the video transition identification method provided by the embodiment can be executed by a preset computing device or the like. In the embodiment, the hard transition is mainly identified.

[0106] Specifically, as shown in Figure 3 the method comprises the following steps:

[0107] In step S310, the first previous frame and the second previous frame of the target frame are determined from the first N video frames of the target frame.

[0108] This step can refer to the description in the Figure 1 embodiment, which is not repeated here.

[0109] Step S320, the first correlation degree of the target frame and the first previous frame is calculated, and the third correlation degree of the previous video frame of the first previous frame and the first previous frame is calculated.

[0110] The first correlation degree is the correlation degree of the target frame and the first previous frame, and the third correlation degree is the correlation degree of the previous video frame of the first previous frame and the first previous frame. The third correlation degree can also be the correlation degree of the second previous frame with the largest frame number and the first previous frame, and is also the correlation degree between the adjacent previous frames of the first previous frame. The specific calculation method of the correlation degree can refer to the description in the embodiment. Figure 1 The description in the embodiment is not repeated here.

[0111] Step S330, the difference between the third correlation degree and the first correlation degree is calculated.

[0112] Specifically, the third correlation degree and the first correlation degree are subtracted, and the obtained difference is taken as the difference between the third correlation degree and the first correlation degree.

[0113] Step S340, if the difference between the third correlation degree and the first correlation degree is greater than the fifth preset threshold, it is determined that the target frame is a transition frame.

[0114] If the difference between the third correlation degree and the first correlation degree is greater than the fifth preset threshold, it indicates that the first previous frame and the previous video frame thereof are closely related, and the first previous frame and the target frame are not closely related, so that it is determined that a transition occurs between the first previous frame and the target frame. Further, since in the hard transition mode, the video frames in the two video scenes are not transitioned, that is, there is no connection frame or transition frame, and thus the third correlation degree and the first correlation degree are greater than the fifth preset threshold, it is determined that the target frame is a transition frame in the hard transition mode.

[0115] As can be seen, in the embodiment of the application, the correlation degrees between adjacent two frames are calculated, and in the case that the difference between the adjacent correlation degrees is large, it is determined that a hard transition occurs, so that the transition frame in the hard transition mode can be accurately identified, and the video transition recognition precision is improved.

[0116] Figure 4 A flowchart of a video transition recognition method provided by an embodiment of the application is shown. In this embodiment, the video transition recognition method provided by the embodiment can be executed by a preset computing device or the like. In this embodiment, the fast panning and the real scene switching are mainly distinguished. The fast panning is an important video shooting mode, and the fast panning can realize wide-range scene shooting by quickly moving the camera device.

[0117] Specifically, as shown in Figure 4 The method comprises the following steps:

[0118] Step S410, determining the target frame as a transition frame according to the difference between the first correlation degree and each second correlation degree, or determining the target frame as a transition frame according to the difference between the third correlation degree and the first correlation degree.

[0119] The specific implementation process of this step can refer to the description in other method embodiments, which will not be repeated here.

[0120] Step S420, calculating a first frame number difference between the target frame and the nearest real transition frame.

[0121] In this embodiment, after it is determined in step S410 that the target frame is a transition frame, it is further determined whether the target frame corresponds to a soft / hard transition mode or a fast motion mode. Figure 1 and / or Figure 3 After the method in the embodiment determines that the target frame is a transition frame, the target frame is further verified to determine whether the current corresponds to a soft / hard transition mode or a fast motion mode.

[0122] Specifically, after it is determined in step S410 that the target frame is a transition frame, a frame number difference between the target frame and the nearest real transition frame is calculated, and the frame number difference is a first frame number difference, which indicates the number of video frames between the target frame and the nearest real transition frame. The nearest real transition frame is a video frame determined as a real transition frame with the largest current frame number, and the real transition frame indicates that it actually occurs scene switching, i.e., soft transition or hard transition.

[0123] Step S430, determining whether the first frame number difference is greater than a first preset frame number threshold; if yes, step S460 is executed; if no, step S470 is executed.

[0124] Through analysis of a large number of videos, it is found that in the soft switching and hard switching modes, the frame number of each video scene in the video is usually greater than a certain threshold value to achieve good user visual experience, i.e., the video is switched to the next video scene after the corresponding frame number. In view of this, in this embodiment, the first frame number difference is compared with the first preset frame number threshold, which is determined according to the frame number statistical value commonly used in each video scene in the soft switching and hard switching modes. For example, the average value of the number of video frames used in each video scene in the soft transition and hard transition modes is 30, and the first preset frame number threshold can be slightly lower than or equal to 30.

[0125] Step S440, calculating a second frame number difference between the target frame and the nearest buffer transition frame.

[0126] After it is determined in step S410 that the target frame is a transition frame, a frame number difference between the target frame and the nearest buffer transition frame is calculated, and the frame number difference is a second frame number difference, which indicates the number of video frames between the target frame and the nearest buffer transition frame. The nearest buffer transition frame is a video frame determined as a buffer transition frame with the largest current frame number, and the buffer transition frame indicates that it actually occurs fast motion.

[0127] In step S450, it is determined whether the second frame number difference is greater than the second preset frame number threshold. If yes, step S460 is executed. If no, step S470 is executed.

[0128] Through analysis of a large number of videos, it is found that in the fast panning mode, the video scene will quickly change, so that the video will be converted to the next video scene within the corresponding frame number. In view of this, in the embodiment, the second frame number difference is compared with the second preset frame number threshold, which is determined according to the frame number statistical value of each video scene in the fast panning mode. For example, the average value of the number of video frames used by each video scene in the fast panning mode is 15, and the second preset frame number threshold can be slightly lower than or equal to 15. The second preset frame number threshold can be matched with the number of video frames buffered in the buffer, so as to facilitate comparison of video frames.

[0129] In step S460, the target frame is determined as a real transition frame.

[0130] If the first frame number difference is greater than the first preset frame number threshold, it indicates that the distance between the target frame and the transition frame in the last soft transition mode or hard transition mode is far, and the target frame is determined as a real transition frame. The real transition frame is the transition frame in the soft transition mode or the hard transition mode.

[0131] If the second frame number difference is greater than the second preset frame number threshold, it indicates that the distance between the target frame and the transition frame in the last fast panning mode is far, and the target frame is no longer in the fast panning mode, so the target frame is determined as a real transition frame.

[0132] In step S470, the target frame is determined as a buffered transition frame.

[0133] If the first frame number difference is less than or equal to the first preset frame number threshold, it indicates that the distance between the target frame and the transition frame in the last soft transition mode or hard transition mode is close, and it indicates that the target frame enters the fast panning mode, so the target frame is determined as a buffered transition frame. The buffered transition frame is the transition frame in the fast panning mode.

[0134] If the second frame number difference is less than or equal to the second preset frame number threshold, it indicates that the distance between the target frame and the transition frame in the last fast panning mode is close, and it indicates that the target frame is still in the fast panning mode, so the target frame is determined as a buffered transition frame.

[0135] In an alternative embodiment, in subsequent video segmentation, since the real transition frame is a transition frame in the soft transition mode or the hard transition mode, a video segmentation point can be determined between the real transition frame and the previous frame of the real transition frame to realize segmentation of two different scenes; and since the buffer transition frame is a transition frame in the fast motion mode, the video frames in the fast motion mode usually correspond to a same theme or semantics, so the buffer transition frame is not taken as a video segmentation point in video segmentation.

[0136] Further alternatively, in order to facilitate subsequent processing of the video, a corresponding identifier can be assigned to each video segment according to the type of the transition frame contained in the video segment after video segmentation. For example, if the video segment contains a buffer transition frame, the video segment is assigned an identifier of the fast motion mode; if the video segment contains a transition frame of the soft scene mode, the video segment is assigned an identifier of the soft transition mode; and if the video segment contains a transition frame of the hard scene mode, the video segment is assigned an identifier of the hard transition mode.

[0137] It can be seen that, after the target frame is determined to be a transition frame according to the difference between the first correlation degree and each second correlation degree, or the target frame is determined to be a transition frame according to the difference between the third correlation degree and the first correlation degree, the target frame is further verified to determine whether the current corresponds to the soft / hard transition mode or the fast motion mode. Moreover, the target frame is determined to correspond to the real transition frame or the buffer transition frame by the first frame number difference between the target frame and the nearest real transition frame and the second frame number difference between the target frame and the nearest buffer transition frame, which further improves the recognition efficiency and provides a basis for accurate video segmentation in the future.

[0138] Figure 5 A structure schematic diagram of a video transition recognition device provided by an embodiment of the present application is shown. As shown in Figure 5 The video transition recognition device 500 includes a first determination module 510, a calculation module 520, and a second determination module 530.

[0139] The first determination module 510 is configured to determine a first previous frame and a second previous frame of a target frame from the first N video frames before the target frame; wherein the first previous frame of the target frame is a previous video frame of the target frame, and the second previous frame of the target frame is a video frame other than the first previous frame in the first N video frames;

[0140] The calculation module 520 is configured to calculate a first correlation degree between the target frame and the first previous frame, and calculate second correlation degrees between the target frame and each second previous frame.

[0141] The second determination module 530 is configured to determine whether the target frame is a transition frame according to the difference between the first correlation degree and each second correlation degree.

[0142] In an optional implementation, the second determining module is configured to: calculate a difference between the first correlation degree and each second correlation degree,

[0143] determine a maximum difference, and determine whether the target frame is a transition frame based on the maximum difference.

[0144] In an optional implementation, the second determining module is configured to: if the maximum difference is greater than a first preset threshold, determine that the target frame is a transition frame.

[0145] In an optional implementation, the second determining module is configured to: determine a target second previous frame corresponding to the maximum difference.

[0146] If the image content correlation degree between the target frame and the target second previous frame is less than a second preset threshold, and the gray histogram correlation degree between the target frame and the target second previous frame is less than a third preset threshold, it is determined that the target frame is a transition frame.

[0147] In an optional implementation, the second determining module is configured to: determine a target second previous frame corresponding to the maximum difference.

[0148] If the gray histogram correlation degree between the target frame and the target second previous frame is less than a fourth preset threshold, it is determined that the target frame is a transition frame.

[0149] In an optional implementation, the second determining module is configured to: determine whether the target frame is a transition frame in a soft transition mode according to the difference between the first correlation degree and each second correlation degree.

[0150] In an optional implementation, the calculating module is configured to: calculate a third correlation degree between a previous video frame of the first previous frame and the first previous frame; and calculate a difference between the third correlation degree and the first correlation degree.

[0151] The second determining module is configured to: if the difference between the third correlation degree and the first correlation degree is greater than a fifth preset threshold, determine that the target frame is a transition frame.

[0152] In an optional implementation, the second determining module is configured to: if the difference between the third correlation degree and the first correlation degree is greater than a fifth preset threshold, determine that the target frame is a transition frame in a hard transition mode.

[0153] In an optional implementation, the calculating module is configured to: calculate a first frame number difference between the target frame and a nearest real transition frame.

[0154] The second determining module is configured to: if the first frame number difference is greater than a first preset frame number threshold, determine that the target frame is a real transition frame; and if the first frame number difference is less than or equal to the first preset frame number threshold, determine that the target frame is a buffer transition frame.

[0155] In an optional implementation, the calculating module is configured to calculate a second frame number difference between the target frame and the nearest buffered transition frame.

[0156] The second determining module is configured to determine that the target frame is a real transition frame if the second frame number difference is greater than a second preset frame number threshold, and determine that the target frame is a buffered transition frame if the second frame number difference is less than or equal to the second preset frame number threshold.

[0157] In an optional implementation, the buffered transition frame is a transition frame in a fast motion mode.

[0158] In an optional implementation, the first determining module is configured to cache N continuous video frames in a cache area, and take a next video frame of a video frame with a maximum frame number in the cache area as the target frame.

[0159] The first previous frame and the second previous frame of the target frame are determined from the N video frames cached in the cache area.

[0160] Therefore, according to the above method, the first N video frames of the target frame are taken as data basis, the first N video frames are divided into the first previous frame and the second previous frame according to the proximity to the target frame, the first correlation degree between the target frame and the first previous frame is calculated, and the second correlation degree between the target frame and each second previous frame is calculated, and whether the target frame is a transition frame is determined according to the difference between the first correlation degree and each second correlation degree. By using the above scheme, whether a soft transition occurs can be accurately identified, and the video transition recognition precision is improved. Moreover, the implementation process of the above scheme is simple and easy to implement, and the execution efficiency is high.

[0161] Figure 6 A structural schematic diagram of a computing device provided by an embodiment of the present application is shown. The specific embodiments of the present application do not limit the specific implementation of the computing device.

[0162] As shown in Figure 6 the computing device can include a processor 602, a communications interface 604, a memory 606, and a communications bus 608.

[0163] The processor 602, the communications interface 604, and the memory 606 complete mutual communication through the communications bus 608. The communications interface 604 is configured to communicate with network elements of other devices, such as clients or other computing devices. The processor 602 is configured to execute the program 610, and specifically can execute the related steps in the above-mentioned embodiments of the method for video transition recognition.

[0164] Specifically, the program 610 can include program code, and the program code includes computer operation instructions.

[0165] The processor 602 can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement one or more embodiments of the application. The one or more processors included in the computing device can be of the same type or different types.

[0166] The memory 606 stores a program 610. The memory 606 can include a high speed RAM memory and can also include a non-volatile memory such as at least one disk memory. The program 610 can be configured to cause the processor 602 to perform the method of any of the method embodiments described above.

[0167] The embodiments of the application provide a non-volatile computer storage medium, which stores at least one executable instruction, and the computer executable instruction can execute the video transition identification method in any of the method embodiments described above.

[0168] The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with these teachings, or with modifications thereto. The construction and use of such systems would be apparent to those skilled in the art from the description herein. Furthermore, embodiments of the present application are not described with reference to any particular programming language. It will be appreciated that a variety of programming languages can be used to implement the teachings of the embodiments of the application as described herein, and any references below to specific languages are provided for disclosure of enablement of the best mode of the embodiments of the application.

[0169] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order not to obscure the understanding of this description.

[0170] Similarly, it is to be understood that the embodiments of the application can be alternately or additionally employed in a variety of ways, and that utilized in the description of exemplary embodiments of the application above are sometimes individually listed separately in the description for clarity. However, the manner in which the various embodiments of the application are employed is not to be interpreted as reflecting a limitation of the application as claimed. Rather, the application contemplates combinations of the various embodiments of the application in any manner possible pursuant to the application, except as can be expressly excluded by definition in the claims.

[0171] Those skilled in the art will appreciate that the modules in the apparatuses in the embodiments can be adapted and placed in one or more apparatuses other than the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and further can be divided into multiple sub-modules or sub-units or sub-components. Any combination of all the features disclosed in the specification (including the accompanying claims, abstract and drawings), and any method or of the apparatuses so disclosed, can be taken, except that at least some of such features and / or processes or units are mutually exclusive, unless specifically stated otherwise. Each feature disclosed in the specification (including the accompanying claims, abstract and drawings) can be replaced by alternative features serving the same, equivalent or a similar purpose, unless specifically stated otherwise.

[0172] Furthermore, those skilled in the art will appreciate that different embodiments of the application have different subsets of features, and that a combination of features from different embodiments can or can not be possible depending on the particular application of the method or apparatus. For example, in the claims below, any of the embodiments of the claimed application can be used in any combination. Thus, the application is not intended to be limited to the features of the preferred embodiments described herein, but also encompasses any subset of features of the embodiments disclosed herein.

[0173] The various components of the embodiments of the present application can be implemented in hardware, or as software modules running in one or more processors, or combinations thereof. Skilled persons should appreciate that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components according to the embodiments of the present application. The embodiments of the present application can also be implemented as a program of apparatus or device (for example, a computer program and a computer program product) for performing part or all of the methods described herein. Such a program implementing the embodiments of the present application can be stored on a computer readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.

[0174] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In a unit claim, several devices can be listed with a conjunction like 'or', but it is to be understood that each of these devices can be implemented by its own hardware item. The use of the word 'at least' followed by a list of one or more members does not preclude the existence of additional such members. The word 'first' or'second' does not have any order of magnitude. The use of the words 'first' and'second' is not to be interpreted as indicating that the order of the steps is limited to the order in which the steps are recited.

Claims

1. A video transition recognition method, characterized in that, include: The first preceding frame and the second preceding frame of the target frame are determined from the N video frames preceding the target frame; wherein, the first preceding frame of the target frame is the video frame preceding the target frame, and the second preceding frame of the target frame is the video frame other than the first preceding frame among the N video frames. Calculate the first correlation between the target frame and the first previous frame, and calculate the second correlation between the target frame and each of the second previous frames; Calculate the difference between the first correlation and each of the second correlations, determine the maximum difference, and determine whether the target frame is a transition frame in soft transition mode based on the maximum difference.

2. The method according to claim 1, characterized in that, The step of determining whether the target frame is a soft transition frame based on the maximum difference further includes: If the maximum difference is greater than the first preset threshold, the target frame is determined to be a transition frame in soft transition mode.

3. The method according to claim 1, characterized in that, The step of determining whether the target frame is a soft transition frame based on the maximum difference further includes: Determine the target second previous frame corresponding to the maximum difference; If the correlation between the image content of the target frame and the target second previous frame is less than a second preset threshold, and the correlation between the grayscale histogram of the target frame and the target second previous frame is less than a third preset threshold, then the target frame is determined to be a transition frame in soft transition mode.

4. The method according to claim 1, characterized in that, The step of determining whether the target frame is a soft transition frame based on the maximum difference further includes: Determine the target second previous frame corresponding to the maximum difference; If the correlation between the grayscale histogram of the target frame and the target second previous frame is less than the fourth preset threshold, then the target frame is determined to be a transition frame in soft transition mode.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: Calculate the third correlation between the video frame preceding the first previous frame and the first previous frame; Calculate the difference between the third relevance and the first relevance; If the difference between the third correlation and the first correlation is greater than the fifth preset threshold, then the target frame is determined to be a transition frame in hard transition mode.

6. The method according to claim 1, characterized in that, The method further includes: Calculate the first frame number difference between the target frame and the nearest real transition frame; If the first frame difference is greater than the first preset frame threshold, then the target frame is determined to be a real transition frame; If the first frame number difference is less than or equal to the first preset frame number threshold, then the target frame is determined to be a buffered transition frame.

7. The method according to claim 1, characterized in that, The method further includes: Calculate the second frame number difference between the target frame and the nearest buffered transition frame; If the second frame number difference is greater than the second preset frame number threshold, then the target frame is determined to be a real transition frame; If the second frame number difference is less than or equal to the second preset frame number threshold, then the target frame is determined to be a buffered transition frame.

8. The method according to claim 6 or 7, characterized in that, The buffered transition frame is the transition frame in the fast camera movement mode.

9. The method according to any one of claims 1-4, characterized in that, Before determining the first preceding frame and the second preceding frame of the target frame from the N preceding video frames of the target frame, the method further includes: caching N consecutive video frames in a buffer; and taking the next video frame of the video frame with the largest frame number in the buffer as the target frame. The step of determining the first preceding frame and the second preceding frame of the target frame from the first N video frames of the target frame further includes: determining the first preceding frame and the second preceding frame of the target frame from the N video frames cached in the buffer.

10. A video transition recognition device, characterized in that, include: The first determining module is used to determine the first preceding frame and the second preceding frame of the target frame from the first N video frames of the target frame; wherein, the first preceding frame of the target frame is the previous video frame of the target frame, and the second preceding frame of the target frame is the video frame other than the first preceding frame among the first N video frames. The calculation module is used to calculate the first correlation between the target frame and the first previous frame, and to calculate the second correlation between the target frame and each of the second previous frames; The second determining module is used to calculate the difference between the first correlation degree and each of the second correlation degrees, determine the maximum difference, and determine whether the target frame is a transition frame of soft transition mode based on the maximum difference.

11. A computing device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the video transition recognition method as described in any one of claims 1-9.

12. A computer storage medium, characterized in that, The storage medium stores at least one executable instruction that causes the processor to perform the operation corresponding to the video transition recognition method as described in any one of claims 1-9.

13. A computer program product, characterized in that, The computer program product is used to perform the operations corresponding to the video transition recognition method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Method and device for identifying key identifier in video, equipment and storage medium

    CN111753762A

  • Detection of logos in a sequence of video frames

    US20180150696A1