Video matching method, video processing method, device, electronic device and medium
By identifying and comparing scene change information in videos and extracting feature data for matching, it solves the problems of low matching accuracy and large amount of calculation in existing video matching methods, and achieves efficient and accurate video matching.
Patent Information
- Application Number
- CN202110520030.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-12
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-05-12
AI Technical Summary
When existing video matching methods match videos through search terms, the matching accuracy is low, it is difficult to meet user needs, and the calculation amount is large, resulting in low efficiency.
By receiving the feature data of the reference video, it identifies the scene change information in the candidate video, extracts the feature data for comparison, and determines the target video that matches the reference video, reducing the amount of calculation and improving the matching efficiency.
The accuracy and efficiency of video matching are improved, the calculation cost is reduced, and the matching success rate is enhanced.
Smart Images

Figure CN113254703B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to the fields of image processing, intelligent search, and more specifically to a video matching method, a video processing method, a device, an electronic device, a medium, and a program product. Background Art
[0002] With the popularization of the Internet, more and more users are searching for videos on the Internet. In the process of searching for videos, relevant videos are matched based on the search terms input by the user, and the matched videos are recommended to the user. However, the method of matching videos by search terms has the problem of low matching accuracy, and the matched videos are difficult to meet the needs of users. Summary of the invention
[0003] The present disclosure provides a video matching method, a video processing method, an apparatus, an electronic device, a storage medium, and a computer program product.
[0004] According to one aspect of the present disclosure, a video matching method is provided, comprising: receiving first feature data for a reference video; comparing the first feature data with second feature data of at least one candidate video to obtain a comparison result, wherein the second feature data is obtained by identifying scene change information in the candidate video; based on the comparison result, determining a target video that matches the reference video from the at least one candidate video, wherein the second feature data of the target video matches the first feature data.
[0005] According to another aspect of the present disclosure, a video processing method is provided, including: identifying scene change information in a reference video; extracting first feature data from the reference video in response to identifying the scene change information; and sending the first feature data.
[0006] According to another aspect of the present disclosure, a video matching device is provided, comprising: a receiving module, a comparison module, and a determination module. The receiving module is used to receive first feature data for a reference video. The comparison module is used to compare the first feature data with the second feature data of at least one candidate video to obtain a comparison result, wherein the second feature data is obtained by identifying scene change information in the candidate video. The determination module is used to determine a target video that matches the reference video from the at least one candidate video based on the comparison result, wherein the second feature data of the target video matches the first feature data.
[0007] According to another aspect of the present disclosure, a video processing device is provided, comprising: a second recognition module, a second extraction module and a sending module. The second recognition module is used to recognize scene change information in a reference video. The second extraction module is used to extract first feature data from the reference video in response to recognizing the scene change information. The sending module is used to send the first feature data.
[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory in communication with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the video matching method as described above.
[0009] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory in communication with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the video processing method as described above.
[0010] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the video matching method as described above.
[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the video processing method as described above.
[0012] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the video matching method as described above when executed by a processor.
[0013] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the video processing method as described above when executed by a processor.
[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0016] Figure 1The application scenario of the video matching method according to the embodiment of the present disclosure is schematically shown;
[0017] Figure 2 A flowchart of a video matching method according to an embodiment of the present disclosure is schematically shown;
[0018] Figure 3 A schematic diagram schematically shows a video matching method according to an embodiment of the present disclosure;
[0019] Figure 4 The flowchart of the video processing method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 5 A schematic diagram schematically shows a video matching method and a video processing method according to an embodiment of the present disclosure;
[0021] Figure 6 A block diagram of a video matching device according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 7 A block diagram schematically shows a video processing device according to an embodiment of the present disclosure; and
[0023] Figure 8 It is a block diagram of an electronic device used to implement the video matching method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0025] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0026] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0027] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0028] Figure 1 The application scenario of the video matching method according to the embodiment of the present disclosure is schematically shown.
[0029] like Figure 1 As shown, the application scenario 100 of the embodiment of the present disclosure includes, for example, candidate videos and reference videos.
[0030] For example, multiple candidate videos are stored in a server, and a reference video is stored in a client. When a user needs to search for a video that matches a reference video, the server can receive the reference video from the client, and match the reference video with each candidate video to determine a target video that matches the reference video from the multiple candidate videos, and the target video is the video required by the user.
[0031] The embodiment of the present disclosure takes a candidate video 110 as an example to illustrate the matching between the candidate video and the reference video.
[0032] Exemplarily, the reference videos 121 and 122 are subsets of the candidate video 110. When the candidate video 110 is matched based on the reference videos 121 and 122, at least a portion of the content of the candidate video 110 matches the entire content of the reference videos 121 and 122.
[0033] Exemplarily, partial contents of the reference videos 123 and 124 are subsets of the candidate video 110. When the candidate video 110 is matched based on the reference videos 123 and 124, partial contents of the candidate video 110 are matched with partial contents of the reference videos 123 and 124.
[0034] Exemplarily, the candidate video 110 is a subset of the reference videos 125, 126. When the candidate video 110 is matched based on the reference videos 125, 126, the entire content of the candidate video 110 is matched with a portion of the content of the reference videos 125, 126.
[0035] Exemplarily, the candidate video 110 has no intersection with the reference videos 127 and 128. When the candidate video 110 is matched based on the reference videos 127 and 128, the content of the candidate video 110 does not match the content of the reference videos 127 and 128.
[0036] For example, the image similarity recognition algorithm and the feature extraction matching algorithm can be used to match the video. Specifically, multiple images can be extracted from the reference video, multiple images can be extracted from each candidate video, and the multiple images of the reference video and the multiple images of the candidate video can be matched to determine the target video that matches the reference video from the candidate video. Alternatively, the features of each image can be extracted from the multiple images of the reference video, the features of each image can be extracted from the multiple images of the candidate video, and the features of the images can be matched to determine the target video that matches the reference video from the candidate video. It can be seen that since the video is a continuous content, when matching the reference video and the candidate video, the process of matching through multiple images is computationally intensive.
[0037] For example, for every second of content in a video, 25 images (frames) are extracted from the content every second. If the duration of the video is 16 seconds, the number of images to be extracted is 16*25=400. Due to the large number of extracted images, the amount of calculation is large when using the extracted images for matching. And which images to extract from the video is something that needs to be considered, because inconsistent rules for extracting images will lead to the problem that two identical videos cannot be matched.
[0038] For example, the duration of the reference video is 16 seconds, and the duration of the candidate video is 32 seconds. In one case, 25 images are extracted from the content of the reference video per second, and a total of 16*25 images are extracted. 25 images are extracted from the content of the candidate video per second, and a total of 32*25 images are extracted. When matching the reference video and the candidate video, each time an image of the reference video is compared with an image of the candidate video, a maximum of (16*25)*(32*25)=320,000 comparisons are required. It can be seen that the computational complexity of video matching is relatively large.
[0039] In view of this, an embodiment of the present disclosure provides a video matching method, comprising: receiving first feature data for a reference video. Then, comparing the first feature data with second feature data of at least one candidate video to obtain a comparison result, wherein the second feature data is obtained by identifying scene change information in the candidate video. Next, based on the comparison result, determining a target video that matches the reference video from at least one candidate video, wherein the second feature data of the target video matches the first feature data.
[0040] The embodiment of the present disclosure also provides a video processing method, comprising: identifying scene change information in a reference video, extracting first feature data from the reference video in response to identifying the scene change information, and sending the first feature data.
[0041] Combine the following Figure 1For application scenarios, refer to Figure 2 to Figure 5 A video matching method and a video processing method according to an exemplary embodiment of the present disclosure are described.
[0042] Figure 2 The flowchart of a video matching method according to an embodiment of the present disclosure is schematically shown.
[0043] like Figure 2 As shown, the video matching method 200 of the embodiment of the present disclosure may include, for example, operations S210 to S230. The method of the embodiment of the present disclosure may be executed, for example, by a server.
[0044] In operation S210, first feature data for a reference video is received.
[0045] In operation S220, the first feature data is compared with second feature data of at least one candidate video to obtain a comparison result, wherein the second feature data is obtained by identifying scene change information in the candidate video.
[0046] In operation S230, a target video matching the reference video is determined from at least one candidate video based on the comparison result.
[0047] According to an embodiment of the present disclosure, the second feature data is obtained, for example, by identifying scene change information in the candidate video. When a scene change in the candidate video is identified, the second feature data is extracted from the candidate video. The second feature data of the target video matches the first feature data.
[0048] For example, when a scene change in a candidate video is identified, an image is extracted from the candidate video, and the second feature data may include the extracted image. Alternatively, after the image is extracted, the image may be processed to obtain image features of the image, and the image features are used as the second feature data.
[0049] Exemplarily, the first feature data is obtained by, for example, identifying scene change information in a reference video, and the method for extracting the first feature data is similar to the method for extracting the second feature data.
[0050] For example, the first feature data is sent by the client to the server. The server stores a plurality of candidate videos, each of which has the second feature data. After receiving the first feature data, the server compares the first feature data with the second feature data of each candidate video to obtain a comparison result, and then determines a candidate video matching the reference video from the plurality of candidate videos based on the comparison result as the target video.
[0051] In the embodiment of the present disclosure, feature data is extracted from the video and video matching is performed by comparing the feature data, which greatly reduces the amount of computation for video matching and improves the efficiency of video matching. In addition, the embodiment of the present disclosure extracts feature data by identifying scene change information in the video, so that the extracted first feature data is for scene changes, and the second feature data is for scene changes in the candidate video, which improves the matching probability between the first feature data and the second feature data, thereby improving the success rate of video matching.
[0052] Figure 3 A schematic diagram of a video matching method according to an embodiment of the present disclosure is schematically shown.
[0053] like Figure 3 As shown, each candidate video is composed of multiple (frame) images. Taking the candidate video 300 as an example, the scene change information in the candidate video 300 is identified, and when the scene change information is identified, the second feature data is extracted from the candidate video 300.
[0054] For example, the candidate video 300 includes video data 310 for a first scene and video data 320 for a second scene. The first scene is, for example, two users (characters) in the video are talking, and the second scene is, for example, a scene about scenery. When it is recognized that the candidate video 300 switches from the first scene to the second scene, a first video segment 330 is determined from the candidate video 300.
[0055] Exemplarily, the first video segment 330 includes video data for the first scene and / or video data for the second scene. For example, the first video segment 330 includes part of the video data in the video data 310. Alternatively, the first video segment 330 includes part of the video data in the video data 320. Alternatively, the first video segment 330 includes part of the video data in the video data 310 and part of the video data in the video data 320. The embodiment of the present disclosure is described by taking the example that the first video segment 330 includes part of the video data in the video data 310 and part of the video data in the video data 320.
[0056] After the first video segment 330 is determined, second feature data for scene changes is extracted from the first video segment 330 .
[0057] In one example, a first image 340 may be extracted from the first video clip 330 and used as the second feature data. Alternatively, the first image 340 may be pre-processed by compression, cropping, image size change, grayscale conversion, etc. and the pre-processed first image may be used as the second feature data.
[0058] In another example, the first image 340 may be extracted from the first video clip 330, and then the first image 340 may be preprocessed, and then the preprocessed first image 340 may be further processed to extract image features 350 of the first image 340, and the image features 350 may be used as the second feature data. The image features 350 may be feature vectors.
[0059] According to an embodiment of the present disclosure, when extracting the second feature data of a candidate video, the first video segment for the scene switch is determined by identifying the scene switch, and then the second feature data is extracted from the first video segment. Compared with comparing each (frame) image in the video, the method of extracting the second feature data for video matching greatly reduces the cost of video matching. In addition, the video content corresponding to the second feature data in the candidate video is for scene changes, and video matching is performed based on the second feature data, which improves the success rate of video matching.
[0060] In the embodiment of the present disclosure, the first characteristic data includes, for example, a first data sequence including a plurality of sub-data. The second characteristic data includes, for example, a second data sequence including a plurality of sub-data.
[0061] For example, the first data sequence is [a1, a2, a3], and the sub-data a1 represents the feature data extracted when it is recognized that the reference video switches from scene A1 to scene A2, at which time scene A1 is the third scene and scene A2 is the fourth scene. The sub-data a2 represents the feature data extracted when it is recognized that the reference video switches from scene A2 to scene A3, at which time scene A2 is the third scene and scene A3 is the fourth scene. The sub-data a3 represents the feature data extracted when it is recognized that the reference video switches from scene A3 to scene A4, at which time scene A3 is the third scene and scene A4 is the fourth scene. Scenes A1, A2, A3, and A4 appear in the reference video in sequence. The first data sequence [a1, a2, a3] is stored in association with the reference video.
[0062] For example, the second data sequence is [b1, b2, b3, b4], and sub-data b1 represents the feature data extracted when it is recognized that the candidate video switches from scene B1 to scene B2, at which time scene B1 is the first scene and scene B2 is the second scene. Sub-data b2 represents the feature data extracted when it is recognized that the candidate video switches from scene B2 to scene B3, at which time scene B2 is the first scene and scene B3 is the second scene. Sub-data b3 represents the feature data extracted when it is recognized that the candidate video switches from scene B3 to scene B4, at which time scene B3 is the first scene and scene B4 is the second scene. Sub-data b4 represents the feature data extracted when it is recognized that the candidate video switches from scene B4 to scene B5, at which time scene B4 is the first scene and scene B5 is the second scene. Scenes B1, B2, B3, B4, and B5 appear in the candidate video in sequence. The second data sequence [b1, b2, b3, b4] is stored in association with the candidate video.
[0063] Then, multiple adjacent sub-data are determined from the first data sequence [a1, a2, a3] as the first sub-sequence, and multiple adjacent sub-data are determined from the second data sequence [b1, b2, b3, b4] as the second sub-sequence. The number of sub-data in the second sub-sequence is the same as the number of sub-data in the first sub-sequence. The number can be set according to the actual application, for example, the number is 2. That is, the first sub-sequence is, for example, [a1, a2] or [a2, a3], and the second sub-sequence is [b1, b2], [b2, b3] or [b3, b4]. Any first sub-sequence is compared with any second sub-sequence. If any first sub-sequence matches any second sub-sequence, the candidate video corresponding to the second sub-sequence is determined as the target video. Taking the first subsequence as [a1, a2] and the second subsequence as [b2, b3] as an example, when the sub-data a1 matches the sub-data b2 and the sub-data a2 matches the sub-data b3, it is determined that the first sub-sequence [a1, a2] and the second sub-sequence [b2, b3] match. The matching of two sub-data includes that the two sub-data have a high similarity, and the sub-data may be an image or a feature vector of an image.
[0064] In one embodiment, the first data sequence [a1, a2, a3] is sent by the client to the server. After receiving the first data sequence [a1, a2, a3], the server determines a first subsequence from the first data sequence [a1, a2, a3], determines a second subsequence from the second data sequence [b1, b2, b3, b4], and matches the first subsequence with the second subsequence.
[0065] In another example, the client may send one sub-data for the reference video to the server each time, and after receiving the sub-data of the reference video, the server compares the received sub-data with the sub-data of the candidate video until it is determined that a preset number of adjacent sub-data for the reference video matches a preset number of adjacent sub-data for the candidate video. The preset number is, for example, 2. After it is determined that a preset number of adjacent sub-data for the reference video matches a preset number of adjacent sub-data for the candidate video, the matching process may be terminated, and the matched candidate video may be recommended to the client as a target video.
[0066] For example, the client sends sub-data a1 to the server, and the server compares a1 with each sub-data in the second data sequence [b1, b2, b3, b4]. When it is determined that sub-data a1 matches sub-data b2, the candidate video for the second data sequence [b1, b2, b3, b4] is stored in the queue. The client continues to send sub-data a2 to the server, and the server compares a2 with each sub-data in the second data sequence [b1, b2, b3, b4]. When it is determined that sub-data a2 matches sub-data b3, at this time, there are 2 adjacent sub-data matching in the first data sequence and the second data sequence, and the candidate video for the second data sequence [b1, b2, b3, b4] in the queue is used as the target video. The server can recommend the target video to the client. If sub-data a2 and sub-data b3 do not match, the candidate video for the second data sequence [b1, b2, b3, b4] can be removed from the queue.
[0067] Figure 4 The flowchart of a video processing method according to an embodiment of the present disclosure is schematically shown.
[0068] like Figure 4 As shown, the video processing method 400 of the embodiment of the present disclosure may include, for example, operations S410 to S430. The method of the embodiment of the present disclosure may be executed by, for example, a client.
[0069] In operation S410, scene change information in a reference video is identified.
[0070] In operation S420, in response to identifying the scene change information, first feature data is extracted from the reference video.
[0071] In operation S430, first feature data is transmitted.
[0072] In the embodiments of the present disclosure, the process of extracting the first feature data by the client through scene change information recognition of the reference video is the same or similar to the process of extracting the second feature data by the server through scene change information recognition of the candidate video, and will not be described in detail here. After the client extracts the first feature data, the client can send the first feature data to the server to facilitate the server to match the first feature data with the second feature data.
[0073] In the embodiment of the present disclosure, the first feature data is extracted from the reference video and the video matching is performed by using the first feature data, which greatly reduces the amount of computation for video matching and improves the efficiency of video matching. In addition, the embodiment of the present disclosure extracts feature data by identifying scene change information in the video, so that the extracted first feature data is for scene changes, which improves the matching probability between the first feature data and the second feature data, thereby improving the success rate of video matching.
[0074] In an embodiment of the present disclosure, when the client recognizes that the reference video switches from the third scene to the fourth scene, a second video segment is determined from the reference video, and then first feature data is extracted from the second video segment, where the second video segment includes video data for the third scene and / or video data for the fourth scene. The process of determining the second video segment is similar to the process of determining the first video segment, and will not be described in detail herein.
[0075] For example, when the client recognizes that the reference video switches from the third scene to the fourth scene, the second video segment is determined from the reference video, and then the second image is extracted from the second video segment, and the second image is used as the first feature data. Alternatively, the second image may be pre-processed by compression, cropping, image size change, grayscale conversion, etc., and the pre-processed second image is used as the first feature data.
[0076] In another example, a second image may be extracted from the second video clip, and then the second image is preprocessed, and the preprocessed second image is further processed to extract image features of the second image, and the image features are used as the first feature data. The image features may be feature vectors.
[0077] According to an embodiment of the present disclosure, when extracting the first feature data of a reference video, the second video segment for the scene switch is determined by identifying the scene switch, and then the first feature data is extracted from the second video segment. Compared with comparing each image in the video, the method of extracting the first feature data for video matching greatly reduces the cost of video matching. In addition, the video content corresponding to the first feature data in the reference video is for scene changes, and video matching is performed based on the first feature data, which improves the success rate of video matching.
[0078] Figure 5 A schematic diagram schematically shows a video matching method and a video processing method according to an embodiment of the present disclosure.
[0079] like Figure 5 As shown, the video matching method executed by the server 510 includes operations S510A to S560A, and the video processing method executed by the client 520 includes operations S510B to S540B.
[0080] In operation S510A, the server 510 identifies scene change information in each stored candidate video.
[0081] In operation S520A, the server 510 extracts second feature data from the candidate video after identifying the scene change information.
[0082] In operation S510B, the client 520 identifies scene change information in the reference video.
[0083] In operation S520B, after identifying the scene change information, the client 520 extracts first feature data from the reference video.
[0084] In operation S530B, the client 520 sends the first feature data to the server 510 .
[0085] In operation S530A, the server 510 receives first feature data.
[0086] In operation S540A, the server 510 compares the first feature data with the second feature data of each candidate video to obtain a comparison result.
[0087] In operation S550A, the server 510 determines a target video that matches the reference video from among the plurality of candidate videos based on the comparison result.
[0088] In operation S560A, the server 510 recommends a target video to the client 520 .
[0089] In operation S540B, the client 520 displays the target video to the user.
[0090] In the embodiments of the present disclosure, if multiple frames of images in a video are compared for video matching, the cost of matching calculation will be too high. Based on the scene switching of the video, feature data in the video is extracted, and the client and the server (cloud) cooperate to achieve a low-cost video search.
[0091] For the client, there is no need to upload the complete reference video to the server. The second image is extracted by identifying the scene switching in the reference video, and the second image is preprocessed and image processed to obtain the first feature data, and the first feature data is uploaded to the server for video matching.
[0092] For the server, the first feature data uploaded by the client is compared with the second feature data extracted in advance. The server does not limit the amount of first feature data uploaded by the client, and there is no need for the client to upload a complete reference video. The client can extract features in real time, and the server performs video matching in real time. It can be seen that through the technical solution of the embodiment of the present disclosure, when feature extraction is performed for videos with different video lengths or different video starting points, the extracted first feature data and second feature data are both for scene switching, that is, the extracted first feature data and second feature data are more likely to be similar, and video matching and video searching can be achieved with a relatively low amount of calculation.
[0093] According to the embodiments of the present disclosure, image extraction, image preprocessing and feature data extraction are completed on the client, which reduces the amount of data transmission between the client and the server and greatly improves the matching speed of the server.
[0094] Figure 6 The block diagram schematically shows a video matching device according to an embodiment of the present disclosure.
[0095] like Figure 6 As shown, the video matching device 600 of the embodiment of the present disclosure includes, for example, a receiving module 610 , a comparing module 620 and a determining module 630 .
[0096] The receiving module 610 may be used to receive the first feature data for the reference video. According to the embodiment of the present disclosure, the receiving module 610 may, for example, execute the above reference video. Figure 2 The operation S210 described above will not be described in detail here.
[0097] The comparison module 620 may be used to compare the first feature data with the second feature data of at least one candidate video to obtain a comparison result, wherein the second feature data is obtained by identifying scene change information in the candidate video. Figure 2 The operation S220 described above will not be described in detail here.
[0098] The determination module 630 may be used to determine a target video that matches the reference video from at least one candidate video based on the comparison result, wherein the second feature data of the target video matches the first feature data. Figure 2The operation S230 described above will not be described in detail here.
[0099] According to an embodiment of the present disclosure, the apparatus 600 may further include: a first recognition module and a first extraction module. The first recognition module is used to recognize scene change information in the candidate video for each candidate video in at least one candidate video. The first extraction module is used to extract second feature data from the candidate video in response to recognizing the scene change information.
[0100] According to an embodiment of the present disclosure, the first extraction module includes: a first determination submodule and a first extraction submodule. The first determination submodule is used to determine a first video segment from the candidate video in response to identifying a switch from a first scene to a second scene in the candidate video, wherein the first video segment includes video data for the first scene and / or video data for the second scene. The first extraction submodule is used to extract second feature data from the first video segment.
[0101] According to an embodiment of the present disclosure, the first extraction module includes: a second extraction submodule and a first processing submodule. The second extraction submodule is used to extract the first image from the candidate video. The first processing submodule is used to process the first image to obtain second feature data for the candidate video.
[0102] According to an embodiment of the present disclosure, the first characteristic data includes a first data sequence, and the first data sequence includes a plurality of sub-data; the second characteristic data includes a second data sequence, and the second data sequence includes a plurality of sub-data. The comparison module 620 includes: a second determination submodule, a third determination submodule, and a comparison submodule. The second determination submodule is used to determine a plurality of adjacent sub-data from the first data sequence as a first sub-sequence. The third determination submodule is used to determine a plurality of adjacent sub-data from the second data sequence as a second sub-sequence, wherein the number of sub-data in the second sub-sequence is the same as the number of sub-data in the first sub-sequence. The comparison submodule is used to compare the first sub-sequence with the second sub-sequence.
[0103] According to an embodiment of the present disclosure, the determination module 630 is further configured to determine, in response to the first subsequence matching the second subsequence, a candidate video corresponding to the second subsequence as a target video.
[0104] Figure 7 The block diagram schematically shows a video processing device according to an embodiment of the present disclosure.
[0105] like Figure 7 As shown, the video processing device 700 of the embodiment of the present disclosure includes, for example, a second identification module 710 , a second extraction module 720 and a sending module 730 .
[0106] The second recognition module 710 may be used to recognize scene change information in the reference video. Figure 4 The operation S410 described above will not be described in detail here.
[0107] The second extraction module 720 may be used to extract the first feature data from the reference video in response to identifying the scene change information. According to the embodiment of the present disclosure, the second extraction module 720 may, for example, perform the above reference Figure 4 The operation S420 described above will not be described in detail here.
[0108] The sending module 730 may be used to send the first feature data. According to an embodiment of the present disclosure, the sending module 730 may, for example, execute the above reference Figure 4 The operation S430 described above will not be described in detail here.
[0109] According to an embodiment of the present disclosure, the second extraction module 720 includes: a fourth determination submodule and a third extraction submodule. The fourth determination submodule is used to determine a second video segment from the reference video in response to identifying a switch from the third scene to the fourth scene in the reference video, wherein the second video segment includes video data for the third scene and / or video data for the fourth scene. The third extraction submodule is used to extract the first feature data from the second video segment.
[0110] According to an embodiment of the present disclosure, the second extraction module 720 includes: a fourth extraction submodule and a second processing submodule. The fourth extraction submodule is used to extract the second image from the reference video. The second processing submodule is used to process the second image to obtain the first feature data for the reference video.
[0111] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0112] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0113] Figure 8 It is a block diagram of an electronic device used to implement the video matching method of the embodiment of the present disclosure.
[0114] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 800 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0115] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0116] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0117] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the video matching method. For example, in some embodiments, the video matching method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the video matching method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the video matching method in any other appropriate manner (e.g., by means of firmware).
[0118] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0119] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0120] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0121] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0122] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0123] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0124] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0125] The electronic device can be used to perform the video processing method. The electronic device may include, for example, a computing unit, a ROM, a RAM, an I / O interface, an input unit, an output unit, a storage unit, and a communication unit. The computing unit, the ROM, the RAM, the I / O interface, the input unit, the output unit, the storage unit, and the communication unit in the electronic device may have the same Figure 8 The computing unit, ROM, RAM, I / O interface, input unit, output unit, storage unit and communication unit of the electronic device shown in the figure have the same or similar functions and are not described in detail here.
[0126] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0127] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A video matching method, comprising: Receiving first feature data for a reference video; Comparing the first feature data with second feature data of at least one candidate video to obtain a comparison result, wherein the second feature data is obtained by identifying scene change information in the candidate video; and Based on the comparison result, determining a target video matching the reference video from the at least one candidate video, wherein the second feature data of the target video matches the first feature data; The first feature data includes a first data sequence, which includes a plurality of first sub-data; the second feature data includes a second data sequence, which includes a plurality of second sub-data; and comparing the first feature data with the second feature data of at least one candidate video includes: Determine a plurality of adjacent first sub-data from the first data sequence as a first sub-sequence; Determine a plurality of adjacent second sub-data from the second data sequence as a second sub-sequence, wherein the number of sub-data in the second sub-sequence is the same as the number of sub-data in the first sub-sequence; and matching the plurality of first sub-data with the plurality of second sub-data; The determining the target video matching the reference video comprises: determining the target video in response to determining that a preset number of adjacent first sub-data and a preset number of adjacent second sub-data are respectively matched; Determining the target video includes: In response to a first sub-data in the first sub-sequence matching a second sub-data in the second sub-sequence, storing a candidate video for the second data sequence into a queue; In response to the next first sub-data matching the next second sub-data, taking the candidate video for the second data sequence in the queue as the target video; In response to the next first sub-data not matching the next second sub-data, the candidate video for the second data sequence is removed from the queue.
2. The method according to claim 1, further comprising: For each candidate video in the at least one candidate video, identifying scene change information in the candidate video; as well as In response to identifying scene change information, second feature data is extracted from the candidate video.
3. The method according to claim 2, wherein: In response to identifying the scene change information, extracting second feature data from the candidate video includes: In response to identifying a switch from a first scene to a second scene in the candidate video, determining a first video segment from the candidate video, wherein the first video segment includes video data for the first scene and / or video data for the second scene; and The second feature data is extracted from the first video clip.
4. The method according to claim 2 or 3, wherein: The extracting second feature data from the candidate video comprises: Extracting a first image from the candidate video; and The first image is processed to obtain second feature data for the candidate video.
5. A video matching device, comprising: A receiving module, configured to receive first feature data for a reference video; a comparison module, configured to compare the first feature data with second feature data of at least one candidate video to obtain a comparison result, wherein the second feature data is obtained by identifying scene change information in the candidate video; and a determination module, configured to determine, based on the comparison result, a target video matching the reference video from the at least one candidate video, wherein the second feature data of the target video matches the first feature data; The first characteristic data includes a first data sequence, which includes a plurality of first sub-data; the second characteristic data includes a second data sequence, which includes a plurality of second sub-data; Wherein, the comparison module comprises: A second determining submodule, configured to determine a plurality of adjacent first sub-data from the first data sequence as a first sub-sequence; A third determining submodule, configured to determine a plurality of adjacent second sub-data from the second data sequence as a second sub-sequence, wherein the number of sub-data in the second sub-sequence is the same as the number of sub-data in the first sub-sequence; a comparison submodule, configured to match the plurality of first sub-data with the plurality of second sub-data; The determination module is further configured to determine the target video in response to determining that a preset number of adjacent first sub-data and a preset number of adjacent second sub-data are respectively matched; The determination module is further configured to, in response to a first sub-data in the first sub-sequence matching a second sub-data in the second sub-sequence, store the candidate video for the second data sequence into a queue; in response to a next first sub-data matching a next second sub-data, use the candidate video for the second data sequence in the queue as the target video; and in response to a mismatch between the next first sub-data and the next second sub-data, remove the candidate video for the second data sequence from the queue.
6. The apparatus according to claim 5, further comprising: A first identification module, configured to identify scene change information in each candidate video of the at least one candidate video; as well as The first extraction module is used to extract second feature data from the candidate video in response to identifying scene change information.
7. The device according to claim 6, wherein: The first extraction module comprises: a first determining submodule, configured to determine a first video segment from the candidate video in response to identifying a switch from a first scene to a second scene in the candidate video, wherein the first video segment includes video data for the first scene and / or video data for the second scene; and The first extraction submodule is used to extract the second feature data from the first video clip.
8. The device according to claim 6 or 7, wherein: The first extraction module comprises: A second extraction submodule, configured to extract a first image from the candidate video; and The first processing submodule is used to process the first image to obtain second feature data for the candidate video.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.
11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
