Disclosure of Invention
Aiming at the technical problems in the prior art, the invention provides a method and a device for picking pictures and texts in an image.
A method for picking image-text in an image comprises the following steps:
drawing a first picture of three channels according to a preset first picture drawing strategy;
drawing a third picture of the three channels according to a preset second picture drawing strategy;
drawing a third picture of the four channels according to a preset third picture drawing strategy;
the pixel points of the first picture, the second picture and the third picture are in one-to-one correspondence, and each pixel point of the third picture is reset to generate a target picture;
wherein, resetting each pixel of the third picture comprises:
for any pixel point of the third picture, determining that an Alpha channel value, an R channel value, a G channel value and a B channel value of the pixel point of the third picture are respectively Alpha C, RedC, GreenC and BlueC, determining that the R channel value, the G channel value and the B channel value of the pixel point of the first picture corresponding to the pixel point are respectively RedA, GreenA and BlueA, and determining that the R channel value, the G channel value and the B channel value of the pixel point of the second picture corresponding to the pixel point are respectively RedB, GreenB and BlueB;
normalizing the channel values of all pixel points of the first picture, the second picture and the third picture; for any pixel point of the normalized third picture, the Alpha channel value is expressed as Alpha C ', the R channel value, the G channel value and the B channel value are respectively RedC', GreenC 'and BlueC', the R channel value, the G channel value and the B channel value of the pixel point of the first picture corresponding to the Alpha channel value, the G channel value and the B channel value are respectively RedA ', GreenA' and BlueA ', and the R channel value, the G channel value and the B channel value of the pixel point of the second picture corresponding to the G channel value and the B channel value are respectively RedB', GreenB 'and BlueB';
updating the alphaC ' values of all pixel points of the third picture, wherein the alphaC ' = RedA ';
and updating the RedC ', GreenC ' and BlueC ' values of all pixel points of the third picture, including: for a pixel point with alpha 'being =0, let red c' =0, GreenC '= 0, and BlueC' = 0; for alpha C'
(0, 1) for the pixel point, the value of RedC ' is the quotient of RedB ' and RedA ', the value of GreenC ' is the quotient of GreenB ' and GreenA ', and the value of BlueC ' is the quotient of BlueB ' and BlueA '; for a pixel point with alpha ' 1, let red c ' = RedB ', GreenC ' = GreenB ', and BlueC ' = BlueB ';
and performing inverse normalization on the channel values of all the pixel points of the third picture and taking an integer.
Further, the first picture drawing strategy is as follows: and generating a first black background according to a preset picture resolution, generating a first picture and text according to a preset first picture and text generation strategy, and combining the first black background and the first picture and text according to a preset combination strategy.
Further, the second picture drawing strategy is as follows: and generating a second black background according to a preset picture resolution, generating a second image-text according to a preset second image-text generation strategy, and combining the second black background and the second image-text according to a preset combination strategy.
Further, the first image-text generation strategy is as follows: generating white pictures and texts by using preset characters and preset patterns; the second image-text generation strategy is as follows: and generating the colorful pictures and texts by combining the preset characters and the preset patterns with the pre-selected colors.
Further, the third picture drawing strategy is as follows: and generating a full transparent picture at a preset picture resolution.
Further, the combination strategy is: and superposing the image on the background according to a preset position relation.
Further, the channel values of all the pixel points of the third picture are denormalized and are taken as integers, and the method comprises the following steps: and (4) rounding the denormalized channel value.
The invention also provides a device for picking the image and the text in the image, which comprises a first image drawing module, a second image drawing module, a third image drawing module and a third image setting module, wherein:
the first picture drawing module is connected with the third picture setting module; the first picture drawing module is used for drawing a three-channel first picture according to a preset first picture drawing strategy;
the second picture drawing module is connected with the third picture setting module; the second picture drawing module is used for drawing a third picture of the three channels according to a preset second picture drawing strategy;
the third picture drawing module is connected with the third picture setting module; the third picture drawing module is used for drawing a third picture of the four channels according to a preset third picture drawing strategy;
the third picture setting module is connected with the first picture drawing module, the second picture drawing module and the third picture drawing module; the third picture setting module is used for corresponding the pixel points of the first picture, the second picture and the third picture one by one, resetting each pixel point of the third picture and generating a target picture; wherein, the third picture presumes that the module resets including to every pixel of the third picture:
for any pixel point of the third picture, determining that an Alpha channel value, an R channel value, a G channel value and a B channel value of the pixel point of the third picture are respectively Alpha C, RedC, GreenC and BlueC, determining that the R channel value, the G channel value and the B channel value of the pixel point of the first picture corresponding to the pixel point are respectively RedA, GreenA and BlueA, and determining that the R channel value, the G channel value and the B channel value of the pixel point of the second picture corresponding to the pixel point are respectively RedB, GreenB and BlueB;
normalizing the channel values of all pixel points of the first picture, the second picture and the third picture; for any pixel point of the normalized third picture, the Alpha channel value is expressed as Alpha C ', the R channel value, the G channel value and the B channel value are respectively RedC', GreenC 'and BlueC', the R channel value, the G channel value and the B channel value of the pixel point of the first picture corresponding to the Alpha channel value, the G channel value and the B channel value are respectively RedA ', GreenA' and BlueA ', and the R channel value, the G channel value and the B channel value of the pixel point of the second picture corresponding to the G channel value and the B channel value are respectively RedB', GreenB 'and BlueB';
updating the alphaC ' values of all pixel points of the third picture, wherein the alphaC ' = RedA ';
and updating the RedC ', GreenC ' and BlueC ' values of all pixel points of the third picture, including: for a pixel point with alpha 'being =0, let red c' =0, GreenC '= 0, and BlueC' = 0; for alpha C'
(0, 1) for the pixel point, the value of RedC ' is the quotient of RedB ' and RedA ', the value of GreenC ' is the quotient of GreenB ' and GreenA ', and the value of BlueC ' is the quotient of BlueB ' and BlueA '; for a pixel point with alpha ' 1, let red c ' = RedB ', GreenC ' = GreenB ', and BlueC ' = BlueB ';
and performing inverse normalization on the channel values of all the pixel points of the third picture and taking an integer.
The invention also provides a picture superposition display method, which comprises the following steps:
generating a target picture by the method;
superposing the target picture in the selected picture according to a preset superposition strategy to obtain a superposed picture;
and displaying the superposed pictures.
The invention also provides a picture superposition display device, which comprises the picture-text digging device, a picture superposition device and a display device, wherein:
the image-text digging device is connected with the image superposition device; the image-text matting device is used for generating a target image;
the picture stacking device is connected with the image-text digging device and the display device; the image superposition device is used for superposing the target image in the selected image according to a preset superposition strategy to obtain a superposed image;
the display device is connected with the picture superposition device; the display device is used for displaying the superposed pictures.
The image-text matting method in the image realizes matting of color images and texts, and finally generates a target image with translucency by setting an Alpha channel, so that the anti-aliasing effect of the target image is improved, and the target image can have a very good display effect when being overlaid in other images or videos; on the other hand, the invention is not limited to the picking of patterns or characters and the color effect of the pictures and the texts, and completely reforms the current situation that the prior art can only pick single color pictures and texts.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, a method for image-text matting in an image according to an embodiment of the present invention includes the following steps:
step S101: and drawing a first picture of the three channels according to a preset first picture drawing strategy.
The first picture is used as a medium for subsequent image-text matting, and is generated through a preset first picture drawing strategy, where the first picture drawing strategy may include limitation on pixels (size) and content of the first picture, the first picture in this embodiment is a three-channel picture, and those skilled in the art can know that three channels are an R (red) channel, a G (green) channel, and a B (blue) channel, respectively, each pixel of the first picture is represented by three values, and the value ranges of the values are different according to the difference of channel depths, for example, when the channel depth is 8 bits, the value range of the value is 0-255. The content contained in the first picture depends on the content to be extracted. Specifically, the first picture drawing strategy in this embodiment is as follows: and generating a first black background according to a preset picture resolution, generating a first picture and text according to a preset first picture and text generation strategy, and combining the first black background and the first picture and text according to a preset combination strategy. The preset picture resolution is set for the size of the first picture, the first image-text generation strategy is used for limiting the first image-text, and the first black background and the first image-text with the preset resolution are used for generating the first picture according to the preset combination strategy. The image resolution is selected by the staff according to the specific requirements, first images and texts with specific colors and specific image and text contents are generated according to a first image and text generation strategy, and the first images and texts are combined according to a combination strategy. Specifically, the combination strategy of the combination of the present application may be: and superposing the first image and the first text on the background according to a preset position relation so as to limit the position relation between the first image and the first black background. And after the first picture is generated according to the process, executing the next step.
Step S102: and drawing a third-channel second picture according to a preset second picture drawing strategy.
The steps S102 and S101 can be performed in a reversed order during the implementation, that is, the second picture is generated first and then the first picture is generated, which does not affect the subsequent steps.
And the second picture is used as a target for subsequent image-text matting and is generated through a preset second picture drawing strategy. The method is used for realizing the scratching of the image-text in the second picture so as to be superposed with other files for application. Referring to the first picture drawing strategy in step S101, in order to achieve the best image-text matting effect, when the second picture drawing strategy and the first picture drawing strategy are preset, the basic characteristic parameters are kept the same, which facilitates correspondence in subsequent steps. Therefore, the second picture drawing policy is set to: and generating a second black background according to a preset picture resolution, generating a second image-text according to a preset second image-text generation strategy, and combining the second black background and the second image-text according to a preset combination strategy. The second picture is also a three-channel picture, wherein the second picture drawing strategy and the first picture drawing strategy adopt the same picture drawing strategy, so that the finally generated first picture and the second picture have the same size, and each pixel point can be in one-to-one correspondence. The background of the second picture is also generated as black, and the first picture differs from the second picture only in the difference between the first and second teletext strategy.
Specifically, the first image-text generation strategy is set as follows: generating white pictures and texts by using preset characters and preset patterns; the second image-text generation strategy is as follows: and generating the colorful pictures and texts by combining the preset characters and the preset patterns with the pre-selected colors. Therefore, the difference between the first picture and the second picture is that the colors of the pictures and texts are white and colored respectively, and the pictures and texts have the same preset pattern and the same preset characters. The present embodiment does not propose setting the sizes of the pattern and the text, that is, the text and the pattern in the first picture and the second picture are the same size by default. As shown in fig. 2 and 3, which are examples of a first picture and a second picture, respectively. The color in the invention can be the filling of single color of any pattern or character, and can also be the filling of multiple colors with gradual change effect, and the design scheme can be suitable for the image and text as long as the image and text are colored. And the finally extracted image-text by the method of the embodiment of the invention is the color image-text in the second picture.
In the process of generating the first picture or the second picture, no matter the color of the image and text is white or colored, when the image and text is combined with a black background, the gradual change from white to black or from colored to black appears at the position of the edge of the image and text due to the anti-aliasing effect, which is a characteristic of all graphic software in the process of generating the picture, so as to say in the background art, the effect of image and text matting is deteriorated due to the anti-aliasing factor, and the invention mainly aims at further improving the problem.
The embodiment of the invention takes the channel depth of 8 bits as an example, and the implementation of the whole scheme is explained. However, the scheme of the present invention is also applicable to 10 bits, 12 bits, 16 bits, and the like, and only "255" needs to be replaced by "1023" when the maximum value of the corresponding channel depth is replaced by "255", for example, in the case of 10 bits.
In the embodiment of the invention, the R channel value, the G channel value and the B channel value of the first picture are respectively RedA, GreenA and BlueA, and the R channel value, the G channel value and the B channel value of the pixel point of the second picture are respectively RedB, GreenB and BlueB. Due to the anti-aliasing effect, the values of RedA, GreenA and BlueA of pixel points at the black background in the first picture are the same and are all 0; the values of RedA, GreenA and BlueA of the pixels in the white image-text are the same and are 255, and the values of RedA, GreenA and BlueA of the pixels in the sawtooth area are the same and are more than 0 and less than 255. For the second picture, values of RedB, GreenB and BlueB of pixel points at the black background are the same and are all 0; RedB, GreenB and BlueB values of pixel points in the color image-text or the sawtooth area are different, and the value range is 0-255. The R channel value, the G channel value, and the B channel value of the pixel points in the sawtooth areas of the first picture and the second picture are automatically generated when the background and the image are combined, and the specific values are not limited in this embodiment. And after the first picture and the second picture are generated according to the steps, the following steps are continuously executed.
Step S103: and drawing a third picture of the four channels according to a preset third picture drawing strategy.
The third picture of this embodiment is a four-channel picture, that is, compared with the RGB three channels of the first picture and the second picture, the third picture of this embodiment also has an Alpha channel, which has a limitation on transparency. Referring to the first picture and the second picture generated in the foregoing steps, the third picture in this embodiment also has the same resolution. Since the subsequent steps involve resetting the pixel points of the third picture, the color and content displayed by the third picture are not limited in this embodiment. Preferably, the third picture drawing policy in the present embodiment is set to: and generating a full transparent picture by using a preset picture resolution, namely the RGB three channels have a value of 0 and the Alpha channel has a value of 0.
In this embodiment, media used for drawing the first picture, the second picture, and the third picture are not limited, and those skilled in the art may implement the media by using existing picture processing software, such as Photoshop, office series, or other common software, or industrial application software. And after the first picture, the second picture and the third picture are generated according to the steps, continuing to execute the issuing step.
Step S104: and correspondingly enabling the pixel points of the first picture, the second picture and the third picture to correspond one to one, and resetting each pixel point of the third picture to generate a target picture.
The first picture, the second picture and the third picture generated according to the steps have the same pixel points and have the same size, so that after the pixel points are in one-to-one correspondence, each pixel point of the third picture is redefined according to the following rule, and the picture generated according to the set Alpha channel value and the set RGB three channel value is the target picture. As shown in fig. 4, resetting each pixel point of the third picture in step S104 specifically includes the following steps:
step S1041: and for any pixel point of the third picture, determining that an Alpha channel value, an R channel value, a G channel value and a B channel value of the pixel point of the third picture are respectively Alpha C, RedC, GreenC and BlueC, determining that the R channel value, the G channel value and the B channel value of the pixel point of the first picture corresponding to the pixel point are respectively RedA, GreenA and BlueA, and determining that the R channel value, the G channel value and the B channel value of the pixel point of the second picture corresponding to the pixel point are respectively RedB, GreenB and BlueB.
As shown in tables 1 to 3, taking a fully transparent third picture as an example, a pixel 1, a pixel 2, and a pixel 3 are selected from the third picture, and a pixel 1A, a pixel 2A, and a pixel 3A, a pixel 1B, a pixel 2B, and a pixel 3B corresponding to the first picture and the second picture are correspondingly found and their values are listed.
TABLE 1
TABLE 2
TABLE 3
According to the channel values of the pixel points in tables 1 to 3, it can be known that the pixel point 1A is at the black background of the first picture, the pixel point 2A is at the sawtooth area where the black background and the white picture and text of the first picture are intersected, the pixel point 3A is in the white picture and text of the first picture, the pixel point 1B is at the black background of the second picture, the pixel point 2B is at the sawtooth area where the black background and the color picture and text of the second picture are intersected, and the pixel point 3B is in the color picture and text of the second picture.
After the pixel points of the first picture, the second picture and the third picture are in one-to-one correspondence, the following steps are continuously executed:
step S1042: normalizing the channel values of all pixel points of the first picture, the second picture and the third picture; for any pixel point of the normalized third picture, the Alpha channel value is expressed as Alpha C ', the R channel value, the G channel value and the B channel value are respectively RedC', GreenC 'and BlueC', the R channel value, the G channel value and the B channel value of the pixel point of the first picture corresponding to the Alpha channel value, the G channel value and the B channel value are respectively RedA ', GreenA' and BlueA ', and the R channel value, the G channel value and the B channel value of the pixel point of the second picture corresponding to the G channel value and the B channel value are respectively RedB', GreenB 'and BlueB'.
Taking a picture with a channel depth of 8 bits as an example, the normalization process is a process of dividing a channel value by 255. Normalization processing is performed on the three pixel points according to the pixel point 1, the pixel point 2 and the pixel point 3 listed in tables 1 to 3, and specific values (three bits are taken after the decimal point) are shown in tables 4 to 6 below.
TABLE 4
TABLE 5
TABLE 6
After the normalization step is finished, the following steps are continuously executed:
step S1043: and updating the AlphaC ' values of all pixel points of the third picture, wherein the AlphaC ' = RedA '.
That is, the updated AlphaC' values of pixel 1, pixel 2, and pixel 3 are 0, 0.137, and 1, respectively.
Step S1044: and updating the RedC ', GreenC ' and BlueC ' values of all pixel points of the third picture, including: for a pixel point with alpha 'being =0, let red c' =0, GreenC '= 0, and BlueC' = 0; for alpha C'
(0, 1) for the pixel point, the value of RedC ' is the quotient of RedB ' and RedA ', the value of GreenC ' is the quotient of GreenB ' and GreenA ', and the value of BlueC ' is the quotient of BlueB ' and BlueA '; for a pixel point with AlphaC ' =1, let red c ' = RedB ', GreenC ' = GreenB ', and BlueC ' = BlueB '.
For a pixel with AlphaC '= 0, let red c' =0, GreenC '= 0, and BlueC' =0. That is, for pixel 1 of AlphaC ' =0, Red ' C ' =0, GreenC ' =0, and BlueC ' =0.
For alpha C'
For the pixel (0, 1), the value of RedC ' is the quotient of RedB ' and RedA ', the value of GreenC ' is the quotient of GreenB ' and GreenA ', and the value of BlueC ' is the quotient of BlueB ' and BlueA '. That is, for the pixel 2 with alpha ' =0.137, the division of RedB ' and RedA ' is 0.059/0.137
0.431; GreenB 'divided by GreenA' by 0.078/0.137
0.569; the division of BlueB 'by BlueA' was 0.098/0.137
0.718。
For a pixel point with AlphaC ' =1, let red c ' = RedB ', GreenC ' = GreenB ', and BlueC ' = BlueB '. That is, for pixel 3 of AlphaC '= 1, red c' =0.667, GreenC '= 0.451, and BlueC' = 0.800.
Step S1045: and performing inverse normalization on the channel values of all the pixel points of the third picture and taking an integer.
The inverse normalization process is opposite to the normalization process, and takes a picture with a channel depth of 8 bits as an example, the inverse normalization process is a process of multiplying a channel value by 255. After taking an integer from the obtained result, the Alpha channel value and the RGB channel value of the pixel point 1, the pixel point 2, and the pixel point 3 are as shown in table 7 below:
TABLE 7
In table 7, the recc value of pixel 2 is 255 × (15/255)/(35/255), the GreenC value of pixel 2 is 255 × (20/255)/(35/255), and the BlueC value is 255 × (25/255)/(35/255), and this embodiment does not limit the rule of taking integers for the channel values in this step, and the rounding may be performed by a truncation method, or a carry rounding method, or preferably, a rounding method is performed. Therefore, the RedC value of pixel point 2 is 109, the GreenC value is 146; the BlueC value was 182.
As can be seen from table 7, the target picture obtained by the method of the present invention has the effects of completely transparent background, partially transparent sawtooth region, and completely opaque color image-text, so as to achieve the purpose of extracting the color image-text in the second picture, as shown in fig. 2, 3, and 5, which are the display effects of the first picture, the second picture, and the target picture, respectively.
The image-text matting method in the image realizes matting of color images and texts, and finally generates a target image with translucency by setting an Alpha channel, so that the anti-aliasing effect of the target image is improved, and the target image can have a very good display effect when being overlapped in the image or video; on the other hand, the invention is not limited to the picking of patterns or characters and the color effect of the pictures and the texts, and completely reforms the current situation that the prior art can only pick single color pictures and texts.
The present invention further provides an image-text matting device in an image, as shown in fig. 6, the image-text matting device 100 includes a first picture drawing module 101, a second picture drawing module 102, a third picture drawing module 103, and a third picture setting module 104, wherein: the first picture drawing module 101 is connected 104 with the third picture setting module; the first picture drawing module 101 is used for drawing a three-channel first picture according to a preset first picture drawing strategy; the second picture drawing module 102 is connected with the third picture setting module 104; the second picture drawing module 102 is configured to draw a third picture of the three channels according to a preset second picture drawing policy; the third picture drawing module 103 is connected with the third picture setting module 104; the third picture drawing module 103 is configured to draw a third picture of the four channels according to a preset third picture drawing policy; the third picture setting module 104 is connected with the first picture drawing module 101, the second picture drawing module 102 and the third picture drawing module 103; the third picture setting module 104 is configured to correspond the pixel points of the first picture, the second picture, and the third picture one to one, and reset each pixel point of the third picture to generate a target picture; the third picture setting module 104 resets each pixel point of the third picture, including:
for any pixel point of the third picture, determining that an Alpha channel value, an R channel value, a G channel value and a B channel value of the pixel point of the third picture are respectively Alpha C, RedC, GreenC and BlueC, determining that the R channel value, the G channel value and the B channel value of the pixel point of the first picture corresponding to the pixel point are respectively RedA, GreenA and BlueA, and determining that the R channel value, the G channel value and the B channel value of the pixel point of the second picture corresponding to the pixel point are respectively RedB, GreenB and BlueB;
normalizing the channel values of all pixel points of the first picture, the second picture and the third picture; for any pixel point of the normalized third picture, the Alpha channel value is expressed as Alpha C ', the R channel value, the G channel value and the B channel value are respectively RedC', GreenC 'and BlueC', the R channel value, the G channel value and the B channel value of the pixel point of the first picture corresponding to the Alpha channel value, the G channel value and the B channel value are respectively RedA ', GreenA' and BlueA ', and the R channel value, the G channel value and the B channel value of the pixel point of the second picture corresponding to the G channel value and the B channel value are respectively RedB', GreenB 'and BlueB';
updating the alphaC ' values of all pixel points of the third picture, wherein the alphaC ' = RedA ';
and updating the RedC ', GreenC ' and BlueC ' values of all pixel points of the third picture, including: for a pixel point with alpha 'being =0, let red c' =0, GreenC '= 0, and BlueC' = 0; for alpha C'
(0, 1) for the pixel point, the value of RedC ' is the quotient of RedB ' and RedA ', the value of GreenC ' is the quotient of GreenB ' and GreenA ', and the value of BlueC ' is the quotient of BlueB ' and BlueA '; for a pixel point with alpha ' 1, let red c ' = RedB ', GreenC ' = GreenB ', and BlueC ' = BlueB ';
and performing inverse normalization on the channel values of all the pixel points of the third picture and taking an integer.
Preferably, the denormalizing the channel values of all the pixel points of the third picture and taking an integer includes: and (4) rounding the denormalized channel value.
Wherein the first picture drawing strategy is: and generating a first black background according to a preset picture resolution, generating a first picture and text according to a preset first picture and text generation strategy, and combining the first black background and the first picture and text according to a preset combination strategy. The second picture drawing strategy is: and generating a second black background according to a preset picture resolution, generating a second image-text according to a preset second image-text generation strategy, and combining the second black background and the second image-text according to a preset combination strategy. The third picture drawing strategy is as follows: and generating a full transparent picture at a preset picture resolution. The first image-text generation strategy is as follows: generating white pictures and texts by using preset characters and preset patterns; the second image-text generation strategy is as follows: and generating the colorful pictures and texts by combining the preset characters and the preset patterns with the pre-selected colors. The combination strategy is: and superposing the image on the background according to a preset position relation.
For the generation process of the target picture in this embodiment, the method for image-text matting in the image in the above embodiment can be directly referred to for implementation, and details will not be described here.
As shown in fig. 7, the present invention further includes an embodiment, which is a method for displaying a picture in an overlapping manner, and specifically includes the following steps:
step S201: and generating a target picture by the image-text matting method in the image.
The generation process of the target picture is not repeated here, and those skilled in the art can implement the method by directly referring to the foregoing embodiment.
Step S202: and superposing the target picture in the selected picture according to a preset superposition strategy to obtain a superposed picture.
In the method of this embodiment, the target picture may be superimposed in the picture or the video, which is substantially the superposition of the picture and the picture, and for the superposition method of the picture and the picture, a person skilled in the art can use the existing superposition technology to implement, and details are not described here either.
Step S203: and displaying the superposed pictures.
The present invention also includes an embodiment of a picture overlaying display device, as shown in fig. 8, including the image-text matting device 100, the picture overlaying device 200 and the display device 300 of the above embodiment, wherein: the image-text matting device 100 is connected with the image superposition device 200; the image-text matting device 100 is used for generating a target image; the picture stacking device 200 is connected with the image-text matting device 100 and the display device 300; the picture superimposing device 200 is configured to superimpose the target picture in the selected picture according to a preset superimposing strategy to obtain a superimposed picture; a display device 300 connected with the picture superimposing apparatus 200; the display device 300 is used for displaying the overlay picture. The device of this embodiment implements the image superimposition by the above image superimposition display method, and the specific process is not described in detail, and the image-text matting device 100 in this embodiment can be implemented by referring to the foregoing embodiment, which is not described in detail herein.
As shown in fig. 9, for the effect displayed by the target picture superimposed in the selected picture, window 1 is the image size of the selected picture, and window 2 is the size of the target picture. The target picture generated by the method has transparency, so that the anti-aliasing capability is improved, the attractiveness of the content displayed by the picture is not affected when the target picture is superposed on the picture, and the display effect is very good.
The present invention has been further described with reference to specific embodiments, but it should be understood that the detailed description should not be construed as limiting the spirit and scope of the present invention, and various modifications made to the above-described embodiments by those of ordinary skill in the art after reading this specification are within the scope of the present invention.