Video recognition method, device, equipment and storage medium
The video fingerprint algorithm efficiently identifies homologous videos by decompressing and decoding frame sequences, determining feature value strings, and matching them with pre-stored values, overcoming inefficiencies in existing systems.
Patent Information
- Application Number
- CN202011035017.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-27
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-09-27
AI Technical Summary
Existing video fingerprint algorithms are inefficient and insecure, especially in real-time processing of massive videos, and existing fingerprint recognition systems are inefficient in identifying videos, and existing video fingerprint algorithms are inefficient in identifying videos.
A video fingerprint algorithm that decompresses and decodes videos to obtain frame sequences, determines feature value strings based on these sequences, and matches them with pre-stored strings for robust recognition.
The algorithm provides robust video recognition that can identify homologous videos even with frame additions, deletions, or bit rate reductions, ensuring accurate identification.
Smart Images

Figure CN112183328B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of video recognition technology, and in particular to a video recognition method, device, equipment and storage medium. Background Art
[0002] With the rapid rise of various short video software, the authentication, management and copyright protection of digital video content have become urgent issues to be resolved; at the same time, with the explosive growth in the number of original videos, how to automatically and efficiently identify these massive videos has become a top priority for the development of the industry. The video fingerprint algorithm can collect video feature value strings from the video content. As the unique "identity" of the video, the video feature value string can identify the same source video based on the video content, and track the video being "moved" or "cut", thereby effectively solving these problems from a technical level.
[0003] There are many existing video fingerprint algorithms, the main ones are as follows: 1. Find the characteristic image of the video content and use the relevant features as the video fingerprint; 2. Divide the video key frame image into regions and count the average value of the Y component of each region, and record the relevant information of the average value of each region as the video fingerprint; 3. According to the changes in the shot boundaries, calculate the duration of each shot, and form a time slice sequence as the video fingerprint, etc.
[0004] The first algorithm requires a training and learning process, and local image comparison is performed frame by frame during fingerprint recognition. This algorithm is relatively complex and slow in calculation, and is not suitable for real-time processing of massive videos on the Internet. At the same time, if only one segment of the source video is intercepted, it may not be possible to correctly identify the same-source video. For the second algorithm, after the video is attacked by adding or deleting frames, reducing the bit rate, or intercepting, the key frame during video fingerprint collection and recognition may not be the same frame image, so the same-source video cannot be correctly identified. For the third algorithm, after the video is intercepted, rotated, and black-bordered, the shot boundaries during video fingerprint collection and recognition are completely different, and the duration of each shot cannot be correctly calculated, so the same-source video cannot be correctly identified. Summary of the invention
[0005] The present invention provides a video recognition method, device, equipment and storage medium, so as to realize that any intercepted video can correctly identify its homologous video, and the test robustness is good.
[0006] In a first aspect, an embodiment of the present invention provides a video recognition method, including:
[0007] Decompress and decode the video to be identified to obtain a video frame sequence;
[0008] Determining a feature value string of the video to be identified based on the video frame sequence;
[0009] The video to be identified is identified based on a matching result between the feature value string of the video to be identified and a pre-stored feature value string.
[0010] In a second aspect, an embodiment of the present invention further provides a video recognition device, including:
[0011] A decoding module, used to decompress and decode the video to be identified to obtain a video frame sequence;
[0012] A determination module, used to determine a feature value string of the video to be identified based on the video frame sequence;
[0013] The recognition module is used to recognize the video to be recognized based on the matching result between the feature value string of the video to be recognized and the pre-stored feature value string.
[0014] In a third aspect, an embodiment of the present invention further provides a device, the device comprising:
[0015] one or more processors;
[0016] A memory for storing one or more programs;
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the video recognition method as described in any one of the embodiments of the present application.
[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, a video recognition method as described in any one of the embodiments of the present application is implemented.
[0019] The video recognition method, device, equipment and storage medium provided in the above-mentioned embodiments include: decompressing and decoding the video to be recognized to obtain a video frame sequence; determining the feature value string of the video to be recognized based on the video frame sequence; and recognizing the video to be recognized based on the matching result of the feature value string of the video to be recognized and the pre-stored feature value string. The technical solution provided in the embodiment of the present application does not make statistics for a single key frame, but for a group of continuous frame sequences, so attacks such as adding and deleting frames, reducing bit rate and interception have little effect on the statistical results, and the robustness is good in actual tests, and any interception of a few minutes of video can correctly identify the video. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a video recognition method provided in Embodiment 1 of the present invention;
[0021] Figure 2 A flowchart of a video recognition method provided in Embodiment 2 of the present invention;
[0022] Figure 3This is a video fingerprint collection flow chart provided in Example 2 of the present application;
[0023] Figure 4 This is a video fingerprint recognition flow chart provided in Example 2 of the present application;
[0024] Figure 5 A schematic diagram of the structure of a video recognition device provided in Embodiment 3 of the present invention;
[0025] Figure 6 A schematic diagram of the structure of a device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0027] Embodiment 1
[0028] Figure 1 This is a flow chart of a video recognition method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where video recognition is performed. The method can be executed by a video recognition device, which can be implemented in software and / or hardware.
[0029] like Figure 1 As shown, the video recognition method provided in the embodiment of the present application mainly includes the following steps:
[0030] S11, decompressing and decoding the video to be identified to obtain a video frame sequence.
[0031] In this embodiment, the feature value string of the video to be identified can be efficiently calculated and matched with the pre-stored video feature value string to determine whether they are homologous videos.
[0032] The video to be identified can be any continuous video captured on the Internet, can be a video that has been processed by adding or deleting frames, reducing bit rate, and capturing, or can be a video that has not been processed. The type of video is not limited in this embodiment. A frame sequence can also be called a video sequence, which can be understood as a video image sequence composed of video images frame by frame.
[0033] Generally, in order to meet the display requirements, the data volume of the video is relatively large. It will be very difficult to directly store or transmit a large number of videos. Therefore, it is necessary to adopt compression technology to reduce the bit rate. The video to be identified in this embodiment is a video after coding compression. The video to be identified is decompressed and decoded to obtain a video frame sequence. It should be noted that the method for video decompression and decoding can be any technology that can realize video decompression and decoding, and this embodiment does not limit the method for video decompression and decoding.
[0034] S12. Determine a feature value string of the video to be identified based on the video frame sequence.
[0035] In this embodiment, the feature value string is used as the unique "identity" of the video, and can identify the same-source video according to the video content. That is, the video content is analyzed to obtain a feature value string that can uniquely identify a video, and this feature value string can also be called a video fingerprint.
[0036] The feature value string of the video to be identified refers to the frame sequence of the video to be identified being grouped by length, and each group of frame sequences is statistically analyzed to obtain the feature value string of the group of frame sequences. The feature value string of the video to be identified is obtained by sorting the feature value strings of all groups by time, and is used to identify the identity of the video to be identified.
[0037] In this embodiment, a method for determining a feature value string of a video to be identified is provided. The video image is divided into 2*M regions of equal size and non-overlapping, the source video is decoded to obtain a frame sequence in YUV format, the average value of the brightness signal Y value of the 2*M region in a continuous N-second frame sequence is counted, the size relationship of the mean values of two adjacent regions is compared, the size relationship of the brightness signal Y of the 2*M region in the N-second frame sequence is obtained, and K bit feature values are generated. After processing the entire video, a string of feature values is obtained, which is the fingerprint of the video.
[0038] It should be noted that this embodiment only illustrates the method for determining the feature value string of a video, but does not limit it.
[0039] S13: Identify the video to be identified based on a matching result between the feature value string of the video to be identified and a pre-stored feature value string.
[0040] In this embodiment, the pre-stored feature value string refers to the feature value string obtained after collecting the video fingerprint of the source video. The feature value string is pre-stored in the fingerprint database and is used to identify the identity of the source video.
[0041] In this embodiment, a video identifier and a feature value string stored in a pair with the video identifier are read from the fingerprint database, and the feature value string of the video to be identified is compared with the pre-stored feature value string. Each time the comparison is made, the pre-stored feature value string slides back by 1 bit, and the matching rate obtained by each comparison is compared with the set threshold. If any matching rate is greater than or equal to the set threshold, the comparison ends, and the video identifier corresponding to the pre-stored feature value string is output. If all matching rates are less than the set threshold, it is determined whether all pre-stored feature value strings in the fingerprint database have been compared. If the comparison has been completed, it is determined that the homologous video of the video to be identified has not been found in the fingerprint database. If all feature value strings have not been compared, the next video identifier and the feature value string stored in a pair with the video identifier are read from the fingerprint database, and the feature value string of the video to be identified is continued to be compared with the feature value string currently read. .
[0042] The video recognition method provided in the embodiment of the present application includes: decompressing and decoding the video to be recognized to obtain a video frame sequence; determining a feature value string of the video to be recognized based on the video frame sequence; and recognizing the video to be recognized based on the matching result between the feature value string and a pre-stored feature value string. The technical solution provided in the embodiment of the present application does not make statistics for a single key frame, but for a group of continuous frame sequences, so attacks such as adding and deleting frames, reducing bit rate, and interception have little effect on the statistical results, and the robustness is good in actual tests, and any interception of a few minutes of video can correctly identify the video.
[0043] Based on the above embodiment, the method further includes: obtaining a feature value string of the source video according to a video fingerprint algorithm; obtaining a video identifier corresponding to the source video; and storing a pairing of the feature value string of the source video and the video identifier in a fingerprint database.
[0044] Figure 2 This is a video fingerprint collection flow chart provided in Example 2 of this application. Figure 2 As shown in the figure, video fingerprint acquisition must analyze and calculate the feature value string of the entire source video, and store the source video identifier and the feature value string in a pair in the video fingerprint database. Video fingerprint acquisition refers to the process of using a video fingerprint algorithm to analyze and calculate a given video frame sequence to obtain a video fingerprint, and then storing the video identifier and the video fingerprint in a pair in the video fingerprint database. Figure 3 The video fingerprint collection mainly includes obtaining an input source video, decompressing and decoding the source video to obtain a video frame sequence, using the above-mentioned fingerprint algorithm to process the above-mentioned frame sequence to obtain a feature value string; obtaining an input source video identifier, and pairing the source video identifier with the feature value string and storing them in a fingerprint database.
[0045] In this embodiment, the principle of the fingerprint algorithm is: divide the video image into 2*M regions of equal size and non-overlapping, decode the source video to obtain a frame sequence in YUV format, calculate the average value of the brightness signal Y value of the 2*M region for a continuous N-second frame sequence, compare the average value size relationship of the two adjacent regions, obtain the size relationship of the brightness signal Y of the 2*M region in the N-second frame sequence, generate K bit feature values, and after processing the entire video, a string of feature values is obtained, which is the fingerprint of the video. It should be noted that M, N and K here are set according to the application scenario.
[0046] It should be noted that, in this embodiment, the fingerprint algorithm used to determine the feature value string of the video to be identified and the feature value string of the source video is the same fingerprint algorithm.
[0047] Embodiment 2
[0048] Based on the above embodiment, the above video recognition method is optimized. Figure 3 This is a video recognition method provided by Embodiment 2 of the present application. Figure 3 As shown, the video recognition method provided in the embodiment of the present application mainly includes the following steps:
[0049] S21. Decompress and decode the video to be identified to obtain a video frame sequence, and divide the video frame sequence into a plurality of frame sequences of equal length in chronological order.
[0050] S22: For each group of frame sequences, divide the image of the video to be identified into multiple image areas.
[0051] In this embodiment, the number of image regions is an even number. Any method can be adopted to evenly divide the image of the video to be identified into an even number of image regions.
[0052] S23. For each image region, calculate the average value of the brightness signal of the frame sequence.
[0053] In this embodiment, two image regions are taken as an example for description, and the average value of the brightness signal in the first image region in the frame sequence is counted, and the average value of the brightness signal in the second image region in the frame sequence is counted.
[0054] S24. Determine a feature value string of each frame sequence based on an average value of brightness signals of multiple image regions in the frame sequence, and concatenate the feature value strings of all groups into a feature value string of the video to be identified.
[0055] Among them, the characteristic value string of the video to be identified is determined based on the average value of the brightness signals of multiple image areas in each group of frame sequences, including: for each group of frame sequences, the difference between the average values of the brightness signals of the first image area and the second image area is determined in turn; wherein the first image area and the second image area are any two adjacent image areas; based on the comparison result of each of the differences with the first threshold value, the characteristic value string of the video to be identified is determined.
[0056] In this embodiment, the video fingerprint is to collect effective features of the video itself from the video content, which can uniquely represent the "identity" of the video. In the process of video fingerprint collection and identification, the video will not be encrypted or encoded, but only a "read" operation will be performed on the video, which is similar to the collection and identification of human fingerprints in life.
[0057] After the video to be identified is decompressed and decoded, a frame sequence in YUV format is obtained. The image is divided into 2*M areas of equal size and non-overlapping, and the average values of the brightness signal Y of the continuous N-second frame sequence of these 2*M areas are counted respectively. The average values of the brightness signal Y of the two adjacent areas are compared, and the K bit feature values in the N-second frame sequence are calculated according to the preset first threshold. After processing the entire video, a string of feature values is obtained, which is the fingerprint of the video.
[0058] The following example is taken as M=1, N=1, K=2. The image is divided into two regions of equal size and non-overlapping, and the average values of the brightness signal Y of the two regions for 1 second are counted respectively. The average values of the brightness signal Y of the two regions are compared, and the 2-bit feature value is calculated according to the threshold Δ1. The 2-bit length can represent four situations. The following formula represents the calculation process of the 2-bit feature value:
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065] Where: w is the image width, h is the image height, Δ1 is the threshold, and fval is the calculated 2-bit length feature value.
[0066] Among them, the method of determining a feature value string of a group of frame sequences based on the comparison result of each of the difference values and the first threshold value includes: determining multiple bit values based on the comparison result of each of the difference values and the first threshold value; sorting the multiple bit values according to the relative position of each regional image to obtain the feature value string of the group of frame sequences; and splicing the feature value strings of each group of frame sequences into a feature value string of the video to be identified in chronological order.
[0067] In this embodiment, the video to be fingerprinted may have been intentionally or unintentionally attacked (i.e., it has been transcoded, scaled, cropped, rotated, mirrored, and bitrate reduced as mentioned above). The processed video is different from the source video. and The difference will change, resulting in the two collected eigenvalues not necessarily being the same. and When the difference is close to 0, it is very likely that the opposite result will be extracted. This means that the 2-bit feature value 10 / 11 collected from the above N-second frame sequence is a little unreliable, while the corresponding feature value 00 / 01 is relatively reliable. Therefore, when identifying video fingerprints, only the relatively reliable part of the source video fingerprint feature value string with the value 00 / 01 is compared, and the unreliable part with the value 10 / 11 is not compared. However, the unreliable part has the function of a placeholder and still needs to be saved in the fingerprint database.
[0068] Because the first threshold is greater than the second threshold, if the characteristic value of a frame sequence is 00 during video fingerprint recognition, then the characteristic value of the frame sequence during video fingerprint collection is generally 00; if the characteristic value of a frame sequence is 10 during video fingerprint recognition, then the characteristic value of the frame sequence during video fingerprint collection may also be 00. Similarly, the characteristic value is 01.
[0069] As mentioned above, even if the video has been hacked, and The difference changes. When the video fingerprint is collected, the characteristic value of a certain frame sequence is 00. Then, when the video fingerprint is identified, the characteristic value of the frame sequence may be 00 or 10, but it is almost impossible to be 01 / 11. This provides a guarantee for the correct identification of the video fingerprint. Similarly, the characteristic value is 01.
[0070] S25. Compare the feature value string of the video to be identified with the pre-stored feature value string bit by bit, and calculate a matching rate.
[0071] The video to be identified may be an arbitrary segment of the source video, so the collected feature value string is only a part of the feature value string of the source video; the pre-stored feature value string saves the complete feature value string of the source video, and it is obvious that the feature value string of the video to be identified is only a part of the pre-stored feature value string; we can only enumerate all possibilities, slide the pre-stored feature value string bit by bit according to the length of the feature value string of the video to be identified to generate multiple feature value strings to be compared, and then compare them one by one.
[0072] S26. When the above-mentioned matching rate is greater than the set threshold, the comparison is completed, and it is confirmed that the videos uniquely represented by the two feature value strings are the same source videos; when the above-mentioned matching rate is less than the set threshold, the pre-stored feature value string is slid backward by one bit, and then compared with the feature value string of the video to be identified bit by bit, until the length of the pre-stored feature value string after sliding backward is less than the length of the feature value string of the video to be identified, the comparison is completed, and it is confirmed that the videos uniquely represented by the two feature value strings are not the same source videos.
[0073] Among them, the video to be identified is identified based on the matching rate between the feature value string of the video to be identified and any feature value string to be compared, including: obtaining the feature value string to be compared in sequence; matching the feature value to be compared with the feature value string of the video to be identified to obtain the matching rate; when the matching rate is greater than or equal to a preset threshold, determining the video identifier stored in the pairing of the pre-stored feature value string as the video identifier corresponding to the video to be identified; when the matching rate is less than the preset threshold, continuing to calculate the matching rate between the next feature value string to be compared and the feature value string to be identified, until the matching rate is greater than or equal to the preset matching threshold.
[0074] In this embodiment, assuming that a 64-bit video fingerprint is collected during the video fingerprint recognition, the 64-bit feature value string is compared bit by bit with the feature value string in the video fingerprint library, and the matching rate obtained in each comparison is compared with the set threshold to determine whether the match is successful.
[0075] The following is a brief introduction to the method of setting the threshold. If there are two arbitrary 64-bit feature values, what is the probability R that their matching rate exceeds the specified matching rate threshold of 90%? The formula for calculating the probability of the matching rate is as follows:
[0076]
[0077] Where: n is the number of bits with the same position and value, and R is the probability of n bits matching.
[0078] When n=64, that is, the matching rate is 100%, R=1 / 2 64 .
[0079] When n=63, the matching rate is 63 / 64=98.4%.
[0080] When n=62, the matching rate is 62 / 64=96.9%.
[0081] When n=61, the matching rate is 61 / 64=95.3%.
[0082] When n=60, the matching rate is 60 / 64=93.8%.
[0083] When n=59, the matching rate is 59 / 64=92.2%.
[0084] When n=58, the matching rate is 58 / 64=90.6%.
[0085] When n=57, the matching rate is 57 / 64=89.1%.
[0086] From the above calculation, we can know that the probability that the matching rate of two 64-bit feature values exceeds the threshold of 90% is:
[0087] R≤1 / 2 64 +1 / 2 55 +1 / 2 47 +1 / 2 39 +1 / 2 32 +1 / 2 28 +1 / 2 24
[0088] That is: R≤7 / 2 24 ≤1 / 2 21
[0089] From the above, we can see that the probability that the matching rate of any two 64-bit feature values is greater than 90% is less than 1 / 2 21 , which is less than 1 in 2.09 million. That is to say, if the length of the video fingerprint feature value is set to 64 bits and the matching rate threshold is set to 90%, the probability that any two different videos (corresponding to two 64-bit feature value strings collected) are mistakenly judged as the same source video is less than 1 in 2.09 million.
[0090] Furthermore, when the minimum length of the video fingerprint feature value string set by the video fingerprint recognition system is larger, or the preset threshold is larger, the probability that any two different videos are mistakenly judged as the same source video will be smaller. Then the video fingerprint recognition system can set the minimum length of the feature value string and the preset threshold according to the needs of the specific application scenario.
[0091] In order to make the results of video fingerprint recognition more reliable, the video fingerprint recognition system sets the shortest video fingerprint feature value string length to be no less than 400 bits. In the test of the video fingerprint recognition system, 30 videos with different packaging formats, lengths, sizes, styles, clarity, and types were selected for testing. The experimental data showed that the average fingerprint matching rate of two non-homologous videos was about 20%, and the maximum value was no more than 35%. Therefore, setting a smaller matching rate threshold in the fingerprint recognition system will not affect the accuracy of recognition, but it can identify homologous videos faster.
[0092] Figure 4 This is a video fingerprint recognition flow chart provided in Example 2 of this application. Figure 4 As shown, the video fingerprint recognition process mainly includes: obtaining the input video to be recognized, decompressing and decoding the video to be recognized to obtain a video frame sequence, using the above-mentioned fingerprint algorithm to process the frame sequence to obtain a feature value string; reading a video identifier and a feature value string corresponding to the video identifier from the fingerprint database, sliding the feature value string bit by bit according to the length of the feature value string of the video to be recognized to generate multiple feature value strings to be compared, comparing the feature value string of the video to be recognized with the feature value string to be compared one by one, and comparing the matching rate obtained by each comparison with the set threshold. If any matching rate is greater than or equal to the set threshold, the video identifier corresponding to the pre-stored feature value string is output. If all matching rates are less than the set threshold, it is determined whether all fingerprints in the fingerprint database have been compared. If all fingerprints have been compared, it is determined that the homologous video corresponding to the video to be recognized has not been found in the fingerprint database. If all fingerprints have not been compared, the next video identifier and the feature value string corresponding to the video identifier are read from the fingerprint database, and the operation of comparing the feature value string of the video to be recognized with the pre-stored feature value string is returned.
[0093] The video recognition method, device, equipment and storage medium provided by the embodiment of the present application include: decompressing and decoding the video to be recognized to obtain a video frame sequence, grouping the frame sequence, and for each group of frame sequences, dividing the image of the video to be recognized into multiple image areas; for each image area, counting the average value of the brightness signal of the continuous group of frame sequences; determining the feature value string of the group of frame sequences based on the average value of the brightness signals of multiple image areas in the group of frame sequences; splicing the feature value strings of all groups into the feature value string of the video to be recognized; and recognizing the video to be recognized based on the matching result of the feature value string of the video to be recognized and the pre-stored feature value string. The technical solution provided by the embodiment of the present application does not make statistics for a single key frame, but for a group of continuous frames, so attacks such as adding and deleting frames, reducing bit rate and interception have little effect on the statistical results, and have good robustness in actual tests, and any interception of a few minutes of video can correctly identify its homologous video.
[0094] Embodiment 3
[0095] Figure 5 This is a schematic diagram of the structure of a video recognition device provided in Embodiment 3 of the present invention. This embodiment is applicable to situations where video recognition is performed, and the device may be implemented in software and / or hardware.
[0096] like Figure 5 As shown, the video recognition device provided in the embodiment of the present application mainly includes:
[0097] A decoding module 51 is used to decompress and decode the video to be identified to obtain a video frame sequence and group them into groups of the same length;
[0098] A determination module 52, configured to determine a feature value string of the video to be identified based on the video frame sequence;
[0099] The identification module 53 is used to identify the video to be identified based on the matching result between the feature value string of the video to be identified and the pre-stored feature value string.
[0100] The video recognition device provided in the embodiment of the present application includes: decompressing and decoding the video to be recognized to obtain a video frame sequence; determining the feature value string of the video to be recognized based on the video frame sequence; and recognizing the video to be recognized based on the matching result of the feature value string of the video to be recognized and the pre-stored feature value string. The technical solution provided in the embodiment of the present application does not make statistics for a single key frame, but for multiple frame sequences, so attacks such as adding and deleting frames, reducing bit rate, and interception have little effect on the statistical results, and the robustness is good in actual tests, and any interception of a few minutes of video can correctly identify its homologous video.
[0101] Furthermore, the determination module 52 includes: a region division unit, an average value statistics unit and a characteristic value string determination unit; wherein,
[0102] A region division unit is used to divide the video frame sequence into a plurality of frame sequences of equal length in time order, and for each frame sequence, divide each frame image in the sequence into a plurality of image regions;
[0103] An average value statistical unit, used for calculating the average value of the brightness signal of the group of continuous frame sequences for each image area;
[0104] The feature value string determination unit is used to determine the feature value string of the frame sequence in the video to be identified based on the average value of the brightness signals of multiple image areas in each frame sequence.
[0105] Among them, the feature value string determination unit is specifically used to determine the difference between the average values of the brightness signals of the first image area and the second image area in turn for each group of frame sequences; wherein the first image area and the second image area are any two adjacent image areas; based on the comparison result of each of the differences with the first threshold, determine the feature value string of the group of frame sequences of the video to be identified.
[0106] Furthermore, the method of determining a feature value string of the video to be identified based on the comparison result of each of the difference values with the first threshold value includes: determining multiple bit values based on the comparison result of each of the difference values with the first threshold value; sorting the multiple bit values according to the relative position of each regional image to obtain the feature value string of the frame sequence; and concatenating the feature value strings of all groups into a feature value string of the video to be identified.
[0107] Furthermore, the recognition module 53 is specifically used to compare the feature value string of the video to be recognized with the pre-stored feature value string bit by bit, and calculate a matching rate;
[0108] When the above matching rate is greater than the set threshold, the comparison ends, and it is confirmed that the videos uniquely represented by the two feature value strings are homologous videos;
[0109] When the above matching rate is less than the set threshold, the pre-stored feature value string is slid backward by one bit, and then compared bit by bit with the feature value string of the video to be identified, until the length of the pre-stored feature value string after sliding backward is less than the length of the feature value string of the video to be identified. The comparison is completed, and it is confirmed that the videos uniquely represented by the two feature value strings are not the same source videos.
[0110] Furthermore, the device also includes:
[0111] An acquisition module is used to acquire a feature value string of a source video according to a preset video fingerprint algorithm; and acquire a video identifier corresponding to the source video;
[0112] The storage module is used to store the corresponding relationship between the feature value string of the source video and the video identifier in a fingerprint database.
[0113] The video recognition device provided in the embodiment of the present invention can execute the video recognition method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0114] Embodiment 4
[0115] Figure 6 A schematic diagram of a device structure provided in Embodiment 4 of the present invention is shown in FIG. Figure 6 As shown, the device includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of processors 610 in the device can be one or more. Figure 6A processor 610 is taken as an example; the processor 610, memory 620, input device 630 and output device 640 in the device can be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0116] The memory 620, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the video recognition method in the embodiment of the present invention (for example, the decoding module 51, the determination module 52 and the recognition module 53 in the video recognition device). The processor 610 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 620, that is, implements the above-mentioned video recognition method.
[0117] The memory 620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 620 may further include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the device 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 combinations thereof.
[0118] The input device 630 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 640 may include a display device such as a display screen.
[0119] Embodiment 5
[0120] Embodiment 5 of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to perform a video recognition method when executed by a computer processor, the method comprising:
[0121] Decompress and decode the video to be identified to obtain a video frame sequence;
[0122] Determining a feature value string of the video to be identified based on the video frame sequence;
[0123] The video to be identified is identified based on a matching result between the feature value string of the video to be identified and a pre-stored feature value string.
[0124] Of course, the computer executable instructions of the storage medium provided by the embodiment of the present invention are not limited to the above-mentioned method operations, but can also perform related operations in the video recognition method provided by any embodiment of the present invention.
[0125] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0126] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0127] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A video recognition method, characterized in that: include: Decompress and decode the video to be identified to obtain a video frame sequence; Determining the feature value string of the video to be identified based on the video frame sequence includes: dividing the video frame sequence into a plurality of frame sequences of equal length in time order; dividing each frame image in each frame sequence into a plurality of image regions; calculating the average value of brightness signals of all frames in the frame sequence for each image region; and determining the feature value string of the frame sequence based on the average value of brightness signals of the plurality of image regions in each frame sequence; The video to be identified is identified based on the matching result of the feature value string of the video to be identified and the pre-stored feature value string, including: comparing the feature value string of the video to be identified with the pre-stored feature value string bit by bit, and calculating a matching rate; when the matching rate is greater than a set threshold, the comparison ends, and it is confirmed that the videos uniquely represented by the two feature value strings are homologous videos; when the matching rate is less than the set threshold, the pre-stored feature value string is slid back by one bit, and then compared with the feature value string of the video to be identified bit by bit, until the length of the pre-stored feature value string after sliding back is less than the length of the feature value string of the video to be identified, the comparison ends, and it is confirmed that the videos uniquely represented by the two feature value strings are not homologous videos; wherein the pre-stored feature value string refers to the feature value string obtained after video fingerprint collection of the source video, which is pre-stored in the fingerprint database; If the videos uniquely represented by the two feature value strings are not homologous videos, it is determined whether all the feature value strings in the fingerprint database have been compared; if there is no uncompared feature value string in the fingerprint database, it is determined that the homologous video corresponding to the video to be identified is not found in the fingerprint database; if there is an uncompared feature value string in the fingerprint database, the next video identifier and the feature value string corresponding to the video identifier are read from the fingerprint database, and the operation of comparing the feature value string of the video to be identified with the pre-stored feature value string is returned.
2. The method according to claim 1, characterized in that Determining a feature value string of a group of frame sequences based on an average value of brightness signals of a plurality of image regions in a group of frame sequences comprises: For each frame sequence, the difference between the average values of the brightness signals of the first image area and the second image area is determined in sequence; wherein the first image area and the second image area are any two adjacent image areas; A feature value string of the frame sequence is determined based on a comparison result between each of the difference values and the first threshold.
3. The method according to claim 2, characterized in that The step of determining the characteristic value string of the frame sequence based on the comparison result between each difference value and the first threshold value comprises: determining a plurality of bit values based on a comparison result of each of the difference values with a first threshold; The multiple bit values are sorted according to the relative position of each regional image, and then the feature value string of each group of frame sequences is sorted in time order to obtain the feature value string of the video to be identified.
4. The method according to claim 1, characterized in that The method further comprises: Obtaining a feature value string of the source video according to a preset video fingerprint algorithm; Get the video ID corresponding to the source video; The feature value string of the source video and the video identifier are paired and stored in a fingerprint database.
Citation Information
Patent Citations
Video fingerprint extraction and retrieval method
CN104809248A
Video fingerprint method
CN110889011A
