Disclosure of Invention
The invention aims to provide an advertisement implantation method and device, which are used for realizing the precise advertisement putting of a real court and improving the exposure rate and the acceptance degree of advertisements.
To achieve the above object, an embodiment of the present invention provides an advertisement implanting method, including:
obtaining a court key point corresponding to a court simulation model and a first position corresponding to an implanted advertisement;
Acquiring an advertisement video to be implanted, and determining a standard frame image under each shot corresponding to the advertisement video to be implanted, wherein the standard frame image is a video frame image of an implanted advertisement appearing under each shot for the first time;
determining a first space conversion relation between the court simulation model and the standard frame image according to the standard frame image and the court key points;
And implanting advertisements into the advertisement video to be implanted according to the first space conversion relation and the first position.
Optionally, acquiring the advertisement video to be implanted, and determining a standard frame image under each shot corresponding to the advertisement video to be implanted includes:
Classifying the video to be embedded with advertisements according to lens types, and determining video data corresponding to N lens types, wherein N is an integer greater than or equal to 1;
According to the N video data, establishing a video data list corresponding to the N lens types;
and determining the standard frame image under each shot according to the video data list.
Optionally, the method further comprises:
Acquiring a non-standard frame image of the advertisement video to be implanted, wherein the non-standard frame image is other images except the standard frame image in the non-standard frame image;
according to the non-standard frame image and the video data list, determining a first standard frame image under a lens corresponding to the non-standard frame image;
and implanting advertisements into the advertisement video to be implanted according to the first standard frame image, the first space conversion relation and the first position.
Optionally, implanting an advertisement into the advertisement video to be implanted according to the first standard frame image, the first spatial conversion relationship and the first position, including:
Determining a second spatial conversion relation between the standard frame image and the non-standard frame image under each lens according to the non-standard frame image and the first standard frame image;
Determining a third spatial conversion relation between the court simulation model and the nonstandard frame image according to the second spatial conversion relation and the first spatial conversion relation;
And implanting advertisements into the advertisement video to be implanted according to the third space conversion relation and the first position.
Optionally, implanting an advertisement into the advertisement video to be implanted according to the third spatial conversion relationship and the first position, including:
According to the third space conversion relation, determining a first area range covered by the nonstandard frame image in the court simulation model;
Predicting a second area range covered by the next frame of image in the court simulation model according to the first area range;
And implanting advertisements into the video to be implanted according to the second area range and the first position.
Optionally, predicting, according to the first area range, a second area range covered by a next frame of image in the course simulation model includes:
determining a time sequence corresponding to the video frame image according to the advertisement video to be implanted, wherein the time sequence comprises a region range corresponding to each frame image;
determining the moving speed of the nonstandard frame image in the court simulation model according to the time sequence and the first area range;
And predicting a second area range covered by the next frame of image in the court simulation model according to the moving speed.
Optionally, implanting an advertisement into the advertisement video to be implanted according to the second area range and the first position, including:
determining a positional relationship between the second area range and the first position according to the second area range and the first position;
And implanting advertisements according to the position relation.
Optionally, when the positional relationship is that the second area range and the first position have no intersection,
According to the position relationship, implanting advertisements comprises the following steps:
Determining the pasting time of the advertisement and the type of the advertisement according to the position relation;
and implanting advertisements according to the pasting time of the advertisements and the types of the advertisements.
Optionally, when the second area range completely includes the first position,
According to the position relationship, implanting advertisements comprises the following steps:
according to the position relation, determining that the frame image corresponding to the second area range is an updated standard frame image;
determining a second position of the frame image corresponding to the second area range, in which the advertisement is implanted, corresponding to the court simulation model according to the updated standard frame image, the first spatial conversion relation and the second spatial conversion relation;
Determining a first material layer of a frame image corresponding to the second area range and a second material layer to be implanted with advertisements;
and fusing the first material layer, the second material layer and the second position layer, and implanting advertisements.
Optionally, determining a standard frame image under each shot corresponding to the advertisement video to be implanted, further includes:
Acquiring camera position information corresponding to the advertisement video to be implanted and corresponding image information under the current lens;
Updating a standard frame corresponding to the image information under the current lens when any one of the following preset conditions is met;
Wherein, the preset conditions are as follows:
the resolution of the image information under the current lens is lower than a first preset range;
switching the current lens corresponding to the advertisement video to be implanted;
the corresponding camera position information exceeds a first preset distance.
Optionally, constructing a court simulation model includes:
Obtaining court information and advertisement information to be implanted;
Determining key points of the court according to the court information, and determining the position of the implanted advertisement according to the advertisement information to be implanted;
and constructing a court simulation model according to the court key points and the positions where the advertisements are implanted.
To achieve the above object, an embodiment of the present invention further provides an advertisement implanting apparatus, including:
the acquisition module is used for acquiring the court key points corresponding to the court simulation model and the first positions corresponding to the implanted advertisements;
The first processing module is used for acquiring the video to be implanted with advertisements, and determining a standard frame image under each lens corresponding to the video to be implanted with advertisements, wherein the standard frame image is a video frame image of the first occurrence of the implanted advertisements under each lens;
the second processing module is used for determining a first space conversion relation between the court simulation model and the standard frame image according to the standard frame image and the court key points;
And the third processing module is used for implanting advertisements into the advertisement video to be implanted according to the first space conversion relation and the first position.
To achieve the above object, an embodiment of the present invention also provides a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps in the advertisement implantation method as set forth in any one of the above.
The technical scheme of the invention has the following beneficial effects:
The embodiment of the invention acquires a court key point corresponding to a court simulation model and a first position corresponding to an implanted advertisement, acquires a video of the advertisement to be implanted, determines a standard frame image under each lens corresponding to the video of the advertisement to be implanted, wherein the standard frame image is a video frame image of the advertisement to be implanted under each lens, adopts a multi-lens standard frame determining mechanism, determines a first space conversion relation between the court simulation model and the standard frame image according to the standard frame image and the court key point, pastes the advertisement in the court simulation model into a standard frame according to the first space conversion relation, and implants the advertisement to the video of the advertisement to be implanted according to the first space conversion relation and the first position. The follow-up advertisement pasting and delivering can preferentially classify the shots, and perform space transformation operation on each frame of image and the corresponding standard frame under the shot, so that the best standard frame can be searched for each shot, the space transformation cost of the image is reduced, and the accuracy and stability of advertisement delivering are improved.
Detailed Description
In order to make the technical problems, technical solutions and advantages to be solved more apparent, the following detailed description will be given with reference to the accompanying drawings and specific embodiments.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
In various embodiments of the present invention, it should be understood that the sequence numbers of the following processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
In addition, the terms "system" and "network" are often used interchangeably herein.
In the embodiments provided herein, it should be understood that "B corresponding to a" means that B is associated with a from which B may be determined. It should also be understood that determining B from a does not mean determining B from a alone, but may also determine B from a and/or other information.
In order to solve the problems, the proposal provides an advertisement implantation method and device, which are based on real court information modeling, combine with video shot switching, determine advertisement pasting time and type, search the best conversion standard frame, and realize fine time management and accurate advertisement putting of a real court.
The technical scheme of the invention is based on artificial intelligence technology, and is suitable for scenes such as basketball, volleyball, football and the like of video/live broadcast (including but not limited to basketball, volleyball, football and the like) advertisement implantation of a court game. According to the invention, scene modeling of real court information is carried out, and the virtual advertisement in the model is put in a fixed virtual position, so that the advertisement and the scene are integrated (such as stuck on the court surface) together, the virtual advertisement in the model is moved to the court video at the visual angle of a camera by matching with the court modeling information through video analysis at the visual angle of the camera, and the timing and the type of the advertisement put in are determined by combining the lens classification with the spatial relationship between the scene and the real scene under the video lens, so that the virtual advertisement in the model is virtually put in the virtual scene of the video.
The invention carries out the delivery of the immersive advertisement by the artificial intelligence technology, models the real court and the advertisement according to the fixed position, and transfers the advertisement to the court scene under the visual angle of the camera, so that the advertisement and the scene are integrated, the offensiveness of the advertisement delivery is reduced, the user experience is improved, and the problem that the difficult industry has single advertisement delivery and the pain point affecting the look and feel is solved.
As shown in fig. 1, an advertisement implantation method according to an embodiment of the present invention includes:
Step 100, obtaining a court key point corresponding to a court simulation model and a first position corresponding to an implanted advertisement;
It can be understood that in order to implant advertisements in videos, advertisement contents are required to be embedded in video frames and displayed along with the playing of the video frames, a court key point P_model and a first position D_ad corresponding to the implanted advertisements are required to be determined, wherein the court key point is data of the court simulation model reflecting real court field information, the first position corresponding to the implanted advertisements is located in the range of the court key point, and the first position can be one position or a plurality of positions.
Step 200, acquiring an advertisement video to be implanted, and determining a standard frame image under each shot corresponding to the advertisement video to be implanted, wherein the standard frame image is a video frame image of an implanted advertisement appearing under each shot for the first time;
In this embodiment, the video playing mode of the advertisement to be implanted is online video on demand, local video playing or live broadcast, and the storage location and transmission mode of the advertisement video to be implanted are not limited, for example, the storage location may be a local hard disk, a mobile storage device, a network server, etc. of the video playing terminal, and the transmission mode may be network transmission, data line transmission, bluetooth wireless transmission, etc. And classifying shots of all video frames of the advertisement video to be implanted, and decoding the advertisement video to be implanted to obtain at least one corresponding video frame image under the shots. In step 200, according to the advertisement video to be implanted, all video frame images under each shot are determined, a first frame of the shot, in which the advertisement is completely implanted for the first time, appears in the picture is taken as an initialized standard frame image, each standard frame can be correspondingly provided with a standard frame key point, and the standard frame key point is taken as a basis for subsequent processing.
Step 300, determining a first space conversion relation between the court simulation model and the standard frame image according to the standard frame image and the court key points;
In this embodiment, after initializing a standard frame image LMn-standard for each lens, calculating a standard frame key point, matching the standard frame key point with the court key point, and determining a first spatial conversion relationship Ln-K between the court simulation Model and the standard frame image LMn-standard.
And 400, implanting advertisements into the advertisement video to be implanted according to the first space conversion relation and the first position.
In this embodiment, according to the first spatial conversion relationship Ln-K and the first position d_ad, conversion of advertisement space is performed, an advertisement position d_ad 'corresponding to a standard frame image is determined, and according to the advertisement position d_ad', the video to be embedded with advertisement is embedded with advertisement
All frame images under each lens view angle are based on the image space of the standard frame image, and can be used as reference frames for detecting key points of a court to replace and put advertisements.
According to the invention, advertisements can be changed along with the movement of the visual angle of the camera, so that the advertising scene is realized. Meanwhile, the space position shot by the lens can be used for carrying out diversified advertisement delivery according to different lens types, so that the advertisement delivery time is refined, the delivery cost is low, the replacement of advertisements is convenient, the time and the duration of advertisement playing can be freely controlled, the mobility is wide, and the like.
Specifically, prior to step 100, a course simulation model is constructed, including:
step 110, obtaining court information and advertisement information to be implanted;
step 120, determining key points of the court according to the court information, and determining the position of the implanted advertisement according to the advertisement information to be implanted;
and 130, constructing a court simulation model according to the court key points and the positions where the advertisements are implanted.
In this embodiment, the field information, that is, the real course information, size, and information, size, insertion position of the advertisement, establishing a court simulation Model to obtain a court simulation Model (Model), and determining the key points of the court to be detected and the positions where advertisements are implanted; the court keypoints are represented by P_model= [ P0, P1, P2, ]. The number of keypoints is q, and the positions of the embedded advertisements are represented by D_ad= [ x1, y1; x2, y2] (a plurality of the embedded advertisements are allowed by D_ad). The location of the embedded advertisement is preferably a target area located at a key point of a court, and the shape of the target area can be determined according to the requirement of advertisement content, for example, the target area can be rectangular, trapezoidal, quadrilateral, trapezoid, circular, fan-shaped, arched and the like.
Based on steps 110 to 130, the method adopts a multi-shot standard frame determination mechanism to classify the video, obtains standard frames under the corresponding classification, establishes a corresponding space conversion relation according to the relation between a real court simulation model and the standard frames, and performs space conversion operation on each frame image and the corresponding standard frame under the shot preferentially when the advertisement is implanted, thereby being beneficial to searching the optimal standard frame for each shot, reducing the space conversion cost of the image and improving the accuracy and stability of advertisement placement.
Optionally, the step 200 includes:
Step 210, classifying the advertisement video to be implanted according to the lens types, and determining video data corresponding to N lens types, wherein N is an integer greater than or equal to 1;
Here, the lens categories include, but are not limited to, different camera positions, angles, and the like.
Step 220, according to the N video data, establishing a video data list corresponding to the N lens types;
step 230, determining the standard frame image under each shot according to the video data list.
In this embodiment, according to video data corresponding to N shot types, shot classification is performed on all video frame images of the advertisement video to be implanted, and video data lists l_list, l_list= [ L1, L2, ] corresponding to N shot types, where N is the total number of shots, where according to the video data list, all frame image data under each shot including the standard frame image under each shot and other images under each shot except the standard frame image may be determined, so as to provide data support for subsequent advertisement delivery.
Optionally, the method further comprises:
Step 500, obtaining a non-standard frame image of the advertisement video to be implanted, wherein the non-standard frame image is other images except the standard frame image in the non-standard frame image;
step 600, determining a first standard frame image under a shot corresponding to the non-standard frame image according to the non-standard frame image and the video data list;
And 700, implanting advertisements into the advertisement video to be implanted according to the first standard frame image, the first space conversion relation and the first position.
The invention also provides a processing method for acquiring the nonstandard frame image of the advertisement video to be implanted, specifically, classifying the nonstandard frame image M of the advertisement video to be implanted according to the video data list, belonging to the L_list, determining a first standard frame image under the corresponding lens of the nonstandard frame image M, namely a standard frame Ln-standard under the corresponding lens of the nonstandard frame image M, determining the first standard frame image according to the nonstandard frame image M in the step 700, and implanting advertisement into the advertisement video to be implanted according to the first space conversion relation and the first position mode of the step 400. According to the invention, the advertisement is implanted into the video to be implanted from two modes of standard frame images and non-standard frame images, so that the diversity of advertisement release is increased, and the time management of advertisement release is more refined.
Optionally, the step 700 includes:
step 710, determining a second spatial conversion relationship between the standard frame image and the non-standard frame image under each lens according to the non-standard frame image and the first standard frame image;
In this embodiment, detection of standard frame key points is performed according to the non-standard frame image and the first standard frame image, a key point p_m= [ P0, P1, ] of the non-standard frame image M is determined, and standard frame key points of a standard frame Ln-standard of the key point p_m of the non-standard frame image M are matched to obtain a second spatial conversion relationship Ln-M between the standard frame image and the non-standard frame image.
Step 720, determining a third spatial conversion relation between the court simulation model and the nonstandard frame image according to the second spatial conversion relation and the first spatial conversion relation;
and step 730, implanting advertisements into the advertisement video to be implanted according to the third spatial conversion relation and the first position.
In this embodiment, according to the second spatial conversion relationship Ln-M and the first spatial conversion relationship Ln-K, a third spatial conversion relationship Ln-model between the court simulation model and the nonstandard frame image is determined by matching a court key point p_model with a key point p_m of the nonstandard frame image M, and according to the conversion relationship of the third spatial conversion relationship Ln-model and the first position, an advertisement is implanted into the image space of the nonstandard frame image M.
Optionally, step 730 includes:
step 731, determining a first area range covered by the nonstandard frame image in the court simulation model according to the third spatial conversion relation;
In this embodiment, according to the third spatial conversion relationship Ln-Model, the image space of the current non-standard frame image M is converted into the course simulation Model to obtain a first area range M-area= (x 1, y 1), (x 2, y 2),. The first area range M-area= (xn, yn) ], where the visual space where the non-standard frame image M is located is covered in the course simulation Model.
Step 732, predicting a second area coverage of the next frame of image in the course simulation model according to the first area coverage;
And step 733, implanting advertisements into the video to be implanted according to the second area range and the first position.
It should be noted that, the first area range and the second area range may be understood as a field size included in the current video frame image, which is smaller than or equal to a field range determined by the key points of the field, and the shape of the area range may be determined according to the requirement of the video content under the current lens, for example, may be rectangular, regular tetragon, circular, and fan-shaped.
In this embodiment, in order to solve the problem of inter-frame key point jitter, the present invention may adopt a point location registration method, predict a second area range of a next frame image in the course simulation model according to the first area range, that is, search around the key point detected by the current frame by using the key point of the previous frame as a reference, and find a position that is most matched with a point location corresponding to the previous frame, so as to ensure a visual effect of the whole advertisement implantation scheme.
According to the method, the standard frames obtained by shot classification are used as the standard of the subsequent frame conversion, the position relation between the first area range of each shot in the simulation model and the advertisement delivery is calculated, and the advertisement delivery is carried out. Compared with a real court simulation model matching scheme, the method has the advantages that the image space of a standard frame is more similar to the image space of a subsequent frame, the standard frame can be used as a reference frame for detecting key points of the subsequent frame, the space conversion matrix is calculated more accurately, and the accuracy of advertisement pasting is facilitated.
Optionally, the step 732 includes:
Step 7321, determining a time sequence corresponding to the video frame image according to the advertisement video to be implanted, wherein the time sequence comprises a region range corresponding to each frame image;
Step 7322, determining a moving speed of the nonstandard frame image in the court simulation model according to the time sequence and the first area range;
step 7323, predicting a second area coverage of the next frame image in the course simulation model according to the moving speed.
In the embodiment, a time sequence corresponding to the video frame images is established, wherein the time sequence comprises a region range corresponding to each frame image, and the region range is represented as List_area= [ M-area1, M-area 2. ], M-arean ], after the lens is classified according to the points of the regions of the front frame and the rear frame, the moving speed of a visual space where a non-standard frame image corresponding to the first region range exists in the field simulation Model is recorded as V, and the second region range M-area' covered by the next frame image in the field simulation Model is predicted according to the M-area and the speed V of the non-standard frame image corresponding to the first region range.
Optionally, the step 733 includes:
step 7331, determining a positional relationship between the second area range and the first position according to the second area range and the first position;
and step 7332, implanting advertisements according to the position relation.
In this embodiment, the positional relationship between the first position D_ad and the second area range M-area' is judged in combination with the first position D_ad in the course simulation Model, and there is a case where the first position D_ad is completely contained, and there is an intersection (incomplete contained), and there is no intersection. And judging the pasting time of the advertisement and the type of the advertisement according to the position relation. According to the advertisement coordinate range in the court simulation Model, the advertisement transformation diagram and the coordinates based on the shooting visual angle after transformation are obtained by combining the calculated transformation information, and a position and an image basis are provided for subsequent advertisement migration.
According to the technical scheme, according to the spatial relationship between the non-standard image and the court simulation model, the area range displayed by the non-standard image is converted into the court simulation model, an area monitoring list is built, the moving speed and the moving position of the area are calculated, and the area displayed by the lens is monitored in real time. Combining the position information of the advertisements to be put in the court, determining the time and the type of the advertisements to be put in, increasing the diversity of the advertisements to make the time management of the advertisements more fine.
Specifically, when the positional relationship is that the second area range and the first position have no intersection, the step 7332 includes:
Determining the pasting time of the advertisement and the type of the advertisement according to the position relation;
and implanting advertisements according to the pasting time of the advertisements and the types of the advertisements.
In this embodiment, when the first position relationship is that the second area range and the first position do not have an intersection, the attachment timing of the advertisement and the type of the advertisement are determined according to the position relationship. The replacement and the model selection of the advertisements can be carried out according to the actual conditions, and the diversity of advertisement delivery is increased.
Specifically, when the positional relationship is that the second area completely includes the first position, the step 7332 includes:
according to the position relation, determining that the frame image corresponding to the second area range is an updated standard frame image;
in this embodiment, according to the position of the current image display area in the court simulation Model, in combination with the position where the advertisement needs to be implanted, the first frame of the area completely containing the advertisement is updated to the standard frame under the shot, and the standard frame is updated in real time, that is, the video frame image corresponding to the second area completely containing the first position is determined to be the updated standard frame image, so that the standard frame better meets the requirement of conversion. It is also understood that the completely contained first frame is subjected to standard frame substitution under its shot classification, denoted as LMn-standard' (this is an updated standard frame image).
Determining a second position of the frame image corresponding to the second area range, in which the advertisement is implanted, corresponding to the court simulation model according to the updated standard frame image, the first spatial conversion relation and the second spatial conversion relation;
in this embodiment, according to the determined first spatial conversion relationship Ln-K and the first position d_ad, spatial conversion is performed to determine an advertisement position d_ad 'corresponding to a standard frame image, and then according to the second spatial conversion relationship Ln-M and the advertisement position d_ad', a second position d_ad_m where an advertisement is implanted in the second frame image corresponding to the second area range corresponding to the court simulation model is determined.
Determining a first material layer of a frame image corresponding to the second area range and a second material layer to be implanted with advertisements;
and fusing the first material layer, the second material layer and the second position layer, and implanting advertisements.
In this embodiment, the first material layer of the frame image corresponding to the second area range, that is, the information of the person and the sphere is detected and the contour mask is extracted, and the second material layer of the advertisement to be implanted, that is, the extraction of the advertisement image, is determined, finally, the contour mask (the first material layer) of the person and the sphere in the current non-standard frame image is combined with the second position d_ad_m, the advertisement image (the second material layer), and the fusion (the poisson fusion, etc. fusion modes are not limited) of the person and the sphere according to a certain hierarchical relationship, so that the final advertisement presentation effect is obtained, and the implanted advertisement is completed.
It should be noted that, according to the obtained advertisement area to be converted, the invention uses the classification network to judge whether the image of the advertisement area exists, if no person information exists, the advertisement is directly pasted, and if the person information exists, the subsequent person image segmentation operation is performed, and the operation can improve the operation speed of the whole scheme, so that the whole scheme has real-time performance.
The invention further discloses a method for customizing the advertisement, which comprises the steps of separating the image from the background through the image segmentation algorithm, separating the sphere through the sphere detection algorithm, and finally carrying out layered fusion on the advertisement image, the sphere and the background.
In a specific embodiment, the advertisement putting method is based on real court scene modeling, the advertisement is put in a fixed court simulation model position according to the requirement, the video is subjected to shot classification, standard frames for advertisement space conversion are established for each shot, more accurate space references are provided for subsequent frames, meanwhile, the shot classification and the area range of the current area image under the video shot in the real court simulation model are combined, the timing and the type of the advertisement putting are calculated, the accurate migration of different visual angles and different timings of the advertisement is realized, meanwhile, people and balls in the court are detected and identified, the advertisement is prevented from shielding video content, and the advertisement is vividly embedded into the video.
In summary, the invention has the following advantages in advertisement placement:
The invention provides a precise transformation space template for a subsequent frame, improves the advertisement putting precision, can precisely calculate the time and type of advertisement putting according to the classification of the lens and the area range of the current video lens image in a real court simulation model, ensures that the advertisement putting time is more free to control and the putting means is richer, updates the standard frame under the corresponding lens according to the view angle range of the lens and the advertisement position, improves the advertisement space conversion precision, ensures that the advertisement is more vivid to paste, and ensures that the advertisement put can be adjusted according to the different view angles in the video, changes along with the position of the view angle, and is fixedly put on the inherent position of the court, thereby ensuring that the advertisement putting has no illegal sense.
Optionally, in step 200, determining a standard frame image under each shot corresponding to the advertisement video to be implanted, further includes:
determining a standard frame image under each shot corresponding to the advertisement video to be implanted, and further comprising:
Acquiring camera position information corresponding to the advertisement video to be implanted and corresponding image information under the current lens;
Updating a standard frame corresponding to the image information under the current lens when any one of the following preset conditions is met;
Wherein, the preset conditions are as follows:
the resolution of the image information under the current lens is lower than a first preset range;
In this embodiment, when determining the standard frame corresponding to the current lens angle according to the image information under the current lens corresponding to the advertisement video to be implanted, it may be understood that, in a case that the current lens angle is one lens to one, the resolution of the current lens angle is lower than a first preset range, that is, when the resolution of the current lens angle is lower than a threshold, the standard frame corresponding to the current lens angle is updated. The first preset range is a preset range value related to video resolution, and can be set according to specific requirements.
Switching the current lens corresponding to the advertisement video to be implanted;
here, at the time of shot switching, the standard frame corresponding to the current lens angle is updated.
The corresponding camera position information exceeds a first preset distance.
It should be noted that, when the current lens angle is changed from one lens to the bottom and moves from the leftmost side to the rightmost side of the court, when the key point of the court far away from the leftmost side of the court is beyond the first preset distance, that is, when the corresponding camera position information is switched, the standard frame corresponding to the current lens angle is updated. The first preset distance is a preset value related to the distance, for example, the real court is determined to be four court key points, namely four corners of the real court, which are sequentially marked as A, B, C, D points, and the first preset distance is a preset distance value set at each corner.
The invention is based on real court information modeling, combines the switching of video shots, determines advertisement pasting time and type based on the positioning of court simulation positions, searches for the optimal conversion standard frame, and realizes the precise management of the fine time and the precise throwing of the real court advertisements.
As shown in fig. 2, in a specific overall flowchart, the method includes:
Modeling according to real court data, determining a court key point P_model and a first position D_ad, establishing a shot type list L_list for an input live ball game video, classifying acquired frames, initializing a standard LMn-standard for each shot, namely taking a first frame of an advertisement under the shot, which is completely appeared in a picture, as an initialized standard frame, matching a second key point of the standard frame with the key point in a real court simulation model, establishing a first space conversion relation Ln-K between the court simulation model and the standard frame, and converting advertisement space to obtain an advertisement position D_ad' under the standard frame.
And classifying the corresponding shot type of each frame of non-standard frame image M of the video, belonging to the L_list, determining a standard frame Ln-standard belonging to the shot, detecting corresponding key points of the M to obtain P_M, matching the P_M with the key points of the standard frame Ln-standard to obtain a spatial conversion relation between the standard frame and the current non-standard frame image M, and matching the P_model of the court key points in the court simulation model to obtain a spatial conversion relation Ln-model of the court simulation model and the current non-standard frame image M.
According to the conversion relation of Ln-model, converting the image space of the current non-standard frame image M into a court simulation model to obtain the range M-area covered by the visual space of the non-standard frame image M in the court simulation model.
Establishing a time sequence List_area, calculating the moving speed V of a visual space where a non-standard frame image M is located in a court simulation model according to points of areas of front and rear frames, deducing the M-area 'of the next frame according to the M-area and the speed V of the current non-standard frame image M, combining a first position D_ad in the court simulation model, judging the position relation between the D_ad and the M-area', and judging the pasting time of advertisements and the types of advertisements according to the position relation.
When the positional relationship between D_ad and M-area ' is completely contained, the completely contained first frame M ' is replaced by a standard frame under the lens classification, and the standard frame is denoted as LMn-standard '.
And carrying out image space conversion of advertisements according to a second space conversion relation Ln-M of the standard frame and the current non-standard frame image M, detecting character and sphere information in the current non-standard frame image M and extracting a contour mask, and obtaining a second position D_ad_M to be pasted of the current image by the advertisement position D_ad' in the standard frame through the space conversion relation Ln-M.
Combining the second position D_ad_M, the advertisement image, and the outline mask of the person and the sphere in the current non-standard frame image M, and fusing the person and the sphere according to a certain hierarchical relationship to obtain the final advertisement presentation effect.
In summary, the video advertisement implantation method can realize batch automatic analysis of massive videos, has high video advertisement release efficiency, can implant different advertisement contents in the same video according to advertisement release requirements, has high repeated utilization rate, takes no more than 30ms for processing in the whole scheme, can ensure real-time processing, supports implantation of various forms of picture advertisements, is not limited by the advertisement contents, and has high release content flexibility.
As shown in fig. 3, an alternative embodiment of the present invention provides an advertisement implanting apparatus, including:
the acquisition module 10 is used for acquiring the court key points corresponding to the court simulation model and the first positions corresponding to the implanted advertisements;
The first processing module 20 is configured to obtain a video to be implanted with an advertisement, determine a standard frame image under each shot corresponding to the video to be implanted with the advertisement, where the standard frame image is a video frame image under each shot where an implanted advertisement appears for the first time;
A second processing module 30, configured to determine a first spatial conversion relationship between the court simulation model and the standard frame image according to the standard frame image and the court key points;
And a third processing module 40, configured to perform an advertisement implantation on the advertisement video to be implanted according to the first spatial conversion relationship and the first position.
Optionally, the first processing module 20 includes:
The first determining submodule is used for classifying the advertisement video to be implanted according to the lens types and determining video data corresponding to N lens types, wherein N is an integer greater than or equal to 1;
the establishing sub-module is used for establishing video data lists corresponding to N lens types according to N video data;
and the second determining submodule is used for determining the standard frame image under each shot according to the video data list.
Optionally, the apparatus further includes:
the second acquisition module is used for acquiring the non-standard frame image of the advertisement video to be implanted, wherein the non-standard frame image is other images except the standard frame image in the non-standard frame image;
The first determining module is used for determining a first standard frame image under a lens corresponding to the non-standard frame image according to the non-standard frame image and the video data list;
and the fourth processing module is used for implanting advertisements into the advertisement video to be implanted according to the first standard frame image, the first space conversion relation and the first position.
Optionally, the fourth processing module includes:
A third determining sub-module, configured to determine a second spatial conversion relationship between the standard frame image and the non-standard frame image under each lens according to the non-standard frame image and the first standard frame image;
a fourth determining submodule, configured to determine a third spatial conversion relationship between the course simulation model and the nonstandard frame image according to the second spatial conversion relationship and the first spatial conversion relationship;
and a fifth determining submodule, configured to implant an advertisement for the advertisement video to be implanted according to the third spatial conversion relation and the first position.
Optionally, the fifth determining submodule includes:
The first determining unit is used for determining a first area range covered by the nonstandard frame image in the court simulation model according to the third space conversion relation;
the prediction unit is used for predicting a second area range covered by the next frame of image in the court simulation model according to the first area range;
and the first processing unit is used for implanting advertisements into the advertisement video to be implanted according to the second area range and the first position.
Optionally, the prediction unit includes:
the first determining subunit is used for determining a time sequence corresponding to the video frame image according to the advertisement video to be implanted, wherein the time sequence comprises a region range corresponding to each frame image;
A second determining subunit, configured to determine, according to the time sequence and the first area range, a moving speed of the nonstandard frame image in the court simulation model;
and the prediction subunit is used for predicting a second area range covered by the next frame of image in the court simulation model according to the moving speed.
Optionally, the first processing unit includes:
a third determination subunit configured to determine a positional relationship between the second area range and the first position according to the second area range and the first position;
and the first processing subunit is used for implanting advertisements according to the position relation.
Optionally, when the positional relationship is that the second area range and the first position do not intersect, the first processing subunit is specifically configured to:
Determining the pasting time of the advertisement and the type of the advertisement according to the position relation;
and implanting advertisements according to the pasting time of the advertisements and the types of the advertisements.
Optionally, when the positional relationship is that the second area completely includes the first position, the first processing subunit is specifically configured to:
according to the position relation, determining that the frame image corresponding to the second area range is an updated standard frame image;
determining a second position of the frame image corresponding to the second area range, in which the advertisement is implanted, corresponding to the court simulation model according to the updated standard frame image, the first spatial conversion relation and the second spatial conversion relation;
Determining a first material layer of a frame image corresponding to the second area range and a second material layer to be implanted with advertisements;
and fusing the first material layer, the second material layer and the second position layer, and implanting advertisements.
Optionally, the first processing module 20 further includes:
The acquisition unit is used for acquiring the position information of the camera corresponding to the advertisement video to be implanted and the corresponding image information under the current lens;
the updating unit is used for updating the standard frame corresponding to the image information under the current lens when any one of the following preset conditions is met;
Wherein, the preset conditions are as follows:
the resolution of the image information under the current lens is lower than a first preset range;
switching the current lens corresponding to the advertisement video to be implanted;
the corresponding camera position information exceeds a first preset distance.
Optionally, the apparatus further includes:
the third acquisition module is used for acquiring court site information and advertisement information to be implanted;
the second determining module is used for determining the key points of the court according to the court information and determining the positions of the implanted advertisements according to the advertisement information to be implanted;
and the building module is used for building a court simulation model according to the court key points and the positions where the advertisements are implanted.
The readable storage medium of the embodiment of the present invention stores a program or an instruction, which when executed by a processor, implements the steps in the advertisement implantation method described above, and can achieve the same technical effects, and is not described herein again for avoiding repetition.
Wherein, the processor is the processor in the advertisement implantation method described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a magnetic disk or an optical disk.
In an embodiment of the invention, the modules may be implemented in software for execution by various types of processors. An identified module of executable code may, for instance, comprise one or more physical or logical blocks of computer instructions which may, for instance, be organized as an object, procedure, or function. Nevertheless, the executables of an identified module need not be physically located together, but may comprise disparate instructions stored in different bits which, when joined logically together, comprise the module and achieve the stated purpose for the module.
Indeed, a module of executable code may be a single instruction, or many instructions, and may even be distributed over several different code segments, among different programs, and across several memory devices. Likewise, operational data may be identified within modules and may be embodied in any suitable form and organized within any suitable type of data structure. The operational data may be collected as a single data set, or may be distributed over different locations including over different storage devices.
Where a module may be implemented in software, taking into account the level of existing hardware technology, a module may be implemented in software, and one skilled in the art may, without regard to cost, build corresponding hardware circuitry, including conventional Very Large Scale Integration (VLSI) circuits or gate arrays, and existing semiconductors such as logic chips, transistors, or other discrete components, to achieve the corresponding functions. A module may also be implemented in programmable hardware devices such as field programmable gate arrays, programmable array logic, programmable logic devices or the like.
The exemplary embodiments described above are described with reference to the drawings, many different forms and embodiments are possible without departing from the spirit and teachings of the present invention, and therefore, the present invention should not be construed as limited to the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will convey the scope of the invention to those skilled in the art. In the drawings, the size of the elements and relative sizes may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Unless otherwise indicated, a range of values includes the upper and lower limits of the range and any subranges therebetween.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.