Sticker adding method and device, picture editing equipment and storage medium
By calculating the occlusion indicators of stickers on advertising images and overlaying stickers when the occlusion indicators are less than the preset threshold, the problem of stickers elements blocking the main content of the advertisement is solved, and the display effect of advertising images is improved.
Patent Information
- Application Number
- CN202411381721.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-02-14
AI Technical Summary
When adding a large number or multiple sticker elements to the advertising image, it is easy to obstruct the main content of the advertising image and affect the advertising delivery effect.
By obtaining the initial advertising image, determining the non-transparent pixel points of the sticker and the planned addition position, calculating the sticker's occlusion indicator for the initial advertising image, and superimposing the sticker in the initial advertising image when the occlusion indicator is less than the preset threshold to obtain the target advertising image.
It effectively reduces the obstruction of sticker elements on the main content of the advertisement, and improves the display effect of advertising images and advertising delivery.
Smart Images

Figure CN119444929A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image generation, and in particular to a sticker adding method, device, picture editing equipment and storage medium. Background Art
[0002] In the related art, in order to achieve effects such as promoting product features and increasing corporate visibility, advertisers often superimpose some self-designed sticker elements in advertising images, such as the company's logo, product thumbnails, etc., to further highlight the content they want to promote in the advertisement, thereby achieving the purpose of enhancing the effectiveness of advertising.
[0003] Although sticker elements with larger sizes or larger numbers can better highlight the content you want to promote, they are also more likely to block the main content of the advertising image. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a sticker adding method, device, picture editing device and storage medium to reduce the obstruction of the main content of the advertisement by sticker elements. The specific technical solution is as follows:
[0005] In a first aspect of the present invention, a sticker adding method is provided, which is applied to a picture editing device, and the method comprises:
[0006] Obtain an initial advertising picture; the initial advertising picture is the picture to which stickers are to be added;
[0007] Determine the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertisement picture, and the area where the non-transparent pixels in the initial advertisement picture are located, wherein the non-transparent pixels in the initial advertisement picture represent the main content of the initial advertisement picture;
[0008] Based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, determining the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture, and calculating the occlusion index of the sticker on the initial advertising picture;
[0009] When the occlusion index is less than a preset threshold, stickers are superimposed at the planned adding position in the initial advertising picture to obtain a target advertising picture.
[0010] Optionally, calculating an occlusion index of the sticker on the initial advertisement image includes:
[0011] In response to detecting a selection operation on the initial advertising image, calculating an occlusion index of the initial advertising image by the sticker, wherein a current position corresponding to the selection operation is used as a planned adding position; or
[0012] After determining the target planned adding position, the occlusion index of the sticker on the initial advertising image is calculated.
[0013] Optionally, determining the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertisement picture, and the area where the non-transparent pixels in the initial advertisement picture are located includes:
[0014] Determine the non-transparent pixel points of the sticker and the non-transparent pixel points of the current picture area, wherein the current picture area represents the area overlapping with the initial advertisement picture when the sticker is at the current position in the initial advertisement picture, and use the current position as the planned adding position;
[0015] The determining, based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture, and calculating the occlusion index of the sticker on the initial advertising picture, includes:
[0016] Based on the quantitative relationship between the non-transparent pixels of the sticker and the non-transparent pixels of the current image area, calculating the occlusion index of the initial advertising image by the sticker at the current position;
[0017] When the occlusion index is less than a preset threshold, the sticker is superimposed at the planned adding position in the initial advertisement picture to obtain a target advertisement picture, including:
[0018] When the occlusion index is less than a preset threshold, a sticker is superimposed at the current position in the initial advertising picture to obtain a target advertising picture.
[0019] Optionally, before determining the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertisement picture, and the area where the non-transparent pixels in the initial advertisement picture are located, the method further includes:
[0020] Get multiple original sticker elements;
[0021] The multiple original sticker elements are spliced together to obtain the sticker.
[0022] Optionally, the method further comprises:
[0023] When the occlusion index is not less than a preset threshold, a prompt message is displayed, where the prompt message is used to prompt the user to adjust the size and / or position of the sticker.
[0024] Optionally, the method further comprises:
[0025] When the occlusion index is not less than a preset threshold, the planned adding position is updated, and the process returns to determine the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising image, and the area where the non-transparent pixels in the initial advertising image are located; based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising image, and the area where the non-transparent pixels in the initial advertising image are located, the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising image is determined, and the occlusion index of the sticker to the initial advertising image is calculated, until the occlusion index corresponding to the updated planned adding position is less than the preset threshold.
[0026] Optionally, the method further comprises:
[0027] Constructing a virtual container, wherein the size of the virtual container is the same as the size of the video playing window playing the initial advertisement image;
[0028] The obtaining of the initial advertisement picture comprises:
[0029] Adding an initial advertisement image to the virtual container;
[0030] The determining of the non-transparent pixel points of the sticker includes:
[0031] Writing the sticker into the virtual container;
[0032] Creating a two-dimensional array in the virtual container, wherein each element position of the two-dimensional array corresponds to a pixel point of the initial advertisement image;
[0033] Traversing each pixel of the sticker, when a pixel is a non-transparent pixel, updating the non-transparent pixel to a two-dimensional array according to the current position of the sticker in the initial advertising image, and the current position is the planned adding position;
[0034] The determining, based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture, and calculating the occlusion index of the sticker on the initial advertising picture, includes:
[0035] Based on the updated two-dimensional array, counting the number of non-transparent pixels of the sticker;
[0036] Determine the ratio of the number of non-transparent pixels of the sticker to the number of non-transparent pixels in the initial advertising picture area when the sticker is at the planned addition position in the initial advertising picture, as the occlusion index of the initial advertising picture by the sticker.
[0037] In a second aspect of the present invention, a sticker adding device is provided, which is applied to a picture editing device, and the device comprises:
[0038] An acquisition module is used to acquire an initial advertisement picture; the initial advertisement picture is a picture to which stickers are to be added;
[0039] A determination module, used to determine the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, wherein the non-transparent pixels in the initial advertising picture represent the main content of the initial advertising picture;
[0040] a calculation module, for determining a quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture, and calculating an occlusion index of the initial advertising picture by the sticker, based on the non-transparent pixels of the sticker, a planned location of the sticker in the initial advertising picture, and an area where the non-transparent pixels in the initial advertising picture are located;
[0041] The adding module is used to superimpose stickers at the planned adding position in the initial advertising picture when the occlusion index is less than a preset threshold value to obtain a target advertising picture.
[0042] A third aspect of an embodiment of the present invention provides a picture editing device, comprising 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;
[0043] The memory is used to store computer programs;
[0044] The processor is used to implement the sticker adding method described in the first aspect when executing the program stored in the memory.
[0045] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the sticker adding method described in the first aspect is implemented.
[0046] According to another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the sticker adding method described in the first aspect.
[0047] In an embodiment of the present invention, an occlusion index reflecting the degree of occlusion of the initial advertising image at the planned adding position is calculated, and when the occlusion index is less than a preset threshold, a sticker is superimposed at the planned adding position in the initial advertising image to obtain a target advertising image. In this way, sticker elements at the planned adding position corresponding to the occlusion index being less than the preset threshold can reduce the occlusion of the main content of the advertisement by the sticker elements. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention 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.
[0049] Figure 1 This is a flowchart of a sticker adding method provided by an embodiment of the present invention.
[0050] Figure 2 It is a schematic diagram of overlapping of multiple stickers in an advertisement picture according to an embodiment of the present invention.
[0051] Figure 3a This is an example diagram of a sticker coverage area provided by an embodiment of the present invention.
[0052] Figure 3b This is another example diagram of a sticker coverage area provided by an embodiment of the present invention.
[0053] Figure 4 A flowchart of a specific embodiment is provided for the embodiment of the present invention.
[0054] Figure 5 A schematic diagram of the structure of a sticker adding device provided in an embodiment of the present invention.
[0055] Figure 6 A schematic diagram of the structure of a picture editing device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0057] In existing advertising practices, advertisers usually design some patterns and texts by themselves. For example, corporate logos, slogans, etc. are used as sticker elements and superimposed on advertising pictures to enhance the advertising effect.
[0058] However, when the area of a single sticker element to be added is too large, or the number of sticker elements to be added is large, the added sticker elements are likely to cover the main content of the advertisement image, thereby affecting the effect of the advertisement.
[0059] In view of the above problems, an embodiment of the present invention provides a sticker adding method, such as Figure 1As shown, including:
[0060] S101, obtaining an initial advertisement picture; the initial advertisement picture is a picture to which stickers are to be added;
[0061] S102, determining non-transparent pixels of the sticker, a planned location for adding the sticker in the initial advertisement picture, and an area where the non-transparent pixels in the initial advertisement picture are located, wherein the non-transparent pixels in the initial advertisement picture represent the main content of the initial advertisement picture;
[0062] S103, based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, determining the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture, and calculating the occlusion index of the sticker on the initial advertising picture;
[0063] S104, when the occlusion index is less than a preset threshold, superimpose stickers at planned locations in the initial advertisement image to obtain a target advertisement image.
[0064] The sticker adding method provided by the embodiment of the present invention can be applied to a picture editing device, for example, the picture editing device can be a server, a terminal, etc.
[0065] For example, the sticker adding method provided in the embodiment of the present invention can be applied to the process of an advertiser generating an advertisement. In this case, the picture editing device can be an electronic device that provides picture editing functions to the advertiser, such as a browser.
[0066] The sticker adding method provided by an embodiment of the present invention calculates an occlusion index reflecting the degree of occlusion of the initial advertising image at the planned adding position, and when the occlusion index is less than a preset threshold, superimposes stickers at the planned adding position in the initial advertising image to obtain a target advertising image. In this way, sticker elements at the planned adding position corresponding to the occlusion index being less than the preset threshold can reduce the occlusion of the main content of the advertisement by the sticker elements.
[0067] The main content in the initial advertisement picture can also be understood as the effective information in the initial advertisement picture. Specifically, the main content can include people, objects, etc. in the initial advertisement picture.
[0068] In one approach, a main content recognition model may be obtained by training a plurality of sample images in advance, and the initial advertisement image may be input into the main content recognition model, and the main content of the initial advertisement image may be determined by the main content recognition model.
[0069] Specifically, the main content recognition model can be obtained by training multiple sample images in the following ways:
[0070] Obtaining multiple sample images and marking information of the main content of each sample image, such as marking people and objects in the initial advertisement image with a rectangular frame, wherein the image can be marked using a marking method in the related art, which is not limited in the embodiment of the present invention;
[0071] A sample image is selected, and the sample image is input into the initial model. The initial model outputs the recognition information of the main content in the sample image, and the recognition information is compared with the marking information. If the difference between the recognition information and the marking information exceeds the preset difference, the parameters of the initial model are adjusted until the difference between the recognition information and the marking information is less than the preset difference. Then, the method returns to execute the selection of a sample image and subsequent steps until the number of training times reaches the preset number, and the training is terminated to obtain a trained main content recognition model, wherein the preset difference, the preset number of times, etc. are determined according to actual needs or experience.
[0072] The identification information may be a picture marked with the main content of the sample, or may be the position information of the identified main content in the initial advertisement picture.
[0073] The initial model can be any type of artificial intelligence model, such as a deep learning model. The specific model training process is carried out with reference to the training method of the artificial intelligence model in the relevant technology, which will not be repeated here.
[0074] In the embodiment of the present invention, the main content of the initial advertisement picture is represented by non-transparent pixels in the initial advertisement picture.
[0075] Reference Figure 1 , the embodiment of the present invention describes the sticker adding method in detail.
[0076] S101, obtaining an initial advertisement picture; the initial advertisement picture is a picture to which stickers are to be added.
[0077] The initial advertising images may include images in various forms, such as photographs, screenshots, hand-drawn images, and images generated using AI (Artificial Intelligence) technology.
[0078] The initial advertisement picture may be a picture provided by the advertiser for promoting the business. In the embodiment of the present invention, after adding sticker elements to the initial advertisement picture, the sticker elements will not block the main content of the advertisement as much as possible, so that the advertisement recipient can obtain more information through the advertisement with the sticker elements added, thereby improving the advertising effect.
[0079] Stickers, which can also be understood as sticker elements, refer to elements added to the initial advertising image that can enhance the expressive effect of the image.
[0080] Sticker elements can include elements that can add additional information to the image, such as a sticker element with the text "70% off all items" or a sticker element with the logo of company A.
[0081] The sticker elements may include elements that can increase the beauty of the picture, for example, a sticker element with a pattern of "butterfly" is added to the "forest" picture; and sticker elements with patterns of "cake", "star", etc. are added to the "birthday photo" picture.
[0082] In S102, in a scenario where the advertiser generates an advertisement in real time, the current location selected can be used as the planned adding location in real time during the process of dragging the sticker on the advertisement picture by using a mouse, gestures, etc. to select a planned adding location.
[0083] Alternatively, a position that has been determined may be used as a planned adding position. In this case, the planned adding position may also be referred to as a target planned adding position.
[0084] In the case where the advertiser selects the planned adding position in real time, in the embodiment of the present invention, determining the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertisement picture, and the area where the non-transparent pixels in the initial advertisement picture are located may include:
[0085] Determine the non-transparent pixel points of the sticker and the non-transparent pixel points of the current image area, wherein the current image area represents the area overlapping with the initial advertising image when the sticker is at the current position in the initial advertising image, and the current position is used as the planned adding position.
[0086] In one possible implementation, before S102, the process may further include obtaining a plurality of original sticker elements; and splicing the plurality of original sticker elements to obtain stickers.
[0087] It can be understood that the sticker added to the initial advertisement image in the embodiment of the present invention may be a single sticker or a sticker obtained by splicing multiple stickers.
[0088] In S103, the method for triggering the calculation of the occlusion index of the sticker on the initial advertisement image is as follows:
[0089] In one possible implementation, after determining the target planned adding position, the occlusion index of the sticker on the initial advertisement image is calculated.
[0090] In another possible implementation, in response to detecting a selection operation on an initial advertising image, an occlusion index of the initial advertising image by the sticker is calculated, wherein a current position corresponding to the selection operation is used as a planned adding position.
[0091] Regarding the situation in which the occlusion index of the sticker on the initial advertising image is calculated in response to detecting a selection operation for the initial advertising image, it can also be understood that, during the process in which the operator selects a planned adding position for the advertising image in real time, the occlusion index of the sticker on the initial advertising image is calculated in real time corresponding to the currently determined planned adding position.
[0092] The selection operation may also include dragging stickers using a mouse, gestures, etc.
[0093] Specifically, in response to detecting a selection operation on the initial advertisement image, the current position of the sticker in the initial advertisement image is determined, and the current position is used as the planned adding position, and then steps S102 and S103 are executed.
[0094] For example, in a scenario where an advertiser generates an advertisement in real time, while the advertiser drags a sticker to the position of an advertisement picture using a mouse, gestures, etc., the currently selected position, that is, the current position, is determined based on the operation of dragging the sticker to the position of the advertisement picture using a mouse, gestures, etc. After determining the current position, the current position is used as a planned adding position, and steps S102 and S103 are executed.
[0095] Specifically, based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture is determined, and the occlusion index of the sticker on the initial advertising picture is calculated, including:
[0096] Based on the quantitative relationship between the non-transparent pixels of the sticker and the non-transparent pixels of the current image area, the occlusion index of the initial advertisement image by the sticker at the current position is calculated;
[0097] In this case, when the occlusion index is less than a preset threshold, stickers are superimposed at the planned position in the initial advertising image to obtain the target advertising image, that is, stickers are superimposed at the current position in the initial advertising image to obtain the target advertising image.
[0098] In which, in response to detecting a selection operation on the initial advertising picture, determining the current position of the sticker in the initial advertising picture may include: in response to a placement operation of the sticker in the initial advertising picture, determining the current position of the sticker in the initial advertising picture.
[0099] In the embodiment of the present invention, the number of stickers targeted by the placement operation may be one or more.
[0100] When the number of stickers targeted by the placement operation is one, the current position of the sticker in the target image indicates the position of the sticker in the target image.
[0101] When the number of stickers targeted by the placement operation is multiple, the current position of the sticker in the target image represents the position of each of the stickers in the target image.
[0102] The placement operation of stickers in the target image may include a selection operation for stickers and a move operation for the selected stickers. For example, to place stickers in the initial advertisement image, for the placement process of a single sticker, the operator first selects which sticker to place in the initial advertisement image, and then moves the sticker to the initial advertisement image.
[0103] In one practicable manner, the selected sticker may include elements customized by the provider of the initial advertising image according to demand.
[0104] The provider of the initial advertising image can customize stickers that meet actual needs in advance and upload them to the platform that provides sticker adding services. In this way, the stickers are more consistent with the initial advertising image, making the generated final advertising image more meet actual needs. In the scenario of generating advertising images, the communication effect of the advertising images is improved.
[0105] In another achievable manner, the selected stickers may include elements pre-randomly generated by a platform providing sticker adding services.
[0106] The platform that provides sticker adding service can pre-generate a large number of stickers randomly, and can store these stickers in a material library, so that the operator can select the stickers that he wants to add to the initial advertising picture in the material library.
[0107] The moving operation for the selected sticker may include a dragging operation and a scaling operation for the sticker, wherein the dragging operation refers to the operation of moving the sticker position; and the scaling operation refers to the operation of changing the sticker size.
[0108] The operator places the selected sticker in the initial advertisement picture at a position where the sticker is expected to overlap with the initial advertisement picture by dragging and zooming, which is also the current position of the sticker in the initial advertisement picture determined by the picture editing device in response to the placement operation.
[0109] Understandably, since the position is only selected by the operator based on subjective judgment, the position where the sticker is superimposed will not excessively block the content of the initial advertisement picture. Therefore, it cannot be determined that this position is definitely a position that will not excessively block the content of the target picture, and the picture editing device is required to further determine the rationality of the current position, that is, through S102 and S103, calculate the blocking index of the sticker on the initial advertisement picture if the sticker is superimposed at the current position.
[0110] In S103, the following method may be used to calculate the occlusion index of the sticker on the initial advertisement image:
[0111] In one implementable method, the non-transparent pixels of the sticker and the non-transparent pixels of the overlapping area in the initial advertising image can be determined, wherein the overlapping area is the area that overlaps with the initial advertising image when the sticker is at the planned addition position in the initial advertising image, and based on the quantitative relationship between the non-transparent pixels of the sticker and the non-transparent pixels of the overlapping area in the initial advertising image, the occlusion index of the sticker on the initial advertising image when it is at the planned addition position is calculated.
[0112] Among them, the ratio of the number of non-transparent pixels of the sticker and the number of non-transparent pixels in the overlapping area of the initial advertising image can be used as an occlusion indicator of the initial advertising image when the sticker is planned to be added.
[0113] In another possible implementation method, the non-transparent pixels in the overlapping area of the stickers and the non-transparent pixels in the initial advertising image can be determined, and based on the quantitative relationship between the non-transparent pixels in the overlapping area of the stickers and the non-transparent pixels in the initial advertising image, the occlusion index of the initial advertising image by the stickers at the planned addition position can be calculated.
[0114] Among them, the ratio of the number of non-transparent pixels in the overlapping area of the sticker to the number of non-transparent pixels in the initial advertising image can be used as an occlusion indicator of the initial advertising image when the sticker is planned to be added.
[0115] In another possible implementation method, the planned location of the sticker in the initial advertising image, the non-transparent pixels of the sticker, and the non-transparent pixels of the initial advertising image can be determined, and based on the quantitative relationship between the planned location of the sticker in the initial advertising image, the non-transparent pixels of the sticker, and the non-transparent pixels of the overlapping area in the initial advertising image, the occlusion index of the sticker on the initial advertising image can be calculated.
[0116] Among them, the ratio of the number of non-transparent pixels of the sticker to the number of non-transparent pixels of the initial advertising picture when the sticker is at the planned adding position in the initial advertising picture can be used as an occlusion indicator of the initial advertising picture when the sticker is at the planned adding position.
[0117] Determining a non-transparent pixel can also be understood as determining the transparency information of the pixel. The transparency information is used to indicate whether the pixel contains valid information. It is generally believed that the higher the transparency, the less valid information the pixel contains; the lower the transparency, the more valid information the pixel contains. In an embodiment of the present invention, the pixels can be divided into non-transparent pixels whose transparency information is non-transparent and transparent pixels whose pixel information is transparent.
[0118] In one feasible method, the color value can be used to evaluate the amount of effective information contained in a pixel. Pixels with color values greater than a preset color value threshold (dark color value) contain more effective information, and the pixel information of the pixel can be set to non-transparent; pixels with color values less than a preset color value threshold (light color value) contain less effective information, and the pixel information of the pixel can be set to transparent. Furthermore, the embodiment of the present invention can obtain the non-transparent pixels of the sticker by detecting the color value of each pixel of the sticker.
[0119] The transparency information of the sticker can be stored in a two-dimensional array. In one achievable manner, the transparency information of the sticker can be saved in a two-dimensional array through a preset API of the browser. Among them, four consecutive elements in the two-dimensional array can be used to represent the four attribute values of a pixel, and the attribute value represented by the fourth element can be the transparency information of the pixel.
[0120] For example, four consecutive elements in a two-dimensional array can represent the red (R), green (G), blue (B), and transparency (Alpha, A for short) values of a pixel respectively. If the A value of a pixel is greater than 0, it means that the pixel is visible, that is, non-transparent. When the image editing device detects that the A value of a pixel is greater than 0, it determines that it is a non-transparent pixel. The above-mentioned method of representing the attribute value of a pixel with R, G, B, and A values can also be called RGBA color representation (additional transparency color representation).
[0121] In one feasible method, the image editing device can traverse all stickers and parse each pixel in the stickers to obtain the colored pixels, or non-transparent pixels, and update the pixel information of the non-transparent pixels to the same coordinates in the two-dimensional array, thereby marking the non-transparent pixels in the two-dimensional array.
[0122] For some stickers, their combination can bring different expressive effects. For example, a sticker with an "arc" pattern and a sticker with a "star" pattern can express the combined effect of a "shooting star" when the two are combined.
[0123] Therefore, the operator can place different sticker combinations in the initial advertising image to achieve different expression effects. In this process, different stickers may overlap. Figure 2 As shown, in the shadow part, sticker A and sticker B overlap. At this time, if we still determine the occlusion of each sticker on the initial advertising picture separately, it is obviously inaccurate.
[0124] Furthermore, in the embodiment of the present invention, the sticker area when the sticker is at the current position refers to the joint coverage area of the stickers. Figure 3a As shown, sticker area 301 is the area covered by sticker A. When the number of stickers targeted by the placement operation in S102 is multiple, such as Figure 3b , sticker area 302 refers to the entire area covered by these stickers.
[0125] In a possible embodiment, determining the sticker area when the sticker is at the current position may include: for each sticker, drawing the contour area of the sticker; the contour area includes each pixel whose transparency information of the sticker is non-transparent; and taking the union of the contour areas of each sticker at the current position to obtain the sticker area.
[0126] Each sticker refers to each sticker in the stickers targeted by this placement operation. According to the transparency information of each pixel in each sticker, a contour area corresponding to each sticker is drawn, including all non-transparent pixel information in the sticker. By taking the union of each contour area drawn at the current position, the sticker area corresponding to the sticker targeted by this placement operation is obtained.
[0127] In another possible embodiment, for each sticker, the transparency information is the position information of each non-transparent pixel; and the sticker area is drawn using the position information.
[0128] The position information of each pixel whose transparency information is non-transparent in each sticker placed in this operation is counted. When the position information of each pixel whose transparency information is non-transparent overlaps, only this is counted. In this way, the coverage area of the non-transparent pixel points in each sticker at the current position can be drawn, that is, the sticker area.
[0129] According to the embodiments of the present invention, a plurality of stickers can be spliced together to obtain a continuous sticker area, and the occlusion of the initial advertising image when multiple stickers are added can be determined more effectively in the future, thereby making the detection of whether the content of the initial advertising image is occluded more accurate.
[0130] The sticker adding method provided by the embodiment of the present invention may further include: constructing a virtual container.
[0131] Constructing a virtual container, the size of the virtual container being the same as the size of the video playing window playing the initial advertisement image;
[0132] S101 includes: adding an initial advertisement image to a virtual container;
[0133] Determining the non-transparent pixel points of the sticker in S102 includes: writing the sticker into a virtual container; creating a two-dimensional array in the virtual container, where each element position of the two-dimensional array corresponds to a pixel point of the initial advertising image; traversing each pixel point of the sticker, when a pixel point is a non-transparent pixel point, updating the non-transparent pixel point to the two-dimensional array according to the current position of the sticker in the initial advertising image, and the current position is the planned adding position;
[0134] S103 includes: counting the number of non-transparent pixels of the sticker based on the updated two-dimensional array; determining the ratio of the number of non-transparent pixels of the sticker to the number of non-transparent pixels in the initial advertising picture area when the sticker is planned to be added in the initial advertising picture, as an occlusion indicator of the sticker on the initial advertising picture.
[0135] The virtual container can be understood as a virtual interface that can simulate the sticker process. In a possible implementation, the virtual container can be constructed using the browser's Canvas. The size of the virtual container can be the same as the size of the initial advertisement image.
[0136] Then, the initial advertisement image may be added to the virtual container.
[0137] Since the size of the virtual container is the same as the size of the initial advertisement image, after the initial advertisement image is added to the virtual container, the initial advertisement image can be well adapted to the virtual container. The process of adding the initial advertisement image to the virtual container can also be considered as instantiating the virtual container. This process can be performed in memory.
[0138] In response to a placement operation of the sticker in the initial advertisement picture within the virtual container, a current position of the sticker in the initial advertisement picture is determined using the virtual container.
[0139] The image editing device (a browser in the embodiment of the present invention) can obtain addable stickers according to a provided API (Application Programming Interface) after the initial advertisement image is added to the virtual container. In a possible implementation, the addable stickers can be a DOM (Document Object Model) instance customized by the provider of the initial advertisement image.
[0140] The image editing device can display these addable stickers to the operator so that the operator can select from the displayed stickers. In response to the operator's placement operation on the sticker in the initial advertisement picture in the virtual container, the current position of the sticker in the initial advertisement picture is determined using the preset function of the virtual container.
[0141] In a possible implementation, when the addable stickers are customized DOM instances by the provider of the initial advertising image, since it can be considered that these stickers do not have elements unrelated to the initial advertising image, all DOM instances can be directly copied to the virtual container.
[0142] Since the size of the virtual container is the same as the size of the initial advertisement image, in the embodiment of the present invention, determining the position of the sticker pixel added in the initial advertisement image is essentially determining the position of the sticker in the virtual container. The position of the sticker in the virtual container can be determined by constructing a specific coordinate system in the virtual container, for example, taking the center point of the virtual container as the origin, constructing a coordinate system with the positive directions of the y-axis and the x-axis upward and to the right respectively, to determine the position of the sticker in the coordinate system.
[0143] Furthermore, the virtual container can be used to determine the non-transparent pixels of the sticker.
[0144] By using the preset function of the virtual container and based on the current position of each sticker in the virtual container, the stickers are spliced to obtain a continuous sticker area. The pixel information of the stickers is detected and the content of the sticker area is determined. The relevant content in the aforementioned S103 can be referred to and will not be repeated here.
[0145] Furthermore, based on the non-transparent pixels of the sticker, the planned addition position of the sticker in the initial advertising image, and the area where the non-transparent pixels in the initial advertising image are located, the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising image is determined, and the occlusion index of the sticker on the initial advertising image is calculated.
[0146] Among them, the occlusion index is used to reflect the degree of joint coverage of the initial advertising image by the stickers placed in the initial advertising image at the current position, or the degree of occlusion. If the degree of occlusion is low, it is considered that adding stickers at the current position in the initial advertising image will not block the main content of the initial advertising image; if the degree of occlusion is high, it is considered that adding stickers at the current position in the initial advertising image will block the main content of the initial advertising image, thereby affecting the display effect of the initial advertising image.
[0147] The overlapping area can also be understood as the area where the sticker area is located inside the initial advertising image. It can be understood that only the part of the sticker added in the initial advertising image area can be displayed in the final image (final image). In one example, the ratio of the first number to the second number is calculated to obtain the occlusion index of the initial advertising image; wherein the first number represents the number of pixels with non-transparent transparency information in the overlapping area of the sticker area; and the second number represents the number of pixels with non-transparent transparency information in the initial advertising image.
[0148] The overlapping area may include all or part of the sticker area. If the sticker is completely inside the initial advertising image, the sticker area is the overlapping area. The first number is the number of pixels in the sticker area whose transparency information is non-transparent. If the sticker is partially inside the initial advertising image and partially outside the initial advertising image, the overlapping area may include the part of the sticker area that is inside the initial advertising image. The first number is the number of pixels in the sticker area whose transparency information is non-transparent in the overlapping area.
[0149] Continuing with the aforementioned example of storing sticker pixel information in a two-dimensional array, the embodiment of the present invention can accumulate the number of non-transparent pixels in the global two-dimensional array as a numerator for calculating the occlusion index, that is, the first number.
[0150] In one achievable manner, regardless of the actual information of each pixel in the initial advertisement image, the pixel information of each pixel is considered to be non-transparent, that is, the second number may be the total number of pixels in the initial advertisement image, thereby avoiding the detection of the pixel information of each pixel in the initial advertisement image and saving computing resources.
[0151] In another achievable manner, the method of determining the non-transparent pixels of the sticker in S103 may be referred to to determine the pixels with transparency information as non-transparent in the initial advertising image, thereby improving the accuracy of the second number.
[0152] After obtaining the first number and the second number, the ratio of the first number to the second number may be calculated to obtain the occlusion index of the initial advertisement image.
[0153] In a feasible manner, the first area of the overlapping area in the sticker area and the second area of the initial advertisement image may be determined, and the occlusion index may be obtained by calculating the first area and the second area.
[0154] In S104, when the occlusion index is less than a preset threshold, stickers are superimposed at the planned locations in the initial advertisement image to obtain a target advertisement image.
[0155] The occlusion index is less than the preset threshold, and it is considered that adding stickers at the planned adding position will not excessively block the initial advertising image. Furthermore, when the initial advertising image is an advertising image, adding stickers at the planned adding position will not only not affect the communication of the advertisement, but also effectively improve the display effect of the advertising image by using stickers, and further improve the effective communication rate of the advertisement.
[0156] Conversely, there may also be a situation where the occlusion index is not less than the preset threshold.
[0157] In one possible implementation for a situation where the occlusion index is not less than a preset threshold, the image editing device may be adaptively adjusted to achieve adaptively moving stickers that do not meet the occlusion index away from the main content of the initial advertising image.
[0158] Specifically, when the occlusion index is not less than the preset threshold, the planned adding position is updated, and the process returns to execute S102 and S103 until the occlusion index corresponding to the updated planned adding position is less than the preset threshold.
[0159] In another possible implementation for the case where the occlusion index is not less than a preset threshold, the operator may be reminded to make adjustments, for example, a user who edits the picture, such as an advertiser, may be reminded to make adjustments.
[0160] Specifically, when the occlusion index is not less than a preset threshold, a prompt message is displayed, and the prompt message is used to prompt the user to adjust the size and / or position of the sticker.
[0161] For example, in a scenario where an advertiser generates an advertisement in real time, the advertiser drags a sticker on an advertisement image through a mouse, gesture, etc. to select a planned adding location, and the selected current location is used as the planned adding location in real time.
[0162] When the occlusion index is not less than a preset threshold, the operator is prompted that the initial advertising image is occluded, and in response to a change operation on the sticker, the execution returns to the step of determining the current position of the sticker in the initial advertising image.
[0163] When the occlusion index is not less than the preset threshold, it means that adding a sticker at the current position will occlude the initial advertising image, affecting the information conveyed by the initial advertising image.
[0164] Therefore, the picture editing device can prompt the operator that the initial advertising picture is blocked, for example, by popping up a prompt box containing "Please adjust the sticker" on the operation interface, so that the operator triggers the change operation for the sticker after seeing the prompt information.
[0165] The direct factor causing the occlusion index to be not less than the preset threshold is that there are too many non-transparent pixels in the overlapping area between the sticker area and the initial advertising image. Therefore, according to the number of non-transparent pixels in the area, the embodiment of the present invention can adjust the position and size of the stickers, or even delete some stickers. That is, in the embodiment of the present invention, the change operation can include moving the position of the sticker, and / or adjusting the size of the sticker, and / or changing the type of the sticker, etc.
[0166] When the change operation is to move the position of the sticker, the picture editing device responds to the change operation of the sticker in the initial advertising picture, redetermines the current position of the sticker in the initial advertising picture, and again determines the occlusion index of the initial advertising picture at the changed current position through S102 and S103 to determine whether the sticker can be added at the changed position.
[0167] Generally, adjusting the size of the sticker means reducing the size of the sticker so that the range of the sticker area is reduced, thereby reducing the number of non-transparent pixels in the overlapping area between the sticker area and the initial advertising image. The image editing device responds to the change operation of the sticker in the initial advertising image and re-determines the current position of the sticker in the initial advertising image. S102 and S103 are used to determine the occlusion index of the initial advertising image at the changed current position again, so as to determine whether the sticker can be added at the changed position.
[0168] Changing the type of sticker may include adding a new sticker, that is, the operator triggers a placement operation to place a new sticker in the initial advertising picture; it may also include deleting a sticker, and the operator may delete the sticker in the initial advertising picture by moving the position of the sticker so that the moved sticker does not overlap with the initial advertising picture. The picture editing device responds to the change operation of the sticker in the initial advertising picture, re-determines the current position of the sticker in the initial advertising picture, and again determines the occlusion index of the initial advertising picture at the changed current position through S102 and S103, so as to determine whether the sticker can be added at the changed position.
[0169] The sticker adding method provided by the embodiment of the present invention can be summarized into four steps: collecting and splicing stickers, parsing the pixel information of stickers, calculating the occlusion index, and adjusting the stickers according to the occlusion index. For example, by accurately counting the number of non-transparent pixels in the overlapping area of the stickers and the initial advertising picture, the effective coverage ratio (occlusion index) of the stickers for the initial advertising picture is calculated, and according to whether the occlusion index is less than a preset threshold, it is determined whether the sticker added at the current position will cover the main content of the initial advertising picture, and then the sticker is added at the current position that will not cover the main content of the initial advertising picture. In this way, the communication effect of the initial advertising picture can be improved by adding stickers in the initial advertising picture, and the sticker is guaranteed not to cover the main content of the picture.
[0170] Furthermore, in the field of advertising, for some companies with advertising capabilities, especially advertising platforms and marketing companies that can provide customized advertising sticker adding services, the sticker adding method provided by the embodiments of the present invention can not only ensure that the main content of the advertising image is not covered by stickers, but also use stickers to improve the effective communication rate and advertising effect of the advertisement, enhance the advertiser's advertising experience, and further improve the service quality and customer satisfaction of the advertising platform.
[0171] In one feasible approach, AI technology and deep learning technology can be introduced to accurately identify the main content area of the initial advertising image that contains effective information, and prompt the operator to avoid adding stickers in the main content area, so that the overlapping range of stickers and the initial advertising image can be controlled.
[0172] like Figure 4 As shown, in a specific embodiment, the sticker adding method provided by the embodiment of the present invention may include:
[0173] S401, initializing a virtual container using a browser interface.
[0174] The size of the virtual container may be the same as the size of the initial ad image.
[0175] S402, loading an initial advertisement image in a virtual container and obtaining stickers.
[0176] S402 may be executed in the memory, and the image editing device may copy the sticker DOM instance from the memory.
[0177] S403, writing the sticker into the virtual container.
[0178] In response to the placement operation for the sticker triggered by the operator, the picture editing device writes the sticker to the position where the operator wants to add the sticker in the advertisement picture.
[0179] S403 may be referred to as instantiation of the sticker and the virtual container.
[0180] S404, analyzing the pixel position information of the sticker, and storing the pixel position information in a global two-dimensional array.
[0181] This process is also the process of determining the non-transparent pixels of the sticker.
[0182] The pixel point information of the sticker may include pixel information of each pixel of the sticker. The embodiment of the present invention may correspond to the position of each pixel of the sticker in the virtual container and fill the pixel point information of each pixel of the sticker in the corresponding position of the global two-dimensional array.
[0183] In this process, each pixel of the sticker can be traversed and the non-transparent pixels therein can be marked.
[0184] S405, counting the number of non-transparent pixels of the sticker in the overlapping area and the number of non-transparent pixels in the initial advertisement image.
[0185] S406, calculating the occlusion index.
[0186] Specifically, the method of calculating the occlusion index has been described in detail in the above embodiment and will not be repeated here.
[0187] S407, prompting the operator to perform an operation according to the occlusion index.
[0188] When the occlusion index is less than a preset threshold, the operator can be prompted that adding stickers at the current position will not block the main content of the advertising image. At this time, the final image can be generated, that is, the stickers are superimposed at the planned position in the initial advertising image to obtain the target advertising image.
[0189] When the occlusion index is not less than a preset threshold, the operator can be prompted to add stickers at the current position to prevent excessive occlusion of the main content of the advertisement image. The stickers can be adjusted by moving the position of the stickers, adjusting the size of the stickers, changing the type of stickers, etc.
[0190] The embodiment of the present invention applies the sticker adding method to the generation process of the advertising picture, which effectively improves the display effect of the advertising picture while ensuring that the main content of the advertising picture is not excessively covered by the sticker, thereby improving the effective communication rate of the advertisement.
[0191] like Figure 5 As shown, an embodiment of the present invention provides a sticker adding device, which is applied to a picture editing device and may include:
[0192] The acquisition module 501 is used to acquire an initial advertisement picture; the initial advertisement picture is a picture to which stickers are to be added;
[0193] A determination module 502 is used to determine the non-transparent pixels of the sticker, the planned location of the sticker in the initial advertisement picture, and the area where the non-transparent pixels in the initial advertisement picture are located, wherein the non-transparent pixels in the initial advertisement picture represent the main content of the initial advertisement picture;
[0194] A calculation module 503 is used to determine the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, and calculate the occlusion index of the sticker on the initial advertising picture;
[0195] The adding module 504 is used to add stickers at the planned location in the initial advertisement image to obtain a target advertisement image when the occlusion index is less than a preset threshold.
[0196] Optionally, the calculation module 503 is specifically used to: in response to detecting a selection operation on an initial advertising image, calculate the occlusion index of the sticker on the initial advertising image, wherein the current position corresponding to the selection operation is used as the planned adding position; or, after determining the target planned adding position, calculate the occlusion index of the sticker on the initial advertising image.
[0197] Optionally, the determination module 502 is specifically used to: determine the non-transparent pixel points of the sticker and the non-transparent pixel points of the current image area, wherein the current image area represents the area overlapping with the initial advertisement image when the current position of the sticker in the initial advertisement image, and the current position is used as the planned adding position;
[0198] The calculation module 503 is specifically used to calculate the occlusion index of the initial advertisement image when the sticker is at the current position based on the quantity relationship between the non-transparent pixels of the sticker and the non-transparent pixels of the current image area;
[0199] The adding module 504 is specifically used to: when the occlusion index is less than a preset threshold, superimpose a sticker at the current position in the initial advertisement image to obtain a target advertisement image.
[0200] Optionally, the device further comprises:
[0201] The splicing module is used to obtain multiple original sticker elements before determining the non-transparent pixels of the sticker and the planned addition position of the sticker in the initial advertising picture and the area where the non-transparent pixels in the initial advertising picture are located; and splicing the multiple original sticker elements to obtain the sticker.
[0202] Optionally, the device further comprises:
[0203] The prompt module is used to display a prompt message when the occlusion index is not less than a preset threshold, and the prompt message is used to prompt the user to adjust the size and / or position of the sticker.
[0204] Optionally, the device further comprises:
[0205] The updating module is used to update the planned adding position when the occlusion index is not less than a preset threshold value, and return to execute to determine the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising image, and the area where the non-transparent pixels in the initial advertising image are located; based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising image, and the area where the non-transparent pixels in the initial advertising image are located, determine the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising image, and calculate the occlusion index of the sticker to the initial advertising image until the occlusion index corresponding to the updated planned adding position is less than the preset threshold value.
[0206] Optionally, the device further comprises:
[0207] A construction module, used for constructing a virtual container, the size of the virtual container being the same as the size of the video playing window playing the initial advertisement image;
[0208] The acquisition module 501 is specifically used to: add the initial advertisement image to the virtual container;
[0209] Determine module 502, specifically used to write the sticker into the virtual container; create a two-dimensional array in the virtual container, each element position of the two-dimensional array corresponds to a pixel point of the initial advertising picture; traverse each pixel point of the sticker, when a pixel point is a non-transparent pixel point, then according to the current position of the sticker in the initial advertising picture, update the non-transparent pixel point to the two-dimensional array, and the current position is the planned adding position;
[0210] The calculation module 503 is specifically used to: count the number of non-transparent pixels of the sticker based on the updated two-dimensional array; determine the ratio of the number of non-transparent pixels of the sticker to the number of non-transparent pixels in the initial advertising picture area when the sticker is planned to be added in the initial advertising picture, as an occlusion indicator of the sticker on the initial advertising picture.
[0211] The embodiment of the present invention also provides a picture editing device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.
[0212] Memory 603, used for storing computer programs;
[0213] The processor 601 is used to implement any of the above-mentioned sticker adding methods when executing the program stored in the memory 603.
[0214] The communication bus mentioned in the above-mentioned picture editing device 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.
[0215] The communication interface is used for communication between the above-mentioned picture editing device and other devices.
[0216] 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.
[0217] 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.
[0218] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the sticker adding method described in any one of the above embodiments is implemented.
[0219] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the sticker adding methods described in the above embodiments.
[0220] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by 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 invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can 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 can be transmitted from one website site, computer, server or data center to another 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.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can 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 hard disk Solid State Disk (SSD)), etc.
[0221] 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.
[0222] 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, picture editing equipment, computer-readable storage medium, and computer program product 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.
[0223] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A sticker adding method, characterized in that: Applied to a picture editing device, the method comprises: Obtain an initial advertising picture; the initial advertising picture is the picture to which stickers are to be added; Determine the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertisement picture, and the area where the non-transparent pixels in the initial advertisement picture are located, wherein the non-transparent pixels in the initial advertisement picture represent the main content of the initial advertisement picture; Based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, determining the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture, and calculating the occlusion index of the sticker on the initial advertising picture; When the occlusion index is less than a preset threshold, stickers are superimposed at the planned adding position in the initial advertising picture to obtain a target advertising picture.
2. The method according to claim 1, characterized in that The calculating the occlusion index of the sticker on the initial advertisement image includes: In response to detecting a selection operation on the initial advertising image, calculating an occlusion index of the initial advertising image by the sticker, wherein a current position corresponding to the selection operation is used as a planned adding position; or After determining the target planned adding position, the occlusion index of the sticker on the initial advertising image is calculated.
3. The method according to claim 1, characterized in that The determining of the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertisement picture, and the area where the non-transparent pixels in the initial advertisement picture are located includes: Determine the non-transparent pixel points of the sticker and the non-transparent pixel points of the current picture area, wherein the current picture area represents the area overlapping with the initial advertisement picture when the sticker is at the current position in the initial advertisement picture, and use the current position as the planned adding position; The determining, based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture, and calculating the occlusion index of the sticker on the initial advertising picture, includes: Based on the quantitative relationship between the non-transparent pixels of the sticker and the non-transparent pixels of the current image area, calculating the occlusion index of the initial advertising image by the sticker at the current position; When the occlusion index is less than a preset threshold, the sticker is superimposed at the planned adding position in the initial advertisement picture to obtain a target advertisement picture, including: When the occlusion index is less than a preset threshold, a sticker is superimposed at the current position in the initial advertising picture to obtain a target advertising picture.
4. The method according to claim 1, characterized in that Before determining the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertisement picture, and the area where the non-transparent pixels in the initial advertisement picture are located, the method further includes: Get multiple original sticker elements; The multiple original sticker elements are spliced together to obtain the sticker.
5. The method according to claim 1, characterized in that The method further comprises: When the occlusion index is not less than a preset threshold, a prompt message is displayed, where the prompt message is used to prompt the user to adjust the size and / or position of the sticker.
6. The method according to claim 1, characterized in that The method further comprises: When the occlusion index is not less than a preset threshold, the planned adding position is updated, and the process returns to determine the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising image, and the area where the non-transparent pixels in the initial advertising image are located; based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising image, and the area where the non-transparent pixels in the initial advertising image are located, the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising image is determined, and the occlusion index of the sticker to the initial advertising image is calculated, until the occlusion index corresponding to the updated planned adding position is less than the preset threshold.
7. The method according to claim 1, characterized in that The method further comprises: Constructing a virtual container, wherein the size of the virtual container is the same as the size of the video playing window playing the initial advertisement image; The obtaining of the initial advertisement picture comprises: Adding an initial advertisement image to the virtual container; The determining of the non-transparent pixel points of the sticker includes: Writing the sticker into the virtual container; Creating a two-dimensional array in the virtual container, wherein each element position of the two-dimensional array corresponds to a pixel point of the initial advertisement image; Traversing each pixel of the sticker, when a pixel is a non-transparent pixel, updating the non-transparent pixel to a two-dimensional array according to the current position of the sticker in the initial advertising image, and the current position is the planned adding position; The determining, based on the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, the quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture, and calculating the occlusion index of the sticker on the initial advertising picture, includes: Based on the updated two-dimensional array, counting the number of non-transparent pixels of the sticker; Determine the ratio of the number of non-transparent pixels of the sticker to the number of non-transparent pixels in the initial advertising picture area when the sticker is at the planned addition position in the initial advertising picture, as the occlusion index of the initial advertising picture by the sticker.
8. A sticker adding device, characterized in that: Applied to a picture editing device, the device comprises: An acquisition module is used to acquire an initial advertisement picture; the initial advertisement picture is a picture to which stickers are to be added; A determination module, used to determine the non-transparent pixels of the sticker, the planned adding position of the sticker in the initial advertising picture, and the area where the non-transparent pixels in the initial advertising picture are located, wherein the non-transparent pixels in the initial advertising picture represent the main content of the initial advertising picture; a calculation module, for determining a quantitative relationship between the non-transparent pixels of the sticker and the initial advertising picture, and calculating an occlusion index of the initial advertising picture by the sticker, based on the non-transparent pixels of the sticker, a planned location of the sticker in the initial advertising picture, and an area where the non-transparent pixels in the initial advertising picture are located; The adding module is used to superimpose stickers at the planned adding position in the initial advertising picture when the occlusion index is less than a preset threshold value to obtain a target advertising picture.
9. A picture editing 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 steps of any method described in claims 1-7 when executing a program stored in a memory.
10. 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 steps of any one of the methods of claims 1-7 are implemented.