Implantation location determination method, device, electronic device and storage medium

The target detection and scene segmentation algorithm automatically determines the position of the specified object in the video frame, which solves the high cost and inefficiency problem of manual browsing on the video playback platform to determine the location of resource implantation, and achieves efficient and accurate resource implantation.

CN116074581BActive Publication Date: 2024-08-30BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310047604.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2024-08-30
Estimated Expiration
2043-01-31

AI Technical Summary

Technical Problem

In the existing technology, the video playback platform requires manual browsing of videos to determine the location of resource implantation, resulting in high cost and low efficiency.

Method used

The target detection algorithm and scene segmentation algorithm are used to automatically detect the position of the specified object in the video frame, and determine the implantation position of the three-dimensional image resource based on the intersection ratio and the evaluation value of the evaluation item.

Benefits of technology

It reduces labor costs, improves the efficiency of determining resource implantation locations, and ensures the accuracy of implantation locations and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116074581B
    Figure CN116074581B
Patent Text Reader

Abstract

The embodiment of the present application provides a method, device, electronic device and storage medium for determining an implantation position, which relates to the field of video processing technology. The method includes: obtaining a video image in which a three-dimensional image resource needs to be implanted; based on a target detection algorithm, determining a video frame containing a specified object in the video image as a first video frame; wherein, when the three-dimensional image resource is implanted at the position of the specified object in the first video frame, the intersection-and-union ratio of the image area occupied by the three-dimensional image resource and the image area occupied by the specified object is less than a first preset threshold; based on the position of the specified object in the first video frame, determining the implantation position of the three-dimensional image resource in the video image. Based on this, the implantation position is automatically detected by the electronic device, which can reduce the labor cost and improve the efficiency of determining the implantation position compared with manually browsing the video image to determine the implantation position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video processing technology, and in particular to an implantation position determination method, device, electronic device and storage medium. Background Art

[0002] At present, in video playback platforms, it is often necessary to embed other resources in the video without affecting the user's viewing of the video content. For example, the embedded resources can be advertisements. For example, when it is necessary to embed a beverage advertisement, a beverage bottle image can be embedded in the image area occupied by the tabletop of the dining table in the video, so that the video after the beverage bottle image is embedded can present a three-dimensional visual effect of the beverage bottle on the tabletop of the dining table. Therefore, for the video playback platform, it is very important to determine the embedding position of the resource in the image so that the resource can be integrated into the video content without affecting the user's viewing experience.

[0003] In the related art, it is usually necessary to manually browse the video where the resource needs to be embedded so as to determine the embedding position of the resource in the video. However, this method has high labor cost and low efficiency. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for determining an implantation location, so as to reduce the cost of determining the implantation location of a resource and improve the efficiency of determining the implantation location of a resource. The specific technical solution is as follows:

[0005] In a first aspect of the present application, a method for determining an implantation position is first provided, the method comprising:

[0006] Acquire the video image that needs to be embedded with the three-dimensional image resource;

[0007] Based on the target detection algorithm, a video frame containing the specified object in the video image is determined as the first video frame; wherein when the three-dimensional image resource is implanted at the position of the specified object in the first video frame, an intersection-over-union ratio of an image area occupied by the three-dimensional image resource and an image area occupied by the specified object is less than a first preset threshold;

[0008] Based on the position of the designated object in the first video frame, an implantation position of the three-dimensional image resource in the video image is determined.

[0009] Optionally, the determining, based on the target detection algorithm, a video frame containing a specified object in the video image as the first video frame includes:

[0010] Based on the target detection algorithm, determining that the designated objects contained in the video image are video frames of the same object as the second video frames corresponding to the designated object;

[0011] The step of determining, based on the position of the designated object in the first video frame, an implantation position of the three-dimensional image resource in the video image comprises:

[0012] Based on the position of each designated object in the corresponding second video frame, an embedding position for embedding the three-dimensional image resource in the video image is determined.

[0013] Optionally, the determining, based on the target detection algorithm, that the designated objects contained in the video image are video frames of the same object as the second video frames corresponding to the designated objects includes:

[0014] Determining a current video frame to be processed in the video image according to the order of the video frames in the video image;

[0015] Based on the target detection algorithm, detect whether the current video frame to be processed contains the specified object;

[0016] If it is determined based on the target detection algorithm that the current video frame to be processed contains the specified object, determining whether the specified object is determined in a video frame before the current video frame to be processed;

[0017] If the designated object is determined in a video frame before the current video frame to be processed, determining whether the designated object detected in the current video frame to be processed and the designated object determined in the previous video frame are the same object;

[0018] If the specified object detected in the current video frame to be processed is the same object as the specified object determined in the previous video frame, then determining that the current video frame to be processed and the previous video frame belong to a set of video frames containing the same specified object; and returning to execute the step of determining the current video frame to be processed in the video image according to the order between the video frames in the video image;

[0019] Based on the similarity between the image regions occupied by the designated objects in the video frames, the video frames in the video frame set including the designated objects as the same object are determined as the second video frames corresponding to the designated objects.

[0020] Optionally, before determining, based on the similarity between the image areas occupied by the specified objects in the video frames, the video frames in the set of video frames including the specified objects as the same object as the second video frames corresponding to the specified objects, the method further includes:

[0021] Based on a scene segmentation algorithm, determining the scene to which each video frame in the video image belongs;

[0022] The method of determining, based on the similarity between the image areas occupied by the designated objects in the video frames, the video frames in the video frame set including the designated objects as the same object as the second video frames corresponding to the designated objects includes:

[0023] For each scene, based on the similarity between the image areas occupied by the specified object in the video frames, from the video frame sets belonging to the scene, a video frame set containing the specified object as the same object is determined as the video frame set corresponding to the specified object;

[0024] The video frames in the video frame set corresponding to the designated object are determined as the second video frames corresponding to the designated object.

[0025] Optionally, the method further includes:

[0026] If the specified object detected in the current video frame to be processed is not the same object as the specified object determined in the previous video frame, or if the specified object is not determined in the previous video frame of the current video frame to be processed, or if it is determined based on the target detection algorithm that the current video frame to be processed does not contain the specified object, then determine the video frame containing the specified object determined last time as the current third video frame;

[0027] Based on the target tracking algorithm, determining whether the specified object determined in the current third video frame is tracked in the current video frame to be processed;

[0028] If, based on the target tracking algorithm, the specified object determined in the current third video frame is tracked in the current video frame to be processed, it is determined that the current video frame to be processed and the current third video frame belong to a set of video frames containing the same specified object; and the process returns to execute the step of determining the current video frame to be processed in the video image according to the order between the video frames in the video image.

[0029] Optionally, when it is determined based on the target detection algorithm that the current video frame to be processed does not contain the specified object, before determining the video frame containing the specified object determined last time as the current third video frame, the method further includes:

[0030] Determine whether there are a preset number of continuous fourth video frames before the current video frame to be processed; wherein the fourth video frame represents a video frame determined not to contain the specified object;

[0031] The step of determining the last determined video frame containing the specified object as the current third video frame includes:

[0032] If there are no preset number of consecutive fourth video frames before the current video frame to be processed, determine the video frame containing the specified object determined last time as the current third video frame;

[0033] When there are a preset number of consecutive fourth video frames before the current video frame to be processed, it is determined that the current video frame to be processed does not contain the specified object, and the step of determining the current video frame to be processed in the video image according to the order between the video frames in the video image is returned to be executed.

[0034] Optionally, before determining the implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame, the method further includes:

[0035] For each candidate object included in the video image, based on each second video frame corresponding to the candidate object, calculate the evaluation value of the candidate object for the preset evaluation item to obtain the object evaluation value of the candidate object; wherein the candidate object is determined based on the designated object included in the video image;

[0036] The preset evaluation items include at least one of the following: a completeness evaluation item, a clarity evaluation item, and a stability evaluation item;

[0037] The completeness evaluation item is used to represent: an average value of the completeness of the candidate object in each corresponding second video frame;

[0038] The clarity evaluation item is used to represent: the proportion of the foreground in the first image area corresponding to the candidate object; the first image area corresponding to the candidate object represents: the image area occupied by the candidate object in each corresponding second video frame;

[0039] The stability evaluation item includes at least one of the following: a regional stability evaluation item and an area stability evaluation item;

[0040] The regional stability evaluation item is used to characterize: the change amplitude of the first image region corresponding to the candidate object;

[0041] The area stability evaluation item is used to represent: the proportion of image areas whose areas are smaller than a second preset threshold in each first image area corresponding to the candidate object;

[0042] The step of determining the implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame includes:

[0043] Determine a target object from among the candidate objects based on the object evaluation value of each candidate object;

[0044] Based on the position of the target object in the corresponding second video frame, an implantation position of the three-dimensional image resource in the video image is determined.

[0045] Optionally, the evaluation value of a candidate object for the completeness evaluation item is calculated as follows:

[0046] For each second video frame corresponding to the candidate object, obtaining a detection value corresponding to the second video frame as the completeness of the candidate object in the second video frame; wherein the detection value corresponding to the second video frame represents a probability of determining that the second video frame contains the candidate object;

[0047] For each video frame set corresponding to the candidate object, calculating an average value of the completeness of the candidate object in each second video frame included in the video frame set as the average completeness of the candidate object in the video frame set;

[0048] An average value of the average completeness of the candidate object in each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the completeness evaluation item.

[0049] Optionally, the evaluation value of a candidate object for the clarity evaluation item is calculated as follows:

[0050] For each second video frame corresponding to the candidate object, calculating the proportion of the foreground in the first image area corresponding to the candidate object in the second video frame as the clarity of the candidate object in the second video frame;

[0051] For each video frame set corresponding to the candidate object, calculating an average value of the clarity of the candidate object in each second video frame included in the video frame set as the average clarity of the candidate object in the video frame set;

[0052] The maximum value of the average definition of the candidate object in each video frame set corresponding to the candidate object is determined as the evaluation value of the candidate object for the definition evaluation item.

[0053] Optionally, the regional stability evaluation item includes at least one of the following: a first regional stability evaluation sub-item and a second regional stability evaluation sub-item;

[0054] The evaluation value of a candidate object corresponding to the first regional stability evaluation sub-item is calculated in the following way:

[0055] For each second video frame corresponding to the candidate object, obtaining the coordinates of the center point of the first image region corresponding to the candidate object in the second video frame as the coordinates to be processed corresponding to the second video frame; and calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame;

[0056] For each video frame set corresponding to the candidate object, calculate the standard deviation of the coordinates to be processed corresponding to each second video frame included in the video frame set as the first standard deviation corresponding to the video frame set;

[0057] Calculating an average value of first areas to be processed corresponding to each second video frame included in the video frame set as an average area corresponding to the video frame set;

[0058] Calculating a ratio of a first standard deviation corresponding to the video frame set to an average area corresponding to the video frame set as the central point stability corresponding to the video frame set;

[0059] Determine an average value of the central point stability corresponding to each set of video frames corresponding to the candidate object as an evaluation value of the candidate object for the first region stability evaluation sub-item;

[0060] The evaluation value of a candidate object corresponding to the second regional stability evaluation sub-item is calculated in the following way:

[0061] For each second video frame corresponding to the candidate object, calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame;

[0062] For each video frame set corresponding to the candidate object, calculate the standard deviation of the first to-be-processed area corresponding to each second video frame included in the video frame set as the second standard deviation corresponding to the video frame set;

[0063] An average value of second standard deviations corresponding to each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the second region stability evaluation sub-item.

[0064] Optionally, before calculating, for each candidate object included in the video image, an evaluation value of the candidate object for a preset evaluation item based on each second video frame corresponding to the candidate object to obtain the object evaluation value of the candidate object, the method further includes:

[0065] For each designated object included in the video image, based on each second video frame corresponding to the designated object, obtain the appearance duration of the designated object in the video image;

[0066] Determine whether the appearance duration of the specified object is greater than a preset duration;

[0067] If the appearance duration of the designated object is longer than the preset duration, the designated object is determined as a candidate object.

[0068] In a second aspect of the present application, there is also provided an implantation position determination device, the device comprising:

[0069] A video image acquisition module, used for video images that need to be embedded with three-dimensional image resources;

[0070] A first determination module is used to determine, based on a target detection algorithm, a video frame containing a specified object in the video image as a first video frame; wherein, when the three-dimensional image resource is implanted at the position of the specified object in the first video frame, an intersection-over-union ratio of an image area occupied by the three-dimensional image resource and an image area occupied by the specified object is less than a first preset threshold;

[0071] The implantation position determination module is used to determine the implantation position of the three-dimensional image resource in the video image based on the position of the designated object in the first video frame.

[0072] Optionally, the first determining module includes:

[0073] A first determination submodule is used to determine, based on a target detection algorithm, video frames of the same object as the designated objects contained in the video image as the second video frames corresponding to the designated object;

[0074] The implantation position determination module comprises:

[0075] The implantation position determination submodule is used to determine the implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame.

[0076] Optionally, the first determining submodule includes:

[0077] A first determining unit, configured to determine a current video frame to be processed in the video image according to an order between video frames in the video image;

[0078] A designated object detection unit is used to detect whether the current video frame to be processed contains a designated object based on a target detection algorithm;

[0079] A first judgment unit is used to judge whether the specified object is determined in a previous video frame of the current video frame to be processed if it is determined based on the target detection algorithm that the current video frame to be processed contains the specified object;

[0080] A second judgment unit is used to judge whether the specified object detected in the current video frame to be processed and the specified object determined in the previous video frame are the same object if the specified object is determined in the previous video frame of the current video frame to be processed;

[0081] A second determining unit is used to determine that the current video frame to be processed and the previous video frame belong to a set of video frames containing the same specified object if the specified object detected in the current video frame to be processed is the same object as the specified object determined in the previous video frame; and return to execute the step of determining the current video frame to be processed in the video image according to the order of the video frames in the video image;

[0082] The third determining unit is used to determine the video frames in the video frame set including the designated object as the same object as the second video frames corresponding to the designated object based on the similarity between the image areas occupied by the designated object in the video frames.

[0083] Optionally, the device further comprises:

[0084] a scene determination module, configured to determine the scene to which each video frame in the video image belongs based on a scene segmentation algorithm before determining the video frames in the set of video frames containing the same designated object as the second video frames corresponding to the designated object based on the similarity between the image areas occupied by the designated object in the video frames;

[0085] The third determination unit is specifically used to determine, for each scene, based on the similarity between the image areas occupied by the specified objects in the video frames, a set of video frames that contain the specified object as the same object from the sets of video frames belonging to the scene, as the set of video frames corresponding to the specified object; and determine the video frames in the set of video frames corresponding to the specified object as the second video frames corresponding to the specified object.

[0086] Optionally, the device further comprises:

[0087] A second determination module is used to determine the video frame containing the specified object determined last time as the current third video frame if the specified object detected in the current video frame to be processed is not the same object as the specified object determined in the previous video frame, or if the specified object is not determined in the previous video frame of the current video frame to be processed, or if it is determined based on the target detection algorithm that the current video frame to be processed does not contain the specified object;

[0088] A designated object tracking module, used to determine whether the designated object determined in the current third video frame is tracked in the current video frame to be processed based on a target tracking algorithm;

[0089] A video frame set determination module is used to determine that the current video frame to be processed and the current third video frame belong to a video frame set containing the same specified object if the specified object determined in the current third video frame is tracked in the current video frame to be processed based on the target tracking algorithm; and trigger the first determination unit.

[0090] Optionally, the device further comprises:

[0091] A first judgment module is used for, when it is determined based on the target detection algorithm that the current video frame to be processed does not contain the specified object, and before determining the video frame containing the specified object determined last time as the current third video frame, judging whether there are a preset number of continuous fourth video frames before the current video frame to be processed; wherein the fourth video frame represents the video frame determined not to contain the specified object;

[0092] The second determination module is specifically used to determine the video frame containing the specified object determined last time as the current third video frame when there is no preset number of consecutive fourth video frames before the current video frame to be processed; and to determine that the current video frame to be processed does not contain the specified object and trigger the first determination unit when there is a preset number of consecutive fourth video frames before the current video frame to be processed.

[0093] Optionally, the device further comprises:

[0094] The object evaluation value calculation module is used to calculate the evaluation value of each candidate object included in the video image based on each second video frame corresponding to the candidate object for a preset evaluation item before determining the implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame, so as to obtain the object evaluation value of the candidate object; wherein the candidate object is determined based on the designated object included in the video image;

[0095] The preset evaluation items include at least one of the following: a completeness evaluation item, a clarity evaluation item, and a stability evaluation item;

[0096] The completeness evaluation item is used to represent: an average value of the completeness of the candidate object in each corresponding second video frame;

[0097] The clarity evaluation item is used to represent: the proportion of the foreground in the first image area corresponding to the candidate object; the first image area corresponding to the candidate object represents: the image area occupied by the candidate object in each corresponding second video frame;

[0098] The stability evaluation item includes at least one of the following: a regional stability evaluation item and an area stability evaluation item;

[0099] The regional stability evaluation item is used to characterize: the change amplitude of the first image region corresponding to the candidate object;

[0100] The area stability evaluation item is used to represent: the proportion of image areas whose areas are smaller than a second preset threshold in each first image area corresponding to the candidate object;

[0101] The implantation position determination submodule is specifically used to determine the target object from each candidate object based on the object evaluation value of each candidate object; and determine the implantation position of the three-dimensional image resource in the video image based on the position of the target object in the corresponding second video frame.

[0102] Optionally, the evaluation value of a candidate object for the completeness evaluation item is calculated as follows:

[0103] For each second video frame corresponding to the candidate object, obtaining a detection value corresponding to the second video frame as the completeness of the candidate object in the second video frame; wherein the detection value corresponding to the second video frame represents a probability of determining that the second video frame contains the candidate object;

[0104] For each video frame set corresponding to the candidate object, calculating an average value of the completeness of the candidate object in each second video frame included in the video frame set as the average completeness of the candidate object in the video frame set;

[0105] An average value of the average completeness of the candidate object in each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the completeness evaluation item.

[0106] Optionally, the evaluation value of a candidate object for the clarity evaluation item is calculated as follows:

[0107] For each second video frame corresponding to the candidate object, calculating the proportion of the foreground in the first image area corresponding to the candidate object in the second video frame as the clarity of the candidate object in the second video frame;

[0108] For each video frame set corresponding to the candidate object, calculating an average value of the clarity of the candidate object in each second video frame included in the video frame set as the average clarity of the candidate object in the video frame set;

[0109] The maximum value of the average definition of the candidate object in each video frame set corresponding to the candidate object is determined as the evaluation value of the candidate object for the definition evaluation item.

[0110] Optionally, the regional stability evaluation item includes at least one of the following: a first regional stability evaluation sub-item and a second regional stability evaluation sub-item;

[0111] The evaluation value of a candidate object corresponding to the first regional stability evaluation sub-item is calculated in the following way:

[0112] For each second video frame corresponding to the candidate object, obtaining the coordinates of the center point of the first image region corresponding to the candidate object in the second video frame as the coordinates to be processed corresponding to the second video frame; and calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame;

[0113] For each video frame set corresponding to the candidate object, calculate the standard deviation of the coordinates to be processed corresponding to each second video frame included in the video frame set as the first standard deviation corresponding to the video frame set;

[0114] Calculating an average value of first areas to be processed corresponding to each second video frame included in the video frame set as an average area corresponding to the video frame set;

[0115] Calculating a ratio of a first standard deviation corresponding to the video frame set to an average area corresponding to the video frame set as the central point stability corresponding to the video frame set;

[0116] Determine an average value of the central point stability corresponding to each set of video frames corresponding to the candidate object as an evaluation value of the candidate object for the first region stability evaluation sub-item;

[0117] The evaluation value of a candidate object corresponding to the second regional stability evaluation sub-item is calculated in the following way:

[0118] For each second video frame corresponding to the candidate object, calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame;

[0119] For each video frame set corresponding to the candidate object, calculate the standard deviation of the first to-be-processed area corresponding to each second video frame included in the video frame set as the second standard deviation corresponding to the video frame set;

[0120] An average value of second standard deviations corresponding to each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the second region stability evaluation sub-item.

[0121] Optionally, the device further comprises:

[0122] an appearance duration acquisition module, for calculating the evaluation value of each candidate object for a preset evaluation item based on each second video frame corresponding to the candidate object for each candidate object included in the video image, and obtaining the object evaluation value of the candidate object, and for each designated object included in the video image, obtaining the appearance duration of the designated object in the video image based on each second video frame corresponding to the designated object;

[0123] The second judging module is used to judge whether the appearance time of the specified object is greater than a preset time;

[0124] The candidate object determination module is used to determine the specified object as a candidate object if the appearance duration of the specified object is greater than a preset duration.

[0125] In a third aspect of the implementation of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0126] Memory, used to store computer programs;

[0127] The processor is used to implement any of the above-mentioned implantation position determination method steps when executing the program stored in the memory.

[0128] In another aspect of the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the above-mentioned implantation position determination methods is implemented.

[0129] In another aspect of the present application, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned implantation position determination methods.

[0130] An embodiment of the present application provides an implantation position determination method, which comprises acquiring a video image in which a three-dimensional image resource is to be implanted; determining, based on a target detection algorithm, a video frame containing a specified object in the video image as a first video frame; wherein, when the three-dimensional image resource is implanted at the position of the specified object in the first video frame, an intersection-and-union ratio of an image area occupied by the three-dimensional image resource and an image area occupied by the specified object is less than a first preset threshold; and determining an implantation position in the video image for implanting the three-dimensional image resource based on the position of the specified object in the first video frame.

[0131] Based on the above processing, the designated object in the video image can be determined. Since when the three-dimensional image resource is implanted at the position of the designated object in the first video frame, the intersection-and-union ratio of the image area occupied by the three-dimensional image resource and the image area occupied by the designated object is less than the first preset threshold, that is, the three-dimensional image resource can be implanted at the position of the designated object. Accordingly, the implantation position of the three-dimensional image resource in the video image can be determined according to the position of the designated object in the first video frame. Based on this, the automatic detection of the implantation position by the electronic device can reduce the labor cost and improve the efficiency of determining the implantation position compared with manually browsing the video image to determine the implantation position. BRIEF DESCRIPTION OF THE DRAWINGS

[0132] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0133] Figure 1 A first flow chart of the implantation position determination method provided in an embodiment of the present application;

[0134] Figure 2 A second flow chart of the implantation position determination method provided in an embodiment of the present application;

[0135] Figure 3 A third flow chart of the implantation position determination method provided in an embodiment of the present application;

[0136] Figure 4 A fourth flow chart of the implantation position determination method provided in an embodiment of the present application;

[0137] Figure 5 A fifth flow chart of the implantation position determination method provided in an embodiment of the present application;

[0138] Figure 6 A flowchart for determining a set of video frames containing the same specified object provided in an embodiment of the present application;

[0139] Figure 7 A schematic diagram of a foreground portion of a video frame provided in an embodiment of the present application;

[0140] Figure 8 A flowchart of calculating the evaluation value of a candidate object for a preset evaluation item provided in an embodiment of the present application;

[0141] Fig. 9 A flow chart of clustering a set of video frames provided in an embodiment of the present application;

[0142] Fig.10 A schematic diagram of a video frame set clustering result provided in an embodiment of the present application;

[0143] Fig.11 A schematic diagram of another video frame set clustering result provided in an embodiment of the present application;

[0144] Fig.12 A sixth flow chart of the implantation position determination method provided in an embodiment of the present application;

[0145] Fig.13 A schematic diagram of the structure of an implantation position determination device provided in an embodiment of the present application;

[0146] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0147] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0148] At present, in video playback platforms, it is often necessary to embed other resources in the video without affecting the user's viewing of the video content. For example, the embedded resources can be advertisements. For example, an advertisement poster image can be embedded on the wall in the video, or an advertisement poster image can be embedded on the desk in the video. Therefore, for the video playback platform, it is very important to determine the embedding position of the resource in the image screen so that the resource can be integrated into the video content without affecting the user's viewing experience.

[0149] In the related art, it is usually necessary to manually browse the video where the resource needs to be embedded so as to determine the embedding position of the resource in the video. However, this method has high labor cost and low efficiency.

[0150] In order to reduce the cost of implantation position determination and improve the efficiency of implantation position determination, the present application embodiment provides an implantation position determination method. Figure 1 , Figure 1 A first flow chart of a method for determining an implantation position provided in an embodiment of the present application, the method comprising the following steps:

[0151] Step S101: obtaining a video image into which a three-dimensional image resource needs to be embedded.

[0152] Step S102: Based on the target detection algorithm, determine a video frame containing a specified object in the video image as the first video frame.

[0153] When the three-dimensional image resource is implanted at the position of the designated object in the first video frame, an intersection-and-union ratio of an image area occupied by the three-dimensional image resource and an image area occupied by the designated object is less than a first preset threshold.

[0154] Step S103: Determine an embedding position for embedding the three-dimensional image resource in the video image based on the position of the designated object in the first video frame.

[0155] Based on the above processing, the designated object in the video image can be determined. Since when the three-dimensional image resource is implanted at the position of the designated object in the first video frame, the intersection-and-union ratio of the image area occupied by the three-dimensional image resource and the image area occupied by the designated object is less than the first preset threshold, that is, the three-dimensional image resource can be implanted at the position of the designated object. Accordingly, the implantation position of the three-dimensional image resource in the video image can be determined according to the position of the designated object in the first video frame. Based on this, the automatic detection of the implantation position by the electronic device can reduce the labor cost and improve the efficiency of determining the implantation position compared with manually browsing the video image to determine the implantation position.

[0156] For step S101, the video image that needs to be embedded with a 3D image resource, that is, the video image for which the embedding position of the 3D image resource is currently to be determined, may be, for example, a video image of a TV series, or may be a video image of a movie. The 3D image resource may be a picture resource that can represent a 3D object, for example, may be a picture of a beverage bottle.

[0157] For step S102, the first preset threshold may be 0.2 or 0.1. The image area occupied by the three-dimensional image resource is smaller than the image area occupied by the designated object. When the three-dimensional image resource is implanted at the position of the designated object in the first video frame, the intersection-over-union ratio of the image area occupied by the three-dimensional image resource and the image area occupied by the designated object is smaller than the first preset threshold. That is, the image area occupied by the three-dimensional image resource and the image area occupied by the designated object have a small overlapping portion.

[0158] For example, the designated object may have a plane with an angle greater than a preset angle with respect to the vertical direction in the first video frame. That is, from the user's viewing angle, the designated object has a plane that is biased toward the vertical direction. For example, the preset angle may be 75° or 85°. For example, the designated object may be a dining table, an office desk, a coffee table, or a bedside table.

[0159] In order to ensure that the implanted three-dimensional image resource can present a three-dimensional visual effect in the video image, the position of the implanted three-dimensional image resource in the image area occupied by the designated object can be determined according to the positional relationship between the object represented by the three-dimensional image resource and the designated object in the scene involved in the video image. Furthermore, the three-dimensional image resource can be implanted at the determined position, instead of filling the three-dimensional image resource in the image area occupied by the designated object, so that the image area occupied by the three-dimensional image resource and the image area occupied by the designated object have a small overlapping part. For example, the three-dimensional image resource can be a picture of a beverage bottle, and the designated object can be a dining table. In actual life scenes, the beverage bottle is usually located on the table top of the dining table. Therefore, it can be determined to implant the beverage bottle picture in the image area occupied by the table top of the dining table, so that the video image after the beverage bottle picture is implanted can present a three-dimensional visual effect of the beverage bottle being located on the table top of the dining table.

[0160] The video image includes multiple video frames. For any video frame, there may be one specified object, multiple specified objects, or no specified object in the video frame. In the present application, a target detection algorithm can be used to detect whether a video frame contains a specified object, and then the video frame containing the specified object can be determined as the first video frame. It is understandable that there can be multiple first video frames determined. For example, for any video frame, if the video frame contains at least one specified object, the video can be determined as the first video frame.

[0161] The target detection algorithm may be an R-CNN (Region-based Convolutional Neural Networks) algorithm, an SSD (Single Shot MultiBox Detector) algorithm, or a YOLO (You Only Look Once) algorithm.

[0162] With respect to step S103 , for example, the position of the designated object in the first video frame may be directly determined as the implantation position for implanting the three-dimensional image resource in the video image.

[0163] In addition, when there are multiple video frames that contain the specified object, see Figure 2 , Figure 2 The second flow chart of the implantation position determination method provided in the embodiment of the present application, based on the target detection algorithm, determines a video frame containing a specified object in a video image as a first video frame (S102), including:

[0164] Step S1021: Based on the target detection algorithm, determine that the designated object contained in the video image is a video frame of the same object as each second video frame corresponding to the designated object.

[0165] Determining an implantation position of a 3D image resource in a video image based on a position of a designated object in a first video frame (S103), including:

[0166] Step S1031: Determine an embedding position of a 3D image resource in a video image based on a position of each designated object in a corresponding second video frame.

[0167] In an embodiment of the present application, if a first video frame contains multiple designated objects, then for any one of the multiple designated objects, multiple first video frames containing the designated object can be determined, and the multiple first video frames are the second video frames corresponding to the designated object. For example, a first video frame containing a designated object in a video image can be determined based on a target detection algorithm, and then, based on the similarity between the image areas occupied by the designated object in the first video frame, it is determined whether the designated objects contained in any two first video frames are the same object, and the first video frame containing the same designated object is determined as the second video frame corresponding to the designated object.

[0168] Subsequently, the position of the three-dimensional image resource to be implanted in the video image may be determined based on the position of each designated object in the corresponding second video frame. For example, the position of any designated object in the corresponding second video frame may be determined as the position of the three-dimensional image resource to be implanted in the video image; or, multiple designated objects may be screened, and the position of the three-dimensional image resource to be implanted in the video image may be determined based on the screening result.

[0169] Based on this, for any designated object, the second video frame containing the designated object in the video image can be determined. That is, the video frames containing the designated object in the video image can be associated, and subsequently, based on the position of the designated object in each corresponding second video frame, the position of the three-dimensional image resource to be implanted in the video image is determined, which can avoid the situation where the position of the same designated object in different video frames is determined as different implantation positions for implanting the three-dimensional image resource, further ensuring the effect of the implantation of the three-dimensional image resource.

[0170] In one embodiment, Figure 2 Based on Figure 3 , Figure 3 The third flow chart of the implantation position determination method provided in the embodiment of the present application, based on the target detection algorithm, determines that the designated objects contained in the video image are video frames of the same object as the second video frames corresponding to the designated objects (S1021), including:

[0171] Step S10211: Determine the current video frame to be processed in the video image according to the order of the video frames in the video image.

[0172] Step S10212: Based on the target detection algorithm, detect whether the current video frame to be processed contains the specified object. If yes, execute step S10213; if not, execute step S10219.

[0173] Step S10213: Determine whether the designated object is determined in the previous video frame of the current video frame to be processed. If yes, execute step S10214; if not, execute step S10216.

[0174] Step S10214: Determine whether the designated object detected in the current video frame to be processed is the same as the designated object determined in the previous video frame. If yes, execute step S10215; if not, execute step S10216.

[0175] Step S10215: Determine whether the current video frame to be processed and the previous video frame belong to a video frame set containing the same specified object. If the current video frame to be processed is the last frame in the video image, execute step S102111; if the current video frame to be processed is not the last frame in the video image, return to execute step S10211.

[0176] Step S10216: Determine the video frame containing the specified object determined last time as the current third video frame.

[0177] Step S10217: Based on the target tracking algorithm, determine whether the designated object determined in the current third video frame is tracked in the current video frame to be processed. If yes, execute step S10218.

[0178] Step S10218: Determine whether the current video frame to be processed and the current third video frame belong to a video frame set containing the same specified object. If the current video frame to be processed is the last frame in the video image, execute step S102111; if the current video frame to be processed is not the last frame in the video image, return to execute step S10211.

[0179] Step S10219: Determine whether there are a preset number of consecutive fourth video frames before the current video frame to be processed. If not, execute step S10216; if yes, execute step S102110.

[0180] The fourth video frame represents a video frame that is determined not to contain the specified object. That is, for the fourth video frame, it is determined based on both the target detection algorithm and the target tracking algorithm that it does not contain the specified object.

[0181] Step S102110: Determine whether the current video frame to be processed does not contain the specified object. If the current video frame to be processed is the last frame in the video image, execute step S102111; if the current video frame to be processed is not the last frame in the video image, return to execute step S10211.

[0182] Step S102111: based on the similarity between the image regions occupied by the designated objects in the video frames, video frames in a set of video frames that include the designated objects as the same object are determined as second video frames corresponding to the designated objects.

[0183] In the embodiment of the present application, each video frame in the video image may be processed in sequence according to the order between the video frames in the video image to determine whether a specified object exists in the video frame.

[0184] For example, there are N video frames in the video image, and the video frames in the video image can be numbered in sequence, and then the first frame, the second frame, ..., the Nth frame can be determined as the current video frames to be processed in sequence, and processed according to the above steps S10212 to S102110. It can be understood that for the first frame, it is only necessary to detect whether the frame contains a specified object based on the target detection algorithm, without determining whether the specified object is determined in the previous video frame.

[0185] If it is determined based on the target detection algorithm that the current video frame to be processed contains a specified object, and the specified object is determined in a video frame before the current video frame to be processed, then it is determined whether the specified object detected in the current video frame to be processed is the same object as the specified object determined in the previous video frame.

[0186] For example, the overlap between the image area occupied by the specified object detected in the current video frame to be processed and the image area occupied by the specified object determined in the previous video frame can be calculated. For example, the overlap can be expressed by the IoU (Intersection over Union) of the two image areas.

[0187] When the calculated overlap reaches the preset overlap threshold, it indicates that the specified object detected in the current video frame to be processed is the same object as the specified object determined in the previous video frame, and it can be determined that the current video frame to be processed and the previous video frame belong to a set of video frames containing the same specified object. Accordingly, the same identifier (which can be called a target ID) can be used to mark video frames belonging to the same set of video frames.

[0188] Based on the above processing, the video frames in the video image that are adjacent and contain the same designated object can be determined to belong to a set of video frames. Since in the entire video image, the same designated object may appear in different segments, that is, different sets of video frames may also contain the same designated object, therefore, based on the similarity between the image areas occupied by the designated objects in the video frames, the video frames in the set of video frames containing the same designated object can be determined as the second video frames corresponding to the designated object. In this way, for any designated object, the video frame containing the designated object in the entire video image can be determined. That is, the video frames containing the designated object in the entire video image can be associated, and subsequently, based on the position of the designated object in the corresponding second video frames, the implantation position of the three-dimensional image resource in the video image is determined, which can avoid the situation where the position of the same designated object in different video frames is determined as different implantation positions for implanting the three-dimensional image resource, and further ensure the effect of the implantation of the three-dimensional image resource.

[0189] Since the same designated object may appear in different segments in the entire video image, that is, the same designated object may appear in non-adjacent video frames. Therefore, if the designated object detected in the current video frame to be processed is not the same object as the designated object determined in the previous video frame, or the designated object is not determined in the previous video frame of the current video frame to be processed, the designated object determined in the current third video frame (which may be referred to as the first designated object) may be tracked based on the target tracking algorithm using the video frame containing the designated object determined last time (that is, the current third video frame).

[0190] If the first designated object is tracked in the current video frame to be processed, it is determined that the current video frame to be processed and the current third video frame belong to a video frame set containing the first designated object. The current video frame to be processed in the video image is determined according to the order between the video frames in the video image, so that non-adjacent video frames in the video image and containing the same designated object can be determined as belonging to a video frame set.

[0191] It can be understood that the designated object determined in the previous video frame and the designated object determined in the current third video frame can be determined based on a target detection algorithm, or can also be determined based on a target tracking algorithm.

[0192] For example, the target tracking algorithm may be a CSRT (Correlation Filter-based Tracking) algorithm, a KCF tracker (Kernelized Correlation Filters tracker) algorithm, or a MIL tracker (Multiple Instance Learning tracker) algorithm.

[0193] Since the same designated object may appear in different segments in the entire video image, based on the above processing, non-adjacent video frames in the video image that contain the same designated object can be determined to belong to a set of video frames. In this way, for any designated object, the video frame that contains the designated object in the entire video image can be determined. That is, the video frames that contain the designated object in the entire video image can be associated, and then, based on the position of the designated object in the corresponding second video frames, the implantation position of the three-dimensional image resource in the video image is determined, which can avoid the situation where the position of the same designated object in different video frames is determined as different implantation positions for implanting the three-dimensional image resource, further ensuring the effect of the implantation of the three-dimensional image resource.

[0194] Due to the influence of the accuracy of the target detection algorithm, the target detection algorithm may not be able to detect the specified object contained in the current video frame to be processed. Therefore, in the embodiment of the present application, if the target detection algorithm determines that the current video frame to be processed does not contain the specified object, the last determined video frame containing the specified object (i.e., the current third video frame) can be used to track the first specified object based on the target tracking algorithm.

[0195] If the first designated object is tracked in the current video frame to be processed, it is determined that the current video frame to be processed and the current third video frame belong to a video frame set containing the same designated object. The current video frame to be processed in the video image is determined according to the order between the video frames in the video image, so that the video frames containing the same designated object in the video image are determined to belong to a video frame set.

[0196] Based on the above processing, for any designated object, the situation where the video frame that partially contains the designated object in the video image is not determined due to the influence of the accuracy of the target detection algorithm can be avoided, and the video frame that contains the designated object in the entire video image can be determined. That is, the video frames that contain the designated object in the entire video image can be associated, and then, based on the position of the designated object in each corresponding second video frame, the implantation position of the three-dimensional image resource in the video image is determined, which can avoid the situation where only the position of the same designated object in a part of the video frames is determined as the implantation position of the three-dimensional image resource, and can further ensure the effect of the implantation of the three-dimensional image resource.

[0197] When it is necessary to embed advertisements in video images, the method provided based on the above embodiment can avoid the situation where only the position of the same designated object in a part of the video frames is determined as the embedding position of the embedded advertisement, and avoid the situation where the positions of the same designated object in different video frames are determined as different embedding positions of the embedded advertisement, thereby avoiding the situation where the advertisement embedding is exposed.

[0198] In a video image, a specified object may appear in different segments, but if the specified object does not exist in multiple consecutive video frames, the specified object may not exist in subsequent video frames. Therefore, in an embodiment of the present application, if there are no preset number of consecutive fourth video frames before the current video frame to be processed, it indicates that the specified object may still exist in the current video frame to be processed, and therefore, the current video frame to be processed can be tracked. The preset number may be 10, or 20.

[0199] On the contrary, if there are a preset number of consecutive fourth video frames before the current video frame to be processed, it means that the current video frame to be processed and the subsequent video frames may not contain the specified object. Here, there is no need to perform target tracking on the current video frame to be processed, and it is directly determined that the current video frame to be processed does not contain the specified object.

[0200] Based on the above processing, it is not necessary to track every video frame in the video image, which can improve the efficiency of implantation position determination.

[0201] In addition, since there may be multiple designated objects, the multiple designated objects may be screened, and based on the screening result, the implantation position of the three-dimensional image resource in the video image is determined. Figure 4 , Figure 4 The fourth flow chart of the method for determining an implantation position provided in an embodiment of the present application, before determining the implantation position for implanting the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame (S1031), the method may further include:

[0202] Step S104: for each candidate object included in the video image, based on each second video frame corresponding to the candidate object, calculating the evaluation value of the candidate object for the preset evaluation item, to obtain the object evaluation value of the candidate object.

[0203] The candidate objects are determined based on the designated objects contained in the video image.

[0204] The preset evaluation items include at least one of the following: a completeness evaluation item, a clarity evaluation item, and a stability evaluation item; the completeness evaluation item is used to represent: an average value of the completeness of the candidate object in each corresponding second video frame; the clarity evaluation item is used to represent: a proportion of the foreground in the first image area corresponding to the candidate object; the first image area corresponding to the candidate object represents: an image area occupied by the candidate object in each corresponding second video frame;

[0205] The stability evaluation item includes at least one of the following: a regional stability evaluation item and an area stability evaluation item; the regional stability evaluation item is used to characterize: the change amplitude of the first image area corresponding to the candidate object; the area stability evaluation item is used to characterize: the proportion of image areas with an area smaller than a second preset threshold in each first image area corresponding to the candidate object.

[0206] Accordingly, based on the position of each designated object in the corresponding second video frame, determining the implantation position of the three-dimensional image resource in the video image (S1031) includes:

[0207] Step S10311: Determine a target object from among the candidate objects based on the object evaluation value of each candidate object.

[0208] Step S10312: Determine an implantation position of the three-dimensional image resource in the video image based on the position of the target object in the corresponding second video frame.

[0209] In the embodiment of the present application, if the first video frame contains multiple specified objects, then for any one of the multiple specified objects, multiple first video frames containing the specified object can be determined, and the multiple first video frames are the second video frames corresponding to the specified object. For example, based on the similarity between the image areas occupied by the specified objects in the first video frames, it can be determined whether the specified objects contained in any two first video frames are the same object.

[0210] In one implementation, each designated object determined in the first video frame may be directly determined as a candidate object.

[0211] In another implementation, the candidate objects may be determined by screening the designated objects determined in the first video frame. Figure 5 , Figure 5The fifth flow chart of the implantation position determination method provided in the embodiment of the present application. Before calculating the evaluation value of each candidate object included in the video image based on each second video frame corresponding to the candidate object for the preset evaluation item and obtaining the object evaluation value of the candidate object (S104), the implantation position determination method further includes:

[0212] Step S105: for each designated object included in the video image, based on each second video frame corresponding to the designated object, obtain the appearance duration of the designated object in the video image.

[0213] Step S106: Determine whether the appearance duration of the designated object is greater than a preset duration.

[0214] Step S107: If the appearance duration of the designated object is greater than the preset duration, the designated object is determined as a candidate object.

[0215] In an embodiment of the present application, the duration of appearance of each designated object in the video image can be obtained based on each second video frame corresponding to each designated object. For example, the number of second video frames corresponding to the designated object can be counted to indicate the duration of appearance of the designated object in the video image. Accordingly, the preset duration can be a preset number of frames, for example, 144 frames or 192 frames.

[0216] Alternatively, the duration of each second video frame corresponding to the specified object in the video image may be counted as the duration of appearance of the specified object in the video image. Accordingly, the preset duration may be a preset time length, for example, 6 seconds or 8 seconds.

[0217] The longer the appearance time of the designated object in the video image, the better the implantation effect will be if the three-dimensional image resource is implanted at the position of the designated object. Therefore, the designated objects can be screened based on the appearance time, that is, the position of the designated object with a shorter appearance time is not suitable for implanting the three-dimensional image resource.

[0218] In addition, based on the appearance duration of the designated objects, the designated objects in the video image are screened, and the designated objects with longer appearance durations are determined as candidate objects, so that the designated objects with shorter appearance durations can be screened out. Furthermore, based on the designated objects with longer appearance durations (i.e., candidate objects), the implantation position of the three-dimensional image resource in the video image can be determined, without executing the subsequent step S104 for each designated object, thereby further improving the efficiency of implantation position determination.

[0219] For each candidate object, based on each second video frame corresponding to the candidate object, an evaluation value of the candidate object for the preset evaluation item is calculated to obtain an object evaluation value of the candidate object.

[0220] It can be understood that the greater the average value of the completeness of the candidate object in the corresponding second video frames, the more complete the three-dimensional image resource can be implanted in the position of the candidate object in the video image. Therefore, the specified object can be screened based on the completeness evaluation item.

[0221] As mentioned above, the clarity evaluation item of a candidate object is used to characterize the proportion of the foreground in the first image area corresponding to the candidate object. The first image area corresponding to the candidate object is the image area occupied by the candidate object in each corresponding second video frame. Specifically, the first image area can be the image area corresponding to the minimum circumscribed rectangle of the candidate object in the corresponding second video frame. The first image area can be marked with a target frame, that is, the target frame is a frame represented by the boundary of the first image area.

[0222] In addition, in order to highlight the foreground in the video image, the background is often processed in a defocused manner, so the foreground in the video image is clearer. Therefore, the higher the proportion of the foreground in the first image area corresponding to the candidate object, the higher the proportion of the foreground in the first image area corresponding to the candidate object. Accordingly, the three-dimensional image resource can be implanted at the position of the candidate object in the video image, so that the implanted three-dimensional image resource can be clearer in the video image. Therefore, the specified object can be screened based on the clarity evaluation item.

[0223] In one embodiment, the clarity evaluation item may be used to characterize the clarity of the first image region corresponding to the candidate object, wherein the clarity of the first image region corresponding to the candidate object may be obtained based on a preset clarity evaluation method. For example, the preset clarity evaluation method may be a Tenengrad (a gradient-based function) gradient method, a Laplacian gradient method, or a variance method.

[0224] In addition, the smaller the change amplitude of the first image area corresponding to the candidate object, the smaller the proportion of the image area in the first image area corresponding to the candidate object that is smaller than the second preset threshold, which means that the position of the candidate object in the video image is relatively stable and the area is relatively large. Accordingly, the three-dimensional image resource is implanted at the position of the candidate object in the video image, which can make the implanted three-dimensional image resource appear more stable in the video image. Furthermore, the effect of implanting the three-dimensional image resource can be better. Therefore, the specified object can be screened based on the stability evaluation item.

[0225] It can be understood that the preset evaluation items may include any one or any two of the completeness evaluation item, the clarity evaluation item and the stability evaluation item, or may also include all three items.

[0226] Correspondingly, the evaluation value of each candidate object for the preset evaluation item (i.e., the object evaluation value) can be obtained based on any one, any two, or any three of the evaluation values ​​of the completeness evaluation item (which can be called the detection score), the evaluation value of the clarity evaluation item (which can be called the clarity score), and the evaluation value of the stability evaluation item (which can be called the stability score) of each candidate object in the corresponding second video frames.

[0227] The object evaluation value is positively correlated with the calculated multiple evaluation values. For example, the sum of the calculated multiple evaluation values ​​can be used as the object evaluation value. In addition, when calculating the sum, weights can be set for different evaluation items respectively, and then the weighted sum of the multiple evaluation values ​​can be calculated as the object evaluation value.

[0228] For example, the candidate object with the highest object evaluation value can be determined as the target object. In this way, the implantation position can be automatically determined by the electronic device, which can reduce labor costs and improve the efficiency of determining the implantation position compared to manually browsing video images to determine the implantation position. Alternatively, multiple candidate objects with the highest object evaluation values ​​can be selected as the target object. Subsequently, the multiple candidate objects and their corresponding object evaluation values ​​can be provided to the user, so that the user can further screen the multiple candidate objects.

[0229] Based on the above processing, the target object can be determined from the candidate objects based on the preset evaluation items, and then the position of the target object in the video image can be determined as the implantation position for implanting the three-dimensional image resource in the video image. In this way, the implantation position with a better effect of implanting the three-dimensional image resource can be determined, and the efficiency of implantation position determination is improved while improving the effect of implanting the three-dimensional image resource at the determined implantation position.

[0230] In one embodiment, see Figure 6 , Figure 6 A flowchart for determining a set of video frames containing the same specified object is provided in an embodiment of the present application.

[0231] Step S601: Obtain the i-th frame of the picture. That is, obtain the i-th frame of the picture in the video image as the current video frame to be processed, and the initial value of i is 1.

[0232] Step S602: Target detection: That is, based on the target detection algorithm, it is detected whether the current video frame to be processed contains a specified object.

[0233] Step S603: Determine whether there is a target. That is, based on the result of target detection, determine whether the current video frame to be processed contains a target (i.e., a specified object). If the current video frame to be processed contains a target, execute step S604; if the current video frame to be processed does not contain a target, execute step S605.

[0234] Step S604: Determine whether there is a target in the previous frame. That is, determine whether the specified object is determined in the previous video frame of the current video frame to be processed. If the specified object is determined in the previous video frame of the current video frame to be processed, execute step S606; if the specified object is not determined in the previous video frame of the current video frame to be processed, execute step S607.

[0235] Step S605: Determine whether the duration of continuous absence of detection results exceeds a threshold. That is, determine whether there are a preset number of continuous fourth video frames before the current video frame to be processed. The fourth video frame represents a video frame determined not to contain the specified object. If there are a preset number of continuous fourth video frames before the current video frame to be processed, then end; if there are no preset number of continuous fourth video frames before the current video frame to be processed, then execute step S607.

[0236] The end here only ends the process for the specified object, and the process for other specified objects can continue.

[0237] Step S606: Determine whether the degree of coincidence with the target of the previous frame reaches a threshold. That is, determine whether the specified object detected in the current video frame to be processed is the same object as the specified object determined in the previous video frame. If the specified object detected in the current video frame to be processed is the same object as the specified object determined in the previous video frame, execute step S608; if the specified object detected in the current video frame to be processed is not the same object as the specified object determined in the previous video frame, execute step S607.

[0238] Step S607: target tracking. That is, based on the target tracking algorithm, target tracking is performed on the specified object determined in the current third video frame. The current third video frame is the video frame containing the specified object determined last time.

[0239] Step S608: Update object_result. After updating object_result, return to step S601 and assign the value of i to i+1.

[0240] Step S609: Determine whether the target is tracked. That is, determine whether the specified object determined in the current third video frame is tracked in the current video frame to be processed. If the specified object determined in the current third video frame is tracked in the current video frame to be processed, then execute step S608; if the specified object determined in the current third video frame is not tracked in the current video frame to be processed, then end.

[0241] In the embodiment of the present application, object_result is a set of detection and tracking results obtained after target detection and tracking of the specified object, which is used to record the detection and tracking results of each specified object. For each specified object, the detection and tracking results of the specified object are shown in Table (1). The information recorded in Table (1) is as follows:

[0242] TrackId, data type is Int (integer), target tracking result ID, that is, the target ID in the above embodiment.

[0243] Label, data type is Str (string type), target tracking result label, that is, the category of the specified object. The category of the specified object can be dining table, desk, coffee table, or bedside table.

[0244] DetectScore, data type is List, target detection score, that is, the probability of containing a specified object in a video frame based on the target detection algorithm (which can be called the first probability). For a video frame, if the first probability is greater than the preset detection probability threshold, it is determined that the video frame contains the specified object, and the DetectScore corresponding to the video frame is recorded as the first probability. If the first probability is less than the preset detection probability threshold, it is determined that the video frame does not contain the specified object, and the DetectScore corresponding to the video frame is recorded as -1. The preset detection probability threshold can be 0.7 or 0.8.

[0245] TrackScore, data type is List, target tracking score, that is, the probability (which can be called the second probability) that a specified object is contained in a video frame based on the target tracking algorithm. For a video frame, if the second probability is greater than the preset tracking probability threshold, it is determined that the video frame contains the specified object, and the TrackScore corresponding to the video frame is recorded as the second probability. If the second probability is less than the preset tracking probability threshold, it is determined that the video frame does not contain the specified object, and the TrackScore corresponding to the video frame is recorded as -1. The preset tracking probability threshold can be 0.7 or 0.8.

[0246] FrameId, data type is List, contains the frame number of the target, that is, the serial number of the video frame containing the specified object. For example, there are N video frames in the video image, and the video frames in the video image can be numbered in sequence. Then, the serial number of each video frame in the video image can be obtained, and when the video frame containing the specified object is determined, the serial number of the video frame can be recorded.

[0247] Box, data type is List, the position of the target in each frame, that is, the position of the specified object in each video frame containing the specified object. It can be the position of the target box in the above embodiment, and accordingly, the coordinate representation of the four vertices of the target box can be recorded.

[0248] Table (1)

[0249]

[0250]

[0251] In one embodiment, the evaluation value of a candidate object for the completeness evaluation item is calculated in the following manner:

[0252] For each second video frame corresponding to the candidate object, a detection value corresponding to the second video frame is obtained as the completeness of the candidate object in the second video frame, wherein the detection value corresponding to the second video frame represents the probability of determining that the candidate object is contained in the second video frame.

[0253] For each video frame set corresponding to the candidate object, an average value of the completeness of the candidate object in each second video frame included in the video frame set is calculated as the average completeness of the candidate object in the video frame set.

[0254] An average value of the average completeness of the candidate object in each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the completeness evaluation item.

[0255] It can be understood that, for each candidate object, the video frames included in each video frame set corresponding to the candidate object are all second video frames corresponding to the candidate object. The second video frames belonging to the same video frame set have the same target ID.

[0256] In the embodiment of the present application, the detection value corresponding to the candidate object in each second video frame is the probability that the candidate object is included in the second video frame, which can be the larger value of the DetectScore and TrackScore in the above embodiment corresponding to the candidate object in each second video frame, or it can also be the intersection and union ratio of the target frame predicted by the candidate object in each second video frame and the actual target frame. The greater the probability that the candidate object is included in the second video frame, the greater the detection value corresponding to the second video frame, and then the greater the average completeness of the candidate object in each video frame set corresponding to the candidate object. The greater the average completeness of the candidate object, the more complete the candidate object appears in the video image. The average value of the average completeness of the candidate object in each video frame set corresponding to the candidate object is determined as the evaluation value of the candidate object for the completeness evaluation item, which can make the evaluation value of the relatively complete candidate object appearing in the video image for the completeness evaluation item higher. Based on this, a relatively complete implantation position can be selected to further ensure the effect of implantation of three-dimensional image resources.

[0257] Alternatively, for each second video frame corresponding to the alternative object, obtain the detection value corresponding to the second video frame as the completeness of the alternative object in the second video frame, and calculate the average value of the completeness of the alternative object in each second video frame corresponding to the alternative object as the evaluation value of the alternative object for the completeness evaluation item.

[0258] In one embodiment, the average completeness of the video frame set with target ID i can be calculated based on formula (1):

[0259]

[0260] Among them, score1 i is the average completeness of the video frame set with target ID i, EndId is the serial number of the last video frame in the video frame set with target ID i, StartId is the serial number of the first video frame in the video frame set with target ID i, DetectScore j TrackScore is the target detection score of the jth frame in the video frame set with target ID i. j is the target tracking score of the jth frame in the video frame set with target ID i. j is the sequence number of the video frame in the video frame set with target ID i.

[0261] The evaluation value of the candidate object for the completeness evaluation item can be calculated based on formula (2):

[0262] score1=mean(score1 i∈Ω ) (2)

[0263] Wherein, score1 is the evaluation value of the candidate object for the completeness evaluation item, and Ω is a set of target IDs corresponding to each set of video frames containing the candidate object.

[0264] In one embodiment, the evaluation value of a candidate object for the clarity evaluation item is calculated in the following manner:

[0265] For each second video frame corresponding to the candidate object, the proportion of the foreground in the first image area corresponding to the candidate object in the second video frame is calculated as the clarity of the candidate object in the second video frame.

[0266] For each video frame set corresponding to the candidate object, an average value of the clarity of the candidate object in each second video frame included in the video frame set is calculated as the average clarity of the candidate object in the video frame set.

[0267] The maximum value of the average definition of the candidate object in each video frame set corresponding to the candidate object is determined as the evaluation value of the candidate object for the definition evaluation item.

[0268] In the embodiment of the present application, the video image is divided into a foreground and a background, the foreground is relatively clear, and the background is relatively blurred. In order to ensure the effect of implanting the three-dimensional image resource, it is necessary to make the proportion of the foreground in the implantation position higher.

[0269] For example, for each video frame in a video image, foreground detection can be performed on the video frame through a foreground detection network. Then, a binary matrix consistent with the pixel size of the video frame can be obtained, in which the pixel value corresponding to the foreground pixel is 1, and the pixel value corresponding to the background pixel is 0. The foreground detection network can be trained based on the frame difference method, the optical flow method or the average background method.

[0270] like Figure 7 As shown, Figure 7 A schematic diagram of a foreground portion of a video frame provided in an embodiment of the present application. Figure 7 The part selected by the dotted line is the detected foreground in the video frame, and the part selected by the solid line is the target frame in the video frame.

[0271] For the j-th video frame with target ID i, we use the foreground detection network to obtain mas k i, , that is, a binary matrix with the same pixel size as the video frame. The target box corresponding to the specified object in the video frame can be expressed as b oxi, =[x1 i,j ,1 i, ,2 i, ,2i, ],(1 i,j ,1 i, ) and (2 i,j ,2 i, ) are the coordinates of the upper left corner vertex and the lower right corner vertex of the target box respectively. The clarity of the candidate object in the j-th video frame with target ID i can be calculated based on formula (3):

[0272]

[0273] in, score 2 i, is the clarity of the candidate object in the j-th video frame with target ID i, mask i,j (,c) is the coordinate of the target ID i in the j-th frame of the video. ( ,c ) The pixel value corresponding to the pixel point.

[0274] The average definition of the candidate object in the video frame set can be calculated based on formula (4):

[0275]

[0276] in, score 2 i is the average definition of the video frame set with target ID i, E n dId is the sequence number of the last video frame in the video frame set with target ID i, S tart Id is the sequence number of the first video frame in the video frame set with target ID i, score 2 i, is the definition of the candidate object in the j-th video frame with target ID i, and j is the sequence number of the video frame in the video frame set with target ID i.

[0277] The evaluation value of the candidate object for the clarity evaluation item can be calculated based on formula (5):

[0278] score2=max(score2i∈Ω) (5)

[0279] in, score2 is the evaluation value of the candidate object for the clarity evaluation item, and Ω is the set of target IDs corresponding to the set of video frames containing the candidate object.

[0280] In one embodiment, for each second video frame corresponding to the candidate object, the clarity of the first image area corresponding to the candidate object in the second video frame can be calculated based on a preset clarity evaluation method as the clarity of the candidate object in the second video frame.

[0281] For each video frame set corresponding to the candidate object, an average value of the clarity of the candidate object in each second video frame included in the video frame set is calculated as the average clarity of the candidate object in the video frame set.

[0282] The maximum value of the average definition of the candidate object in each video frame set corresponding to the candidate object is determined as the evaluation value of the candidate object for the definition evaluation item.

[0283] In one embodiment, the regional stability evaluation item includes at least one of the following: a first regional stability evaluation sub-item and a second regional stability evaluation sub-item.

[0284] The evaluation value of a candidate object corresponding to the first regional stability evaluation sub-item is calculated in the following way:

[0285] For each second video frame corresponding to the candidate object, obtaining the coordinates of the center point of the first image region corresponding to the candidate object in the second video frame as the coordinates to be processed corresponding to the second video frame; and calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame;

[0286] For each video frame set corresponding to the candidate object, calculate the standard deviation of the coordinates to be processed corresponding to each second video frame included in the video frame set as the first standard deviation corresponding to the video frame set;

[0287] Calculating an average value of first areas to be processed corresponding to each second video frame included in the video frame set as an average area corresponding to the video frame set;

[0288] Calculating a ratio of a first standard deviation corresponding to the video frame set to an average area corresponding to the video frame set as the central point stability corresponding to the video frame set;

[0289] An average value of the central point stability corresponding to each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the first region stability evaluation sub-item.

[0290] In one embodiment, in a video frame set with a target ID of i, for each candidate object, the coordinates of the center point of each target frame corresponding to the candidate object can be obtained based on formula (6):

[0291] center i=[(x1 i,StarId +x2 i,StarId ,y1 i,StarId +y2 i,StarId ) / 2,…,(x1 i,EndId +x2 i,EndId ,y1 i,EndId +y2 i,EndId ) / 2] (6)

[0292] Among them, center i are the coordinates of the center points of the target frames corresponding to the candidate object, EndId is the sequence number of the last video frame of the video frame set with target ID i, and StartId is the sequence number of the first video frame of the video frame set with target ID i.

[0293] The center point stability corresponding to the video frame set is calculated based on formula (7):

[0294]

[0295] in, is the center point stability corresponding to the video frame set, std[center i ] is the first standard deviation corresponding to the video frame set, mean[area i ] is the average area corresponding to the video frame set.

[0296] The first area to be processed corresponding to the second video frame in the video frame set with target ID i is calculated based on formula (8):

[0297] area i =[(x2 i,StarId -x1 i,StartId )(y2 i,StarId -y1 i,StartId ),…,(x2 i,StarId -x1 i,EndId )(y2 i,StarId -y1 i,EndId ) (8)

[0298] Among them, area i is the first area to be processed corresponding to the second video frame in the video frame set with target ID i, EndId is the sequence number of the last video frame in the video frame set with target ID i, and StartId is the sequence number of the first video frame in the video frame set with target ID i.

[0299] The evaluation value of the candidate object for the first region stability evaluation sub-item is the average value of the central point stabilities corresponding to each video frame set corresponding to the candidate object.

[0300] The evaluation value of a candidate object corresponding to the second regional stability evaluation sub-item is calculated in the following way:

[0301] For each second video frame corresponding to the candidate object, calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame;

[0302] For each video frame set corresponding to the candidate object, calculate the standard deviation of the first to-be-processed area corresponding to each second video frame included in the video frame set as the second standard deviation corresponding to the video frame set;

[0303] An average value of second standard deviations corresponding to each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the second region stability evaluation sub-item.

[0304] In one embodiment, the second standard deviation corresponding to the set of video frames with target ID i is calculated based on formula (9):

[0305]

[0306] in, is the second standard deviation of the video frame set with target ID i, area i is the first area to be processed corresponding to the second video frame in the video frame set with target ID i.

[0307] The evaluation value of the candidate object for the second region stability evaluation sub-item is the average value of the second standard deviations corresponding to each video frame set corresponding to the candidate object.

[0308] In one embodiment, the evaluation value of a candidate object for the area stability evaluation item is calculated in the following manner:

[0309] For each second video frame corresponding to the candidate object, the first area to be processed corresponding to the second video frame is compared with the second preset threshold.

[0310] For each video frame set corresponding to the candidate object, the proportion of video frames whose first to-be-processed area is smaller than a second preset threshold in each second video frame contained in the video frame set is calculated as the area stability of the candidate object in the video frame set.

[0311] An average value of the area stability of the candidate object in each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the area stability evaluation item.

[0312] The first area to be processed corresponding to the second video frame with sequence number j in the video frame set with target ID i is obtained based on formula (10), (x1i,j ,y1 i,j ) and (x2 i,j ,y2 i,j ) are the coordinates of the upper left corner vertex and the lower right corner vertex of the target box in the second video frame.

[0313] A i,j =(x2 i,j -x1 i,j )(y2 i,j -y1 i,j ) (10)

[0314] Among them, A i,j It is the first area to be processed corresponding to the second video frame with a sequence number of j in the video frame set with a target ID of i.

[0315] The proportion of video frames whose first to-be-processed area is smaller than the second preset threshold in each second video frame included in the video frame set with target ID i can be calculated based on formula (11):

[0316]

[0317] in, is the proportion of video frames whose first to-be-processed area is smaller than the second preset threshold in each second video frame included in the video frame set with target ID i, EndId is the sequence number of the last video frame in the video frame set with target ID i, and StartId is the sequence number of the first video frame in the video frame set with target ID i. A i, is the first area to be processed corresponding to the second video frame with sequence number j in the video frame set with target ID i, j is the sequence number of the video frame in the video frame set with target ID i, t h m is the second preset threshold. i, <th m ) is the indicator function, if A i, <th m ,but I(A i, <th m ) has a value of 1, otherwise I(A i, <th m ) is 0. The second preset threshold can be set according to the type of candidate object and is not specifically limited.

[0318] The evaluation value of the candidate object for the area stability evaluation item can be calculated based on formula (12):

[0319]

[0320] in, score 3c is the evaluation value of the candidate object for the area stability evaluation item, and Ω is the set of target IDs corresponding to the set of video frames containing the candidate object.

[0321] In one embodiment, the evaluation value of a candidate object for the stability evaluation item may be negatively correlated with the evaluation value for the first region stability evaluation sub-item, the evaluation value for the second region stability evaluation sub-item, and the evaluation value for the area stability evaluation item. For example, the evaluation value of a candidate object for the stability evaluation item may be calculated based on formula (13):

[0322]

[0323] in, score 3 is the evaluation value of the candidate object for the stability evaluation item, score 3a is the evaluation value of the candidate object for the first region stability evaluation sub-item, score 3b is the evaluation value of the candidate object for the second region stability evaluation sub-item, score 3c is the evaluation value of the candidate object for the area stability evaluation item, and p is a preset parameter, which can be 0.5 or 1.

[0324] In the embodiment of the present application, the stability of the candidate object in each corresponding second video frame can be determined based on the position coordinates of the candidate object in each corresponding second video frame and the area of ​​the image region occupied. Thus, the candidate object with a relatively stable position in the video image can be selected, which can make the implanted three-dimensional image resource appear more stable in the video image. Thus, the implantation effect of the three-dimensional image resource can be better.

[0325] In one embodiment, see Figure 8 , Figure 8 A flowchart of calculating the evaluation value of a candidate object for a preset evaluation item is provided in an embodiment of the present application. A pit position corresponds to a candidate object, and the position of the candidate object in a video frame can be called a pit position.

[0326] Step S801: duration filtering, that is, for each designated object contained in the video image, based on each second video frame corresponding to the designated object, obtain the appearance duration of the designated object in the video image; determine whether the appearance duration of the designated object is greater than the preset duration; if the appearance duration of the designated object is greater than the preset duration, determine the designated object as a candidate object.

[0327] Step S802: Calculate the pit detection score score1, that is, calculate the evaluation value of the candidate object for the completeness evaluation item.

[0328] Step S803: calculating the pit clarity score score2, that is, calculating the evaluation value of the candidate object for the clarity evaluation item.

[0329] Step S804: calculating the pit stability score score3, that is, calculating the evaluation value of the candidate object for the stability evaluation item.

[0330] Step S805: Calculate the total score of the pit, that is, calculate the evaluation value of the candidate object for the preset evaluation items.

[0331] The evaluation value of the candidate object for the preset evaluation item may be the sum of the evaluation value of the candidate object for the completeness evaluation item, the evaluation value of the candidate object for the clarity evaluation item, and the evaluation value of the candidate object for the stability evaluation item.

[0332] In one embodiment, before determining the video frames in the video frame set including the same designated object as the second video frames corresponding to the designated object based on the similarity between the image areas occupied by the designated object in the video frames, the implantation position determination method further includes:

[0333] Step 1: Based on the scene segmentation algorithm, determine the scene to which each video frame in the video image belongs.

[0334] Based on the similarity between the image areas occupied by the designated objects in the video frames, video frames in a set of video frames including the designated objects as the same object are determined as second video frames corresponding to the designated objects, including:

[0335] Step 2: For each scene, based on the similarity between the image areas occupied by the specified object in the video frame, from the video frame sets belonging to the scene, determine the video frame set that contains the specified object as the same object as the video frame set corresponding to the specified object.

[0336] Step three: Determine the video frames in the video frame set corresponding to the designated object as the second video frames corresponding to the designated object.

[0337] In an embodiment of the present application, each video frame in the video image can be divided according to the scene to which it belongs based on a scene segmentation algorithm. The scene segmentation algorithm can be a pixel comparison method, a histogram comparison method, an edge comparison method, or a block matching method, or can also be based on a pre-trained convolutional neural network for scene segmentation.

[0338] Since a specified object in a video image often only appears in one scene, for each scene, the video frame sets belonging to the scene can be associated, that is, from the video frame sets belonging to the scene, the video frame sets containing the same specified object are determined as the video frame sets corresponding to the specified object. There is no need to compare the video frame sets contained in the entire video image, which can further improve the efficiency of determining the implantation position.

[0339] In one embodiment, shot segmentation can be performed before scene segmentation, and each video frame in the video image can be divided according to the shot to which it belongs based on a shot segmentation algorithm. The shot segmentation algorithm can be a pixel comparison method, a histogram comparison method, an edge comparison method, or a block matching method. Since a specified object in a video image often only appears in one shot, for each shot, the video frame sets belonging to the shot can be associated, that is, from the video frame sets belonging to the shot, the video frame sets containing the specified object as the same object are determined as the video frame sets corresponding to the specified object. Without comparing the video frame sets contained in the entire video image, the efficiency of determining the implantation position can be further improved.

[0340] After the shot is split, the start frame number (StartFrame), end frame number (EndFrame) and shot number (ShotId) of each shot can be obtained. After the scene is split, the shot number contained in each scene can be obtained.

[0341] In one embodiment, see Fig. 9 , Fig. 9 A flowchart for clustering a set of video frames is provided in an embodiment of the present application.

[0342] Step S901: randomly extracting a preset number of video frames corresponding to each target ID in the same scene, wherein the preset number may be 5 or 6.

[0343] Step S902: crop the video frame to extract the target part according to the detection frame. The detection frame is the target frame in the above embodiment.

[0344] Step S903: Use the trained deep learning network to calculate the similarity between the images. That is, use the deep learning network to calculate the similarity between the images corresponding to the extracted target parts.

[0345] Step S904: Cluster the target IDs according to similarity. For example, the K-means clustering algorithm or the AGNES clustering algorithm can be used to cluster the target IDs in combination with similarity. After clustering the target IDs, the clustering results can be obtained, as shown in Table (2). The information recorded in Table (2) includes: a target ID set, the data type is List (list type), and the target ID of the video frame set containing the same specified object. Implantation position category, the data type is Str (string type). Duration, the data type is List (list type), the cumulative time from the start of the implantation position to the end of the implantation position. Associated pit positions, the data type is List (list type), for the set of target IDs of the video frame set containing the same specified object, a corresponding pit position number can be set to represent a pit position, and then, the same pit position number is used to mark the pit positions containing the same specified object belonging to the same scene.

[0346] Table (2)

[0347]

[0348] See also Fig.10 , Fig.10 A schematic diagram of a video frame set clustering result provided in an embodiment of the present application. Fig.10 As shown, the lens with lens number k includes four types of objects: dining table, desk, coffee table, and bedside table. Among them, the dining table category includes: dining table 1 and dining table 2. The video frames in the video frame set with target IDs 0, 5, and 6 include dining table 1, and the video frames in the video frame set with target IDs 10 and 11 include dining table 2. The desk category includes: desk 1 and desk 2. The video frames in the video frame set with target IDs 1 and 3 include desk 1, and the video frames in the video frame set with target IDs 5, 6, and 7 include desk 2. The coffee table category includes coffee table 1, and the video frames in the video frame set with target IDs 7 and 8 include coffee table 1. The bedside table category includes: bedside table 1 and bedside table 2. The video frames in the video frame set with target ID 2 include bedside table 1, and the video frames in the video frame set with target IDs 12, 13, and 15 include bedside table 2.

[0349] See also Fig.11 , Fig.11 A schematic diagram of another video frame set clustering result provided in an embodiment of the present application. Fig.11As shown in the figure, the scene with scene number k includes four types of objects: dining table, office desk, coffee table, and bedside table. Among them, the dining table class includes: dining table 1, dining table 2, and dining table 3. The video frames in the video frame set with target IDs 0, 5, and 6 include dining table 1, the video frames in the video frame set with target IDs 10 and 11 include dining table 2, and the video frames in the video frame set with target IDs 13 and 14 include dining table 3. Dining table 1 and dining table 2 belong to lens A, and dining table 3 belongs to lens B, and dining table 1 and dining table 3 are the same target.

[0350] The office desk class includes: office desk 1, office desk 2, office desk 3, office desk 4 and office desk 5. The video frames in the video frame set with target IDs 1 and 3 include office desk 1, the video frames in the video frame set with target IDs 5, 6 and 7 include office desk 2, the video frames in the video frame set with target IDs 16 and 17 include office desk 3, the video frames in the video frame set with target ID 19 include office desk 4, and the video frames in the video frame set with target IDs 21 and 22 include office desk 5. Office desk 1 and office desk 2 belong to lens A, and office desk 3, office desk 4 and office desk 5 belong to lens B. And office desk 2 and office desk 4 are the same target.

[0351] The coffee table category includes coffee table 1 and coffee table 2. The video frames in the video frame set with target IDs 7 and 8 include coffee table 1, and the video frames in the video frame set with target IDs 18 and 20 include coffee table 2. Coffee table 1 belongs to shot A, and coffee table 2 belongs to shot B.

[0352] The bedside table class includes: bedside table 1 and bedside table 2. The video frames in the video frame set with target ID 2 include bedside table 1, and the video frames in the video frame sets with target IDs 12 and 15 include bedside table 2. Bedside table 1 and bedside table 2 belong to shot B.

[0353] In one embodiment, see Fig.12 , Fig.12 This is a sixth flow chart of the implantation position determination method provided in an embodiment of the present application.

[0354] Step S1201: input video, that is, obtain the video image that needs to be embedded with three-dimensional image resources.

[0355] Step S1202: Perform target detection and tracking, that is, based on the target detection algorithm and the target tracking algorithm, determine a set of video frames containing the same specified object, that is, steps S601 to S609 in the above embodiment.

[0356] Step S1203: Shot and scene segmentation, that is, based on the shot segmentation algorithm and the scene segmentation algorithm, determining the shot to which each video frame in the video image belongs and the scene to which each shot belongs.

[0357] It is understandable that step S1202 and step S1203 may be performed asynchronously, in parallel or sequentially. Based on the detection and tracking results obtained in step S1202, and the shots to which each video frame belongs and the scenes to which each shot belongs in the video image obtained in step S1203, the pit positions are aggregated.

[0358] Step S1204: Pit position aggregation, that is, for each shot, based on the similarity between the image areas occupied by the designated object in the video frame, from the video frame sets belonging to the shot, a video frame set containing the designated object as the same object is determined as the video frame set corresponding to the designated object. The video frames in the video frame set corresponding to the designated object are determined as the second video frames corresponding to the designated object.

[0359] Step S1205: scoring the pit position, that is, determining the candidate objects based on the designated objects contained in the video image, and for each candidate object contained in the video image, calculating the evaluation value of the candidate object for the preset evaluation items based on the second video frames corresponding to the candidate object, to obtain the object evaluation value of the candidate object.

[0360] Step S1206: Output the pit information, that is, determine the target object based on the object evaluation value of each candidate object, and provide the target object and the object evaluation value corresponding to the target object to the user. For example, the candidate objects can be sorted in order from high to low according to the object evaluation value of each candidate object, and then the candidate object with the highest object evaluation value can be determined as the target object. Alternatively, multiple candidate objects with the highest object evaluation values ​​can be selected as the target object. Subsequently, the multiple candidate objects and their corresponding object evaluation values ​​can be provided to the user, so that the user can further filter the multiple candidate objects.

[0361] Corresponding to the above method embodiment, the present application embodiment also provides an implantation position determination device, see Fig.13 , Fig.13 A schematic diagram of the structure of an implantation position determination device provided in an embodiment of the present application, the device comprising:

[0362] The video image acquisition module 1301 is used to acquire the video image that needs to be embedded with the three-dimensional image resource.

[0363] The first determination module 1302 is used to determine a video frame containing a specified object in the video image based on a target detection algorithm as a first video frame. When a three-dimensional image resource is implanted at the position of the specified object in the first video frame, an intersection-and-union ratio of an image area occupied by the three-dimensional image resource and an image area occupied by the specified object is less than a first preset threshold.

[0364] The implantation position determination module 1303 is used to determine an implantation position for implanting a 3D image resource in a video image based on the position of a designated object in the first video frame.

[0365] Based on the above processing, the designated object in the video image can be determined. Since when the three-dimensional image resource is implanted at the position of the designated object in the first video frame, the intersection-and-union ratio of the image area occupied by the three-dimensional image resource and the image area occupied by the designated object is less than the first preset threshold, that is, the three-dimensional image resource can be implanted at the position of the designated object. Accordingly, the implantation position of the three-dimensional image resource in the video image can be determined according to the position of the designated object in the first video frame. Based on this, the automatic detection of the implantation position by the electronic device can reduce the labor cost and improve the efficiency of determining the implantation position compared with manually browsing the video image to determine the implantation position.

[0366] In one embodiment, the first determining module 1302 includes:

[0367] A first determination submodule is used to determine, based on a target detection algorithm, video frames of the same object as the designated objects contained in the video image as the second video frames corresponding to the designated object;

[0368] The implantation position determination module 1303 includes:

[0369] The implantation position determination submodule is used to determine the implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame.

[0370] In one embodiment, the first determining submodule includes:

[0371] A first determining unit, configured to determine a current video frame to be processed in the video image according to an order between video frames in the video image;

[0372] A designated object detection unit is used to detect whether the current video frame to be processed contains a designated object based on a target detection algorithm;

[0373] A first judgment unit is used to judge whether the specified object is determined in a previous video frame of the current video frame to be processed if it is determined based on the target detection algorithm that the current video frame to be processed contains the specified object;

[0374] A second judgment unit is used to judge whether the specified object detected in the current video frame to be processed and the specified object determined in the previous video frame are the same object if the specified object is determined in the previous video frame of the current video frame to be processed;

[0375] A second determining unit is used to determine that the current video frame to be processed and the previous video frame belong to a set of video frames containing the same specified object if the specified object detected in the current video frame to be processed is the same object as the specified object determined in the previous video frame; and return to execute the step of determining the current video frame to be processed in the video image according to the order of the video frames in the video image;

[0376] The third determining unit is used to determine the video frames in the video frame set including the designated object as the same object as the second video frames corresponding to the designated object based on the similarity between the image areas occupied by the designated object in the video frames.

[0377] In one embodiment, the apparatus further comprises:

[0378] a scene determination module, configured to determine the scene to which each video frame in the video image belongs based on a scene segmentation algorithm before determining the video frames in the set of video frames containing the same designated object as the second video frames corresponding to the designated object based on the similarity between the image areas occupied by the designated object in the video frames;

[0379] The third determination unit is specifically used to determine, for each scene, based on the similarity between the image areas occupied by the specified objects in the video frames, a set of video frames that contain the specified object as the same object from the sets of video frames belonging to the scene, as the set of video frames corresponding to the specified object; and determine the video frames in the set of video frames corresponding to the specified object as the second video frames corresponding to the specified object.

[0380] In one embodiment, the apparatus further comprises:

[0381] A second determination module is used to determine the video frame containing the specified object determined last time as the current third video frame if the specified object detected in the current video frame to be processed is not the same object as the specified object determined in the previous video frame, or if the specified object is not determined in the previous video frame of the current video frame to be processed, or if it is determined based on the target detection algorithm that the current video frame to be processed does not contain the specified object;

[0382] A designated object tracking module, used to determine whether the designated object determined in the current third video frame is tracked in the current video frame to be processed based on a target tracking algorithm;

[0383] A video frame set determination module is used to determine that the current video frame to be processed and the current third video frame belong to a video frame set containing the same specified object if the specified object determined in the current third video frame is tracked in the current video frame to be processed based on the target tracking algorithm; and trigger the first determination unit.

[0384] In one embodiment, the apparatus further comprises:

[0385] A first judgment module is used for, when it is determined based on the target detection algorithm that the current video frame to be processed does not contain the specified object, and before determining the video frame containing the specified object determined last time as the current third video frame, judging whether there are a preset number of continuous fourth video frames before the current video frame to be processed; wherein the fourth video frame represents the video frame determined not to contain the specified object;

[0386] The second determination module is specifically used to determine the video frame containing the specified object determined last time as the current third video frame when there is no preset number of consecutive fourth video frames before the current video frame to be processed; and to determine that the current video frame to be processed does not contain the specified object and trigger the first determination unit when there is a preset number of consecutive fourth video frames before the current video frame to be processed.

[0387] In one embodiment, the apparatus further comprises:

[0388] The object evaluation value calculation module is used to calculate the evaluation value of each candidate object included in the video image based on each second video frame corresponding to the candidate object for a preset evaluation item before determining the implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame, so as to obtain the object evaluation value of the candidate object; wherein the candidate object is determined based on the designated object included in the video image;

[0389] The preset evaluation items include at least one of the following: a completeness evaluation item, a clarity evaluation item, and a stability evaluation item;

[0390] The completeness evaluation item is used to represent: an average value of the completeness of the candidate object in each corresponding second video frame;

[0391] The clarity evaluation item is used to represent: the proportion of the foreground in the first image area corresponding to the candidate object; the first image area corresponding to the candidate object represents: the image area occupied by the candidate object in each corresponding second video frame;

[0392] The stability evaluation item includes at least one of the following: a regional stability evaluation item and an area stability evaluation item;

[0393] The regional stability evaluation item is used to characterize: the change amplitude of the first image region corresponding to the candidate object;

[0394] The area stability evaluation item is used to represent: the proportion of image areas whose areas are smaller than a second preset threshold in each first image area corresponding to the candidate object;

[0395] The implantation position determination submodule is specifically used to determine the target object from each candidate object based on the object evaluation value of each candidate object; and determine the implantation position of the three-dimensional image resource in the video image based on the position of the target object in the corresponding second video frame.

[0396] In one embodiment, the evaluation value of a candidate object for the completeness evaluation item is calculated in the following manner:

[0397] For each second video frame corresponding to the candidate object, obtaining a detection value corresponding to the second video frame as the completeness of the candidate object in the second video frame; wherein the detection value corresponding to the second video frame represents a probability of determining that the second video frame contains the candidate object;

[0398] For each video frame set corresponding to the candidate object, calculating an average value of the completeness of the candidate object in each second video frame included in the video frame set as the average completeness of the candidate object in the video frame set;

[0399] An average value of the average completeness of the candidate object in each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the completeness evaluation item.

[0400] In one embodiment, the evaluation value of a candidate object for the clarity evaluation item is calculated in the following manner:

[0401] For each second video frame corresponding to the candidate object, calculating the proportion of the foreground in the first image area corresponding to the candidate object in the second video frame as the clarity of the candidate object in the second video frame;

[0402] For each video frame set corresponding to the candidate object, calculating an average value of the clarity of the candidate object in each second video frame included in the video frame set as the average clarity of the candidate object in the video frame set;

[0403] The maximum value of the average definition of the candidate object in each video frame set corresponding to the candidate object is determined as the evaluation value of the candidate object for the definition evaluation item.

[0404] In one embodiment, the regional stability evaluation item includes at least one of the following: a first regional stability evaluation sub-item and a second regional stability evaluation sub-item;

[0405] The evaluation value of a candidate object corresponding to the first regional stability evaluation sub-item is calculated in the following way:

[0406] For each second video frame corresponding to the candidate object, obtaining the coordinates of the center point of the first image region corresponding to the candidate object in the second video frame as the coordinates to be processed corresponding to the second video frame; and calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame;

[0407] For each video frame set corresponding to the candidate object, calculate the standard deviation of the coordinates to be processed corresponding to each second video frame included in the video frame set as the first standard deviation corresponding to the video frame set;

[0408] Calculating an average value of first areas to be processed corresponding to each second video frame included in the video frame set as an average area corresponding to the video frame set;

[0409] Calculating a ratio of a first standard deviation corresponding to the video frame set to an average area corresponding to the video frame set as the central point stability corresponding to the video frame set;

[0410] Determine an average value of the central point stability corresponding to each set of video frames corresponding to the candidate object as an evaluation value of the candidate object for the first region stability evaluation sub-item;

[0411] The evaluation value of a candidate object corresponding to the second regional stability evaluation sub-item is calculated in the following way:

[0412] For each second video frame corresponding to the candidate object, calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame;

[0413] For each video frame set corresponding to the candidate object, calculate the standard deviation of the first to-be-processed area corresponding to each second video frame included in the video frame set as the second standard deviation corresponding to the video frame set;

[0414] An average value of second standard deviations corresponding to each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the second region stability evaluation sub-item.

[0415] In one embodiment, the apparatus further comprises:

[0416] an appearance duration acquisition module, for calculating the evaluation value of each candidate object for a preset evaluation item based on each second video frame corresponding to the candidate object for each candidate object included in the video image, and obtaining the object evaluation value of the candidate object, and for each designated object included in the video image, obtaining the appearance duration of the designated object in the video image based on each second video frame corresponding to the designated object;

[0417] The second judging module is used to judge whether the appearance time of the specified object is greater than a preset time;

[0418] The candidate object determination module is used to determine the specified object as a candidate object if the appearance duration of the specified object is greater than a preset duration.

[0419] The present application also provides an electronic device, such as Fig.14 As shown, it includes a processor 1401, a communication interface 1402, a memory 1403 and a communication bus 1404, wherein the processor 1401, the communication interface 1402, and the memory 1403 communicate with each other through the communication bus 1404.

[0420] Memory 1403, used for storing computer programs;

[0421] The processor 1401 is used to implement the following steps when executing the program stored in the memory 1403:

[0422] Acquire the video image that needs to be embedded with the three-dimensional image resource;

[0423] Based on the target detection algorithm, a video frame containing the specified object in the video image is determined as the first video frame; wherein when the three-dimensional image resource is implanted at the position of the specified object in the first video frame, an intersection-over-union ratio of an image area occupied by the three-dimensional image resource and an image area occupied by the specified object is less than a first preset threshold;

[0424] Based on the position of the designated object in the first video frame, an implantation position of the three-dimensional image resource in the video image is determined.

[0425] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0426] The communication interface is used for communication between the above terminal and other devices.

[0427] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0428] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0429] In another embodiment provided in the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the implantation position determination method described in any one of the above embodiments is implemented.

[0430] In another embodiment provided in the present application, a computer program product comprising instructions is also provided, and when the computer is run on the computer, the computer executes the implantation position determination method described in any one of the above embodiments.

[0431] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0432] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0433] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0434] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A method for determining an implantation position, characterized in that: The method comprises: Acquire the video image that needs to be embedded with the three-dimensional image resource; Based on the target detection algorithm, a video frame containing the specified object in the video image is determined as the first video frame; wherein when the three-dimensional image resource is implanted at the position of the specified object in the first video frame, an intersection-over-union ratio of an image area occupied by the three-dimensional image resource and an image area occupied by the specified object is less than a first preset threshold; Determining an implantation position of the three-dimensional image resource in the video image based on a position of the designated object in the first video frame; The step of determining, based on the target detection algorithm, a video frame containing a specified object in the video image as the first video frame comprises: Based on the target detection algorithm, determining that the designated objects contained in the video image are video frames of the same object as the second video frames corresponding to the designated object; The step of determining, based on the position of the designated object in the first video frame, an implantation position of the three-dimensional image resource in the video image comprises: Determining an implantation position of the three-dimensional image resource in the video image based on a position of each designated object in the corresponding second video frame; Before determining the implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame, the method further includes: For each candidate object included in the video image, based on each second video frame corresponding to the candidate object, calculate the evaluation value of the candidate object for the preset evaluation item to obtain the object evaluation value of the candidate object; wherein the candidate object is determined based on the designated object included in the video image; The preset evaluation items include at least one of the following: a completeness evaluation item, a clarity evaluation item, and a stability evaluation item; The completeness evaluation item is used to represent: an average value of the completeness of the candidate object in each corresponding second video frame; The clarity evaluation item is used to represent: the proportion of the foreground in the first image area corresponding to the candidate object; the first image area corresponding to the candidate object represents: the image area occupied by the candidate object in each corresponding second video frame; The stability evaluation item includes at least one of the following: a regional stability evaluation item and an area stability evaluation item; The regional stability evaluation item is used to characterize: the change amplitude of the first image region corresponding to the candidate object; The area stability evaluation item is used to represent: the proportion of image areas whose areas are smaller than a second preset threshold in each first image area corresponding to the candidate object; The step of determining the implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame includes: Determine a target object from among the candidate objects based on the object evaluation value of each candidate object; Based on the position of the target object in the corresponding second video frame, an implantation position of the three-dimensional image resource in the video image is determined.

2. The method according to claim 1, characterized in that The method of determining, based on the target detection algorithm, that the designated objects contained in the video image are video frames of the same object as the second video frames corresponding to the designated objects includes: Determining a current video frame to be processed in the video image according to the order of the video frames in the video image; Based on the target detection algorithm, detect whether the current video frame to be processed contains the specified object; If it is determined based on the target detection algorithm that the current video frame to be processed contains the specified object, determining whether the specified object is determined in a video frame before the current video frame to be processed; If the designated object is determined in a video frame before the current video frame to be processed, determining whether the designated object detected in the current video frame to be processed and the designated object determined in the previous video frame are the same object; If the specified object detected in the current video frame to be processed is the same object as the specified object determined in the previous video frame, then determining that the current video frame to be processed and the previous video frame belong to a set of video frames containing the same specified object; and returning to execute the step of determining the current video frame to be processed in the video image according to the order between the video frames in the video image; Based on the similarity between the image regions occupied by the designated objects in the video frames, the video frames in the video frame set including the designated objects as the same object are determined as the second video frames corresponding to the designated objects.

3. The method according to claim 2, characterized in that Before determining, based on the similarity between the image areas occupied by the designated objects in the video frames, the video frames in the video frame set including the designated objects as the same object as the second video frames corresponding to the designated objects, the method further includes: Based on a scene segmentation algorithm, determining the scene to which each video frame in the video image belongs; The method of determining, based on the similarity between the image areas occupied by the designated objects in the video frames, the video frames in the video frame set including the designated objects as the same object as the second video frames corresponding to the designated objects includes: For each scene, based on the similarity between the image areas occupied by the specified object in the video frames, from the video frame sets belonging to the scene, a video frame set containing the specified object as the same object is determined as the video frame set corresponding to the specified object; The video frames in the video frame set corresponding to the designated object are determined as the second video frames corresponding to the designated object.

4. The method according to claim 2, characterized in that: The method further comprises: If the specified object detected in the current video frame to be processed is not the same object as the specified object determined in the previous video frame, or if the specified object is not determined in the previous video frame of the current video frame to be processed, or if it is determined based on the target detection algorithm that the current video frame to be processed does not contain the specified object, then determine the video frame containing the specified object determined last time as the current third video frame; Based on the target tracking algorithm, determining whether the specified object determined in the current third video frame is tracked in the current video frame to be processed; If, based on the target tracking algorithm, the specified object determined in the current third video frame is tracked in the current video frame to be processed, it is determined that the current video frame to be processed and the current third video frame belong to a set of video frames containing the same specified object; and the process returns to execute the step of determining the current video frame to be processed in the video image according to the order between the video frames in the video image.

5. The method according to claim 4, characterized in that In the case where it is determined based on the target detection algorithm that the current video frame to be processed does not contain the specified object, before determining the video frame containing the specified object determined last time as the current third video frame, the method further includes: Determine whether there are a preset number of continuous fourth video frames before the current video frame to be processed; wherein the fourth video frame represents a video frame determined not to contain the specified object; The step of determining the last determined video frame containing the specified object as the current third video frame includes: If there are no preset number of consecutive fourth video frames before the current video frame to be processed, determine the video frame containing the specified object determined last time as the current third video frame; When there are a preset number of consecutive fourth video frames before the current video frame to be processed, it is determined that the current video frame to be processed does not contain the specified object, and the step of determining the current video frame to be processed in the video image according to the order between the video frames in the video image is returned to be executed.

6. The method according to claim 1, characterized in that The evaluation value of a candidate object for the completeness evaluation item is calculated as follows: For each second video frame corresponding to the candidate object, obtaining a detection value corresponding to the second video frame as the completeness of the candidate object in the second video frame; wherein the detection value corresponding to the second video frame represents a probability of determining that the second video frame contains the candidate object; For each video frame set corresponding to the candidate object, calculating an average value of the completeness of the candidate object in each second video frame included in the video frame set as the average completeness of the candidate object in the video frame set; An average value of the average completeness of the candidate object in each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the completeness evaluation item.

7. The method according to claim 1, characterized in that The evaluation value of a candidate object for the clarity evaluation item is calculated as follows: For each second video frame corresponding to the candidate object, calculating the proportion of the foreground in the first image area corresponding to the candidate object in the second video frame as the clarity of the candidate object in the second video frame; For each video frame set corresponding to the candidate object, calculating an average value of the clarity of the candidate object in each second video frame included in the video frame set as the average clarity of the candidate object in the video frame set; The maximum value of the average definition of the candidate object in each video frame set corresponding to the candidate object is determined as the evaluation value of the candidate object for the definition evaluation item.

8. The method according to claim 1, characterized in that The regional stability evaluation item includes at least one of the following: a first regional stability evaluation sub-item and a second regional stability evaluation sub-item; The evaluation value of a candidate object corresponding to the first regional stability evaluation sub-item is calculated in the following way: For each second video frame corresponding to the candidate object, obtaining the coordinates of the center point of the first image region corresponding to the candidate object in the second video frame as the coordinates to be processed corresponding to the second video frame; and calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame; For each video frame set corresponding to the candidate object, calculate the standard deviation of the coordinates to be processed corresponding to each second video frame included in the video frame set as the first standard deviation corresponding to the video frame set; Calculating an average value of first areas to be processed corresponding to each second video frame included in the video frame set as an average area corresponding to the video frame set; Calculating a ratio of a first standard deviation corresponding to the video frame set to an average area corresponding to the video frame set as the central point stability corresponding to the video frame set; Determine an average value of the central point stability corresponding to each set of video frames corresponding to the candidate object as an evaluation value of the candidate object for the first region stability evaluation sub-item; The evaluation value of a candidate object corresponding to the second regional stability evaluation sub-item is calculated in the following way: For each second video frame corresponding to the candidate object, calculating the area of ​​the first image region corresponding to the candidate object in the second video frame as the first area to be processed corresponding to the second video frame; For each video frame set corresponding to the candidate object, calculate the standard deviation of the first to-be-processed area corresponding to each second video frame included in the video frame set as the second standard deviation corresponding to the video frame set; An average value of second standard deviations corresponding to each video frame set corresponding to the candidate object is determined as an evaluation value of the candidate object for the second region stability evaluation sub-item.

9. The method according to claim 1, characterized in that: Before calculating, for each candidate object included in the video image, an evaluation value of the candidate object for a preset evaluation item based on each second video frame corresponding to the candidate object to obtain the object evaluation value of the candidate object, the method further includes: For each designated object included in the video image, based on each second video frame corresponding to the designated object, obtain the appearance duration of the designated object in the video image; Determine whether the appearance duration of the specified object is greater than a preset duration; If the appearance duration of the designated object is greater than the preset duration, the designated object is determined as a candidate object.

10. An implantation position determination device, characterized in that: The device comprises: A video image acquisition module, used for video images that need to be embedded with three-dimensional image resources; A first determination module is used to determine, based on a target detection algorithm, a video frame containing a specified object in the video image as a first video frame; wherein, when the three-dimensional image resource is implanted at the position of the specified object in the first video frame, an intersection-over-union ratio of an image area occupied by the three-dimensional image resource and an image area occupied by the specified object is less than a first preset threshold; An implantation position determination module, used to determine an implantation position for implanting the three-dimensional image resource in the video image based on the position of the designated object in the first video frame; The first determining module includes: A first determination submodule is used to determine, based on a target detection algorithm, video frames of the same object as the designated objects contained in the video image as the second video frames corresponding to the designated object; The implantation position determination module comprises: An implantation position determination submodule, used to determine an implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame; The device also includes: The object evaluation value calculation module is used to calculate the evaluation value of each candidate object included in the video image based on each second video frame corresponding to the candidate object for a preset evaluation item before determining the implantation position of the three-dimensional image resource in the video image based on the position of each designated object in the corresponding second video frame, so as to obtain the object evaluation value of the candidate object; wherein the candidate object is determined based on the designated object included in the video image; The preset evaluation items include at least one of the following: a completeness evaluation item, a clarity evaluation item, and a stability evaluation item; The completeness evaluation item is used to represent: an average value of the completeness of the candidate object in each corresponding second video frame; The clarity evaluation item is used to represent: the proportion of the foreground in the first image area corresponding to the candidate object; the first image area corresponding to the candidate object represents: the image area occupied by the candidate object in each corresponding second video frame; The stability evaluation item includes at least one of the following: a regional stability evaluation item and an area stability evaluation item; The regional stability evaluation item is used to characterize: the change amplitude of the first image region corresponding to the candidate object; The area stability evaluation item is used to represent: the proportion of image areas whose areas are smaller than a second preset threshold in each first image area corresponding to the candidate object; The implantation position determination submodule is specifically used to determine the target object from each candidate object based on the object evaluation value of each candidate object; and determine the implantation position of the three-dimensional image resource in the video image based on the position of the target object in the corresponding second video frame.

11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 9 when executing a program stored in a memory.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Recommendation information implantation position determination method and device, equipment and storage medium

    CN110381369A

  • Information implantation area identification method and device, storage medium and electronic equipment

    CN112101075A

  • Dynamic advertisement implantation position detection method and device

    CN112752151A