An image data processing method, device, equipment and storage medium

By creating a reverse mask in a multi-layered visual image and merging it with the intermediate image, the problem of complex drawing paths for hollow styles in multi-layered images is solved, enabling the rapid generation of target visual images with visual hollow effects, thus improving brand display and user experience.

CN116777801BActive Publication Date: 2026-06-02BEIJING QIYI CENTURY SCI & TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING QIYI CENTURY SCI & TECH CO LTD
Filing Date
2023-06-25
Publication Date
2026-06-02

Smart Images

  • Figure CN116777801B_ABST
    Figure CN116777801B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an image data processing method, device and equipment, and a storage medium, relating to the technical field of image processing. The method comprises: first, obtaining a plurality of layers of visual images to be merged, the plurality of layers of visual images comprising at least a top layer image, an intermediate image and a bottom layer image; then creating a reference image having the same size as the intermediate image and each pixel point having a transparency of zero, merging the top layer image with the reference image to obtain a first merged image, and determining a reverse mask corresponding to the top layer image based on the first merged image; finally, performing image fusion on the reverse mask and the intermediate image, and superimposing the fused image on the bottom layer image to obtain a target visual image having a visual hollow effect. Thus, the technical problem of a complex drawing path and high acquisition difficulty of the intermediate image corresponding to the view area of the top layer image when the top layer image comprises a complex picture or text in the view area can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image data processing method, apparatus, device, and storage medium. Background Technology

[0002] Currently, because cutout styles in views are more eye-catching, they are often used as enhancement styles in some business scenarios to guide user operations and enhance brand image.

[0003] However, when the view includes three or more layers, it is usually necessary to draw a mask for the non-cutout parts and obtain the corresponding mask drawing path, or to redraw the intermediate layer image, omitting the cutout parts during the redraw. Both of these methods require obtaining the corresponding drawing path, which becomes very complex and difficult to obtain when the layers include complex images or text. Summary of the Invention

[0004] The purpose of this invention is to provide an image data processing method, apparatus, device, and storage medium to quickly generate a target visual image with a visual cutout effect without needing to obtain the mask drawing path. The specific technical solution is as follows:

[0005] In a first aspect of the present invention, an image data processing method is provided, the method comprising:

[0006] Obtain multi-layer visual images to be merged, wherein the multi-layer visual images include at least: a top layer image, an intermediate image, and a bottom layer image;

[0007] Create a reference image with the same size as the intermediate image, and merge the top-level image with the reference image to obtain a first merged image, wherein the transparency of each pixel in the reference image is zero;

[0008] Based on the first merged image, a reverse mask corresponding to the top layer image is determined. The reverse mask is generated by inverting the transparency of the first merged image.

[0009] The inverted mask and the intermediate image are fused together, and the fused image is overlaid on the bottom image to obtain a target visual image with a visual cutout effect. The image fusion refers to assigning the transparency of each pixel in the inverted mask to the corresponding pixel in the intermediate image.

[0010] Optionally, determining the inverse mask corresponding to the top-level image based on the first merged image includes:

[0011] Remove the color distribution data from the first merged image to determine the second merged image, which is used to characterize the transparency distribution of each pixel in the first merged image;

[0012] The transparency of each pixel in the second merged image is inverted to obtain the inverted mask corresponding to the top layer image.

[0013] Optionally, the step of inverting the transparency of each pixel in the second merged image to obtain the inverted mask corresponding to the top layer image includes:

[0014] Obtain the transparency range corresponding to the second merged image, wherein the transparency range includes at least an upper transparency value;

[0015] The transparency upper limit is subtracted from the transparency of each pixel in the second merged image to determine the reverse mask corresponding to the top layer image.

[0016] Optionally, the method further includes:

[0017] If the number of intermediate images is greater than or equal to two, determine whether at least two intermediate images can be placed in the same parent view, wherein the image size of the parent view is greater than or equal to the image size of the intermediate image with the largest image size;

[0018] If it is determined that at least two intermediate images can be placed in the same parent view, a parent view is created based on the at least two intermediate images, and the at least two intermediate images and the parent view are merged to obtain the updated intermediate images;

[0019] The reference image is created based on the updated intermediate image.

[0020] Optionally, the method further includes:

[0021] If it is determined that at least two intermediate images cannot be placed in the same parent view, a reference image with the same size as each intermediate image is created, and the top-level image is merged with each reference image to obtain multiple first merged images;

[0022] Based on each first merged image, the inverse mask corresponding to the top layer image is determined respectively, wherein the size of each inverse mask is the same as the size of the corresponding intermediate image;

[0023] Each inverse mask is fused with its corresponding intermediate image to obtain the fused image.

[0024] The fused images are stacked sequentially on the underlying image to obtain a target visual image with a visual cutout effect.

[0025] Optionally, determining whether at least two intermediate images can be placed in the same parent view includes:

[0026] The query service provider's view placement results include allowed and prohibited placement results.

[0027] If the view placement result indicates that placement is allowed, it is determined that at least two intermediate images can be placed in the same parent view;

[0028] If the view placement result is "placement prohibited", it is determined that at least two intermediate images cannot be placed in the same parent view.

[0029] Optionally, creating a parent view based on at least two intermediate images includes:

[0030] A parent view is created based on the image dimensions of at least two intermediate images and the projection positions between the at least two intermediate images, such that the parent view wraps around the projection images of the at least two intermediate images on the parent view.

[0031] In a second aspect of the invention, an image data processing apparatus is also provided, the apparatus comprising:

[0032] The image acquisition module is used to acquire multi-layer visual images to be merged, wherein the multi-layer visual images include at least: a top layer image, an intermediate image, and a bottom layer image;

[0033] The first merging module is used to create a reference image with the same size as the intermediate image, and merge the top-level image with the reference image to obtain a first merged image, wherein the transparency of each pixel in the reference image is zero;

[0034] The reverse mask determination module is used to determine the reverse mask corresponding to the top layer image based on the first merged image. The reverse mask is generated by inverting the transparency of the first merged image.

[0035] The target image determination module is used to perform image fusion on the inverse mask and the intermediate image, and to overlay the fused image on the bottom layer image to obtain a target visual image with a visual cutout effect. The image fusion refers to assigning the transparency of each pixel in the inverse mask to the corresponding pixel in the intermediate image.

[0036] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform any of the image data processing methods described above.

[0037] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the image data processing methods described above.

[0038] This invention provides an image data processing method. First, it acquires a multi-layered visual image to be merged, which includes at least a top image, an intermediate image, and a bottom image. Then, it creates a reference image with the same size as the intermediate image and merges the top image with the reference image to obtain a first merged image, where the transparency of each pixel in the reference image is zero. Based on the first merged image, it determines the inverse mask corresponding to the top image. Finally, it fuses the inverse mask and the intermediate image, and overlays the fused image onto the bottom image to obtain a target visual image with a visual cutout effect. This solves the technical problem that when the top image includes a view area with complex images or text, the drawing path of the intermediate image corresponding to the view area of ​​the top image is very complex and difficult to obtain. By applying the transparency of the inverse mask corresponding to the top image to the intermediate image, a visual cutout effect can be achieved on the intermediate image for the view area of ​​the top image. By overlaying the intermediate image with the visual cutout effect onto the bottom image, a target visual image with a visual cutout effect is quickly generated. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0040] Figure 1 This is a flowchart illustrating the steps of an image data processing method provided in an embodiment of the present invention;

[0041] Figure 2 This is a flowchart illustrating the steps of another image data processing method provided in an embodiment of the present invention;

[0042] Figure 3 This is a schematic diagram of the layer distribution of a multi-layer visual image provided in an embodiment of the present invention;

[0043] Figure 4 This is a schematic diagram of a first merged image provided in an embodiment of the present invention;

[0044] Figure 5 This is a schematic diagram of a reverse mask provided in an embodiment of the present invention;

[0045] Figure 6 A schematic diagram of a target visual image provided in an embodiment of the present invention;

[0046] Figure 7This is a schematic diagram of the processing flow of an SDK system provided in an embodiment of the present invention;

[0047] Figure 8 A flowchart illustrating the steps of another image data processing method provided in an embodiment of the present invention;

[0048] Figure 9 This is a schematic diagram of the structure of an image data processing device provided in an embodiment of the present invention;

[0049] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0050] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.

[0051] Reference Figure 1 This invention provides an image data processing method, which may include:

[0052] S101. Obtain the multi-layer visual image to be merged, wherein the multi-layer visual image includes at least: a top layer image, an intermediate image, and a bottom layer image.

[0053] In this embodiment of the invention, the number of layers in the multi-layer visual image is at least three. Correspondingly, after obtaining the multi-layer visual image to be merged, the layers can be arranged in the following order from top to bottom: top layer image, middle layer image, and bottom layer image.

[0054] S102. Create a reference image with the same size as the intermediate image, and merge the top-level image with the reference image to obtain a first merged image.

[0055] In this embodiment of the invention, the transparency of each pixel in the reference image is zero. Transparency can be represented by a value between 0 and 1, indicating the percentage of opacity in the image. For example, a transparency value of 0.5 indicates an opacity of 50%, i.e., semi-transparent. In another example, transparency can be represented by a value between 0 and 255, indicating the degree of opacity of the image, also known as a transparency value. For example, a transparency value of 128 indicates an opacity of 50%, i.e., semi-transparent. Correspondingly, a transparency of 0 can be understood as completely transparent (or hollowed out); a transparency of 1 or 255 can be understood as completely opaque.

[0056] In one example, when the number of intermediate images is one, a reference image with the same size as the intermediate image is created. The top-level image and the reference image can be merged to obtain a first merged image. Each pixel in the image is typically represented using RGBA, which consists of Red, Green, Blue, and Alpha. Image merging here can be understood as the sum of the RGBA values ​​of the reference image and the top-level image. The RGBA values ​​of the reference image are all zero. Thus, image merging is equivalent to replicating the view area from the top-level image into the first merged image. The view area can be understood as the area in the top-level image that is not completely transparent. It can also be seen as the visually visible image in the top-level image, such as a set of pixels like text or a logo. The transparency in the first merged image is divided into two parts: one corresponds to the transparency of the view area in the top-level image and is consistent with the view area of ​​the top-level image; the transparency of other image positions outside the view area is 0.

[0057] S103. Based on the first merged image, determine the reverse mask corresponding to the top layer image.

[0058] In this embodiment of the invention, the reverse mask is generated by inverting the transparency of the first merged image. It is used to control the transparency distribution of the intermediate images. For example, a pixel with a transparency of 1 in the top-level image corresponds to a pixel with a transparency of 0 in the reverse mask at the same position; conversely, a pixel with a transparency of 0 in the top-level image corresponds to a pixel with a transparency of 1 in the reverse mask at the same position. Therefore, the reverse mask can be seen as a hollowing out of the view area in the top-level image, resulting in a corresponding visual cutout effect.

[0059] S104. The reverse mask and the intermediate image are fused together, and the fused image is overlaid on the bottom layer image to obtain a target visual image with a visual cutout effect.

[0060] In this embodiment of the invention, the cutout effect is highlighted by the inverse mask without adding a top-level image. Therefore, image fusion can be performed on the inverse mask and the intermediate image. Image fusion refers to assigning the transparency of each pixel in the inverse mask to the corresponding pixel in the intermediate image. Since the size of the inverse mask and the intermediate image are the same, the transparency of the intermediate image is controlled by the transparency of the inverse mask. For example, the transparency of pixels in the intermediate image corresponding to pixels in the inverse mask that are completely transparent is updated to be completely transparent. This achieves a visual cutout effect of the top-level image on the intermediate image. Finally, the fused image is overlaid on the bottom-level image to obtain a target visual image with a visual cutout effect. The above method embodiment can solve the technical problem that drawing a cutout path for the view area in the top-level image on the intermediate image is very complex and difficult to obtain when the layer includes complex images or text. It can quickly generate a target visual image with a visual cutout effect without needing to obtain the drawing path.

[0061] Reference Figure 2 This invention provides another image data processing method, which may include:

[0062] S201. Obtain the multi-layer visual image to be merged, wherein the multi-layer visual image includes at least: a top layer image, an intermediate image, and a bottom layer image.

[0063] S202. Create a reference image with the same size as the intermediate image, and merge the top-level image with the reference image to obtain a first merged image.

[0064] In this embodiment of the invention, the description of steps S201 and S202 refers to the description of steps S101 and S102.

[0065] In one example, referencing Figure 3 As shown, the top-level image can be a top icon layer, the middle image can be a middle gradient layer, and the bottom-level image can be a bottom animation layer. The bottom-level image can also include other style images, etc., without further limitation. The "ABC" corresponding to the top icon layer is a completely opaque character (transparency of 1 or 255). Furthermore, based on the top-level image and the reference image, an image merging is performed to obtain the first merged image reference. Figure 4 As shown. In the first merged image, the transparency of multiple pixels containing characters (or icons) from the top-level image is completely opaque. The transparency of all pixels in the first merged image, except for the multiple pixels corresponding to the view area of ​​the top-level image, is 0.

[0066] S203. Remove the color distribution data from the first merged image to determine the second merged image, which is used to characterize the transparency distribution of each pixel in the first merged image.

[0067] S204. Invert the transparency of each pixel in the second merged image to obtain the inverted mask corresponding to the top layer image.

[0068] In this embodiment of the invention, for each pixel, the color distribution data (i.e., the RGB values ​​of each pixel in the first merged image) is removed, and only the transparency (Alpha value) of each pixel in the first merged image is retained, thereby obtaining the second merged image. Thus, the second merged image and the first merged image have the same image size, and the pixel transparency of the corresponding pixels in the second merged image and the first merged image is the same.

[0069] After determining the second merged image, the transparency of each pixel in the second merged image is inverted. In one example, the transparency distribution corresponding to the second merged image is obtained. For example, if the top layer image, intermediate image, and bottom layer image are stored in a bitmap format with 32 bits each, then the corresponding red (R channel), green (G channel), blue (B channel), and transparency (Alpha channel) are each represented by 8 bits. The corresponding transparency value is [0, 255], and the upper limit of transparency is 255. Thus, a transparency value of 0 is 0 / 255, which means completely transparent, and a transparency value of 1 is 255 / 255, which means completely opaque.

[0070] Therefore, inverting the transparency involves subtracting the transparency of each pixel in the second merged image from the upper limit of transparency. For example, for a pixel with transparency X, inverting the transparency is 255 - X. Similarly, the transparency of each pixel in the second merged image is inverted to obtain the inverted mask corresponding to the top layer image, which is referenced... Figure 5 As shown.

[0071] The inverse mask is generated by inverting the transparency of the first merged image. It is used to control the transparency distribution of the intermediate images. For example, a pixel with a transparency of 1 in the top layer image corresponds to a pixel with a transparency of 0 in the inverse mask at the same position; conversely, a pixel with a transparency of 0 in the top layer image corresponds to a pixel with a transparency of 1 in the inverse mask at the same position. Thus, the inverse mask can be seen as a hollowing out of the view area in the top layer image, resulting in a corresponding visual cutout effect.

[0072] S205. The reverse mask and the intermediate image are fused together, and the fused image is overlaid on the bottom layer image to obtain a target visual image with a visual cutout effect.

[0073] In this embodiment of the invention, the cutout effect is highlighted by the inverted mask without adding a top-level image. Therefore, image fusion can be performed on the inverted mask and the intermediate image. Image fusion refers to assigning the transparency of each pixel in the inverted mask to the corresponding pixel in the intermediate image. This alters the transparency of some pixels in the intermediate image to create a visual cutout effect. Finally, the fused image is overlaid on the bottom-level image to obtain a target visual image with a visual cutout effect. (Refer to...) Figure 6 As shown, from a visual perspective, the bottom animation layer and the middle gradient layer achieve color overlay and rendering within the icons of the top icon layer. The above-described embodiments of the invention can solve the technical problem that when the top image includes a view area with complex images or text, the drawing path of the middle image corresponding to the view area of ​​the top image is very complex and difficult to obtain. By applying the transparency of the inverse mask corresponding to the top image to the middle image, a visual cutout effect of the view area of ​​the top image on the middle image can be achieved. The middle image with the visual cutout effect is then overlaid on the bottom image to quickly generate a target visual image with the visual cutout effect.

[0074] In an optional embodiment of the invention, the method steps performed in the above method embodiments can be service encapsulated to generate an SDK (Software Development Kit) system, as described above. Figure 7 As shown, this facilitates the ease of use for cutout applications. The SDK system can include a cutout module, which is mainly used by users to achieve cutout effects. The input of the SDK system can be a top-level image (to be cut out) and an intermediate image, and the output can be a reverse mask, or a reverse mask and a parent view.

[0075] In another optional embodiment of the invention, the SDK system may further include an image monitoring module. This module monitors whether the input top-level and intermediate images have changed, such as changes in position or image size. When changes occur, it promptly updates the output inverse mask or parent view. This facilitates image merging between the bottom-level image and the updated image, updating the target visual image, i.e., updating the cutout effect.

[0076] In summary, the embodiments of this invention can quickly realize complex multi-layered cutout styles, while avoiding manual image slicing and eliminating the need to draw additional masking paths or cutout paths for intermediate images, greatly reducing workload. Furthermore, it can better create brand and advertising display effects, improve user experience, and further enhance the operator's advertising revenue.

[0077] Reference Figure 8 This invention provides yet another image data processing method, which may include:

[0078] S801. Obtain the multi-layer visual image to be merged, wherein the multi-layer visual image includes at least: a top layer image, at least two intermediate images and a bottom layer image.

[0079] S802. Determine whether at least two intermediate images can be placed in the same parent view.

[0080] In this embodiment of the invention, when the number of layers in the multi-layered visual image is greater than or equal to four, that is, the number of intermediate images is greater than or equal to two, it is pre-determined whether at least two intermediate images can be placed in the same parent view. If it is determined that at least two intermediate images can be placed in the same parent view, the parent view can be used as an intermediate image in a three-layered multi-layered visual image for subsequent processing. Furthermore, when they can be placed in the same parent view, the image size of the corresponding parent view is greater than or equal to the image size of the intermediate image with the largest image size. That is, the parent view can be understood as a view that surrounds the projection positions of all intermediate images, and the transparency of all pixels is zero. If it is determined that at least two intermediate images can be placed in the same parent view, step S803 is executed; if it is determined that at least two intermediate images cannot be placed in the same parent view, step S808 is executed.

[0081] In one optional embodiment of the invention, the service provider can decide whether to use the same parent view to achieve the cutout effect. Therefore, the view placement results corresponding to the service provider can be queried in advance, including allowed and prohibited placement results.

[0082] If the view placement result is "placement allowed", it is determined that at least two intermediate images can be placed in the same parent view; if the view placement result is "placement prohibited", it is determined that at least two intermediate images cannot be placed in the same parent view.

[0083] S803. Create a parent view based on at least two intermediate images, and merge the at least two intermediate images and the parent view to obtain an updated intermediate image.

[0084] In this embodiment of the invention, a parent view is created based on the image dimensions of at least two intermediate images and the projection positions between them, so that the parent view wraps around the projected images of the at least two intermediate images. Therefore, after pre-determining the image dimensions corresponding to the parent view, the transparency of each pixel in the parent view is set to 0, and RGB attributes are not set. Then, the at least two intermediate images are merged with the parent view layer by layer from bottom to top according to the layer arrangement order to obtain the parent view. This image merging can be understood as the accumulation of the RGBA values ​​of each intermediate image. In one example, during the accumulation process, if the accumulated value of any item in the RGBA value of a corresponding pixel exceeds its upper limit, all values ​​exceeding the upper limit are changed to the upper limit value. In another example, during the accumulation process, the RGBA values ​​of corresponding pixels of two adjacent intermediate images are added once and then divided by 2 to obtain the new RGBA value after accumulation. After completing the accumulation of the RGBA values ​​of all intermediate images, the parent view is obtained, and the at least two intermediate images and the parent view are merged to obtain the updated intermediate image.

[0085] S804. Based on the updated intermediate image, create the reference image.

[0086] S805. Merge the top-level image with the reference image to obtain a first merged image.

[0087] S806. Based on the first merged image, determine the reverse mask corresponding to the top layer image.

[0088] S807. The reverse mask and the intermediate image are fused together, and the fused image is overlaid on the bottom layer image to obtain a target visual image with a visual cutout effect.

[0089] In this embodiment of the invention, the description of steps S804-S807 refers to the description of steps S202-S205.

[0090] S808. Create reference images with the same size as each intermediate image, and merge the top-level image with each reference image to obtain multiple first merged images.

[0091] In this embodiment of the invention, reference images of the same size as each intermediate image are created, thereby obtaining multiple reference images. The top-level image and each reference image are then merged to obtain multiple first merged images corresponding to each intermediate image. In other words, the above operation replicates the view area of ​​the top-level image to each first merged image.

[0092] S809. Based on each of the first merged images, determine the reverse mask corresponding to the top layer image.

[0093] S810. Perform image fusion between each inverse mask and the corresponding intermediate image to obtain the corresponding fused image.

[0094] S811. The fused images are sequentially overlaid on the underlying image to obtain a target visual image with a visual cutout effect.

[0095] In this embodiment of the invention, the reverse mask is generated by inverting the transparency of the first merged image. It is used to control the transparency distribution of the intermediate images. For example, a pixel with a transparency of 1 in the top-level image corresponds to a pixel with a transparency of 0 in the reverse mask at the same position; conversely, a pixel with a transparency of 0 in the top-level image corresponds to a pixel with a transparency of 1 in the reverse mask at the same position. Therefore, the reverse mask can be seen as a hollowing out of the view area in the top-level image, resulting in a corresponding visual cutout effect.

[0096] Without adding a top-level image, the cutout effect is highlighted using the inverse mask. Therefore, image fusion can be performed on the inverse mask and the intermediate images. Image fusion refers to assigning the transparency of each pixel in the inverse mask to the corresponding pixel in the intermediate image. This alters the transparency of some pixels in the intermediate image, creating a visual cutout effect on the visual region corresponding to the top-level image. Thus, after determining the corresponding directional mask based on each first merged image, a fused image corresponding to each intermediate image is determined. The fused image represents the pixel distribution of the visual region of the top-level image in the corresponding intermediate image (or can be understood as the cutout drawing path). Finally, each fused image represents the visual cutout effect of the top-level image's visual region on each intermediate image. Following the placement order of the corresponding intermediate images, the fused images are sequentially overlaid on the bottom-level image to obtain the target visual image with a visual cutout effect.

[0097] For example, when there are two intermediate images, image fusion can be performed based on the inverse mask obtained from the top intermediate image (also called the mask corresponding to the top intermediate image) and the top intermediate image itself, resulting in a fused image. This fused image represents the visual cutout effect of the top image's visual region on the top intermediate image. Similarly, image fusion can be performed based on the inverse mask obtained from the bottom intermediate image (also called the mask corresponding to the bottom intermediate image) and the order of the bottom intermediate image, resulting in a fused image that also represents the visual cutout effect of the top image's visual region on the bottom intermediate image. This logic is then applied sequentially, and the final fused images are superimposed on the bottom images to obtain the target visual image with a visual cutout effect.

[0098] In summary, the image data processing method provided by this invention first acquires a multi-layered visual image to be merged, which includes at least a top-layer image, an intermediate image, and a bottom-layer image. Then, a reference image with the same size as the intermediate image is created, and the top-layer image and the reference image are merged to obtain a first merged image, where the transparency of each pixel in the reference image is zero. Based on the first merged image, a reverse mask corresponding to the top-layer image is determined. Finally, the reverse mask and the intermediate image are image-fused, and the fused image is overlaid on the bottom-layer image to obtain a target visual image with a visual cutout effect. This solves the technical problem that when the top-layer image includes a view area containing complex images or text, the drawing path of the intermediate image corresponding to the view area of ​​the top-layer image is very complex and difficult to obtain. By applying the transparency of the reverse mask corresponding to the top-layer image to the intermediate image, a visual cutout effect can be achieved on the intermediate image for the view area of ​​the top-layer image. By overlaying the intermediate image with the visual cutout effect onto the bottom-layer image, a target visual image with a visual cutout effect is quickly generated.

[0099] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.

[0100] Reference Figure 9 This invention provides a video recommendation device, which may include:

[0101] Image acquisition module 901 is used to acquire multi-layer visual images to be merged, wherein the multi-layer visual images include at least: a top layer image, an intermediate image and a bottom layer image.

[0102] The first merging module 902 is used to create a reference image with the same size as the intermediate image, and merge the top-level image with the reference image to obtain a first merged image, wherein the transparency of each pixel in the reference image is zero.

[0103] The reverse mask determination module 903 is used to determine the reverse mask corresponding to the top layer image based on the first merged image. The reverse mask is generated by inverting the transparency of the first merged image.

[0104] The target image determination module 904 is used to perform image fusion on the inverse mask and the intermediate image, and to overlay the fused image on the bottom layer image to obtain a target visual image with a visual cutout effect. The image fusion refers to assigning the transparency of each pixel in the inverse mask to the corresponding pixel in the intermediate image.

[0105] In an optional embodiment of the invention, the reverse mask determination module 903 may include:

[0106] The color removal submodule is used to remove color distribution data from the first merged image and determine the second merged image, which is used to characterize the transparency distribution of each pixel in the first merged image.

[0107] The inverse mask determination submodule is used to invert the transparency of each pixel in the second merged image to obtain the inverse mask corresponding to the top layer image.

[0108] In an optional embodiment of the invention, the reverse masking determination submodule may include:

[0109] A transparency range determination unit is used to obtain the transparency distribution corresponding to the second merged image.

[0110] The reverse mask determination unit is used to subtract the transparency of each pixel in the second merged image from the upper limit of transparency to determine the reverse mask corresponding to the top layer image.

[0111] In an optional embodiment of the invention, the apparatus may further include:

[0112] The parent view determination module is used to determine whether at least two intermediate images can be placed in the same parent view when the number of intermediate images is greater than or equal to two, wherein the image size of the parent view is greater than or equal to the image size of the intermediate image with the largest image size.

[0113] The intermediate image update module is used to create a parent view based on at least two intermediate images if it is determined that at least two intermediate images can be placed in the same parent view, and to merge the at least two intermediate images and the parent view to obtain the updated intermediate image.

[0114] The first merging module 902 is also used to create the reference image based on the updated intermediate image.

[0115] In an optional embodiment of the invention, the apparatus may further include:

[0116] The first merging module 902 is further configured to, if it is determined that at least two intermediate images cannot be placed in the same parent view, create reference images of the same size as each intermediate image, and merge the top-level image with each reference image to obtain a plurality of first merged images.

[0117] The reverse mask determination module 903 is further configured to determine the reverse mask corresponding to the top layer image based on each first merged image, wherein the size of each reverse mask is the same as the size of the corresponding intermediate image.

[0118] The target image determination module 904 is also used to perform image fusion between each reverse mask and the corresponding intermediate image to obtain the corresponding fused image.

[0119] The target image determination module 904 is also used to sequentially overlay each fused image onto the underlying image to obtain a target visual image with a visual cutout effect.

[0120] In an optional embodiment of the invention, the intermediate image update module can also be used for:

[0121] The query service provider provides the view placement results, which include allowed and prohibited placement.

[0122] If the view placement result is allowed, it is determined that at least two intermediate images can be placed in the same parent view.

[0123] If the view placement result is "placement prohibited", it is determined that at least two intermediate images cannot be placed in the same parent view.

[0124] In an optional embodiment of the invention, the apparatus further includes a view creation module for creating a parent view, the view creation module being used to:

[0125] A parent view is created based on the image dimensions of at least two intermediate images and the projection positions between the at least two intermediate images, such that the parent view wraps around the projection images of the at least two intermediate images on the parent view.

[0126] This invention also provides an electronic device, such as... Figure 10 As shown, it includes a processor 1001, a communication interface 1002, a memory 1003, and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004.

[0127] Memory 1003 is used to store computer programs.

[0128] When processor 1001 executes a program stored in memory 1003, it performs the following steps:

[0129] Obtain multi-layer visual images to be merged, wherein the multi-layer visual images include at least: a top layer image, an intermediate image, and a bottom layer image.

[0130] Create a reference image with the same size as the intermediate image, and merge the top-level image with the reference image to obtain a first merged image, wherein the transparency of each pixel in the reference image is zero.

[0131] Based on the first merged image, a reverse mask corresponding to the top layer image is determined. The reverse mask is generated by inverting the transparency of the first merged image.

[0132] The inverted mask and the intermediate image are fused together, and the fused image is overlaid on the bottom image to obtain a target visual image with a visual cutout effect. The image fusion refers to assigning the transparency of each pixel in the inverted mask to the corresponding pixel in the intermediate image.

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

[0134] The communication interface is used for communication between the aforementioned terminal and other devices.

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

[0136] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc. They can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0137] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the image data processing methods described in the above embodiments.

[0138] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the image data processing methods described in the above embodiments.

[0139] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0140] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0141] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0142] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. An image data processing method, characterized by, The method includes: Obtain multi-layer visual images to be merged, wherein the multi-layer visual images include at least: a top layer image, an intermediate image, and a bottom layer image; Create a reference image with the same size as the intermediate image, and merge the top-level image with the reference image to obtain a first merged image, wherein the transparency of each pixel in the reference image is zero; Based on the first merged image, a reverse mask corresponding to the top layer image is determined. The reverse mask is generated by inverting the transparency of the first merged image. The inverted mask and the intermediate image are fused together, and the fused image is overlaid on the bottom image to obtain a target visual image with a visual cutout effect. The image fusion refers to assigning the transparency of each pixel in the inverted mask to the corresponding pixel in the intermediate image.

2. The image data processing method of claim 1, wherein, The step of determining the inverse mask corresponding to the top-level image based on the first merged image includes: Remove the color distribution data from the first merged image to determine the second merged image, which is used to characterize the transparency distribution of each pixel in the first merged image; The transparency of each pixel in the second merged image is inverted to obtain the inverted mask corresponding to the top layer image.

3. The image data processing method according to claim 2, characterized in that, The step of inverting the transparency of each pixel in the second merged image to obtain the inverted mask corresponding to the top layer image includes: Obtain the transparency distribution corresponding to the second merged image; The transparency upper limit is subtracted from the transparency of each pixel in the second merged image to determine the reverse mask corresponding to the top layer image.

4. The image data processing method according to claim 1, characterized in that, The method further includes: If the number of intermediate images is greater than or equal to two, determine whether at least two intermediate images can be placed in the same parent view, wherein the image size of the parent view is greater than or equal to the image size of the intermediate image with the largest image size; If it is determined that at least two intermediate images can be placed in the same parent view, a parent view is created based on the at least two intermediate images, and the at least two intermediate images and the parent view are merged to obtain the updated intermediate images; The reference image is created based on the updated intermediate image.

5. The image data processing method according to claim 4, characterized in that, The method further includes: If it is determined that at least two intermediate images cannot be placed in the same parent view, a reference image with the same size as each intermediate image is created, and the top-level image is merged with each reference image to obtain multiple first merged images; Based on each first merged image, the inverse mask corresponding to the top layer image is determined respectively, wherein the size of each inverse mask is the same as the size of the corresponding intermediate image; Each inverse mask is fused with its corresponding intermediate image to obtain the fused image. The fused images are stacked sequentially on the underlying image to obtain a target visual image with a visual cutout effect.

6. The image data processing method according to claim 4, characterized in that, Determining whether at least two intermediate images can be placed in the same parent view includes: The query service provider's view placement results include allowed and prohibited placement results. If the view placement result indicates that placement is allowed, it is determined that at least two intermediate images can be placed in the same parent view; If the view placement result is "placement prohibited", it is determined that at least two intermediate images cannot be placed in the same parent view.

7. The image data processing method according to claim 4, characterized in that, Creating a parent view based on at least two intermediate images includes: A parent view is created based on the image dimensions of at least two intermediate images and the projection positions between the at least two intermediate images, such that the parent view wraps around the projection images of the at least two intermediate images on the parent view.

8. An image data processing apparatus, characterized in that, The device includes: The image acquisition module is used to acquire multi-layer visual images to be merged, wherein the multi-layer visual images include at least: a top layer image, an intermediate image, and a bottom layer image; The first merging module is used to create a reference image with the same size as the intermediate image, and merge the top-level image with the reference image to obtain a first merged image, wherein the transparency of each pixel in the reference image is zero; The reverse mask determination module is used to determine the reverse mask corresponding to the top layer image based on the first merged image. The reverse mask is generated by inverting the transparency of the first merged image. The target image determination module is used to perform image fusion on the inverse mask and the intermediate image, and to overlay the fused image on the bottom layer image to obtain a target visual image with a visual cutout effect. The image fusion refers to assigning the transparency of each pixel in the inverse mask to the corresponding pixel in the intermediate image.

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

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.