Sticker effect detection method and device, computer device, and storage medium
By comparing pixels and filtering editing parameters, efficient detection of sticker effects is achieved, solving the problem of low detection efficiency in existing technologies and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-05-06
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technology cannot efficiently detect sticker effects, resulting in a poor user experience.
By comparing the pixels of the target image and the image to be detected, the differences in pixels are determined, and editing parameters are selected based on the difference map to achieve efficient detection of sticker effects.
It accurately represents the added content in the image to be detected, improving the efficiency and accuracy of sticker effect detection.
Smart Images

Figure CN115311446B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a sticker effect detection method, apparatus, computer device, and storage medium. Background Technology
[0002] With the development of image processing technology and the increasing demands of users for diverse multimedia content, users utilize various special effects functions provided by developers when editing images or videos to enrich the content. For example, users can personalize videos and images by adding stickers, such as static stickers (text, images, etc.) or dynamic stickers (animations, etc.). Therefore, the accurate implementation of sticker effects in practical applications is a key factor in ensuring a good user experience.
[0003] In related technologies, assertions are usually made in the code to determine whether the function is complete or the business logic is correct at the UI (User Interface) level to determine whether the sticker effect is accurate. However, this approach cannot guarantee the efficiency of detecting sticker effects. Summary of the Invention
[0004] Therefore, it is necessary to provide a sticker effect detection method, apparatus, computer equipment, and storage medium that can efficiently detect sticker effects in order to address the aforementioned technical problems.
[0005] A method for detecting sticker effects, the method comprising:
[0006] Obtain the image to be detected by adding an edited sticker to the target image, and obtain the editing parameters under at least one editing item corresponding to the sticker;
[0007] The target image and the image to be detected are compared pixel by pixel to determine the difference pixels in the image to be detected, and a difference map corresponding to the difference pixels is obtained.
[0008] Based on the difference map, editing parameters are filtered for each editing item to obtain the filtering results. The editing parameter filtering is to select the target editing parameters from the candidate editing parameters under the corresponding editing item, so that the original sticker matches the difference map after being edited according to the target editing parameters.
[0009] When the filtering results show that there are target editing parameters under each editing item, the target editing parameters under each editing item are compared with the corresponding editing parameters to obtain the image sticker effect detection results.
[0010] In one embodiment, the method further includes:
[0011] Obtain the sticker activation setting time corresponding to the sticker; based on the start and end times of the difference frames in the video to be detected, detect the sticker activation setting time to obtain the video sticker activation time detection result.
[0012] A sticker effect detection device, the device comprising:
[0013] The data acquisition module is used to acquire the image to be detected obtained by adding an edited sticker to the target image, and to acquire the editing parameters under at least one editing item corresponding to the sticker;
[0014] The comparison module is used to compare the target image and the image to be detected pixel by pixel, determine the difference pixels in the image to be detected, and obtain a difference map corresponding to the difference pixels.
[0015] The filtering module is used to filter the editing parameters of each editing item based on the difference map to obtain the filtering results. The editing parameter filtering is to select the target editing parameters from the candidate editing parameters under the corresponding editing item so that the original sticker matches the difference map after being edited according to the target editing parameters.
[0016] The detection module is used to compare the target editing parameters under each editing item with the corresponding editing parameters when the filtering results show that there are target editing parameters under each editing item, so as to obtain the image sticker effect detection result.
[0017] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0018] Obtain the image to be detected by adding an edited sticker to the target image, and obtain the editing parameters under at least one editing item corresponding to the sticker;
[0019] The target image and the image to be detected are compared pixel by pixel to determine the difference pixels in the image to be detected, and a difference map corresponding to the difference pixels is obtained.
[0020] Based on the difference map, editing parameters are filtered for each editing item to obtain the filtering results. The editing parameter filtering is to select the target editing parameters from the candidate editing parameters under the corresponding editing item, so that the original sticker matches the difference map after being edited according to the target editing parameters.
[0021] When the filtering results show that there are target editing parameters under each editing item, the target editing parameters under each editing item are compared with the corresponding editing parameters to obtain the image sticker effect detection results.
[0022] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0023] Obtain the image to be detected by adding an edited sticker to the target image, and obtain the editing parameters under at least one editing item corresponding to the sticker;
[0024] The target image and the image to be detected are compared pixel by pixel to determine the difference pixels in the image to be detected, and a difference map corresponding to the difference pixels is obtained.
[0025] Based on the difference map, editing parameters are filtered for each editing item to obtain the filtering results. The editing parameter filtering is to select the target editing parameters from the candidate editing parameters under the corresponding editing item, so that the original sticker matches the difference map after being edited according to the target editing parameters.
[0026] When the filtering results show that there are target editing parameters under each editing item, the target editing parameters under each editing item are compared with the corresponding editing parameters to obtain the image sticker effect detection results.
[0027] The aforementioned sticker effect detection method, apparatus, computer equipment, and storage medium acquire editing parameters for at least one editing item corresponding to the sticker, facilitating the detection of editing parameters for each editing item. By comparing the target image and the image to be detected after adding the edited sticker, the difference pixels in the image to be detected are determined, and a difference map corresponding to the difference pixels is obtained. This accurately represents the content added to the image to be detected, facilitating comparison between the added content and the original sticker. By filtering candidate editing parameters for each editing item, and ensuring that target editing parameters that match the difference map after editing the original sticker are obtained for each editing item, the target editing parameters are compared with the corresponding editing parameters to obtain the image sticker effect detection result. By detecting the effectiveness of the editing parameters for each editing item corresponding to the sticker in the image to be detected, efficient detection of sticker effects in the image to be detected is achieved. Attached Figure Description
[0028] Figure 1 This is an application environment diagram of the sticker effect detection method in one embodiment;
[0029] Figure 2This is a flowchart illustrating a sticker effect detection method in one embodiment;
[0030] Figure 3 This is a schematic diagram illustrating the addition of a sticker to a target image in one embodiment;
[0031] Figure 4 This is a schematic diagram illustrating the extraction of difference pixels from a difference map to obtain a difference map in one embodiment.
[0032] Figure 5 This is a schematic diagram showing the permutation and combination of sticker style selection items and sticker content editing items in one embodiment;
[0033] Figure 6 This is a schematic diagram of the smallest rectangular pixel block containing the difference pixels in the difference map in one embodiment;
[0034] Figure 7 This is a flowchart illustrating a sticker effect detection method in one embodiment;
[0035] Figure 8 This is a flowchart illustrating the sticker effect detection method in another embodiment;
[0036] Figure 9 This is a schematic diagram of images at each stage of the sticker effect detection process in one embodiment;
[0037] Figure 10 This is a structural block diagram of a sticker effect detection device in one embodiment;
[0038] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0040] The sticker effect testing method provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 responds to the image to be detected generated by editing and adding stickers according to editing items on the target image. Terminal 102 sends the editing parameters under the editing item corresponding to the sticker and the image to be detected to server 104. Server 104 compares the target image and the image to be detected pixel by pixel, determines the difference pixels in the image to be detected, and obtains the difference map corresponding to the difference pixels. Based on the difference map, server 104 filters the editing parameters for each editing item, obtaining the filtering results. Editing parameter filtering involves selecting target editing parameters from the candidate editing parameters under the corresponding editing item, ensuring that the original sticker matches the difference map after being edited according to the corresponding target editing parameters. When the filtering results show that target editing parameters exist under each editing item, server 104 compares the target editing parameters under each editing item with the corresponding editing parameters to obtain the image sticker effect detection result, and pushes the image sticker effect detection result to terminal 102 for display.
[0041] Among them, terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, portable wearable devices, vehicle terminals, etc., and server 104 can be implemented by independent servers or server clusters composed of multiple servers. Server 104 can also be a node in the blockchain.
[0042] In one embodiment, such as Figure 2 As shown, a sticker effect detection method is provided, which is applied to... Figure 1 Taking the server in the example, the following steps are included:
[0043] Step 202: Obtain the image to be detected by adding the edited sticker to the target image, and obtain the editing parameters under at least one editing item corresponding to the sticker.
[0044] Stickers are visual elements that can be attached to visual media files. Visual media files can be static images corresponding to a single frame, or dynamic images composed of multiple frames, such as video files.
[0045] Taking a visual media file as a static image as an example, this static image is the target image. Stickers are added to the target image, such as... Figure 3 As shown, after confirming the sticker's placement location, the pixels in the sticker will cover the existing pixels in the target image at that location, thus merging the sticker into the target image and achieving the addition of the sticker to the image.
[0046] Taking a video, a visual media file composed of multiple frames, as an example, if the product offers a sticker addition time setting function, the sticker can be added to the corresponding video frame at the set effective time. If the product does not offer a sticker addition time setting function, the corresponding sticker will be added to all frames of the entire video by default. After confirming the sticker addition position, each frame in the video where the sticker needs to be added can be used as the target image. At the sticker addition position, the pixels of the sticker will cover the existing pixels of the target image at that position, thus integrating the sticker into each target image and achieving the addition of the sticker to the video.
[0047] The image to be detected is the image obtained by adding edited stickers to a target image. For a static image, the image to be detected is the image obtained by adding edited stickers to a target static image; for a video, the image to be detected is the video frame with stickers added to the target video.
[0048] An editing item refers to the dimension targeted by the corresponding editing operation on the sticker. A sticker added to a target image can undergo editing processing corresponding to at least one editing item. The types of editing items corresponding to a sticker can match the object to which the sticker is added. For example, the corresponding editing items may differ for still images and videos.
[0049] In a specific application, when the sticker is added to a static image, the editing options can be content-related, such as style, text, font, and color, or shape-related, such as rotation and scaling. When the sticker is added to a video, in addition to content-related and shape-related editing options, there can also be editing options that reflect the sticker's ongoing effects, such as activation time or sticker type. Sticker types include static stickers and dynamic stickers. Dynamic stickers are stickers that create a dynamic effect by switching a set of specific static images at a specified frequency.
[0050] Edited stickers refer to the result of editing the original sticker according to the editing items. In a specific application, an edited sticker can be the result of the background automatically editing the original sticker according to the editing items based on a pre-set program. Accordingly, the background program will record the corresponding editing parameters when editing the original sticker according to each editing item. Edited stickers can also be the result of responding to user editing operations on the sticker. The background responds to the user's editing operations on the sticker for each editing item, and obtains the editing parameters for each editing item based on the content entered by the user (such as entered text, set effective time, rotation angle, scaling factor), or the selection operation of candidate information (such as sticker type, style, font, color), or the touch control of the sticker (such as rotation, scaling).
[0051] Step 204: Compare the pixel points of the target image and the image to be detected, determine the difference pixels in the image to be detected, and obtain the difference map corresponding to the difference pixels.
[0052] Pixel matching refers to comparing pixels at the same location in the target image and the image to be detected. Difference pixels are those pixels where the matching results show differences. For example... Figure 4 As shown, a difference map is an image that includes the difference pixels in the image to be detected.
[0053] Specifically, both the target image and the image to be detected are images composed of multiple pixels. Since the image to be detected is obtained by adding stickers to the target image, the target image and the image to be detected have the same image size. Each pixel in the target image and the image to be detected corresponds to a specific location and an assigned value. Pixel comparison can be performed by comparing pixels at the same location in the target image and the image to be detected according to the assigned values. The assigned values for each pixel can be the brightness / grayscale value corresponding to the pixel, or the color components of at least one color channel corresponding to the pixel, including the RGB (red, green, and blue) three channels.
[0054] After adding a sticker to the target image to obtain the image to be detected, assuming the sticker effect is normal, both the target image and the image to be detected will have differing pixels. The differing pixels in the image to be detected represent the added sticker, while the differing pixels in the target image represent the content covered by the sticker. Based on the differing pixels in the image to be detected, the resulting difference map can be used to detect whether the sticker addition was performed correctly in the image to be detected.
[0055] In one embodiment, obtaining a difference map corresponding to the difference pixels includes: extracting the difference pixels from the image to be detected, and constructing a difference map based on the difference pixels.
[0056] The difference map, constructed by extracting the difference pixels, is an image reconstructed based on the pixel values and positions of each difference pixel in the image to be detected. By extracting the difference pixels to construct the difference map, only the difference pixels in the image to be detected need to be processed to obtain the difference map, without needing to process other pixels in the image to be detected, thus reducing the number of pixels that need to be processed and improving the efficiency of obtaining the difference map.
[0057] In one embodiment, obtaining a difference map corresponding to the difference pixels includes: removing identical pixels from the image to be detected to obtain a difference map containing the difference pixels.
[0058] In this context, identical pixels are those that show no difference in pixel comparison results. The difference map obtained by removing identical pixels is based on the image to be detected, with identical pixels removed. By removing identical pixels to construct the difference map, processing only the identical pixels in the image to be detected is performed, eliminating the need to process the differing pixels in the image to be detected or to reconstruct the image. This reduces the number of pixels to be processed and the resources required, improving the efficiency of obtaining the difference map while reducing resource consumption.
[0059] In one embodiment, obtaining a difference map corresponding to the difference pixels includes: adjusting the pixel values corresponding to the same pixels in the image to be detected to the target pixel values, thereby obtaining a difference map containing the difference pixels.
[0060] In this context, identical pixels are those where pixel comparison results show no difference. The target pixel value can be any value. By adjusting the pixel values corresponding to identical pixels to the target pixel value, the adjusted image to be detected contains only the target pixel value and the pixel values corresponding to each differing pixel, thus obtaining a difference map that includes the differing pixels. In a specific application, the target pixel value is zero. By setting the pixel values corresponding to identical pixels to zero, the overall distribution of differing pixels in the difference map can be characterized based on the calculation results of all pixels in the difference map. Although identical pixels participate in the calculation, they do not affect the calculation results; therefore, it is not necessary to distinguish between differing and non-disagreeing pixels in the difference map during calculation. For example, the overall distribution of differing pixels in the difference map can be characterized by calculating the average pixel value or the sum of pixel values corresponding to each pixel in the difference map.
[0061] Step 206: Based on the difference map, filter the editing parameters for each editing item to obtain the filtering results. The editing parameter filtering is to select the target editing parameters from the candidate editing parameters under the corresponding editing item so that the original sticker matches the difference map after being edited according to the corresponding target editing parameters.
[0062] The candidate edit parameters are optional edit parameters corresponding to the edited item. The original sticker is the unedited sticker. Matching to the difference plot means that the parameters in the specified data dimension are the same as or similar to those in the difference plot, and this data dimension can correspond to the edited item.
[0063] It should be noted that the candidate editing parameters for different editing items can be represented in different data formats. For example, the candidate editing parameter for sticker rotation can be the candidate rotation angle; the candidate editing parameter for sticker style editing can be the candidate sticker style; and the candidate editing parameter for sticker scaling can be the candidate scaling ratio.
[0064] Candidate editing parameters can be determined based on whether the editing item has a selection range or whether it can be calculated. For example, for editing items whose editing parameters can be determined through selection (such as sticker style, font, color, etc.), the corresponding candidate editing parameters are various selectable data. Taking sticker style as an example, each selectable sticker style is a candidate sticker style for the sticker style editing item. For the sticker rotation item, since the rotation angle ranges from [0°, 360°), the rotation angle is a selectable editing parameter. As another example, for the sticker scaling item, the candidate scaling ratio can be obtained by calculating the scaling ratio between the original sticker and the difference image.
[0065] The number of candidate editing parameters under an editing project can be one or more. For example, for an editing project where the editing parameters have a selection range, there are multiple candidate editing parameters under the corresponding editing project; for an editing project where the editing parameters do not have a selection range, there is only one candidate editing parameter under the corresponding editing project.
[0066] Target editing parameter filtering involves selecting target editing parameters from the candidate editing parameters under the corresponding editing item, so that the original sticker, after being edited according to the corresponding target editing parameters, matches the difference map. The filtering results of target editing parameter filtering include the selected target editing parameters and the results where no target editing parameters exist.
[0067] Specifically, for each editing item, the candidate editing parameters under the corresponding editing item are traversed, and the original stickers are edited according to the candidate editing parameters to obtain the candidate editing stickers for each editing item. It is determined whether there is a target editing sticker that matches the difference map among the candidate editing stickers for each editing item. If so, the target editing parameters corresponding to the target editing sticker are selected from the candidate editing parameters under the corresponding editing item. If not, the selection result that there are no target editing parameters under the corresponding editing item is obtained.
[0068] In a specific application, for each editing project, when there are multiple candidate editing parameters, the candidate editing parameters under the corresponding editing project are traversed, and the original stickers are edited according to the candidate editing parameters to obtain the candidate editing stickers for each editing project. The candidate editing stickers for each editing project are matched with the difference map. When there is a target editing sticker in the candidate editing stickers for the editing project that matches the difference map, the target editing parameter corresponding to the target editing sticker is selected from the candidate editing parameters. When there is no target editing sticker in the candidate editing stickers for the editing project that matches the difference map, the target editing parameter that does not exist under the editing project is obtained.
[0069] In this embodiment, the selection of target editing parameters for each editing project can be performed synchronously or sequentially. By synchronously selecting target editing parameters for each editing project, the time required to obtain the selection results for each editing project can be saved, improving processing efficiency. By sequentially selecting target editing parameters for each editing project, the process can be terminated directly if the target editing parameter is not found among the candidate editing parameters for one of the editing projects, reducing the resources required for data processing.
[0070] Step 208: When the filtering results show that there are target editing parameters under each editing item, compare the target editing parameters under each editing item with the corresponding editing parameters to obtain the image sticker effect detection results.
[0071] Target editing parameters are selected for each editing item, indicating that each editing item has corresponding editing parameters and a difference map. The target editing parameters for each editing item are compared with the corresponding editing parameters. If the target editing parameters and corresponding editing parameters for each editing item are the same, a detection result indicating that the sticker effect is normal is obtained. If the target editing parameters and corresponding editing parameters for at least one editing item are different, a detection result indicating that the sticker effect is abnormal is obtained.
[0072] The aforementioned sticker effect detection method obtains editing parameters for at least one editing item corresponding to the sticker, facilitating the detection of editing parameters for each editing item. By comparing the target image and the image to be detected after adding the edited sticker, the method identifies the difference pixels in the image to be detected and obtains a difference map corresponding to the difference pixels. This accurately represents the content added to the image to be detected, facilitating the comparison of the added content with the original sticker. By filtering the candidate editing parameters under each editing item to obtain target editing parameters that match the difference map after editing the original sticker, the method compares the target editing parameters with the corresponding editing parameters to obtain the image sticker effect detection result. By detecting the effectiveness of the editing parameters under each editing item corresponding to the sticker in the image to be detected, the method achieves efficient detection of sticker effects in the image to be detected.
[0073] In one embodiment, the editing project includes a sticker style editing project; based on the difference map, each editing project is filtered for editing parameters, and the filtering results include: obtaining the actual pixel features corresponding to the difference map based on the distribution of each difference pixel point in the difference map; for each candidate sticker style under the sticker style editing project, obtaining the candidate pixel features corresponding to the original sticker under each candidate sticker style; when there is a target pixel feature in the candidate pixel features that matches the actual pixel features, the target sticker style corresponding to the target pixel feature is filtered out from the candidate sticker styles.
[0074] The sticker style editing project refers to selecting a sticker style from multiple candidate styles to obtain the editing project for the sticker corresponding to the selected style. Sticker styles can be provided by the product backend. Taking text stickers as an example, candidate sticker styles can be the result of one or more dimensions such as different artistic fonts, different color combinations, or different content (including text and its font, color, or size). Taking image stickers as an example, candidate sticker styles can be various filters, etc. Actual pixel features refer to the pixel features of the difference map corresponding to the content actually added to the target image. Pixel features are feature data used to characterize the pixel distribution of an image. Specifically, pixel features can be the average value, variance, etc., of each pixel. Matching with actual pixel features means that the content is the same as or has a similarity to the actual pixel features that meets the set matching conditions.
[0075] Specifically, based on the distribution of each difference pixel in the difference map, pixel feature fusion is used to obtain the actual pixel features corresponding to the difference map. For each candidate sticker style under the sticker style editing project, the original sticker is combined with the candidate sticker style to obtain the candidate sticker for each candidate sticker style. Based on the distribution of each pixel in each candidate sticker, pixel feature fusion is used to obtain the candidate pixel features that correspond one-to-one with the candidate sticker. When there is a target pixel feature in the candidate pixel features that is the same as the actual pixel feature or whose similarity reaches the set matching condition, it is determined whether there is a target pixel feature in the candidate pixel features that matches the actual pixel feature. If so, the target sticker style corresponding to the target pixel feature is selected from the candidate sticker styles. If not, the result of filtering for no target sticker style is obtained.
[0076] In this embodiment, pixel features are used to express the pixel distribution of the candidate stickers obtained by combining the original sticker with the candidate sticker styles. The actual pixel features corresponding to the difference map are matched with the candidate pixel features corresponding to the candidate stickers to determine whether there is a target sticker style that matches the difference map among the candidate sticker styles. This completes the screening of target sticker styles, which not only ensures the accuracy of the screening results but also improves the screening speed of target editing parameters in the sticker style editing project.
[0077] In one embodiment, obtaining the actual pixel features corresponding to the difference map based on the distribution of each difference pixel in the difference map includes: extracting the pixel values of each difference pixel in the difference map; and calculating the mean of each pixel value to obtain the actual pixel features corresponding to the difference map.
[0078] Mean calculation refers to averaging pixel values. When the difference map contains only difference pixels or all other pixels have a value of zero, the mean value of each pixel in the difference map is calculated to obtain the actual pixel features corresponding to the difference map. In this case, there is no need to distinguish between difference and non-difference pixels in the difference map; the calculation is performed directly on all pixels in the difference map, simplifying the data processing process and improving efficiency.
[0079] In one embodiment, the sticker style editing project includes a sticker style selection project and a sticker content editing project. For each candidate sticker style under the sticker style editing project, the candidate pixel features corresponding to the original sticker under each candidate sticker style are obtained, including: for each candidate sticker style in the sticker style selection project, editing the original sticker according to the editing parameters of each candidate content in the sticker content editing project to obtain a candidate sticker; for each candidate sticker, obtaining candidate pixel features that correspond one-to-one with the candidate sticker based on the distribution of each pixel in the corresponding candidate sticker.
[0080] The sticker style selection option allows you to choose the style of the sticker. The sticker content editing option allows you to edit the content of the sticker, such as the text, font, color, and size. The text can be randomly selected from candidate texts used for sticker effect testing, or it can be randomly entered text. The color, font, and size of the text can all be randomly selected from the corresponding candidate text colors, fonts, or sizes.
[0081] Specifically, for each candidate sticker style in the sticker style selection project, the original sticker is edited according to the editing parameters of each candidate content in the sticker content editing project through permutation and combination, resulting in candidate stickers. For example... Figure 5 As shown, for example, if there are 3 candidate sticker styles and 2 candidate content editing parameters (2 different fonts), then 6 different candidate stickers can be obtained through permutation and combination.
[0082] Furthermore, when a target pixel feature that matches the actual pixel feature exists among the candidate pixel features, a target sticker style corresponding to the target pixel feature is selected from the candidate sticker styles. This includes: when a target pixel feature that matches the actual pixel feature exists among the candidate pixel features, a target sticker corresponding to the target pixel feature is selected from the candidate stickers; a target sticker style corresponding to the target sticker is selected from the candidate sticker styles; and target content editing parameters corresponding to the target sticker are selected from the candidate content editing parameters.
[0083] In this embodiment, when displaying sticker content, the original sticker can be edited by arranging and combining candidate sticker styles and candidate content editing parameters. This enables simultaneous filtering of target editing parameters for both sticker style selection and sticker content editing, improving both the comprehensiveness of filtering target editing parameters under the editing items and the efficiency of data processing.
[0084] Furthermore, the sticker content editing project includes at least one sub-editing project. For example, the text being edited, the font, color, and size are arranged and combined based on candidate sticker styles and the corresponding candidate sub-editing parameters for each sub-editing project to obtain multiple candidate stickers. Based on the distribution of pixels in each candidate sticker, pixel feature fusion is used to obtain candidate pixel features that correspond one-to-one with the candidate stickers. When a target pixel feature exists among the candidate pixel features that is identical to or has a similarity that meets the set matching conditions, the target sticker style and target sub-editing parameters corresponding to the target pixel feature are selected from the candidate sticker styles and the corresponding candidate sub-editing parameters for each sub-editing project, based on the target sticker corresponding to the target pixel feature.
[0085] In this embodiment, candidate sub-editing parameters corresponding to multiple sub-editing items under the sticker content editing project are arranged and combined with candidate sticker styles. The original sticker is edited based on the combined editing parameters to obtain candidate stickers, thereby determining the content of each candidate sticker. Based on the distribution of each pixel in each candidate sticker, candidate pixel features corresponding to the candidate sticker are obtained through pixel feature fusion, which facilitates matching with the actual pixel features corresponding to the difference map. This allows for the rapid and accurate determination of the target sticker style and the target sub-editing parameters corresponding to each sub-editing item under the sticker content editing project.
[0086] In one embodiment, the editing project includes a sticker rotation project. Based on the difference map, each editing project is filtered for editing parameters, and the filtering results include: calculating the actual aspect ratio corresponding to the difference map based on the width and height of the smallest rectangular pixel block containing each difference pixel point in the difference map; rotating the original sticker according to each candidate rotation angle under the sticker rotation project to obtain a rotated sticker that corresponds one-to-one with the candidate rotation angle, and determining the candidate aspect ratio corresponding to the smallest rectangular pixel block containing the corresponding rotated sticker; when there is a target aspect ratio among the candidate aspect ratios that matches the actual aspect ratio, the target rotation angle corresponding to the target aspect ratio is filtered from the candidate rotation angles.
[0087] The sticker rotation item refers to the editing item that rotates the sticker by a rotation angle, with the rotation angle ranging from [0°, 360°]. A rectangular pixel block is a pixel matrix where each row and column has the same number of pixels. For example, if the area formed by the difference pixels in the difference image is a circle with a diameter of 100 pixels, then the smallest rectangular pixel block containing all the difference pixels in the difference image is a 100*100 pixel block, meaning the width and height of the smallest rectangular pixel block containing all the difference pixels in the difference image are both 100. For example... Figure 6The image shows the smallest rectangular pixel block containing all the difference pixels in the difference map. The aspect ratio refers to the ratio of the width to the height of the smallest rectangular pixel block. Candidate rotation angles are multiple rotation angles obtained by dividing the [0°, 360°) region into equal angular intervals. The angular interval can be 1° or 0.5°, resulting in either 360 or 720 candidate rotation angles. The specific angular interval can be set according to actual needs. Smaller angular intervals result in more accurate calculations but also require more computation. Matching the actual aspect ratio means either matching the actual aspect ratio or the difference being less than a set aspect ratio difference threshold.
[0088] Specifically, when an editing project includes both a sticker style editing project and a sticker rotation project, the selection of the target rotation angle in the sticker rotation project can be performed after confirming the existence of a target sticker in the sticker style editing project. For each target sticker, the corresponding sticker is rotated according to each candidate rotation angle under the sticker rotation project. This yields the rotated sticker corresponding to each candidate rotation angle and the candidate aspect ratio corresponding to the smallest rectangular pixel block containing the corresponding rotated sticker. It is then determined whether there is a target aspect ratio among the candidate aspect ratios that matches the actual aspect ratio. If so, the target rotation angle corresponding to the target aspect ratio is selected from the candidate rotation angles. Otherwise, the result of selecting no target rotation angle is obtained, and the processing of that target sticker ends.
[0089] In this embodiment, the characteristics of the smallest rectangular pixel block containing pixels are different under different rotation angles. The aspect ratio of the sticker and the difference pixel in the difference map is calculated by the smallest rectangular pixel block containing pixels. The target rotation angle is filtered out from the candidate rotation angles by matching the aspect ratio. Through simple calculation and comparison, an accurate matching result is obtained, thereby improving the fast and accurate filtering of the target rotation angle under the sticker rotation item.
[0090] In one embodiment, the editing project includes a sticker scaling project; based on the difference map, each editing project is filtered for editing parameters, and the filtering results include: using the size ratio between the size of the smallest rectangular pixel block containing each difference pixel in the difference map and the size of the smallest rectangular pixel block containing the original sticker as a candidate scaling ratio between the difference map and the original sticker; scaling the original sticker according to the candidate scaling ratio to obtain a scaled sticker; comparing the pixel points of the difference map and the scaled sticker, and when the comparison result meets the comparison conditions, using the candidate scaling ratio as the target scaling ratio.
[0091] Sticker scaling refers to editing projects that reduce or increase the size of stickers. It's important to note that the candidate scaling ratios in sticker scaling projects can be calculated. Assuming only the original sticker has been scaled, the scaling ratio between the difference map and the original sticker can be calculated using the dimensions of the smallest rectangular pixel block containing each difference pixel and the smallest rectangular pixel block containing the original sticker. This scaling ratio can include width scaling and height scaling. When the scaling operation is a simultaneous proportional enlargement of both width and height, the width scaling and height scaling ratios are calculated, for example, simultaneously reducing by a factor of 3 or simultaneously enlarging by a factor of 1.5.
[0092] The scaling ratio can be used as a candidate scaling ratio, and it is necessary to further determine whether the scaled sticker matches the difference image. The matching detection process includes: scaling the original sticker according to the candidate scaling ratio to obtain a scaled sticker; comparing the pixel points of the difference image and the scaled sticker; and when the comparison result meets the comparison conditions, the candidate scaling ratio is used as the target scaling ratio. Since the difference image is the actual image corresponding to the image to be detected, scaling the original sticker can reduce the error caused by scaling. It can be understood that in other embodiments, the difference image can also be scaled based on the candidate scaling ratio to obtain a scaled difference image, and the pixel points of the scaled difference image and the original sticker can be compared. When the comparison result meets the comparison conditions, the candidate scaling ratio is used as the target scaling ratio. Specifically, the pixel point comparison between the difference image and the scaled sticker is performed to determine whether the comparison result meets the comparison conditions. If yes, the candidate scaling ratio is used as the target scaling ratio; otherwise, a filtering result indicating that no target scaling ratio exists is obtained.
[0093] In this embodiment, based on the size of the smallest rectangular pixel block containing each difference pixel in the difference map and the size of the smallest rectangular pixel block containing the original sticker, the scaling ratio between the difference map and the original sticker is directly calculated to obtain the candidate scaling ratio. This can accurately narrow down the selection range of candidate scaling ratios. Generally, the number of candidate scaling ratios calculated is one. When a candidate scaling ratio can make the original sticker match the difference map after scaling according to the candidate scaling ratio, the candidate scaling ratio is used as the target scaling ratio under the sticker scaling item, thereby obtaining an accurate target scaling ratio filtering result.
[0094] In one embodiment, the editing items include a combination of sticker rotation and sticker scaling; based on the difference map, editing parameters are filtered for each editing item, and the filtering results include:
[0095] When a target rotation angle exists among the candidate rotation parameters, such that the original sticker matches the difference map after being rotated according to the target rotation angle, the target rotation sticker corresponding to the target rotation angle is obtained; the size ratio between the target rotation sticker and the difference map is used as the candidate scaling ratio, and the target rotation sticker is scaled according to the candidate scaling ratio to obtain the rotated and scaled sticker; it is determined whether the rotated and scaled sticker matches the difference map. If it does, the candidate scaling ratio is used as the target scaling ratio; otherwise, the result of filtering for the absence of a target scaling ratio is obtained.
[0096] The "sticker rotation and scaling combination" refers to editing items that involve both rotating and scaling the sticker. The order of these operations is not limited; you can rotate first and then scale, or scale first and then rotate. Matching the rotated / scaled sticker with the difference image means that the rotated / scaled sticker and the difference image meet set conditions, such as the ratio of identical pixels to the total number of pixels in the rotated / scaled sticker and the difference image being no less than a preset threshold, such as 95% or 99%.
[0097] Specifically, based on the difference map, the actual aspect ratio corresponding to the difference map is calculated based on the width and height of the smallest rectangular pixel block containing each difference pixel in the difference map; the original sticker is rotated according to each candidate rotation angle under the sticker rotation item to obtain rotated stickers that correspond one-to-one with the candidate rotation angles, and the candidate aspect ratio corresponding to the smallest rectangular pixel block containing the corresponding rotated sticker is determined; when there is no target aspect ratio among the candidate aspect ratios that matches the actual aspect ratio, the filtering result of no target rotation angle is obtained, and the processing flow ends.
[0098] When a target aspect ratio that matches the actual aspect ratio exists among the candidate aspect ratios, the target rotation angle corresponding to the target aspect ratio is selected from the candidate rotation angles. The target rotated sticker is then determined by rotating the original sticker based on this target rotation angle. The scaling ratio between the difference image and the target rotated sticker is calculated based on the size of the smallest rectangular pixel block containing each difference pixel in the difference image and the size of the smallest rectangular pixel block containing the target rotated sticker. This calculated scaling ratio is used as a candidate scaling ratio, and the target rotated sticker is scaled according to the candidate scaling ratio to obtain the rotated and scaled sticker. Pixel comparisons are performed between the difference image and the rotated and scaled sticker to determine if the comparison results meet the comparison criteria. If yes, the candidate scaling ratio is used as the target scaling ratio; otherwise, the result is a filter indicating that no target scaling ratio exists. The comparison criteria can be that the pixels in the difference image and the rotated and scaled sticker are completely identical, or that the ratio of identical pixels to the total number of pixels is not less than a preset threshold, such as 95%, 98%, or 99%.
[0099] In this embodiment, when determining the target rotation angle and target scaling ratio under the combination of sticker rotation and sticker scaling, the target rotation angle is determined first and then the target scaling ratio is determined. The original sticker can be rotated based on the target rotation angle to obtain a target rotated sticker with the same rotation angle as the difference map. This makes it easier to further determine the target scaling ratio, avoids unnecessary data processing, and improves data processing efficiency.
[0100] In one embodiment, the method further includes: when the filtering result shows that the target editing parameter is not present among the candidate editing parameters corresponding to at least one editing item, obtaining a detection result indicating that there is an abnormal sticker effect under the corresponding editing item.
[0101] When there are multiple editing projects, the selection of target editing parameters for each editing project can be performed simultaneously or sequentially. Taking the sequential selection of target editing parameters for each editing project as an example, when the target editing parameter is not found among the candidate editing parameters for an editing project, that is, when there is no target editing sticker matching the difference map among the candidate editing stickers for the corresponding editing project, a detection result indicating that there is an abnormal sticker effect in the corresponding editing project is obtained, and the detection process ends, without further selection of target editing parameters for the remaining editing projects.
[0102] In a specific application, taking the sticker editing project, which includes sticker style editing, sticker rotation, and sticker scaling, as an example, the process begins by filtering target sticker styles for the sticker style editing project. Based on the candidate sticker styles under this project, styles are added to the original stickers to obtain candidate stickers. If no candidate sticker matches the difference map, a detection result of "no matching sticker style" is obtained. If a candidate sticker matches the difference map, the corresponding target sticker style is selected from the candidate styles, and the target sticker is rotated according to the candidate rotation angles under the sticker rotation project to obtain candidate rotated stickers. If no candidate rotated sticker matches the difference map, a detection result of "no matching rotated sticker" is obtained. If a candidate rotated sticker matches the difference map, the corresponding target rotation angle is selected from the candidate rotation angles, and the scaling ratio between the target rotated sticker and the difference map is used as the candidate scaling ratio. The target rotated sticker is then scaled according to the candidate scaling ratio to obtain a rotated and scaled sticker. When the rotated and scaled sticker matches the difference map, the candidate scaling ratio is used as the target scaling ratio. When the rotation and scaling sticker does not match the difference map, the detection result is that there is no rotation and scaling matching sticker.
[0103] In one embodiment, acquiring a target image by adding an edited sticker to a target image; performing pixel comparison between the target image and the target image to determine the difference pixels in the target image, and obtaining a difference map corresponding to the difference pixels, includes: acquiring a target video by adding an edited sticker to a target video; performing pixel comparison frame by frame between the target video and the target video to obtain difference frames in the target video that include difference pixels, and determining a difference map corresponding to the difference frames based on the difference pixels in the difference frames.
[0104] In this process, the target video is the object to which stickers can be added, while the video to be detected is the video obtained by adding edited stickers to the target image. Both the target video and the video to be detected consist of the same number of video frames, each with a different sequence number within the video. Frame-by-frame pixel comparison involves sequentially comparing the pixel values of two video frames with the same sequence number in both the target video and the video to be detected. When two video frames with the same sequence number show differences in their pixel comparison results, that video frame is designated as the difference frame. Once all video frames have been compared, the difference frame in the video to be detected is obtained.
[0105] Based on the difference pixels in the difference frames, a difference map corresponding to each difference frame is determined. Specifically, this can be achieved by extracting difference pixels from the difference frames to construct the difference map, removing identical pixels from the difference frames to obtain the difference map, or adjusting the pixel values corresponding to identical pixels in each difference frame to the target pixel value. When the video to be detected includes multiple difference frames, for each difference frame, a difference map corresponding to each difference frame is obtained using any of the above methods.
[0106] Furthermore, the image sticker effect detection result is the sticker effect detection result corresponding to the difference frame. Based on the sticker effect detection result corresponding to each difference frame in the video to be detected, the video sticker effect detection result is obtained.
[0107] Based on the difference map corresponding to each difference frame in the video to be detected, editing parameters are filtered for each editing item to obtain the filtering results. Editing parameter filtering involves selecting target editing parameters from the candidate editing parameters under the corresponding editing item, ensuring that the original sticker matches the difference map after editing according to the corresponding target editing parameters. When the filtering results show that target editing parameters exist under each editing item, the target editing parameters under each editing item are compared with the corresponding editing parameters to obtain the image sticker effect detection result for each difference frame. If the sticker effect detection result for at least one difference frame in the video to be detected is abnormal, the video image sticker effect detection result is determined to be abnormal. If the sticker effect detection results for all difference frames in the video to be detected are normal, the video image sticker effect detection result is determined to be normal.
[0108] In this embodiment, by identifying the difference frames with different pixels in the video to be tested, and detecting whether the sticker effect of each difference frame is normal, the video sticker effect detection result is obtained. This method can be applied to quickly and accurately detect the sticker addition effect in the video.
[0109] In one embodiment, comparing the target video and the video to be detected frame by frame to obtain difference frames in the video to be detected that include differing pixels includes: calculating the pixel difference for each corresponding pixel in the target video and the video to be detected frame by frame, and selecting difference frames from the video to be detected that have pixel differences that are not zero. Here, the pixel difference is the difference between the corresponding pixel values of pixels at the same position in two corresponding video frames of the target video and the video to be detected. The pixel value can specifically be a grayscale value or a component of at least one color channel. Specifically, calculating the pixel difference for each corresponding pixel in the target video and the video to be detected frame by frame, obtaining the pixel difference for each pixel in each video frame of the video to be detected, and selecting video frames with pixel differences that are not zero as difference frames.
[0110] In this embodiment, by calculating the difference between pixels, it is possible to quickly and accurately perform pixel comparison frame by frame and obtain the comparison result of each pixel in each video frame.
[0111] In one embodiment, the pixel-by-pixel comparison of the target video and the video to be detected is performed frame by frame to obtain difference frames in the video to be detected that include differing pixels. This includes: for two corresponding video frames in the target video and the video to be detected, obtaining the components of the pixel at the same pixel position in the two image frames under at least one color channel; calculating the sum of component differences corresponding to each video frame in the video to be detected based on the component differences of the pixel at the same pixel position in the two video frames under each color channel; and filtering out difference frames from the video frames of the video to be detected whose sum of component differences is greater than a target value based on the sum of component differences corresponding to each video frame.
[0112] In this context, a color channel corresponds to a color representation of a pixel. Taking the RGB three-channel as an example, RGB represents the colors of the red (R), green (G), and blue (B) channels. For each pixel, various colors can be obtained by varying the brightness of the red, green, and blue color channels and by superimposing them. The color displayed by a pixel can be created by mixing red, green, and blue light in different proportions, and is recorded and expressed by a set of RGB values. Component difference is the difference between the components of a pixel at the same position in two corresponding video frames of the target video and the video to be detected, under the same color channel. The sum of component differences is the result obtained by adding up the component differences of each pixel in each color channel of the video frame.
[0113] The number of color channels can be one or more. For example, when selecting one color channel as the processing target, it is only necessary to focus on the component of each pixel in that color channel. By calculating the component difference of pixels at the same pixel position in two video frames under that color channel, the sum of the component differences for each video frame in the video to be detected is calculated. Based on the sum of the component differences for each video frame, difference frames with a total component difference greater than the target value are selected from the video frames of the video to be detected. As another example, when selecting all three color channels (RGB) as the processing target, the component differences of pixels at the same pixel position in two video frames under each color channel are calculated and accumulated to obtain the total component difference for each pixel. By accumulating the total component differences of all pixels in each video frame, the sum of the component differences for each video frame is obtained. Difference frames with a total component difference greater than the target value are selected from the video frames of the video to be detected.
[0114] In this embodiment, the components corresponding to the color channels can more accurately represent the color of each pixel, enabling accurate identification of identical and different pixels.
[0115] In one embodiment, the sticker type includes a static sticker or a dynamic sticker; the method further includes: when the sticker type is a static sticker, performing pixel-by-pixel comparison on the difference maps corresponding to each difference frame in the video to be detected to obtain a static effect detection result; when the sticker type is a dynamic sticker, performing pixel-by-pixel comparison on the difference maps corresponding to multiple target difference frames in the video to be detected to obtain a dynamic effect detection result, wherein the number of frames between any two target difference frames matches the loop period corresponding to the dynamic sticker.
[0116] Static stickers are stickers whose display effect does not change in a video. When the sticker type in the video to be tested is static sticker, the difference maps corresponding to all difference frames in the video to be tested should be identical. Dynamic stickers are a set of specific static images that switch at a specified frequency to produce a certain dynamic effect. When the sticker type in the video to be tested is dynamic sticker, with the playback time of the dynamic sticker in the video to be tested as one cycle, the difference maps corresponding to the same position in different cycles should be identical.
[0117] Furthermore, by comparing pixels within the same group of difference maps, a detection result indicating abnormal sticker effect is obtained when an abnormal difference map with different pixels exists within the same group of difference maps. A detection result indicating normal sticker effect is obtained when no abnormal difference map with different pixels exists within the same group of difference maps. The same group of difference maps corresponding to static stickers includes the difference maps corresponding to all difference frames in the video to be detected; the same group of difference maps corresponding to dynamic stickers includes the difference maps corresponding to multiple target difference frames in the video to be detected.
[0118] For example, the video to be tested has 200 frames, a playback time of 20 seconds, a playback speed of 10 frames / second, and a loop period of 2 seconds for the dynamic sticker. If the dynamic sticker is added to every frame from the first to the last in the video to be tested, then the dynamic sticker needs to be looped 10 times in the video to be tested. That is to say, each set of difference maps has 10 images. Among them, the difference maps corresponding to the 1st, 21st, 41st...181st frames of the video to be tested form one set, and the difference maps corresponding to the 2nd, 22nd, 42nd...182nd frames of the video to be tested form another set. If the dynamic sticker is added to the video to be tested from the 4th second to the 16th second, then the dynamic sticker needs to be played in a loop (16-4) / 2 = 6 times in the video to be tested. The sticker is added starting from the 4th second, so the first video frame with the sticker added in the video to be tested is the 41st frame. That is to say, the number of each set of difference maps is 6. Among them, the difference maps corresponding to the 41st, 61st, 81st...141st frames of the video to be tested are in one set, and the difference maps corresponding to the 42nd, 62nd, 82nd...142nd frames of the video to be tested are in another set.
[0119] In this embodiment, by detecting whether the difference maps in the same group are the same, when there are no abnormal difference maps with different pixels in the difference maps in the same group, a detection result of normal sticker effect is obtained; when there are abnormal difference maps with different pixels in the difference maps in the same group, a detection result of abnormal sticker effect is obtained. This allows for sticker effect detection of stickers added to the video based on different sticker types.
[0120] In one embodiment, the method further includes: obtaining the sticker activation setting time corresponding to the sticker; detecting the sticker activation setting time based on the start and end times of the difference frames in the video to be detected, and obtaining the video sticker activation time detection result.
[0121] The sticker activation setting time refers to the sticker activation time set when adding the sticker. Specifically, the sticker activation time can include the start and end activation times. Further, based on the position of the start frame in the difference frame within the video to be detected, the start time of the difference frame in the video to be detected is determined, and based on the position of the end frame in the difference frame within the video to be detected, the end time of the difference frame in the video to be detected is determined. Based on the start and end times, the sticker activation setting time is detected to obtain the video sticker activation time detection result.
[0122] The start frame is the first video frame in the video to be detected to show a difference in pixels, arranged chronologically. The end frame is the last video frame in the video to be detected to show a difference in pixels. The position of a frame in the video to be detected can be represented by its sequence number. The start time can be obtained from the sequence number of the start frame in the video to be detected. The end time can be obtained from the sequence number of the end frame in the video to be detected.
[0123] Taking the sticker activation time setting, which includes the activation time and the end activation time, as an example, when the start activation time is the same as the start time and the end activation time is the same as the end time, the detection result of the video sticker activation time being normal is obtained. When the start activation time is different from the start time or the end activation time is different from the end time, the detection result of the video sticker activation time being abnormal is obtained.
[0124] In this embodiment, the effective time of the video sticker is detected by the start and end times of the abnormal frame in the video to be detected. This method is suitable for detecting sticker effects in videos and can achieve comprehensive and efficient detection of sticker effects in videos.
[0125] In one embodiment, such as Figure 7 As shown, a sticker effect detection method is provided, including the following steps:
[0126] Step 702: Obtain the image to be detected by adding the edited sticker to the target image, and obtain the editing parameters under each editing item corresponding to the sticker. The editing items include sticker style selection, sticker content editing, sticker rotation, and sticker scaling.
[0127] Step 704: Perform pixel comparison between the target image and the image to be detected, and adjust the pixel values corresponding to the same pixels in the image to be detected that have the same pixel value to the target pixel value to obtain a difference map.
[0128] Step 706: Calculate the mean value of each difference pixel in the difference map to obtain the actual pixel features corresponding to the difference map.
[0129] Step 708: For each candidate sticker style in the sticker style project, edit the original sticker according to the editing parameters of each candidate content in the sticker content editing project to obtain candidate stickers.
[0130] Step 710: For each candidate sticker, based on the pixel values of each pixel in the corresponding candidate sticker, calculate the candidate pixel features corresponding to the candidate sticker one by one by using the average pixel value.
[0131] Step 712: When there is a target pixel feature among the candidate pixel features that matches the actual pixel feature, determine the target sticker style and target content editing parameters corresponding to the target sticker based on the target sticker in the candidate stickers that corresponds to the target pixel feature.
[0132] Step 714: When there is no target pixel feature in the candidate pixel features that matches the actual pixel features, the detection result of no matching sticker is obtained.
[0133] Step 716: Calculate the actual aspect ratio of the difference map based on the width and height of the smallest rectangular pixel block containing each difference pixel in the difference map.
[0134] Step 718: Rotate the target sticker according to each candidate rotation angle under the sticker rotation item to obtain a rotating sticker that corresponds one-to-one with the candidate rotation angle, and determine the candidate aspect ratio corresponding to the smallest rectangular pixel block containing the corresponding rotating sticker.
[0135] Step 720: When there is a target aspect ratio among the candidate aspect ratios that matches the actual aspect ratio, determine the target rotation angle corresponding to the target aspect ratio and the target rotation sticker corresponding to the target rotation angle.
[0136] Step 722: When there is no target aspect ratio among the candidate aspect ratios that matches the actual aspect ratio, the screening result of the non-existent target rotation angle is obtained.
[0137] Step 724: Based on the size of the smallest rectangular pixel block containing the target rotating sticker and the size of the smallest rectangular pixel block containing each difference pixel in the difference map, calculate the candidate scaling ratio between the difference map and the target rotating sticker.
[0138] Step 726: Scale the original sticker according to the candidate scaling ratio to obtain the scaled sticker, and compare the pixel points of the difference map and the scaled sticker.
[0139] Step 728: When the comparison result meets the comparison conditions, the candidate scaling ratio is taken as the target scaling ratio.
[0140] Step 730: When the comparison result does not meet the comparison conditions, the filtering result of the non-existent target scaling ratio is obtained.
[0141] Step 732: When the filtering results show that there are target editing parameters that match the editing parameters under each editing item, a detection result indicating that the image sticker effect is normal is obtained.
[0142] Step 734: When the filtering result shows that the target editing parameter does not exist under at least one editing item, the detection result of abnormal image sticker effect is obtained.
[0143] In one embodiment, such as Figure 8 As shown, a sticker effect detection method is provided, including the following steps:
[0144] Step 802: Obtain the video to be tested obtained by adding the edited stickers to the target video, and obtain the editing parameters under each editing item corresponding to the stickers. The editing items include sticker style selection, sticker content editing, sticker rotation, and sticker scaling.
[0145] Step 804: For two corresponding video frames in the target video and the video to be detected, calculate the component difference of the pixel at the same pixel position in the two image frames under the same color channel.
[0146] Step 806: Based on the sum of component differences corresponding to each pixel in each video frame, determine the difference frames in the video to be detected whose sum of component differences is greater than the target value, and extract the difference pixels in the difference frames to form a difference map.
[0147] Step 808: Calculate the mean value of each difference pixel in the difference map to obtain the actual pixel features corresponding to the difference map.
[0148] Step 810: For each candidate sticker style in the sticker style selection project, edit the original sticker according to the editing parameters of each candidate content in the sticker content editing project to obtain candidate stickers.
[0149] Step 812: For each candidate sticker, based on the pixel values of each pixel in the corresponding candidate sticker, calculate the candidate pixel features corresponding to the candidate sticker one by one by using the average pixel value.
[0150] Step 814: When there is a target pixel feature among the candidate pixel features that matches the actual pixel feature, determine the target sticker style and target content editing parameters corresponding to the target sticker based on the target sticker in the candidate stickers that corresponds to the target pixel feature.
[0151] Step 816: When there is no target pixel feature in the candidate pixel features that matches the actual pixel features, the detection result of no matching sticker is obtained.
[0152] Step 818: Calculate the actual aspect ratio of the difference map based on the width and height of the smallest rectangular pixel block containing each difference pixel in the difference map.
[0153] Step 820: Rotate the target sticker according to each candidate rotation angle under the sticker rotation item to obtain rotated stickers that correspond one-to-one with the candidate rotation angles, and determine the candidate aspect ratio corresponding to the smallest rectangular pixel block containing the corresponding rotated sticker.
[0154] Step 822: When there is a target aspect ratio among the candidate aspect ratios that matches the actual aspect ratio, determine the target rotation angle corresponding to the target aspect ratio and the target rotation sticker corresponding to the target rotation angle.
[0155] Step 824: When there is no target aspect ratio among the candidate aspect ratios that matches the actual aspect ratio, the screening result of the non-existent target rotation angle is obtained.
[0156] Step 826: Based on the size of the smallest rectangular pixel block containing the target rotating sticker and the size of the smallest rectangular pixel block containing each difference pixel in the difference map, calculate the candidate scaling ratio between the difference map and the target rotating sticker.
[0157] Step 828: Scale the original sticker according to the candidate scaling ratio to obtain the scaled sticker, and compare the pixel points of the difference map and the scaled sticker.
[0158] Step 830: When the comparison result meets the comparison conditions, the candidate scaling ratio is used as the target scaling ratio.
[0159] Step 832: When the comparison result does not meet the comparison conditions, the filtering result of the non-existent target scaling ratio is obtained.
[0160] Step 834: When the filtering results show that there are target editing parameters that match the editing parameters under each editing item, a detection result indicating that the difference frame sticker effect is normal is obtained.
[0161] Step 836: When the filtering result shows that the target editing parameter is not present in the candidate editing stickers corresponding to at least one editing item, the detection result of abnormal sticker effect in the difference frame under the corresponding editing item is obtained.
[0162] Step 838: When the sticker type is static sticker, perform pixel comparison on the difference map corresponding to each difference frame in the video to be detected to obtain the static effect detection result.
[0163] Step 840: When the sticker type is dynamic sticker, the pixel points of the difference maps corresponding to multiple target difference frames in the video to be detected are compared to obtain the dynamic effect detection result. The number of frames between any two target difference frames matches the loop period corresponding to the dynamic sticker.
[0164] Step 842: Obtain the sticker activation setting time corresponding to the sticker. Based on the start and end times of the difference frames in the video to be detected, detect the sticker activation setting time to obtain the video sticker activation time detection result.
[0165] This application also provides an application scenario in which the above-described sticker effect detection method is applied. Specifically, the sticker effect detection method is applied in this scenario as follows:
[0166] like Figure 9 As shown, randomly select the nth sticker from all N stickers, edit the text to "Text Sticker" (this can be any other text, but "Text Sticker" is used as an example), randomly scale it, assuming it's enlarged to m times its original size (i.e., both length and width are m times the original size), and rotate it clockwise by p degrees. Set the sticker's effective time to t1 to t2, and automatically add the sticker with the above attributes to the template video V. m The video to be tested, V, is obtained. t Complete the automatic addition of text stickers (such as...) Figure 9 (The template video and the video to be detected).
[0167] Since there are N different text stickers, and each sticker has multiple parameters that need to be confirmed, including text content, scaling factor, rotation degree, and effective time, a matching algorithm that combines initial screening and fine calculation is adopted to improve the efficiency of the algorithm while ensuring its accuracy.
[0168] First, the "difference extraction sticker" algorithm is used, and the specific steps are as follows:
[0169] Step 1: For template video V m and the video to be detected V tPerform a traversal from frame 1 to frame F=300, and then proceed with the algorithm starting from step two.
[0170] Step 2: Obtain the template video V m and the video to be detected V t The i-th frame image is represented by T. m,i and T t,i This indicates that the two images are traversed pixel by pixel, and the difference operation of the following formula (1) is performed on each pixel:
[0171]
[0172] in, This represents template video V. m The coordinates of the i-th frame are (x, y) and the value of the R(Red) component, ranging from 0 to 255, and so on. If T m,i and T t,i If the sum of the color differences D of all pixels is 0, then the two images are considered to be completely identical, meaning no text stickers have been added. Otherwise, one image is considered to be identical. t,i After adding text stickers, proceed to step three.
[0173] Step 3: If the sum of the color differences D of all pixels in two images is not zero, then process image T. t,i The difference map T is obtained by performing the following operation (2). D,i :
[0174]
[0175] After the above "difference extraction sticker" algorithm is applied, two pieces of information can be obtained. The first is which frames are considered "difference maps" (i.e., frames with D>0), and the second is the difference map of each difference frame after calculation using equation (2) (e.g., ...). Figure 9 (Difference map in the image). Obtain the first frame showing a difference, and denote the frame number as f. first And the last frame that shows a difference, denoted as f. last , where 1≤f first ,f last ≤F. Then, according to equation (3)
[0176]
[0177] Get t first t last Compared with the initially automatically added t1 and t2, if the following formula is satisfied, the effective time is considered correct; otherwise, the effective time is considered to have failed, an error message "effective time abnormal" is thrown, and the process ends.
[0178] Next, the N stickers are initially screened using the "color mean screening algorithm".
[0179] In the W difference images obtained through "difference extraction sticker", we first determine whether the content of each difference image is consistent. Theoretically, if the sticker effect is normal, the content of each difference image should be consistent. If the text sticker is static, we compare each difference image with the first image using formula (1) starting from the second image. Assume that in each comparison, the percentage of pixels with D>0 in the total number of pixels in the whole image is k. d Then each comparison must satisfy equation (4):
[0180] k d >k Equation (4)
[0181] Here, k = 99% is chosen to prevent slight differences in the rendering of individual images, but this does not affect the overall process. If equation (4) is not satisfied, an error message "Static sticker effect abnormal" is thrown, and the process stops; otherwise, proceed to the next step.
[0182] The above operations ensure that each frame of the difference map is consistent. The first frame is taken as the "difference comparison frame" for subsequent calculations.
[0183] First, calculate the average RGB value of the "difference comparison frames". The specific steps are as follows:
[0184] Algorithm for "taking the average color value of an image":
[0185]
[0186]
[0187]
[0188] Where M represents the total number of non-(0,0,0) pixels in the "difference contrast frame" The R(Red) component represents the i-th non-(0,0,0) pixel in the "difference contrast frame". The mean value representing the red component, and by analogy with equations (6) and (7), can be used to obtain the color mean value of the "difference contrast frame". Use this value for initial screening, retrieve N text stickers from the backend, edit the same text, and then process the N text stickers using the same method to obtain the average color value of the images. Let's assume the average color value of the v-th sticker is... If equation (8) is satisfied:
[0189]
[0190] Where, take k v=1%. If the above formula is satisfied, the sticker is considered to meet the initial screening criteria and is selected, while the rest are eliminated. Assuming that L stickers are selected, if L = 0, it indicates an anomaly, and the message "No matching sticker" is thrown, ending the process; otherwise, proceed to the following steps.
[0191] Next, the "rotation and scaling matching method" is used to perform fine matching on each of the L stickers.
[0192] Step 1: First, obtain the smallest rectangle of the non-completely black area in the difference map (e.g., ...). Figure 9 The smallest rectangle in the array. Let the width be w and the height be h, then the aspect ratio q = w / h. For the l-th sticker, rotate it clockwise from 0 degrees, 1 degree...360 degrees and obtain its aspect ratio (width is...). Gao Wei )for Where l represents the l-th sticker, and u represents the current sticker's rotation degree as clockwise u degrees. Definition (9):
[0193]
[0194] Where, take k q =1%. If no aspect ratio is found after traversing 360 degrees, skip this sticker and perform the same operation on the next sticker. If none of the L stickers meet the condition, throw an exception "No sticker with aspect ratio satisfied by rotation" and end the process. Otherwise, continue to the next step.
[0195] Step 2: After finding a sticker that meets the aspect ratio in Step 1, the scaling ratio is obtained using Equation (10):
[0196]
[0197] Then scale the sticker, which has been rotated by a degree, to match the difference. Figure 1 The sample size is then compared pixel by pixel. The specific comparison method is the same as in equation (1). If the total number of differences D in the entire rectangular region is C D If the following equation (11) is satisfied, then the shape and color are considered to be matched:
[0198] |C D -w*h|≤k D Equation (11)
[0199] Take k D=1%. If equation (11) is not satisfied, the process jumps to the next sticker for comparison. If no suitable sticker is found after iterating through all stickers, an error message "No sticker with the same shape and color" is thrown, and the process ends. Conversely, if a sticker that meets the conditions is found, it can be calculated that the automatically added sticker is the l-th sticker, rotated clockwise by u degrees, with a scaling ratio of s, and an effective time of t. first ~t last Each sticker is compared with the initial automatically added sticker number, rotation degree, scaling ratio, and effective time. If all conditions are met, the effect is considered normal; otherwise, an exception is thrown.
[0200] It should be understood that, although Figure 2 , Figure 7 , Figure 8 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 , Figure 7 , Figure 8 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0201] In one embodiment, such as Figure 10 As shown, a sticker effect detection device 1000 is provided. This device can be a software module, a hardware module, or a combination of both as part of a computer device. Specifically, the device includes: a data acquisition module 1002, a comparison module 1004, a screening module 1006, and a detection module 1008, wherein:
[0202] The data acquisition module 1002 is used to acquire the image to be detected obtained by adding an edited sticker to the target image, and to acquire the editing parameters of at least one editing item corresponding to the sticker;
[0203] The comparison module 1004 is used to compare the target image and the image to be detected pixel by pixel, determine the difference pixels in the image to be detected, and obtain the difference map corresponding to the difference pixels.
[0204] The filtering module 1006 is used to filter the editing parameters of each editing item based on the difference map and obtain the filtering results. The editing parameter filtering is to select the target editing parameters from the candidate editing parameters under the corresponding editing item so that the original sticker matches the difference map after being edited according to the corresponding target editing parameters.
[0205] The detection module 1008 is used to compare the target editing parameters and the corresponding editing parameters under each editing item when the filtering results show that there are target editing parameters under each editing item, and obtain the image sticker effect detection results.
[0206] In one embodiment, the comparison module includes a difference map generation module for extracting difference pixels from the image to be detected and constructing a difference map based on the difference pixels.
[0207] In one embodiment, the comparison module includes a difference map generation module, which is used to adjust the pixel values corresponding to the same pixels in the image to be detected to the target pixel values or to remove the same pixels in the image to be detected, so as to obtain a difference map containing the difference pixels; wherein, the same pixels are pixels whose pixel comparison results show no difference.
[0208] In one embodiment, the editing project includes a sticker style editing project; the filtering module includes a first pixel feature processing module, a second pixel feature processing module, and a target sticker style filtering module, wherein:
[0209] The first pixel feature processing module is used to obtain the actual pixel features corresponding to the difference map based on the distribution of each difference pixel point in the difference map.
[0210] The second pixel feature processing module is used to obtain the candidate pixel features of the original sticker for each candidate sticker style under the sticker style editing project.
[0211] The target sticker style filtering module is used to filter out the target sticker style corresponding to the target pixel feature when there is a target pixel feature in the candidate pixel features that matches the actual pixel feature.
[0212] In one embodiment, the first pixel feature processing module is used to extract the pixel values of each difference pixel in the difference map; and to calculate the mean of each pixel value to obtain the actual pixel features corresponding to the difference map.
[0213] In one embodiment, the sticker style editing project includes a sticker style selection project and a sticker content editing project; the second pixel feature processing module includes a candidate sticker processing module and a candidate pixel feature processing module, wherein:
[0214] The candidate sticker processing module is used to select each candidate sticker style in the sticker style project, and edit the original sticker according to the editing parameters of each candidate content in the sticker content editing project to obtain candidate stickers;
[0215] The candidate pixel feature processing module is used to obtain candidate pixel features that correspond one-to-one with each candidate sticker based on the distribution of each pixel in the corresponding candidate sticker.
[0216] The target sticker style filtering module is also used to filter out the target sticker style corresponding to the target sticker from the candidate sticker styles based on the target sticker corresponding to the target pixel features, and to filter out the target content editing parameters corresponding to the target sticker from the candidate content editing parameters.
[0217] In one embodiment, the editing item includes a sticker rotation item; the filtering module includes a first aspect ratio calculation module, a second aspect ratio calculation module, and a target rotation angle filtering module, wherein:
[0218] The first aspect ratio calculation module is used to calculate the actual aspect ratio of the difference map based on the width and height of the smallest rectangular pixel block containing each difference pixel in the difference map.
[0219] The second aspect ratio calculation module is used to rotate the original sticker according to each candidate rotation angle under the sticker rotation project, obtain the rotated sticker that corresponds one-to-one with the candidate rotation angle, and determine the candidate aspect ratio corresponding to the smallest rectangular pixel block containing the corresponding rotated sticker.
[0220] The target rotation angle filtering module is used to filter out the target rotation angle corresponding to the target aspect ratio when there is a target aspect ratio in the candidate aspect ratio that matches the actual aspect ratio.
[0221] In one embodiment, the editing item includes a sticker scaling item; the filtering module includes a scaling ratio calculation module, a scaling module, and a pixel comparison module, wherein:
[0222] The scaling ratio calculation module is used to take the size ratio between the smallest rectangular pixel block containing each difference pixel in the difference map and the smallest rectangular pixel block containing the original sticker as the candidate scaling ratio between the difference map and the original sticker.
[0223] The scaling module is used to scale the original sticker according to the candidate scaling ratio to obtain a scaled sticker;
[0224] The pixel comparison module is used to compare the pixel points of the difference image and the scaling sticker. When the comparison result meets the comparison conditions, the candidate scaling ratio is used as the target scaling ratio.
[0225] In one embodiment, the editing item includes a combination of sticker rotation and sticker scaling; the filtering module includes a target rotation angle filtering module, a scaling module, and a matching module, wherein:
[0226] The target rotation angle filtering module is used to determine whether there is a target rotation angle among the candidate rotation parameters based on the difference map, so that the original sticker is rotated according to the target rotation angle and matches the difference map. If not, the filtering result of no target rotation angle is obtained.
[0227] The scaling module is used to determine the target rotation sticker corresponding to the target rotation angle if the target rotation angle is true, and to scale the target rotation sticker according to the candidate scaling ratio to obtain the rotation scaled sticker. The candidate scaling ratio is the size ratio between the difference map and the target rotation sticker.
[0228] The matching module is used to determine whether the rotated and scaled sticker matches the difference map. If they match, the candidate scaling ratio is used as the target scaling ratio. If not, the filter result of no target scaling ratio is obtained.
[0229] In one embodiment, the sticker effect detection device further includes a detection result acquisition module, which is used to obtain a detection result indicating that there is an abnormal sticker effect under the corresponding editing item when the screening result is that the target editing parameter is not found in the candidate editing stickers corresponding to at least one editing item.
[0230] In one embodiment, the data acquisition module is further configured to acquire the video to be detected obtained by adding edited stickers to the target video;
[0231] The comparison module is also used to compare the target video and the video to be detected frame by frame to obtain the difference frame in the video to be detected, which includes the difference pixels; and to determine the difference map corresponding to the difference frame based on the difference pixels in the difference frame.
[0232] The image sticker effect detection result is the sticker effect detection result corresponding to the difference frame; the sticker effect detection device also includes a video sticker effect detection module, which is used to obtain the video sticker effect detection result based on the sticker effect detection result corresponding to each difference frame in the video to be detected.
[0233] In one embodiment, the comparison module includes a color channel component acquisition module, a component difference summation calculation module, and a difference frame filtering module, wherein:
[0234] The color channel component acquisition module is used to acquire the component of a pixel at the same pixel position in at least one color channel for two corresponding video frames in the target video and the video to be detected.
[0235] The component difference summation calculation module is used to calculate the component difference summation corresponding to each video frame in the video to be detected based on the component difference of the same pixel position in each color channel in two video frames.
[0236] The difference frame filtering module is used to filter out difference frames from the video frames of the video to be detected whose total component difference is greater than the target value, based on the total component difference of each video frame.
[0237] In one embodiment, the sticker effect detection device further includes a static sticker detection module and a dynamic sticker detection module, wherein:
[0238] The static sticker detection module is used to compare the pixel points of the difference map corresponding to each difference frame in the video to be detected when the sticker type is static sticker, and obtain the static effect detection result.
[0239] The dynamic sticker detection module is used to compare the pixel points of the difference maps corresponding to multiple target difference frames in the video to be detected when the sticker type is dynamic sticker, so as to obtain the dynamic effect detection result. The number of frames between any two target difference frames matches the loop period corresponding to the dynamic sticker.
[0240] In one embodiment, the sticker effect detection device further includes a sticker activation detection module, which is used to obtain the sticker activation setting time corresponding to the sticker; and to detect the sticker activation setting time based on the start time and end time of the difference frame in the video to be detected, so as to obtain the video sticker activation time detection result.
[0241] For specific embodiments of the sticker effect detection device, please refer to the embodiments of the sticker effect detection method described above, which will not be repeated here. Each module in the above-described sticker effect detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0242] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores sticker effect detection data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a sticker effect detection method.
[0243] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0244] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0245] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0246] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.
[0247] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0248] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0249] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for detecting sticker effects, characterized in that, The method includes: Obtain the image to be detected by adding an edited sticker to the target image, and obtain the editing parameters under at least one editing item corresponding to the sticker; The target image and the image to be detected are compared pixel by pixel to determine the difference pixels in the image to be detected, and a difference map corresponding to the difference pixels is obtained. Based on the difference map, editing parameters are filtered for each editing item to obtain the filtering results. The editing parameter filtering is to select the target editing parameters from the candidate editing parameters under the corresponding editing item, so that the original sticker matches the difference map after being edited according to the target editing parameters. When the filtering results show that there are target editing parameters under each editing item, the target editing parameters under each editing item are compared with the corresponding editing parameters to obtain the image sticker effect detection results; When the filtering result indicates that the target editing parameter is not present in the candidate editing stickers corresponding to at least one editing item, or that the target editing parameter under at least one editing item is different from the corresponding editing parameter, a detection result of abnormal sticker effect is obtained.
2. The method according to claim 1, characterized in that, Obtaining the difference map corresponding to the difference pixels includes: Extract the difference pixels from the image to be detected, and construct a difference map based on the difference pixels; or... The pixel values corresponding to the same pixels in the image to be detected are adjusted to the target pixel values or the same pixels in the image to be detected are removed to obtain a difference map containing the difference pixels; wherein, the same pixels are pixels whose pixel comparison results show no difference.
3. The method according to claim 1, characterized in that, The editing items include sticker style editing items; based on the difference map, the editing parameters for each editing item are filtered to obtain the following filtering results: Based on the distribution of each difference pixel in the difference map, the actual pixel features corresponding to the difference map are obtained; For each candidate sticker style under the sticker style editing project, obtain the candidate pixel features corresponding to the original sticker under each candidate sticker style; When there is a target pixel feature among the candidate pixel features that matches the actual pixel feature, the target sticker style corresponding to the target pixel feature is selected from the candidate sticker styles.
4. The method according to claim 3, characterized in that, The step of obtaining the actual pixel features corresponding to the difference map based on the distribution of each difference pixel in the difference map includes: Extract the pixel values of each difference pixel in the difference map; The mean of each pixel value is calculated to obtain the actual pixel features corresponding to the difference map.
5. The method according to claim 3, characterized in that, The sticker style editing project includes a sticker style selection project and a sticker content editing project; For each candidate sticker style under the sticker style editing project, the process of obtaining the candidate pixel features corresponding to the original sticker under each candidate sticker style includes: For each candidate sticker style in the sticker style selection project, edit the original sticker according to the editing parameters of each candidate content in the sticker content editing project to obtain candidate stickers; For each candidate sticker, based on the distribution of each pixel in the corresponding candidate sticker, candidate pixel features corresponding one-to-one with the candidate sticker are obtained; The step of selecting the target sticker style corresponding to the target pixel feature from the candidate sticker styles includes: Based on the target stickers that correspond to the target pixel features in the candidate stickers, the target sticker styles corresponding to the target stickers are selected from the candidate sticker styles, and the target content editing parameters corresponding to the target stickers are selected from the candidate content editing parameters.
6. The method according to claim 1, characterized in that, The editing items include sticker rotation; based on the difference map, the editing parameters for each editing item are filtered to obtain the following filtering results: Calculate the actual aspect ratio of the difference map based on the width and height of the smallest rectangular pixel block containing each difference pixel in the difference map; According to each candidate rotation angle under the sticker rotation item, the original sticker is rotated to obtain a rotated sticker that corresponds one-to-one with the candidate rotation angle, and the candidate aspect ratio corresponding to the smallest rectangular pixel block containing the corresponding rotated sticker is determined. When there is a target aspect ratio among the candidate aspect ratios that matches the actual aspect ratio, the target rotation angle corresponding to the target aspect ratio is selected from the candidate rotation angles.
7. The method according to claim 1, characterized in that, The editing items include sticker scaling; the editing parameters for each editing item are filtered based on the difference map, and the filtering results include: The size ratio between the smallest rectangular pixel block containing each difference pixel in the difference map and the smallest rectangular pixel block containing the original sticker is used as a candidate scaling ratio between the difference map and the original sticker. The original sticker is scaled according to the candidate scaling ratio to obtain a scaled sticker; The pixel points of the difference map and the scaling sticker are compared. When the comparison result meets the comparison conditions, the candidate scaling ratio is taken as the target scaling ratio.
8. The method according to claim 1, characterized in that, The editing options include a combination of sticker rotation and sticker scaling. Based on the difference map, editing parameters are filtered for each editing item to obtain the filtering results, including: When a target rotation angle exists among the candidate rotation parameters, such that the original sticker matches the difference map after being rotated according to the target rotation angle, the target rotation sticker corresponding to the target rotation angle is obtained. The size ratio between the target rotating sticker and the difference map is used as a candidate scaling ratio. The target rotating sticker is scaled according to the candidate scaling ratio to obtain a rotating scaled sticker. Determine whether the rotation and scaling sticker matches the difference map. If yes, use the candidate scaling ratio as the target scaling ratio. If no, obtain the filtering result that there is no target scaling ratio.
9. The method according to any one of claims 1 to 8, characterized in that, The process of obtaining the image to be detected by adding edited stickers to the target image; comparing the target image and the image to be detected pixel by pixel to determine the difference pixels in the image to be detected, and obtaining a difference map corresponding to the difference pixels, includes: Obtain the video to be tested by adding edited stickers to the target video; The target video and the video to be detected are compared frame by frame to obtain the difference frames in the video to be detected that include the difference pixels. Based on the difference pixels in the difference frame, determine the difference map corresponding to the difference frame; The image sticker effect detection result is the sticker effect detection result corresponding to the difference frame; the method further includes: Based on the sticker effect detection results corresponding to each difference frame in the video to be detected, the video sticker effect detection results are obtained.
10. The method according to claim 9, characterized in that, The step of comparing the target video and the video to be detected frame by frame to obtain the difference frames in the video to be detected that include the difference pixels includes: For two corresponding video frames in the target video and the video to be detected, the components of the pixel at the same pixel position in the two image frames are obtained in at least one color channel. Based on the component differences of pixels at the same pixel position in two video frames under each color channel, calculate the sum of component differences corresponding to each video frame in the video to be detected; Based on the sum of component differences corresponding to each video frame, difference frames with a sum of component differences greater than the target value are selected from the video frames of the video to be detected.
11. The method according to claim 9, characterized in that, The method further includes: When the sticker type is a static sticker, the pixel points of the difference map corresponding to each difference frame in the video to be detected are compared to obtain the static effect detection result. When the sticker type is a dynamic sticker, the pixel points of the difference maps corresponding to multiple target difference frames in the video to be detected are compared to obtain the dynamic effect detection result. The number of frames between any two target difference frames matches the cycle period corresponding to the dynamic sticker.
12. The method according to claim 9, characterized in that, The method further includes: Get the sticker's activation time setting corresponding to the sticker; Based on the start and end times of the difference frames in the video to be detected, the sticker activation time is detected to obtain the video sticker activation time detection result.
13. A sticker effect detection device, characterized in that, The device includes: The data acquisition module is used to acquire the image to be detected obtained by adding an edited sticker to the target image, and to acquire the editing parameters under at least one editing item corresponding to the sticker; The comparison module is used to compare the target image and the image to be detected pixel by pixel, determine the difference pixels in the image to be detected, and obtain a difference map corresponding to the difference pixels. The filtering module is used to filter the editing parameters of each editing item based on the difference map to obtain the filtering results. The editing parameter filtering is to select the target editing parameters from the candidate editing parameters under the corresponding editing item so that the original sticker matches the difference map after being edited according to the target editing parameters. The detection module is used to compare the target editing parameters under each editing item with the corresponding editing parameters when the filtering results show that there are target editing parameters under each editing item, and obtain the image sticker effect detection results. The detection result acquisition module is used to obtain a detection result of abnormal sticker effect when the filtering result is that the target editing parameter is not present in the candidate editing stickers corresponding to at least one editing item or the target editing parameter under at least one editing item is different from the corresponding editing parameter.
14. The apparatus according to claim 13, characterized in that, The comparison module includes a difference map generation module, which is used to extract difference pixels from the image to be detected and construct a difference map based on the difference pixels.
15. The apparatus according to claim 13, characterized in that, The comparison module includes a difference map generation module, which is used to adjust the pixel values corresponding to the same pixels in the image to be detected to the target pixel value or remove the same pixels in the image to be detected to obtain a difference map containing the difference pixels; wherein, the same pixels are pixels whose pixel comparison results show no difference.
16. The apparatus according to claim 13, characterized in that, The editing project includes a sticker style editing project; the filtering module includes a first pixel feature processing module, a second pixel feature processing module, and a target sticker style filtering module, wherein: The first pixel feature processing module is used to obtain the actual pixel features corresponding to the difference map based on the distribution of each difference pixel point in the difference map. The second pixel feature processing module is used to obtain the candidate pixel features of the original sticker for each candidate sticker style under the sticker style editing project. The target sticker style filtering module is used to filter out the target sticker style corresponding to the target pixel feature when there is a target pixel feature in the candidate pixel features that matches the actual pixel feature.
17. The apparatus according to claim 16, characterized in that, The first pixel feature processing module is used to extract the pixel values of each difference pixel in the difference map; and to calculate the mean of each pixel value to obtain the actual pixel features corresponding to the difference map.
18. The apparatus according to claim 16, characterized in that, The sticker style editing project includes a sticker style selection project and a sticker content editing project; the second pixel feature processing module includes a candidate sticker processing module and a candidate pixel feature processing module, wherein: The candidate sticker processing module is used to select each candidate sticker style in the sticker style project, and edit the original sticker according to the editing parameters of each candidate content in the sticker content editing project to obtain candidate stickers; The candidate pixel feature processing module is used to obtain candidate pixel features that correspond one-to-one with each candidate sticker based on the distribution of each pixel in the corresponding candidate sticker. The target sticker style filtering module is also used to filter out the target sticker style corresponding to the target sticker from the candidate sticker styles based on the target sticker corresponding to the target pixel features, and to filter out the target content editing parameters corresponding to the target sticker from the candidate content editing parameters.
19. The apparatus according to claim 13, characterized in that, The editing items include sticker rotation; the filtering module includes a first aspect ratio calculation module, a second aspect ratio calculation module, and a target rotation angle filtering module, wherein: The first aspect ratio calculation module is used to calculate the actual aspect ratio of the difference map based on the width and height of the smallest rectangular pixel block containing each difference pixel in the difference map. The second aspect ratio calculation module is used to rotate the original sticker according to each candidate rotation angle under the sticker rotation project, obtain the rotated sticker that corresponds one-to-one with the candidate rotation angle, and determine the candidate aspect ratio corresponding to the smallest rectangular pixel block containing the corresponding rotated sticker. The target rotation angle filtering module is used to filter out the target rotation angle corresponding to the target aspect ratio when there is a target aspect ratio among the candidate aspect ratios that matches the actual aspect ratio.
20. The apparatus according to claim 13, characterized in that, The editing items include sticker scaling; the filtering module includes a scaling ratio calculation module, a scaling module, and a pixel comparison module, wherein: The scaling ratio calculation module is used to take the size ratio between the smallest rectangular pixel block containing each difference pixel in the difference map and the smallest rectangular pixel block containing the original sticker as the candidate scaling ratio between the difference map and the original sticker. The scaling module is used to scale the original sticker according to the candidate scaling ratio to obtain a scaled sticker; The pixel comparison module is used to compare the pixel points of the difference image and the scaling sticker. When the comparison result meets the comparison conditions, the candidate scaling ratio is used as the target scaling ratio.
21. The apparatus according to claim 13, characterized in that, The editing items include a combination of sticker rotation and sticker scaling; the filtering module includes a target rotation angle filtering module, a scaling module, and a matching module, wherein: The target rotation angle filtering module is used to determine whether there is a target rotation angle among the candidate rotation parameters based on the difference map, so that the original sticker is rotated according to the target rotation angle and matches the difference map. If not, the filtering result of no target rotation angle is obtained. The scaling module is used to determine the target rotation sticker corresponding to the target rotation angle if the target rotation angle is true, and to scale the target rotation sticker according to the candidate scaling ratio to obtain the rotation scaled sticker. The candidate scaling ratio is the size ratio between the difference map and the target rotation sticker. The matching module is used to determine whether the rotated and scaled sticker matches the difference map. If they match, the candidate scaling ratio is used as the target scaling ratio. If not, the filter result of no target scaling ratio is obtained.
22. The apparatus according to any one of claims 13 to 21, characterized in that, The data acquisition module is also used to acquire the video to be detected by adding edited stickers to the target video; The comparison module is also used to compare the target video and the video to be detected frame by frame to obtain the difference frames in the video to be detected that include the difference pixels. Based on the difference pixels in the difference frame, determine the difference map corresponding to the difference frame; The image sticker effect detection result is the sticker effect detection result corresponding to the difference frame; the sticker effect detection device also includes a video sticker effect detection module, which is used to obtain the video sticker effect detection result based on the sticker effect detection result corresponding to each difference frame in the video to be detected.
23. The apparatus according to claim 22, characterized in that, The comparison module includes a color channel component acquisition module, a component difference summation calculation module, and a difference frame filtering module, wherein: The color channel component acquisition module is used to acquire the component of a pixel at the same pixel position in at least one color channel for two corresponding video frames in the target video and the video to be detected. The component difference summation calculation module is used to calculate the component difference summation corresponding to each video frame in the video to be detected based on the component difference of the same pixel position in each color channel in two video frames. The difference frame filtering module is used to filter out difference frames from the video frames of the video to be detected whose total component difference is greater than the target value, based on the total component difference of each video frame.
24. The apparatus according to claim 22, characterized in that, The sticker effect detection device further includes a static sticker detection module and a dynamic sticker detection module, wherein: The static sticker detection module is used to compare the pixel points of the difference map corresponding to each difference frame in the video to be detected when the sticker type is static sticker, and obtain the static effect detection result. The dynamic sticker detection module is used to compare the pixel points of the difference maps corresponding to multiple target difference frames in the video to be detected when the sticker type is dynamic sticker, so as to obtain the dynamic effect detection result. The number of frames between any two target difference frames matches the loop period corresponding to the dynamic sticker.
25. The apparatus according to claim 22, characterized in that, The sticker effect detection device also includes a sticker activation detection module, used to obtain the sticker activation setting time corresponding to the sticker; Based on the start and end times of the difference frames in the video to be detected, the sticker activation time is detected to obtain the video sticker activation time detection result.
26. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.
27. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.
28. A computer program product comprising computer instructions stored in a computer-readable storage medium, characterized in that, The processor of the computer device reads the computer instructions from a computer-readable storage medium, and executes the computer instructions to cause the computer device to perform the steps of the method according to any one of claims 1 to 12.