Method, device and electronic device for judging similarity of video events

Through the calculation of feature data of video events and the optimization of feature database, the problem of low accuracy and efficiency of existing video event similarity judgment methods is solved, and efficient video event similarity judgment is achieved.

CN117333790BActive Publication Date: 2024-09-17QINGDAO CHENYUAN TECH INFORMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310441698.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2024-09-17
Estimated Expiration
2043-04-23

AI Technical Summary

Technical Problem

Existing video event similarity judgment methods have low accuracy and efficiency, and poor noise resistance. Methods based on deep learning are highly dependent on sample libraries, and the training cost is high and takes a long time.

Method used

By obtaining the video to be detected, performing preprocessing and granulation processing, extracting feature data of video events, calculating the similarity rate of video events, using feature data to determine the similarity of video events, and improving the comparison efficiency of massive video events through the feature database.

Benefits of technology

It achieves accurate similarity judgment of video events, improves calculation efficiency, and reduces the complexity of comparing massive video events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117333790B
    Figure CN117333790B
Patent Text Reader

Abstract

The present application provides a method, device and electronic device for judging the similarity of video events, which relates to the field of video processing. The method includes obtaining video events by preprocessing the acquired video to be detected; calculating feature data of the video events based on the content frames of the video events, calculating the similarity between the first video event and the second video event according to the feature data of the first video event and the second video event, and then judging whether the first video event and the second video event are similar according to the relationship between the similarity between the two and a first threshold. The present application can improve the detection accuracy of video events and improve the judgment efficiency of video event-level similarity in massive videos.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video processing, and in particular to a method, a device and an electronic device for judging similarity of video events. Background Art

[0002] With the development of Internet technology, there are more and more cases of video copying on the Internet, such as copying all or part of the original video to the video platform for playback without permission, re-editing and combining the original video with imitative clips, etc. In order to protect the rights of the original, the existing technology uses video content comparison method to compare the similarity of two videos.

[0003] However, the existing video content comparison method is a method through video fingerprint comparison, which includes using image color histogram features as video fingerprints and video fingerprints based on two-dimensional discrete cosine transform of video images.

[0004] However, the above method has poor anti-noise ability and low image detection accuracy, which affects the similarity judgment result. For example, when a video is subjected to an aspect ratio transformation or a watermark is added to the frame graphics of the video, the substantial content of the video remains the same, but the transformed video fingerprint will change compared with the original video fingerprint, that is, the detection accuracy of the existing video event similarity judgment method is not high.

[0005] In addition, the existing video similarity comparison method based on deep learning and neural networks is highly dependent on the sample library and requires model training based on a large number of sample videos. The training cost is high, the training time is long, and the noise resistance is poor, resulting in low efficiency in video content comparison. Summary of the invention

[0006] In view of this, the purpose of the present application is to propose a method, device and electronic device for similarity judgment of video events. The present application can specifically solve the problem of low accuracy and efficiency of existing methods for similarity judgment of video events.

[0007] Based on the above purpose, in a first aspect, the present application proposes a method for judging the similarity of video events, the method comprising: obtaining a video to be detected, obtaining a video event based on the video to be detected, the video event comprising a first video event and a second video event; wherein the video event refers to a set of content frames in a shot, the content frame refers to a frame representing the content of the shot, including a first frame, a last frame and N intermediate frames, N is a natural number, the intermediate frame is obtained by calculating the difference rate between all sub-frames of a shot except the first and last two frames and the previous content frame, and the difference rate is greater than a preset threshold; calculating feature data of the video event based on the content frame of the video event, and calculating the similarity between the first video event and the second video event according to the feature data of the first video event and the feature data of the second video event; judging whether the similarity between the first video event and the second video event is greater than or equal to a first threshold, if so, determining that the first video event and the second video event are similar, if not, determining that the first video event and the second video event are not similar.

[0008] Optionally, obtaining a video event based on the video to be detected includes: preprocessing the video to be detected to obtain a normalized video; granulating the normalized video to obtain a shot sequence and a content frame sequence; obtaining a video event sequence based on the shot sequence and the content frame sequence, wherein the video event sequence includes at least one of the video events. Optionally, feature data includes the number of content frames of the video event and a content frame feature matrix of the video event, the number of content frames of the second video event is greater than or equal to the number of content frames of the first video event, and the similarity between the first video event and the second video event is calculated based on the feature data of the first video event and the feature data of the second video event, including: calculating the content frame difference rate of the first content frame of the first video event and the content frames in the second video event in sequence, and obtaining a target content frame corresponding to each content frame of the first video event, wherein the target content frame belongs to the second video event;

[0009] The similarity between the first video event and the second video event is calculated according to a content frame difference rate between each content frame of the first video event and its corresponding target content frame, and the number of content frames of the first video event.

[0010] Optionally, a similarity calculation formula for calculating the similarity between the first video event and the second video event is:

[0011]

[0012] Among them, q represents the first video event, fcnt qis the number of content frames of the first video event, p represents the second video event, fcnt p is the number of content frames of the second video event, SimEV(p,q) represents the similarity between the first video event q and the second video event p, i is the sequence number of the content frame of the first video event, Dis(i) is the difference rate between the i-th content frame of the first video event q and the corresponding target content frame, and the target content frame belongs to the second video event.

[0013] Optionally, there are multiple second video events, and the method includes: performing feature extraction on the multiple second video events to obtain a video event feature database containing feature data of each second video event, the second video event feature data including the number of content frames of the second video event, the feature vector of the second video event, and the content frame feature matrix of the second video event; performing video event similarity judgment on the first video event and each second video event in the video event feature database.

[0014] Optionally, a video event similarity judgment is performed on the first video event and each second video event in the video event feature database, including: calculating the absolute value of the difference in the number of content frames between the first video event and the second video event; determining that the first video event and the second video event are not similar when the absolute value of the difference in the number of content frames is greater than a second threshold; and judging whether the first video event and the second video event are similar based on a feature vector difference rate between the first video event and the second video event when the absolute value of the difference in the number of content frames is less than or equal to a second threshold.

[0015] Optionally, judging whether the first video event and the second video event are similar based on the feature vector difference rate between the first video event and the second video event includes: obtaining the feature vector of the first video event and the modulus of the feature vector of the first video event based on the feature vector of the content frame of the first video event, and obtaining the feature vector of the second video event and the modulus of the feature vector of the second video event based on the feature vector of the content frame of the second video event; obtaining the feature vector difference value between the first video event and the second video event based on the feature vector of the first video event and the feature vector of the second video event; obtaining the feature vector difference rate between the first video event and the second video event based on the feature vector difference value between the first video event and the second video event, the modulus of the feature vector of the first video event, and the modulus of the feature vector of the second video event; when the feature vector difference rate between the first video event and the second video event is greater than a third threshold, determining that the first video event and the second video event are dissimilar; when the feature vector difference rate between the first video event and the second video event is less than or equal to the third threshold, judging whether the first video event and the second video event are similar based on the content frame difference rate between the first video event and the second video event.

[0016] Optionally, the number of content frames of the second video event is greater than or equal to the number of content frames of the first video event, and judging whether the first video event and the second video event are similar based on the content frame difference rate between the first video event and the second video event includes: judging whether any content frame of the first video event has a target content frame in the second video event, and whether the content frame difference rate between each content frame of the first video event and its corresponding target content frame is less than or equal to a fourth threshold; if not, determining that the first video event and the second video event are not similar; if so, executing the step of judging whether the similarity rate between the first video event and the second video event is greater than or equal to a first threshold; wherein, the judgment condition for judging whether the content frames of the first video event and the second video event are similar based on the content frame difference rate between the first video event and the second video event is:

[0017] Dis(i)=dis(f pj ,f qi )+θ+φ≤dis max

[0018] Where Dis(i) is the content frame difference rate between the first video event q and the second video event p, f pi is the j content frame of event p, j∈[1,..,fcnt p ], f qiis the i content frame of event q, i∈[1,..,fcnt q ],dis(f pj ,f qi ) is the original difference rate between the j content frame of event p and the i content frame of event q, θ is the inherent error, φ is the preset threshold for calculating the error, and max is the fourth threshold.

[0019] In a second aspect, a similarity judgment device for video events is also provided, the device comprising: an image processing module, used to obtain a video to be detected, and obtain a video event based on the video to be detected, wherein the video event comprises a first video event and a second video event; wherein the video event refers to a set of content frames in a shot, and the content frame refers to a frame representing the content of the shot, including a first frame, a last frame and N intermediate frames, N being a natural number, and the intermediate frame is obtained by calculating the difference rate between all sub-frames of a shot except the first and last two frames and the previous content frame, and the difference rate is greater than a preset threshold; a calculation module, used to calculate the feature data of the video event based on the content frame of the video event, and calculate the similarity between the first video event and the second video event according to the feature data of the first video event and the feature data of the second video event; a judgment module, used to judge whether the similarity between the first video event and the second video event is greater than or equal to a first threshold, and if so, it is determined that the first video event and the second video event are similar, and if not, it is determined that the first video event and the second video event are not similar.

[0020] In a third aspect, an electronic device is also provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect.

[0021] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and the program is executed by a processor to implement any method described in the first aspect.

[0022] In general, this application has at least the following beneficial effects:

[0023] By normalizing and granulating the video, video events are obtained, so that each video event can be calculated in the same coordinate system, and then the similarity between the first video event and the second video event is obtained by calculating the feature data of the video event, and then whether the two video events are similar can be judged according to the similarity between the first video event and the second video event, which has the characteristic of accurate calculation. In addition, when the first video event and the massive second video event are judged for similarity, the massive second video event is first normalized and feature extracted to form a video event feature database, and then when comparing, only the feature data of the first video event needs to be extracted, and then the similarity between the two is compared according to the feature data of the first video event and the feature data of the second video event, thereby improving the comparison efficiency of massive images. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application. The illustrative embodiments of the present invention and their description are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0025] Figure 1 A schematic diagram showing an application environment of an optional method for determining similarity of video events according to an embodiment of the present invention;

[0026] Figure 2 A schematic diagram showing an application environment of another optional method for determining similarity of video events according to an embodiment of the present invention;

[0027] Figure 3 A flowchart showing the steps of a method for determining similarity of video events according to an embodiment of the present invention;

[0028] Figure 4 A schematic diagram showing a granulation structure according to an embodiment of the present invention;

[0029] Figure 5 A schematic diagram showing a content frame selection according to an embodiment of the present invention;

[0030] Figure 6 A flowchart showing the steps of determining whether a first video event is similar to a second video event according to an embodiment of the present invention;

[0031] Figure 7 A schematic diagram showing the structure of a similarity judgment device for video events provided by an exemplary embodiment of the present invention is shown;

[0032] Figure 8 A schematic diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] In one aspect of an embodiment of the present invention, a method for determining similarity of video events is provided. As an optional implementation, the method for determining similarity of video events can be applied to, but is not limited to, Figure 1 In the application environment shown. The application environment includes: a terminal device 102 for human-computer interaction with a user, a network 104, and a server 106. A user 108 can perform human-computer interaction with the terminal device 102, and a video event similarity judgment application is running in the terminal device 102. The terminal device 102 includes a human-computer interaction screen 1022, a processor 1024, and a memory 1026. The human-computer interaction screen 1022 is used to display images; the processor 1024 is used to obtain a video to be detected, and to perform similarity judgment of video events based on the video to be detected. The memory 1026 is used to store feature data of video events.

[0036] In addition, the server 106 includes a database 1062 and a processing engine 1064, and the database 1062 is used to store the feature data of the above-mentioned video event. The processing engine 1064 is used to: obtain a video to be detected, obtain a video event based on the video to be detected, and the video event includes a first video event and a second video event; calculate the feature data of the video event based on the content frame of the video event, and calculate the similarity between the first video event and the second video event according to the feature data of the first video event and the feature data of the second video event; determine whether the similarity between the first video event and the second video event is greater than or equal to a first threshold, if so, determine that the first video event and the second video event are similar, if not, determine that the first video event and the second video event are not similar.

[0037] In one or more embodiments, the similarity determination method of the video events described above in the present application can be applied to Figure 2 In the application environment shown. Figure 2 As shown, human-computer interaction can be performed between user 202 and user device 204. User device 204 includes memory 206 and processor 208. In this embodiment, user device 204 can refer to but not be limited to executing the operations performed by the above-mentioned terminal device 102 to perform similarity judgment of video events.

[0038] Optionally, the terminal device 102 and the user device 204 include but are not limited to mobile phones, tablet computers, laptop computers, PCs, vehicle-mounted electronic devices, wearable devices and other terminals, and the network 104 may include but is not limited to wireless networks or wired networks. Among them, the wireless network includes: WIFI and other networks that realize wireless communication. The wired network may include but is not limited to: wide area network, metropolitan area network, local area network. The server 106 may include but is not limited to any hardware device that can perform computing. The server may be a single server, or a server cluster composed of multiple servers, or a cloud server. The above is only an example, and no limitation is made to this in this embodiment.

[0039] In the related art, video comparison is mostly carried out by using a video fingerprint comparison method, which includes using image color histogram features as video fingerprints and video fingerprints based on two-dimensional discrete cosine transform of video images.

[0040] However, the above method has poor anti-noise ability and low video detection accuracy, which affects the similarity judgment result. For example, when a video is subjected to an aspect ratio transformation or a watermark is added to the frame graphics of the video, the substantial content of the video remains the same, but the transformed video fingerprint will change compared with the original video fingerprint, that is, the detection accuracy of the existing video event similarity judgment method is not high.

[0041] In addition, the existing video similarity comparison method based on deep learning and neural networks is highly dependent on the sample library and requires model training based on a large number of sample videos. The training cost is high, the training time is long, and the noise resistance is poor, resulting in low efficiency in video content comparison.

[0042] In order to solve the above technical problem, as an optional implementation mode, an embodiment of the present invention provides a method for determining similarity of video events.

[0043] Figure 3 FIG. 1 is a flowchart showing a method for determining similarity of video events according to an embodiment of the present application. Figure 3 As shown, the similarity determination method of the video events includes the following steps S301 to S303:

[0044] S301: Acquire a video to be detected, and obtain a video event based on the video to be detected.

[0045] In this embodiment, the video to be detected may be a video from one or more resource libraries, may be a video specified by a user, or may be a video from the Internet.

[0046] In this embodiment, video events are obtained based on the video to be detected, including: preprocessing the video to be detected to obtain a normalized video; granulating the normalized video to obtain a shot sequence and a content frame sequence; and obtaining a video event sequence based on the shot sequence and the content frame sequence, wherein the video event sequence includes at least one video event.

[0047] Among them, preprocessing includes but is not limited to video deframing, picture-in-picture image extraction, border removal of images in the video, etc., and normalization conversion of the video image in terms of resolution, aspect ratio, color space, etc., so that the obtained normalized videos have the same dimension, which is convenient for granular processing and content analysis.

[0048] Figure 4 A schematic diagram showing a granulation structure is shown in FIG. Figure 4 The granular structure of a video includes video, frame sequence, lens and content frame. The frame sequence is all frames representing the video content. The lens refers to the continuous picture fragments shot by the camera between the start and stop of the camera, which is the basic unit of video composition. The content frame refers to the frame representing the content of the lens, including the first frame, the last frame and N intermediate frames, N is a natural number. The intermediate frame is obtained by calculating the difference rate between all sub-frames of a lens except the first and last two frames and the previous content frame, and the difference rate is greater than the preset threshold.

[0049] In this embodiment, granulation processing refers to segmenting a video into shots to obtain a granular structure of the video. The principle of obtaining the granular structure is as follows: the video content is composed of a continuous frame sequence. The continuous frame sequence can be divided into multiple groups according to the continuity of the video content. Each group of continuous frame sequences is a shot. By analyzing the differences in the content of the video shots, a small number of frames are selected from the continuous frame sequence to represent the content of the shot. These frames are content frames. Among them, the content frame includes at least the first and last two frames of the shot (shot frames), so the number of content frames of a shot is ≥2.

[0050] Figure 5 is a schematic diagram of content frame extraction according to an embodiment of the present invention, such as Figure 5 As shown, the first frame is the first content frame, and then the difference rate between the second and third frames ... and them is calculated until it is greater than the preset threshold. If the difference rate between the second and third frames and the first frame is less than the preset threshold, and the fourth frame is greater than the preset threshold, then the fourth frame is the second content frame. Then the difference rate between the fifth, sixth, ... and the fourth frame is calculated until it is greater than the preset threshold. If the difference rate between the fifth, sixth, and seventh frames and the first frame is less than the preset threshold, and the eighth frame is greater than the preset threshold, then the eighth frame is the third content frame. And so on, calculate the content frames in all subframes between all the first frames and the last frames. The last frame is directly selected as the last content frame without calculating the difference rate between it and the previous content frame. Among them, the difference rate is the difference rate between the two calculated frames.

[0051] For example, in a surveillance video, there are few people and cars at night, and the video screen changes very little, so there will be few content frames. For example, only a few content frames are extracted in 10 hours. During the day, there are many people and cars, and people and objects in the video screen change frequently. The content frames calculated according to the above method will be much more than at night. Therefore, compared with the key frame, the content frame ensures that all content information of the lens video is not lost, because the key frame may lose part of the lens content. Compared with the solution that calculates and considers every frame of the video, the selection of content frames greatly reduces the amount of image calculation without losing content because only part of the video image frames are selected.

[0052] In this embodiment, a video event refers to a collection of all content frames in a shot. Specifically, obtaining a video event based on a video to be detected includes: preprocessing the video to be detected to obtain a normalized video, then performing shot segmentation on the normalized video to obtain at least one shot, then generating shot data (shot sequence) based on the at least one shot, then extracting the content frame of each shot, then generating content frame data (content frame sequence) based on the content frame of each shot, and then combining the shot data and content frame data of each shot to obtain each video event and form a video event sequence.

[0053] In this embodiment, the video event includes a first video event and a second video event, wherein the first video event and the second video event may be different video events from the same video event sequence, or may be different video events from different videos to be detected.

[0054] S302: Calculate feature data of the video event based on the content frame of the video event, and calculate the similarity between the first video event and the second video event according to the feature data of the first video event and the feature data of the second video event.

[0055] In this embodiment, the feature data includes the number of content frames of the video event and the feature matrix of the content frames of the video event. The feature matrix of the content frames of the video event includes the feature matrix of each content frame contained in the video event. The feature matrix of the content frame can be obtained according to the UniformLBP feature of the content frame, which can better reflect the content feature of the video event. In an optional example, the feature matrix of the content frame can also be obtained according to other features of the content frame, such as histogram features, SIFT features, HOG features and Haar features, etc., which are not listed here one by one.

[0056] In this embodiment, the number of content frames of the second video event is greater than or equal to the number of content frames of the first video event, and the similarity between the first video event and the second video event is calculated based on the feature data of the first video event and the feature data of the second video event, including: calculating the content frame difference rate of the first content frame of the first video event and the content frames in the second video event in sequence, and obtaining a target content frame corresponding to each content frame of the first video event, and the target content frame belongs to the second video event. Then, based on the content frame difference rate between each content frame of the first video event and its corresponding target content frame, and the number of content frames of the first video event, the similarity between the first video event and the second video event is calculated.

[0057] For example, the number of content frames of the first video event is 5, and the number of content frames of the second video event is 7, then the content frame differences between the first content frame of the first video event and the first content frame, the second content frame, ..., the sixth content frame, and the seventh content frame of the second video event are calculated. Assuming that the difference rate between the first content frame of the first video event and the first content frame of the second video event is greater than a preset difference rate threshold (fourth threshold), and the difference rate between the first content frame of the first video event and the second content frame of the second video event is less than the preset difference rate threshold, then the second content frame of the second video event is used as the target content frame corresponding to the first content frame of the first video event, and the second content frame of the second video event is used as the first target content frame, and 5 target content frames are obtained in sequence. It can be seen that the target content frame belongs to the second video event, that is, the second content frame of the second video event is sequentially converted into the second content frame. The third content frame of the second video event, the fourth content frame of the second video event, the fifth content frame of the second video event, and the sixth content frame of the second video event are respectively used as the target content frames of the second content frame of the first video event, the third content frame of the first video event, the fourth content frame of the first video event, and the fifth content frame of the first video event, wherein, assuming that the difference rates between the first content frame of the first video event and the first content frame, the second content frame, and the third content frame of the second video event are all greater than the preset difference rate threshold, then 5 target content frames cannot be found in the second video event, that is, the target content frame cannot be found in the second video event for each content frame of the first video event, which means that there are different content frames between the two, the first video event will not be included in the second video event, and it is determined that the first video event and the second video event are not similar.

[0058] After obtaining the target content frames corresponding to each content frame of the first video event according to the above method, the similarity between the first video event and the second video event is calculated based on the content frame difference rate between each content frame of the first video event and the corresponding target content frame, and the number of content frames of the first video event.

[0059] Specifically, the similarity calculation formula for calculating the similarity between the first video event and the second video event is:

[0060]

[0061] Among them, q represents the first video event, fcnt q is the number of content frames of the first video event, p represents the second video event, fcnt p is the number of content frames of the second video event, SimEV(p,q) represents the similarity between the first video event q and the second video event p, i is the sequence number of the content frame of the first video event, Dis(i) is the difference rate between the i-th content frame of the first video event q and the corresponding target content frame, and the target content frame belongs to the second video event.

[0062] It is understandable that when the number of content frames included in video event A is greater than the number of content frames included in video event B, there are more content frames in video event A than in video event B, and it is impossible to consider that video event B contains video event A, and thus it is impossible to determine whether video event A is similar to video event B. However, it is possible to determine whether video event A is similar to video event B by determining whether video event A contains all the content frames of video event B. That is to say, in this embodiment, when the number of content frames of two video events is the same, they can be directly compared. When the number of content frames of two video events is different, the video event with a smaller number of content frames is compared with the video event with a larger number of content frames. The "first" and "second" of the above-mentioned first video event and second video event are only used for distinction and are not used as order restrictions. S303, determine whether the similarity between the first video event and the second video event is greater than or equal to the first threshold. If so, determine that the first video event and the second video event are similar. If not, determine that the first video event and the second video event are not similar. In this embodiment, when SimEV(p,q) satisfies the condition: SimEV≥SimEV min , indicating that the similarity between the first video event and the second video event is relatively large within the allowable error range, that is, the difference between each content frame in the first video event and the corresponding target content frame in the second video event is less than the preset difference rate threshold, and the overall similarity is greater than or equal to the first threshold, then the first video event and the second video event are determined to be similar. If SimEV(p,q) is not satisfied, indicating that the difference between the first video event and the second video event is relatively large, then the first video event and the second video event are determined to be dissimilar, where SimEV min is the first threshold.

[0063] The above is the video event similarity judgment method provided by this embodiment. It can truly and accurately judge the similarity between two video events based on the video event feature matrix of the two video events, and then judge whether the two video events are similar based on the similarity, which has the characteristic of accurate calculation.

[0064] When there are many videos to be detected, for example, when comparing the similarity of a video event with a large number of video events, the amount of calculation using the content frame feature matrix is ​​too large. In this case, the present embodiment further provides a method for judging the similarity between a small number of video events and a large number of video events. For example, when there are multiple second video events, the first video event is compared with a large number of video events consisting of multiple second video events. At this time, the method of this embodiment includes: extracting features from the multiple second video events to obtain a video event feature database containing feature data of each of the second video events, and judging the video event similarity between the first video event and each second video event in the video event feature database.

[0065] The second video event feature data includes the number of content frames of the second video event, the feature vector of the second video event, and the content frame feature matrix of the second video event. The feature data of the second video event can be extracted in advance, and when the similarity between the first video event and any second video event is judged, the feature data in the video event feature database can be directly retrieved to improve the real-time calculation speed.

[0066] For example, the aspect ratio, resolution and color space of massive video events are normalized and granulated one by one to obtain multiple second video events, and then the feature data of each second video event is extracted, and the feature data of multiple second video events are combined into a video event feature database. Then, when making a similarity judgment between a first video event and any second video event, it is only necessary to obtain the feature data of the second video event, and judgment can be made based on the feature data of the first video event and the feature data of the second video event, thereby improving the similarity judgment rate of massive video events.

[0067] Furthermore, in the case of comparing a first video event with a massive amount of video events consisting of multiple second video events, if the first video event is compared with each second video event, the amount of calculation is huge. Therefore, this embodiment can first exclude second video events that are not similar to the first video event through preset conditions to reduce the amount of calculation.

[0068] In this embodiment, video event similarity is judged for a first video event and each second video event in a video event feature database, including: calculating the absolute value of the difference in the number of content frames between the first video event and the second video event; when the absolute value of the difference in the number of content frames is greater than a second threshold, determining that the first video event and the second video event are not similar; and when the absolute value of the difference in the number of content frames is less than or equal to the second threshold, judging whether the first video event and the second video event are similar based on a difference rate of feature vectors of the first video event and the second video event.

[0069] For example, p represents the second video event, q represents the first video event, and fcnt p is the number of content frames of the second video event, fcnt q is the number of content frames of the first video event, then

[0070] |fcnt p -fcnt q |>diff max In the case of , it means that the number of content frames included in the first video event and the second video event is quite different, where diff max ≥0,diff max For example, the number of content frames of the first video event is 9, and the number of content frames of the second video event is 20. The number of content frames is quite different, so it is directly determined that the two are not similar.

[0071] However, in |fcnt p -fcnt q |≤diff max In the case of , it means that the difference in the number of content frames contained in the first video event and the second video event is small, and the first video event and the second video event may be similar or dissimilar. For example, the number of content frames of the first video event is 5, and the number of content frames of the second video event is 7. At this time, the 2 more content frames of the second video event than the first video event may be the same as the 5 content frames of the first video event, or may be different from the 5 content frames of any of the first video events. Therefore, continue to judge whether the first video event and the second video event are similar based on the difference rate of their feature vectors.

[0072] Specifically, judging whether the first video event and the second video event are similar is based on the difference rate of feature vectors between the first video event and the second video event, including: obtaining the feature vector of the first video event and the modulus of the feature vector of the first video event according to the feature vector of the content frame of the first video event, and obtaining the feature vector of the second video event and the modulus of the feature vector of the second video event according to the feature vector of the content frame of the second video event; obtaining the difference value of the feature vectors of the first video event and the second video event according to the feature vector of the first video event and the feature vector of the second video event; obtaining the difference rate of the feature vectors of the first video event and the second video event according to the difference value of the feature vectors of the first video event and the second video event, the modulus of the feature vector of the first video event, and the modulus of the feature vector of the second video event.

[0073] In this embodiment, the feature vector of the content frame is obtained by calculating the feature matrix of the content frame, and the feature vector of the video event is obtained according to the feature vector of the content frame.

[0074] In this embodiment, the video event feature vector is represented by EV, the dimension of EV is 3481, and the formula of EV is as follows:

[0075] EV=(v1,v2,…v k ,v 3481 )

[0076] v k Represents the value of the k-dimensional vector EV, v k The calculation formula is as follows:

[0077]

[0078] Where fcnt is the number of content frames in the video event, FV k (i) is the vector value of the i-th content frame of the video event in dimension k.

[0079] Furthermore, the feature vector difference value DiffEV(p,q) between the first video event and the second video event is:

[0080]

[0081] Where p represents the second video event, q represents the first video event, and v k (p) represents the value of the k-dimensional second video event, v k (q) represents the value of the k-dimensional first video event.

[0082] Furthermore, the characteristic vector difference rate DisEV(p,q) between the first video event and the second video event is calculated as follows:

[0083]

[0084] Wherein, DiffEV(p,q) represents the difference value of the feature vectors of the first video event and the second video event, modEV(p) represents the modulus of the feature vector of the second video event, modEV(q) represents the modulus of the feature vector of the first video event, min(modEV(p), modEV(q)) represents the minimum value between the modulus of the feature vector of the first video event and the modulus of the feature vector of the second video event, modEV(p) and modEV(q) as the denominators are not zero; when modEV(p) and modEV(q) are both zero, DisEV(p,q)=0.

[0085] Among them, the calculation formula of the modulo modEV of the event feature vector is:

[0086]

[0087] After the feature vector difference rate between the first video event and the second video event is obtained as described above, by calculating the relationship between the feature vector difference rate between the first video event and the second video event and a third threshold, it is determined whether the first video event and the second video event are similar.

[0088] When the difference rate of the feature vectors of the first video event and the second video event is greater than a third threshold, it is determined that the first video event and the second video event are not similar, that is, when DisEV(p,q)>DisEV max In the case of , this indicates that the feature vectors of the first video event and the second video event are quite different, and it is determined that the first video event and the second video event are not similar. DisEV max is the third threshold.

[0089] When the difference rate of the feature vectors of the first video event and the second video event is less than or equal to the third threshold, that is, when DisEV(p,q)≤DisEV max In this case, it means that the difference between the feature vectors of the first video event and the second video event is small. However, since DisEV(p,q) cannot be directly used as a criterion for whether events p and q are similar, when the value of DisEV(p,q) is small, events p and q may not be similar. Therefore, whether the first video event and the second video event are similar is also judged based on the content frame difference rate of the first video event and the second video event.

[0090] Specifically, in this embodiment, the number of content frames of the second video event is greater than or equal to the number of content frames of the first video event, and whether the first video event and the second video event are similar is determined based on the content frame difference rate between the first video event and the second video event, including: determining whether any content frame of the first video event has a target content frame in the second video event, and whether the content frame difference rate between each content frame of the first video event and its corresponding target content frame is less than or equal to a fourth threshold; if not, determining that the first video event and the second video event are not similar.

[0091] The judgment condition for judging that the content frames of the first video event and the second video event are similar by using the content frame difference rate of the first video event and the second video event is:

[0092] Dis(i)=dis(f pj ,f qi )+θ+φ≤dis nax

[0093] Where Dis(i) is the content frame difference rate between the first video event q and the second video event p, f pi is the j content frame of event p, j∈[1,..,fcnt p ], f qiis the i content frame of event q, i∈[1,..,fcnt q ],dis(f pj ,f qi ) is the original difference rate between the j content frame of event p and the i content frame of event q, θ is the inherent error, φ is the preset threshold for calculating the error, and max is the fourth threshold.

[0094] In this embodiment, dis(f pj ,f qi ) is calculated as:

[0095]

[0096] Among them, diff(f pj ,f qi ) is the content frame difference between the i content frame of the first video event and the j content frame of the second video event, modULBPM(f pj ) is the modulus of the feature matrix of the j content frame of the second video event, modULBPM(f qi ) is the modulus of the feature matrix of the i content frame of the first video event, modULBPM(f pj ),modULBPM(f qi ) as the denominator is not 0, when modULBPM(f pj ) and modULBPM(f qi ) are all 0 when dis(f pj ,f qi )=0.

[0097] It is understandable that when any content frame of the first video event does not have a target content frame in the second video event, it means that there are different content frames between the first video event and the second video event, and the two are not similar. It should be noted that the method for determining whether there is a target content frame in the second video event that corresponds one-to-one to each content frame of the first video event is consistent with the method for determining the target content frame in the above step S302, and the first content frame of the first video event is sequentially calculated with the content frame in the second video event. The content frame difference rate is obtained to obtain the target content frame corresponding one-to-one to each content frame of the first video event.

[0098] When each content frame of the first video event has a target content frame in the second video event, but the difference rate between any content frame in the first video event and all content frames in the second video event is greater than the fourth threshold, it means that the difference rate between this any content frame in the first video event and all content frames in the second video event is large, indicating that the first video event and the second video event are different, and at this time it is determined that the first video event and the second video event are not similar.

[0099] In the second video event, there is a target content frame corresponding to each content frame of the first video event, and the content frame difference rate between each content frame of the first video event and its corresponding target content frame is less than or equal to the fourth threshold value. max In the case of , it can be explained that the content frame of the first video event and the content frame of the second video event have a smaller difference rate when comparing the single-frame difference rate. However, considering that the video event is composed of multiple content frames in a continuous order, the single-frame difference rate cannot represent the difference rate of the entire video event. Therefore, in order to obtain a more accurate judgment result, any content frame of the first video event has a target content frame in the second video event, and the content frame difference rate of each content frame of the first video event and its corresponding target content frame is less than or equal to the fourth threshold value dis max In the case of, executing the step of determining whether the similarity between the first video event and the second video event is greater than or equal to the first threshold, that is, the above step S303 determines whether the similarity between the first video event and the second video event is greater than or equal to the first threshold, if so, it is determined that the first video event and the second video event are similar, if not, it is determined that the first video event and the second video event are not similar. To avoid repetition, it will not be repeated here. Figure 6 A flowchart showing a step of determining whether a first video event is similar to a second video event is shown. Figure 6 , including the following steps S601 to S603:

[0100] S601, determine whether the absolute value of the difference in the number of content frames of a first video event and a second video event is less than or equal to a second threshold, if so, execute step S602, if not, determine that the first video event and the second video event are not similar.

[0101] S602: Determine whether the vector difference rate between the video event feature vector of the first video event and the video event feature vector of the second video event is less than or equal to a third threshold value. If so, execute step S603; if not, determine that the first video event and the second video event are not similar.

[0102] S603, determining whether any content frame of the first video event has a target content frame in the second video event, and whether the content frame difference rate between each content frame of the first video event and its corresponding target content frame is less than or equal to a fourth threshold; if so, executing step S604; if not, determining that the first video event and the second video event are not similar.

[0103] S604, determine whether the similarity between the first video event and the second video event is greater than or equal to the first threshold value, if so, determine that the first video event and the second video event are similar, if not, determine that the first video event and the second video event are not similar. The above is a method for similarity judgment between a first video event and a massive second video event provided by this embodiment, by first normalizing and extracting features of the massive second video events to form a feature database, and then when comparing, only the feature data of the first video event needs to be extracted, and then the similarity between the two is compared based on the feature data of the first video event and the feature data of the second video event, thereby improving the comparison efficiency of the massive video events. And the massive second video events can be screened according to different video event feature data, and the second video events that are not similar to the first video event are gradually excluded, which can further improve the similarity comparison rate of the massive video events.

[0104] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention. The following is an embodiment of the similarity judgment device for video events of the present invention, which can be used to execute the method embodiments of the present invention. For details not disclosed in the embodiment of the similarity judgment device for video events of the present invention, please refer to the method embodiments of the present invention.

[0105] Figure 7 The schematic diagram of the structure of a similarity judgment device for video events provided by an exemplary embodiment of the present invention is shown. The similarity judgment device for video events can be implemented as all or part of a terminal through software, hardware, or a combination of both. The similarity judgment device for video events 700 includes:

[0106] The image processing module 701 is used to obtain a video to be detected, and obtain a video event based on the video to be detected, wherein the video event includes a first video event and a second video event; wherein the video event refers to a set of all content frames in a shot, and the content frame refers to a frame representing the content of the shot, including a first frame, a last frame, and N intermediate frames, where N is a natural number, and the intermediate frame is obtained by calculating the difference rate between all sub-frames of a shot except the first and last two frames and the previous content frame, and the difference rate is greater than a preset threshold.

[0107] The calculation module 702 is used to calculate the feature data of the video event based on the content frame of the video event, and calculate the similarity between the first video event and the second video event according to the feature data of the first video event and the feature data of the second video event.

[0108] The judgment module 703 is used to judge whether the similarity between the first video event and the second video event is greater than or equal to a first threshold. If so, it is determined that the first video event and the second video event are similar; if not, it is determined that the first video event and the second video event are not similar.

[0109] In one example, there are multiple second video events, and the image processing module 601 is also used to extract features from the multiple second video events to obtain a video event feature database containing feature data of each second video event, wherein the second video event feature data includes the number of content frames of the second video event, the feature vector of the second video event, and the content frame feature matrix of the second video event; the judgment module 603 is also used to perform video event similarity judgment on the first video event and each second video event in the video event feature database.

[0110] It should be noted that, when the similarity judgment device for video events provided in the above-mentioned embodiment executes the similarity judgment method for video events, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the similarity judgment device for video events provided in the above-mentioned embodiment and the embodiment of the similarity judgment generation method for video events belong to the same concept, and the embodiment and implementation process thereof are detailed in the method embodiment, which will not be repeated here. The present application obtains video events by normalizing and granulating the video, so that each video event can be calculated in the same coordinate system, and then obtains the similarity rate between the first video event and the second video event by calculating the feature data of the video event, and then can judge whether the two video events are similar according to the similarity rate of the first video event and the second video event, and has the characteristic of accurate calculation. In addition, when judging the similarity between the first video event and the massive second video events, the massive second video events are first normalized and feature extracted to form a video event feature database, and then when comparing, only the feature data of the first video event needs to be extracted, and then the similarity between the two is compared based on the feature data of the first video event and the feature data of the second video event, thereby improving the comparison efficiency of the massive video events. The massive second video events can also be screened according to different video event features, and the second video events that are not similar to the first video event can be gradually excluded, which can further improve the similarity comparison rate of the massive video events.

[0111] The embodiments of the present application also provide an electronic device corresponding to the video event similarity determination method provided in the above embodiments, so as to execute the above video event similarity determination method.

[0112] Figure 8 Schematic diagram of an electronic device according to an embodiment of the present application is shown. Figure 8 As shown, the electronic device 800 includes: a memory 801 and a processor 802, the memory 801 stores a computer program that can be run on the processor 802, and the processor 802 executes the method provided in any of the aforementioned embodiments of the present application when running the computer program.

[0113] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0114] Optionally, in this embodiment, the processor may be configured to execute the steps of the video event similarity determination method through a computer program.

[0115] Alternatively, a person skilled in the art may understand that: Figure 8 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Figure 8 The electronic device and the electronic equipment described above are not limited in structure. Figure 8 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 8 Different configurations shown.

[0116] Among them, the memory 801 can be used to store software programs and modules, such as program instructions / modules corresponding to the video event similarity judgment method and device in the embodiment of the present invention. The processor 802 executes various functional applications and data processing by running the software programs and modules stored in the memory 801, that is, the above-mentioned video event similarity judgment method is realized. The memory 801 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 801 may further include a memory remotely arranged relative to the processor 802, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof. Among them, the memory 801 can be specifically but not limited to being used for storing image feature data. As an example, the above-mentioned memory 801 may include but is not limited to each module in the above-mentioned video event similarity judgment device. In addition, it may also include but is not limited to other module units in the above-mentioned video event similarity judgment device, which will not be repeated in this example.

[0117] Optionally, the electronic device includes a transmission device 803, which is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 803 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 803 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.

[0118] In addition, the electronic device further comprises: a display 804 for displaying the first judgment result or the second judgment result; and a connection bus 805 for connecting various module components in the electronic device.

[0119] This embodiment provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned video event similarity determination method, wherein the computer program is configured to execute the steps of any one of the above-mentioned method embodiments when running.

[0120] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for executing each step of the method for determining similarity of video events.

[0121] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0122] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0123] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.

[0124] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0125] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0126] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0127] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0128] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for determining similarity of video events, characterized in that: The method comprises: obtaining a video to be detected, and obtaining a video event based on the video to be detected, wherein the video event comprises a first video event and a second video event; wherein the video event refers to a set of all content frames in a shot, and the content frame refers to a frame representing the content of the shot, including a first frame, a last frame, and N intermediate frames, where N is a natural number, and the intermediate frame is obtained by calculating the difference rate between all subframes of a shot except the first and last two frames and the previous content frame in sequence, and when the difference rate is greater than a preset threshold; Calculating feature data of the video event based on the content frame of the video event, and calculating a similarity between the first video event and the second video event according to the feature data of the first video event and the feature data of the second video event; Determine whether the similarity between the first video event and the second video event is greater than or equal to a first threshold, if so, determine that the first video event and the second video event are similar, if not, determine that the first video event and the second video event are not similar; The feature data includes the number of content frames of the video event and the feature matrix of the content frames of the video event, the number of content frames of the second video event is greater than or equal to the number of content frames of the first video event, and the similarity between the first video event and the second video event is calculated based on the feature data of the first video event and the feature data of the second video event, including: Calculate the content frame difference rate of the first content frame of the first video event and the content frames in the second video event in sequence, take the first content frame in the second video event whose difference rate with the first content frame of the first video event is less than a preset difference rate threshold as the first target content frame, and take the content frames after the first target content frame in the second video event as target content frames in sequence starting with the first target content frame to obtain target content frames corresponding to each content frame of the first video event one by one, the target content frames belong to the second video event, and the number of the target content frames is equal to the number of content frames of the first video event; The similarity between the first video event and the second video event is calculated according to a content frame difference rate between each content frame of the first video event and its corresponding target content frame, and the number of content frames of the first video event.

2. The method according to claim 1, characterized in that The obtaining of a video event based on the video to be detected includes: Preprocessing the video to be detected to obtain a normalized video; Performing granular processing on the normalized video to obtain a shot sequence and a content frame sequence; A video event sequence is obtained according to the shot sequence and the content frame sequence, and the video event sequence includes at least one video event.

3. The method according to claim 2, characterized in that The similarity calculation formula for calculating the similarity between the first video event and the second video event is: fcnt p ≥fcnt q Among them, q represents the first video event, fcnt q is the number of content frames of the first video event, p represents the second video event, fcnt p is the number of content frames of the second video event, SimEV(p,q) represents the similarity between the first video event q and the second video event p, i is the sequence number of the content frame of the first video event, Dis(i) is the difference rate between the i-th content frame of the first video event q and the corresponding target content frame, and the target content frame belongs to the second video event.

4. The method according to claim 1, characterized in that: There are multiple second video events, and the method includes: Extracting features from a plurality of second video events to obtain a video event feature database containing feature data of each of the second video events, wherein the second video event feature data includes the number of content frames of the second video event, a feature vector of the second video event, and a feature matrix of content frames of the second video event; Video event similarity is determined for the first video event and each second video event in the video event feature database.

5. The method according to claim 4, characterized in that Performing video event similarity judgment on the first video event and each second video event in the video event feature database includes: Calculate the absolute value of the difference between the number of content frames of the first video event and the second video event; When the absolute value of the difference in the number of content frames is greater than a second threshold, determining that the first video event and the second video event are not similar; When the absolute value of the content frame quantity difference is less than or equal to a second threshold, it is determined whether the first video event and the second video event are similar according to a feature vector difference rate between the first video event and the second video event.

6. The method according to claim 5, characterized in that The determining whether the first video event and the second video event are similar according to the feature vector difference rate between the first video event and the second video event includes: Obtaining a feature vector of the first video event and a modulus of the feature vector of the first video event according to the feature vector of the content frame of the first video event, and obtaining a feature vector of the second video event and a modulus of the feature vector of the second video event according to the feature vector of the content frame of the second video event; Obtaining a difference value of the feature vectors of the first video event and the second video event according to the feature vector of the first video event and the feature vector of the second video event; Obtaining a feature vector difference rate between the first video event and the second video event according to a feature vector difference value between the first video event and the second video event, a modulus of a feature vector of the first video event, and a modulus of a feature vector of the second video event; When the feature vector difference rate between the first video event and the second video event is greater than a third threshold, it is determined that the first video event and the second video event are not similar; when the feature vector difference rate between the first video event and the second video event is less than or equal to the third threshold, whether the first video event and the second video event are similar is determined based on the content frame difference rate between the first video event and the second video event.

7. The method according to claim 6, characterized in that The number of content frames of the second video event is greater than or equal to the number of content frames of the first video event, and judging whether the first video event and the second video event are similar according to a content frame difference rate between the first video event and the second video event includes: Determine whether any content frame of the first video event has a target content frame in the second video event, and whether a content frame difference rate between each content frame of the first video event and its corresponding target content frame is less than or equal to a fourth threshold; if not, determine that the first video event and the second video event are not similar; If yes, executing the step of determining whether the similarity between the first video event and the second video event is greater than or equal to a first threshold; The judgment condition for judging the similarity of the content frames of the first video event and the second video event by the content frame difference rate of the first video event and the second video event is: Dis(i)=dis(f pj ,f qi )+θ+φ≤dis max Where Dis(i) is the content frame difference rate between the first video event q and the second video event p, f pj is the j content frame of event p, j∈[1,..,fcnt p ], f qi is the i content frame of event q, i∈[1,..,fcnt q ],dis(f pj ,f qi ) is the original difference rate between the j content frame of event p and the i content frame of event q, θ is the inherent error, φ is the calculation error, and dis max is the fourth threshold.

8. A similarity judgment device for video events, characterized in that: The device comprises: an image processing module, which is used to obtain a video to be detected, and obtain a video event based on the video to be detected, wherein the video event comprises a first video event and a second video event; wherein the video event refers to a set of all content frames in a shot, and the content frame refers to a frame representing the content of the shot, including a first frame, a last frame, and N intermediate frames, where N is a natural number, and the intermediate frame is obtained by calculating the difference rate between all subframes of a shot except the first and last two frames and the previous content frame in sequence, and the difference rate is greater than a preset threshold; A calculation module is used to calculate the feature data of the video event based on the content frame of the video event, and calculate the similarity between the first video event and the second video event according to the feature data of the first video event and the feature data of the second video event; the feature data includes the number of content frames of the video event and the content frame feature matrix of the video event, the number of content frames of the second video event is greater than or equal to the number of content frames of the first video event, and the similarity between the first video event and the second video event is calculated according to the feature data of the first video event and the feature data of the second video event, including: performing content frame difference on the first content frame of the first video event and the content frames in the second video event in sequence; The similarity ratio of the first video event to the second video event is calculated by taking the first content frame in the second video event whose difference ratio with the first content frame of the first video event is less than a preset difference ratio threshold as the first target content frame, starting with the first target content frame, and sequentially taking the content frames after the first target content frame in the second video event as target content frames to obtain target content frames corresponding to each content frame of the first video event, the target content frames belong to the second video event, and the number of target content frames is equal to the number of content frames of the first video event; according to the content frame difference ratio between each content frame of the first video event and the target content frame corresponding to it, and the number of content frames of the first video event, the similarity ratio of the first video event to the second video event is calculated; The judgment module is used to judge whether the similarity between the first video event and the second video event is greater than or equal to a first threshold. If so, it is determined that the first video event and the second video event are similar; if not, it is determined that the first video event and the second video event are not similar.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor runs the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to any one of claims 1 to 7.