Image generation method, device, equipment, storage medium and program product

Through face detection and cropping technology, the method of generating multimedia program posters solves the problem of low poster production efficiency in the existing technology, and achieves the effect of quickly generating multiple character matching posters.

CN116127102BActive Publication Date: 2025-02-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111340267.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-12
Publication Date
2025-02-28
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

The prior art requires a lot of manpower in the production of multimedia program posters, resulting in low production efficiency and inability to meet the poster needs.

Method used

By obtaining the first image corresponding to the target multimedia program, face detection and cropping to obtain the character image, and then superimposing the character image on the specified background image to generate multiple poster images.

Benefits of technology

It improves the production efficiency of multimedia program posters, saves manpower and material resources, and can quickly generate posters with different roles based on video characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present application discloses an image generation method, device, equipment, storage medium and program product, which relate to the field of multimedia technology. The method comprises: obtaining a first image corresponding to a target multimedia program; performing face detection on the first image to obtain face areas corresponding to at least two face images; obtaining a character image based on the face area cropping; and superimposing a spliced ​​image after the character image is reorganized on a designated background image to obtain a second image. After obtaining the first image corresponding to the target multimedia program, face detection is performed on the first image, and the character image in the first image is obtained by cropping according to the detected face area, thereby generating multiple images corresponding to the target multimedia program based on the matching of different character images, and matching different characters with different dimensions to fit the interests of different users, thereby improving the production efficiency of multimedia program posters and saving manpower and material resources in the poster production process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of multimedia technology, and in particular to an image generation method, device, equipment, storage medium and program product. Background Art

[0002] In multimedia applications, multimedia programs are usually initially displayed in the form of posters, so that users can learn about the actor information, background information, role information, etc. of the multimedia programs through the posters. When the user is interested in the content of the poster, he will click to enter the multimedia program to watch the multimedia content. For example, on the homepage of a video application, posters of TV series and movies are displayed. After the user clicks on the poster of interest, he can watch the corresponding TV series or movie.

[0003] Since a multimedia program usually includes multiple characters, artists usually need to draw different posters for different combinations of characters in the multimedia program when drawing posters, so that the same multimedia program can be displayed from multiple angles when displaying the posters.

[0004] However, the above-mentioned multi-faceted poster production method requires a lot of manpower and has a low efficiency in poster production, which cannot meet the poster production needs of the current large number of multimedia programs. The poster production efficiency is low. Summary of the invention

[0005] The embodiments of the present application provide an image generation method, device, equipment, storage medium and program product, which can improve the efficiency of poster production. The technical solution is as follows.

[0006] In one aspect, a method for generating an image is provided, the method comprising:

[0007] Acquire a first image corresponding to a target multimedia program, wherein the first image includes at least two facial images associated with the target multimedia program;

[0008] Performing face detection on the first image to obtain facial regions corresponding to at least two facial images in the first image;

[0009] Based on the facial region, at least two character image images corresponding to the facial region are obtained by cropping, wherein the i-th facial region corresponds to the i-th character image image, and i is a positive integer;

[0010] The spliced ​​image after the character image is reorganized is superimposed and displayed on the designated background image to obtain a second image corresponding to the target multimedia program.

[0011] In another aspect, an image generating device is provided, the device comprising:

[0012] An acquisition module, configured to acquire a first image corresponding to a target multimedia program, wherein the first image includes at least two facial images associated with the target multimedia program;

[0013] A detection module, configured to perform face detection on the first image to obtain face regions corresponding to at least two face images in the first image;

[0014] A cropping module, configured to crop the facial region to obtain at least two character image images corresponding to the facial region, wherein the i-th facial region corresponds to the i-th character image, and i is a positive integer;

[0015] The reorganization module is used to overlay and display the spliced ​​image after the reorganization of the character image on the designated background image to obtain a second image corresponding to the target multimedia program.

[0016] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement an image generation method as described in any of the above-mentioned embodiments of the present application.

[0017] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement an image generation method as described in any of the above-mentioned embodiments of the present application.

[0018] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the image generation method described in any of the above embodiments.

[0019] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:

[0020] After obtaining the first image corresponding to the target multimedia program (such as: the poster of the target multimedia program), face detection is performed on the first image, and the character image in the first image is obtained by cropping according to the detected face area, so as to generate multiple images corresponding to the target multimedia program based on the combination of different character images, and the different character combination dimensions are used to fit the interests of different users, thereby improving the production efficiency of multimedia program posters and saving manpower and material resources in the poster production process. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 It is a schematic diagram of poster generation in the related art provided by an exemplary embodiment of the present application;

[0023] Figure 2 is a schematic diagram of the overall process of an image generation method provided by an exemplary embodiment of the present application;

[0024] Figure 3 It is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;

[0025] Figure 4 is a flow chart of an image generating method provided by an exemplary embodiment of the present application;

[0026] Figure 5 is based on Figure 4 A schematic diagram of a method for cutting a character image provided by the illustrated embodiment;

[0027] Figure 6 is a flow chart of an image generating method provided by another exemplary embodiment of the present application;

[0028] Figure 7 is based on Figure 6 The illustrated embodiment provides a schematic diagram of the splicing requirements of the character image diagram;

[0029] Figure 8 is based on Figure 6 The illustrated embodiment provides a reference line division schematic diagram;

[0030] Fig. 9 is an image generating method provided by another exemplary embodiment of the present application;

[0031] Fig.10 is based on Fig. 9 The schematic diagram of obtaining a candidate stitched image by stitching the image images provided in the illustrated embodiment;

[0032] Fig.11 is based on Fig. 9 The illustrated embodiment provides a schematic diagram of stretching a candidate stitched image;

[0033] Fig.12 is based on Fig. 9The illustrated embodiment provides a schematic diagram of stretching a candidate stitched image;

[0034] Fig.13 is based on Fig. 9 The illustrated embodiment provides a schematic diagram of the result of the second image;

[0035] Fig.14 is a structural block diagram of an image generating device provided by an exemplary embodiment of the present application;

[0036] Fig.15 is a structural block diagram of an image generating device provided by another exemplary embodiment of the present application;

[0037] Fig.16 It is a structural block diagram of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0039] Posters are widely used in the promotion of various forms of multimedia programs such as film and television works, music works, live performances, etc. For example, displaying promotional posters of TV series and movies on the homepage or promotional page of a film and television application; displaying promotional posters of music works on the homepage or promotional page of a music application; and displaying promotional posters of live performances on the homepage or promotional page of a ticketing application.

[0040] In the embodiment of the present application, the poster display in the film and television application is taken as an example for explanation.

[0041] In the related art, posters are obtained mainly through the following methods:

[0042] 1. The posters are manually designed and produced by designers based on the plots of stills or videos. This process is time-consuming and labor-intensive, and the efficiency of poster generation is low. It is impossible to quickly generate posters with different roles based on the roles in the video;

[0043] 2. Artificial Intelligence (AI) generation, schematically, such as Figure 1 As shown, a suitable video frame 100 is selected from the video, the video frame 100 is cropped into the size required for delivery, and a logo 110, a search box 120, a text 130 and other contents are added to generate a poster 140; however, the AI ​​image selection logic is relatively complex, the image selection effect cannot be controlled, and the accuracy of poster generation is low.

[0044] Figure 2 FIG. 1 is a schematic diagram of the overall process of an image generation method provided by an exemplary embodiment of the present application. Figure 2As shown, first obtain a first image 210 corresponding to a multimedia program, such as an edited poster image, the first image 210 is an image in the format of a Photoshop file (Photoshop Document, PSD), or the first image 210 is an image in the format of a large Photoshop file (Photoshop Big, PSB), or the first image 210 is a file in a common format, such as JPEG (Joint Photographic Experts Group) format, Portable Network Graphics (Portable Network Graphics, PNG) format, etc.

[0045] In this embodiment, the first image 210 in PSD format is taken as an example for explanation, and the first image 210 includes multiple layers, each layer is used to edit and display different image content, and after all layers are superimposed, the complete display content of the first image 210 is obtained.

[0046] In some embodiments, the layers of the first image 210 include a first type of layer for editing the overall image and a second type of layer for editing a single character image. After face detection is performed on each layer of the first image 210, the second type of layer for editing a single character image is obtained from each layer, and the face area corresponding to each layer in the second type of layer is obtained.

[0047] The second type of layers including the face area are spliced ​​and superimposed on the background layer 200 to obtain a second image 220 as a newly generated poster for promoting the multimedia program. Schematically, the second type of layers include layer A (corresponding to character a), layer B (corresponding to character b), and layer C (corresponding to character c). Then, layer A and layer B are spliced ​​to form a poster that matches character a and character b, layer B and layer C are spliced ​​to form a poster that matches character b and character c, layer A and layer C are spliced ​​to form a poster that matches character a and character c, and layer A or layer B or layer C can also be used alone as a recombined spliced ​​image.

[0048] The background layer 200 may be the background layer of the first image 210 , or may be an image uploaded by a user, or may be a randomly selected image, which is not limited in this embodiment.

[0049] It is worth noting that in the above embodiment, the first image 210 is in PSD format as an example for explanation. In some embodiments, the first image 210 can also be implemented as a common format image including only one image layer. The character images corresponding to each character are cropped from the first image 210 by cutout technology and spliced.

[0050] In addition, in the above embodiment, the first image 210 includes multiple character images as an example for explanation. In some embodiments, when the first image 210 includes a character image, the character image is obtained (e.g., the image layer corresponding to the character image is obtained; or, the character image is cut out), and the character image is adjusted and superimposed on the specified background image to obtain an updated poster, such as: the character image is cropped and superimposed on the specified background image; or, the character image is color-adjusted and superimposed on the specified background image; or, the character image is sharpened and superimposed on the specified background image. In this embodiment, the first image 210 includes multiple character images as an example for explanation.

[0051] Next, the implementation environment involved in the embodiments of the present application is described. For illustration, please refer to Figure 3 The implementation environment involves a terminal 310 and a server 320 , and the terminal 310 and the server 320 are connected via a communication network 330 .

[0052] In some embodiments, the terminal 310 is used to send a poster of a target multimedia program to the server 320. In some embodiments, the terminal 310 uploads the poster of the target multimedia program to the server 320 through a poster generation platform; or, the terminal 310 uploads the poster of the target multimedia program to the server 320 through an installed target application, wherein the target application includes a video player application, a music player application, a ticketing application, an instant messaging application, and other types of programs.

[0053] The server 320 is used to receive the poster uploaded by the terminal 310 and reorganize the characters in the poster, wherein the reorganization method of the server 320 includes: 1. When the poster is in PSD format, the layers corresponding to each character are obtained from the poster, and the layers are reorganized and spliced; 2. When the poster is in any format, the image corresponding to each character is cropped from the poster, and the cropped character image images are reorganized and spliced.

[0054] The server 320 superimposes the reorganized spliced ​​image on the designated background image to obtain a newly generated poster image, and feeds the newly generated poster image back to the terminal 310 for display.

[0055] The above-mentioned terminal can be a terminal device in various forms such as a mobile phone, a tablet computer, a desktop computer, a portable laptop computer, a smart TV, a smart car terminal, etc., and the embodiments of the present application are not limited to this.

[0056] It is worth noting that the above-mentioned servers can be independent physical servers, or they can be server clusters or distributed systems composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0057] Among them, cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to realize data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.

[0058] In some embodiments, the above-mentioned server can also be implemented as a node in a blockchain system. Blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0059] In combination with the above introduction and application scenarios, the image generation method provided by the present application is described. The method can be executed by a server or a terminal, or can be executed by a server and a terminal together. In the embodiment of the present application, the method is described by taking the execution of the server as an example. Figure 4 As shown, the method includes the following steps.

[0060] Step 401: Acquire a first image corresponding to a target multimedia program, wherein the first image includes at least two facial images associated with the target multimedia program.

[0061] In some embodiments, the method of acquiring the first image includes at least one of the following methods:

[0062] First, receiving a first image uploaded by a terminal, that is, the terminal uploads the first image to a server through a platform providing a poster generation function for poster generation;

[0063] second, downloading a published poster corresponding to the target multimedia program from the application as the first image;

[0064] Third, a poster of the target multimedia program is obtained from a stored database as the first image.

[0065] It is worth noting that the above-mentioned method of acquiring the first image is only an illustrative example and is not limited to this in the embodiments of the present application.

[0066] The first image is an image in PSD format, or an image in PSB format, or a file in a common format, such as JPEG format, PNG format, etc.

[0067] When the first image is an image in a PSD format or a PSB format, at least two facial images included in the first image are distributed in the same or different layers.

[0068] Illustratively, the first image includes layer A, layer B, and layer C, wherein character a is displayed on layer A, character b is displayed on layer B, and character c is displayed on layer C. Alternatively, the first image includes layer A, layer B, and layer C, wherein layer A is used to edit the overall tone of the first image, layer B includes characters a, b, and c, and layer C is used to edit the background portion of the first image.

[0069] The association relationship between the at least two facial images included in the first image and the multimedia program includes at least one of the following situations:

[0070] First, at least two facial images are facial images corresponding to the participants of the multimedia program;

[0071] Second, at least two facial images are facial images corresponding to the planners of the multimedia program;

[0072] Third, at least two facial images are facial images corresponding to the hosts of the multimedia program;

[0073] Fourth, at least two facial images are cartoon images in the multimedia program.

[0074] It is worth noting that the above situation is only an illustrative example and the embodiments of the present application are not limited to this.

[0075] Step 402: Perform face detection on the first image to obtain facial regions corresponding to at least two facial images in the first image.

[0076] In some embodiments, the first image includes at least two image layers. When performing face detection on the first image, face detection may be performed on each image layer in the first image respectively, or face detection may be performed on the first image as a whole.

[0077] Taking face detection on each image layer of the first image as an example for explanation, that is, face detection is performed on at least two image layers of the first image to obtain face detection results corresponding to the at least two image layers respectively, and the face detection results are used to indicate the face inclusion status of the image layer; in response to the image layer containing a face, at least two face areas in the image layer are obtained.

[0078] If the first image does not include at least two image layers, face detection is directly performed on the entire first image.

[0079] In some embodiments, face detection is performed on the first image using a face detector. Schematically, face detection is performed on the first image using a Dilb face detector.

[0080] Optionally, after performing face detection on the first image, a face region whose face detection result meets the detection requirements is obtained. Illustratively, a face region whose face probability is greater than a probability threshold is obtained in the face detection result; or a face region whose face area is greater than an area threshold is obtained in the face detection result; or a face region whose identity corresponding to the face in the face detection result is in a preset identity library is obtained, and this embodiment does not limit this.

[0081] In some embodiments, at least two image layers including a facial region are obtained, and the facial region in the at least two image layers is obtained. Alternatively, at least two image layers including a facial region are obtained, and the facial region in each image layer is obtained, wherein each image layer includes a facial region. From the image layer where the i-th facial region is located, the i-th character image corresponding to the i-th facial region is cropped.

[0082] Step 403: obtain at least two character image images corresponding to the face area by cropping based on the face area.

[0083] Among them, the i-th facial area corresponds to the i-th character image, and i is a positive integer.

[0084] In some embodiments, the clipping of the character image includes at least one of the following methods:

[0085] 1. Crop along the smallest enclosing rectangle around the character corresponding to the face area to obtain the character image;

[0086] 2. Cut out and crop along the edge of the character corresponding to the facial area to obtain the character image;

[0087] 3. With the character corresponding to the face area as the center, cut out a rectangle of a preset size to obtain the character image;

[0088] 4. Based on the designated position of the character image corresponding to the face area, the character image is cut out to obtain the character image;

[0089] 5. Determine the image layer where the facial area is located as a character image.

[0090] It is worth noting that the above method is only an illustrative example and is not limited to this embodiment of the present application.

[0091] In some embodiments, when cropping the character image, it is also necessary to crop the full body image corresponding to the face area into a half-body image to obtain the character image. That is, the operation of cropping the upper body is performed after obtaining the position of the face area. Assume that the upper edge of the face area is face_up, and the lower edge of the face area is face_down, that is, the size of the face frame is face_down-face_up. Generally, the length of the upper body of the human body is 3 times the length of the head, so the size of the upper body is 3×(face_down-face_up), that is, the top of the image can be cropped to face_up+3×(face_down-face_up). Usually, if you want to capture the waist area, you can choose α times the head length, that is, crop the top of the image to face_up+α×(face_down-face_up).

[0092] In some embodiments, after the half-body image is cropped, the blank area of ​​the half-body image needs to be cropped.

[0093] Indicative, such as Figure 5 As shown, the full-body photo 500 can be cropped into the portion from the top to the solid line 510. Since the area of ​​the right area 520 is too large, if it is combined with other image images, it will show that the remaining area is too large, so the excessive remaining area of ​​the half-body photo should be cropped, that is, the area 520 in the upper right corner should be cropped, and finally the image image 530 is obtained.

[0094] The cropping method traverses the image area from left to right and crops the areas that are all white. Indicatively, if the image size is 1000×600, traverse by column and calculate whether each column is all white. If 0 to 200, 300 to 400, and 700 to 1000 are all white areas, the 200 to 700 part is obtained after cropping. This is because 0 to 200 is the leftmost area, indicating that there is no specific image on the left, and 700 to 1000 is the rightmost area, indicating that the right is blank, and 300 to 400 is empty, which may be caused by some special effects of the human body image.

[0095] Step 404 , overlaying and displaying the spliced ​​image after the character image is reorganized on the designated background image to obtain a second image corresponding to the target multimedia program.

[0096] In some embodiments, the character image images are spliced ​​together according to a preset splicing rule to obtain a spliced ​​image; or, the character image images are spliced ​​together randomly to obtain a spliced ​​image.

[0097] When the character image images are spliced ​​according to the preset splicing rules, schematically, the character image images are spliced ​​in the visual horizontal direction, that is, the eye heights of the facial regions corresponding to the character image images are kept relatively consistent, and the character image images are spliced ​​horizontally; or, after the character image images are cut to the same height, the character image images are spliced ​​in the preset direction at the preset intervals. This embodiment is not limited to this.

[0098] Optionally, when reassembling and splicing the character image images, the character image images are spliced ​​according to a preset splicing number, such as: if the preset splicing number is 2, then two character image images are spliced ​​each time; or, according to the possible matching situations, each character image image is polled and traversed, and different matching situations are performed respectively. Schematically, the character image is cut out from the first image Figure 1 , Character Image Figure 2 , Character Image Figure 3 And the character image Figure 4 ; When matching and splicing the character image pictures, the following matching situations are included:

[0099] Character Image Figure 1 ; Character image Figure 2 ; Character image Figure 3 ; Character image Figure 4 (single character image);

[0100] Character Image Figure 1 and character image Figure 2 ; Character image Figure 1 and character image Figure 3 ; Character image Figure 1 and character image Figure 4 ; Character image Figure 2 and character image Figure 3 ; Character image Figure 2 and character image Figure 4 ; Character image Figure 3 and character image Figure 4 (Two characters are matched);

[0101] Character Image Figure 1 , Character Image Figure 2 and character image Figure 3 ; Character image Figure 1 , Character Image Figure 2and character image Figure 4 ; Character image Figure 2 , Character Image Figure 3 and character image Figure 4 (Three character images are matched).

[0102] In some embodiments, the second image after all the combinations are stitched together is output; or, combinations that meet the alignment rule are selected from the combinations to be stitched together, thereby obtaining the second image.

[0103] It is worth noting that in the above embodiments, the first image includes at least two facial images for explanation. In other embodiments, the first image may also include only one facial image. Taking the PSD image as an example, after face detection is performed on the image layer in the first image, the image layer where the facial image is located is obtained from the first image, and the character image of the facial image is obtained based on the image layer. The character image is edited, such as: after cropping, color adjustment, sharpening, blurring and other processing, the character image is superimposed on the above-mentioned specified background image to obtain the second image.

[0104] To summarize, the image generation method provided in the embodiment of the present application, after obtaining the first image corresponding to the target multimedia program (such as: the poster of the target multimedia program), performs face detection on the first image, and obtains the character image in the first image based on the detected face area, thereby generating multiple images corresponding to the target multimedia program based on the combination of different character images, and using different character combination dimensions to fit the interests of different users, thereby improving the production efficiency of multimedia program posters and saving manpower and material resources in the poster production process.

[0105] The method provided in this embodiment performs face detection on each image layer of the first image in PSD or PSB format, thereby identifying each image layer with a face area, and obtaining the face areas of these image layers, so as to splice the character image images corresponding to the face areas of each image layer, thereby improving the efficiency of obtaining the character image images.

[0106] In an optional embodiment, the at least two facial images of the first image include a first facial image and a second facial image as an example for description. Figure 6 is a flowchart of an image generation method provided by another exemplary embodiment of the present application. The method can be executed by a server or a terminal, or by both a server and a terminal. In the embodiment of the present application, the method is described by taking the execution of the method by the server as an example. Figure 6 As shown, the method includes the following steps.

[0107] Step 601: Acquire a first image corresponding to a target multimedia program, wherein the first image includes at least two facial images associated with the target multimedia program.

[0108] The at least two facial images include a first facial image and a second facial image.

[0109] Optionally, parse each layer of the PSD poster file, input a PSD or PSB file, remove the hierarchical relationship and parse the file, and save all the images. This step can be implemented using the python psd_tools package, and the output is multiple images with PNG channels. These saved images will be parsed later, so for convenience, these images will be renamed to prevent them from being found or processed under the Linux system. The renaming mainly modifies the Chinese characters or the " / " representing the hierarchy. After the modification, each image can be saved in the same directory.

[0110] Step 602: Perform face detection on the first image to obtain facial regions corresponding to at least two facial images in the first image.

[0111] In some embodiments, face detection is performed on at least two image layers of the first image to obtain face detection results corresponding to the at least two image layers respectively, and the face detection results are used to indicate the face inclusion status of the image layer; in response to the image layer containing a face, at least two facial areas in the image layer are obtained.

[0112] The facial region includes a first facial region corresponding to the first facial image and a second facial region corresponding to the second facial image.

[0113] Optionally, the face area is recorded by recording the position ratio of the upper edge and the lower edge of the face area. For example, if the image is 1280×720, that is, the image width is 1280 and the height is 720, if the upper left corner of the face frame is 120 high and the lower right corner is 144 high, then the upper edge of the face frame is recorded as 0.167 (120 / 720) and the lower edge is 0.2 (144 / 720).

[0114] In some embodiments, face detection is performed directly on the first image; or, the first image is first compressed by a fixed multiple, such as compressing the first image to 1 / 3 of the original image, and then face detection is performed, thereby improving the face detection speed.

[0115] Step 603: cropping the facial region to obtain a first image corresponding to the first facial region and a second image corresponding to the second facial region.

[0116] Optionally, a first image corresponding to the first facial region is obtained by cropping from the image layer where the first facial region is located; similarly, a second image corresponding to the second facial region is obtained by cropping from the image layer where the second facial region is located.

[0117] In some embodiments, the first image image and the second image image are first scaled to be in the same height so as to achieve consistency in relative visual horizontal direction, and the first image image and the second image image are spliced ​​on the basis of the same height.

[0118] In some embodiments, in response to the first facial area and the second facial area meeting a preset alignment rule, the first facial area and the second facial area are formed into an image stitching pair, wherein the image stitching pair is used to indicate a combination that requires image stitching, that is, when the first facial area and the second facial area meet the alignment rule for image stitching, it is determined that the character image corresponding to the first facial area and the second facial area needs to be stitched.

[0119] Optionally, the preset alignment rule includes at least one of the following rules:

[0120] First, The upper edge height information and the lower edge height information of the first image corresponding to the facial area are obtained, where the upper edge height information is used to indicate the ratio of the upper edge of the facial area to the height of the first image, and the lower edge height information is used to indicate the ratio of the lower edge of the facial area to the height of the first image; in response to the first upper edge height information of the first facial area and the second upper edge height information of the second facial area meeting the second height difference requirement, the first facial area and the second facial area are formed into an image splicing pair.

[0121] Schematically, after the heights of the first image and the second image are made consistent, they are spliced ​​in the horizontal direction. When the height difference of the faces in the first image and the second image is large, the first image and the second image are not suitable for splicing. Schematically, Figure 7 As shown, the height difference of the human face between the first image 710 and the second image 720 is relatively large, and is not suitable for splicing. In this embodiment, when the height difference of the upper edges of the two character image images is less than 0.08 and the absolute value of the height difference of the lower edges is less than 0.08, the two character image images can be spliced.

[0122] second, Obtaining sight line data corresponding to the facial region, the sight line data being used to indicate the sight line angle of the eyes in the facial region; in response to first sight line data of the first facial region and second sight line data of the second facial region meeting sight line difference requirements, forming the first facial region and the second facial region into an image splicing pair.

[0123] In some embodiments, two facial regions with the same or similar sight lines are combined into an image stitching pair; or two facial regions with opposite sight lines are combined into an image stitching pair. The sight line data is used to represent the angle between the sight line direction of the eyes in the facial region and the shooting direction, and the sight line direction of each character in the first image is identified by a machine learning model.

[0124] That is, in response to the sight angle difference between the first sight angle data of the first facial area and the second sight angle data of the second facial area being within a preset angle difference threshold, the first facial area and the second two-step area are formed into an image stitching pair; or, in response to the sight angle difference between the first sight angle data of the first facial area and the second sight angle data of the second facial area being greater than the required angle difference, the first facial area and the second two-step area are formed into an image stitching pair.

[0125] third, Based on a preset division rule, a reference line is divided into the first image image and the second image image; a first position relationship between the first facial area and the reference line is determined, and a second position relationship between the second facial area and the reference line is determined. In response to the first position relationship and the second position relationship meeting the position requirement, the first facial area and the second facial area are combined into an image splicing pair.

[0126] Indicatively, after adjusting the first image and the second image to the same height, reference lines are divided in the height direction of the first image and the second image according to preset intervals. For indicative purposes, please refer to Figure 8 After dividing the first image 810 and the second image 820 by reference lines, the positional relationship between the facial features in the first facial area and the reference lines is determined, such as the eyes and the mouth are located on the second reference line and the third reference line. If the first positional relationship between the first facial area and the reference line is consistent with the second positional relationship between the second facial area and the reference line, it is determined that the first facial area and the second facial area form an image splicing pair.

[0127] It is worth noting that the above-mentioned method of determining the image splicing pair is only an illustrative example. The embodiment of the present application can also determine whether to splice the first image and the second image by other methods, which is not limited to this.

[0128] In addition, the above-mentioned image splicing is described by taking the splicing of two character image images, the first image image and the second image image, as an example. In some embodiments, it can also be applied to the splicing of three or more character image images, which is not limited in this embodiment.

[0129] Step 604 , superimposing and displaying the spliced ​​image of the first image and the second image on the designated background image, to obtain a second image corresponding to the target multimedia program.

[0130] In some embodiments, after splicing the first image and the second image, the spliced ​​image is superimposed on the specified background image to obtain the second image. That is, the first image and the second image are spliced ​​to obtain the spliced ​​image, and the spliced ​​image is superimposed and displayed on the specified background image to obtain the second image corresponding to the target multimedia program.

[0131] The designated background image may be a background image uploaded by a user, or may be a background image of the first image, or may be a stored random image, or may be a stored selected image, which is not limited in the embodiment of the present application.

[0132] To summarize, the image generation method provided in the embodiment of the present application, after obtaining the first image corresponding to the target multimedia program (such as: the poster of the target multimedia program), performs face detection on the first image, and obtains the character image in the first image based on the detected face area, thereby generating multiple images corresponding to the target multimedia program based on the combination of different character images, and using different character combination dimensions to fit the interests of different users, thereby improving the production efficiency of multimedia program posters and saving manpower and material resources in the poster production process.

[0133] The method provided in this embodiment filters the splicing between character image images through preset alignment rules, thereby avoiding the situation where the character image images have large differences and cause poor splicing effects, thereby improving the accuracy of splicing character image images and the accuracy of poster generation.

[0134] Among them, the difference in size and position of the facial area between the two character image images is judged by the upper and lower edges of the facial area, so as to avoid large differences in the facial positions of the two spliced ​​character image images and improve the splicing effect of the character image images.

[0135] The difference in gaze direction between two character image images is determined through gaze data, and the character images of enemy characters with different gaze directions are spliced ​​together as required, or the character images of teammate characters with the same gaze direction are spliced ​​together, thereby improving the splicing effect of the character image images.

[0136] By cutting the character's image into a half-body image, the splicing basis of each character image is unified, avoiding the problem of misalignment caused by splicing the full-body image and the half-body image, and improving the splicing accuracy of the character image.

[0137] In some embodiments, the splicing result of the first image image and the second image image needs to be adjusted. Fig. 9 is a flowchart of an image generation method provided by another exemplary embodiment of the present application. The method can be executed by a server or a terminal, or by both a server and a terminal. In the embodiment of the present application, the method is described by taking the execution of the method by the server as an example. Fig. 9 As shown, the method includes the following steps.

[0138] Step 901: Acquire a first image corresponding to a target multimedia program, wherein the first image includes at least two facial images associated with the target multimedia program.

[0139] The at least two facial images include a first facial image and a second facial image.

[0140] Step 902: Perform face detection on the first image to obtain facial regions corresponding to at least two facial images in the first image.

[0141] In some embodiments, face detection is performed on at least two image layers of the first image to obtain face detection results corresponding to the at least two image layers respectively, and the face detection results are used to indicate the face inclusion status of the image layer; in response to the image layer containing a face, at least two facial areas in the image layer are obtained.

[0142] The facial region includes a first facial region corresponding to the first facial image and a second facial region corresponding to the second facial image.

[0143] Step 903: cropping the facial region to obtain a first image corresponding to the first facial region and a second image corresponding to the second facial region.

[0144] Optionally, a first image corresponding to the first facial region is obtained by cropping from the image layer where the first facial region is located; similarly, a second image corresponding to the second facial region is obtained by cropping from the image layer where the second facial region is located.

[0145] Step 904: splice the first image image and the second image image to obtain a candidate spliced ​​image.

[0146] Optionally, the first image image and the second image image after the height adjustment are spliced ​​in a horizontal connection manner to obtain a candidate spliced ​​image.

[0147] In some embodiments, since the final output image is generally used for delivery, the width and height of the image are often selected in common ratios, such as 16:9, 5:3, etc. For ease of operation, the output image is saved as 1280×720px, so the image needs to be stretched and expanded.

[0148] In some embodiments, Fig.10 As shown, after the first image 1010 and the second image 1020 are spliced ​​together, a candidate spliced ​​image is obtained, such as Fig.10As shown, in the candidate stitched image, the tops of the characters' heads in the first image 1010 and the second image 1020 are closely aligned with the upper edges of the candidate stitched image, and the distances between the characters in the first image 1010 and the second image 1020 are relatively close.

[0149] Step 905 , stretching the candidate stitched images according to a preset stretching rule to obtain a stitched image, wherein the preset stretching rule is used to adjust the positional relationship between the first image and the second image.

[0150] In some embodiments, the method of stretching the candidate stitched image includes at least one of the following methods:

[0151] The first method is to expand the candidate stitching image in a specified stretching direction at a first stretching ratio.

[0152] In schematic, considering that the human body position in the candidate stitching image starts at the top of the image, the aesthetics are poor, so a hyperparameter is used to represent the proportion of the upper expansion. Assuming that the width and height of the existing image are w×h, β can be used to represent the upper expansion area, that is, the image becomes w wide and (1+β)×h high. Through experiments, β=0.3 has a better effect. In schematic, such as Fig.11 As shown, after the first image 1110 and the second image 1120 are spliced ​​together, they are stretched in the height direction, that is, stretched upward by a height of 0.3h.

[0153] In some embodiments, in addition to stretching upward, the corresponding proportions may be stretched to the left and right respectively, such as stretching 0.3w to the left and right respectively.

[0154] The second method is to expand the distance between the first image and the second image in the candidate stitched image at a second stretching ratio.

[0155] In schematic, considering that the distance between the human positions in the candidate stitching images is relatively close, the stitching effect is relatively poor. Therefore, a hyperparameter is used to represent the distance between the two characters. Assuming that the width and height of the existing image are w×h, respectively, γ can be used to represent the two middle expanded areas, that is, the image becomes (1+γ)×w in width and h in height. Through experiments, γ=0.1 has a better effect. In schematic, as Fig.12 As shown, after the first image 1210 and the second image 1220 are spliced, stretching is performed between the first image 1210 and the second image 1220, that is, stretching upward by a width of 0.1w.

[0156] It is worth noting that the above-mentioned stretching method is only an illustrative example, and the embodiments of the present application do not limit the stretching adjustment method.

[0157] In some embodiments, after the candidate stitched images are stretched, the aspect ratio of the new image usually does not meet the aspect ratio requirements, so expansion is required. There are two types of expansion here. The first is expansion in the height direction, which is to expand at the top until the aspect ratio of the new image is the required aspect ratio; the second is expansion in the width direction, where the expansion is to expand on both sides until the aspect ratio is the required aspect ratio. Schematically, the required aspect ratio is 16:9. If the current image is 1000:900, the width of 1000 needs to be increased by 600 to 1600, so that the image is 1600:900, that is, 16:9. The expanded 600 here can be expanded by 300 on the left side of the original image and 300 on the right side to ensure that the original image is located in the middle area of ​​the new image.

[0158] Step 906: Overlay and display the spliced ​​image on the designated background image to obtain a second image corresponding to the target multimedia program.

[0159] In some embodiments, a designated background image is received, and a stitched image after the character image is reorganized is superimposed and displayed on the received designated background image; or, in response to the first image including at least two image layers, a background layer in the first image is obtained, and the stitched image after the character image is reorganized is superimposed and displayed on the background layer.

[0160] In other embodiments, the background image may be obtained by cutting out a portion of the background of the original first image and scaling it; or by cutting out a portion of the background of the original first image and repeatedly splicing it.

[0161] Optionally, after obtaining the stitched image and the background image, the stitched image and the background image can be synchronously scaled to the same required ratio, such as: scaling the stitched image with a ratio of 16:9 to 1280:720, and also scaling the background image to 1280:720, so that the stitched image is covered on the background image.

[0162] Schematically, the first image includes five character images as an example for explanation. After matching and screening according to the preset alignment rules, four image matching pairs are obtained from the five character images. Each image matching pair includes two characters. Fig.13 As shown, the first image 1300 includes a first character 1310, a second character 1320, a third character 1330, a fourth character 1340 and a fifth character 1350. After matching and screening according to preset alignment rules, images 1360, 1370, 1380 and 1390 are matched.

[0163] To summarize, the image generation method provided in the embodiment of the present application, after obtaining the first image corresponding to the target multimedia program (such as: the poster of the target multimedia program), performs face detection on the first image, and obtains the character image in the first image based on the detected face area, thereby generating multiple images corresponding to the target multimedia program based on the combination of different character images, and using different character combination dimensions to fit the interests of different users, thereby improving the production efficiency of multimedia program posters and saving manpower and material resources in the poster production process.

[0164] The method provided in this embodiment obtains a candidate stitched image after stitching the first image and the second image, and obtains a stitched image after stretching the candidate stitched image according to a preset stretching rule and stretching ratio, thereby avoiding the problem of poor coordination caused by the image image pressing against the top edge of the second image or the image images being too close, thereby improving the effect of poster generation.

[0165] Fig.14 is a structural block diagram of an image generating device provided by an exemplary embodiment of the present application, such as Fig.14 As shown, the device comprises:

[0166] The acquisition module 1410 is used to acquire a first image corresponding to a target multimedia program, wherein the first image includes at least two facial images associated with the target multimedia program;

[0167] A detection module 1420, configured to perform face detection on the first image to obtain face regions corresponding to at least two face images in the first image;

[0168] A cropping module 1430, configured to crop the facial region to obtain at least two character image images corresponding to the facial region, wherein the i-th facial region corresponds to the i-th character image, and i is a positive integer;

[0169] The reorganization module 1440 is used to overlay and display the spliced ​​image after the reorganization of the character image on the designated background image to obtain a second image corresponding to the target multimedia program.

[0170] In an optional embodiment, the first image includes at least two image layers;

[0171] like Fig.15 As shown, the detection module 1420 includes:

[0172] A detection unit 1421 is used to perform face detection on at least two image layers of the first image to obtain face detection results corresponding to the at least two image layers, wherein the face detection results are used to indicate face inclusion status of the image layers;

[0173] The acquisition unit 1422 is configured to acquire at least two facial regions in the image layer in response to the image layer containing a human face.

[0174] In an optional embodiment, the acquisition unit 1422 is further configured to acquire at least two image layers including a face region, and acquire the face region in the at least two image layers.

[0175] In an optional embodiment, the cropping module 1430 is further used to crop the i-th character image corresponding to the i-th facial region from the image layer where the i-th facial region is located.

[0176] In an optional embodiment, the at least two facial images include a first facial image and a second facial image, and the facial regions include a first facial region of the first facial image and a second facial region of the second facial image;

[0177] The cropping module 1430 is further configured to crop the facial region to obtain a first image corresponding to the first facial region and a second image corresponding to the second facial region;

[0178] The recombining module 1440 is further configured to overlay and display a spliced ​​image of the first image and the second image on a designated background image to obtain the second image corresponding to the target multimedia program.

[0179] In an optional embodiment, the device further includes:

[0180] The determination module 1450 is used to form an image stitching pair with the first facial region and the second facial region in response to the first facial region and the second facial region meeting a preset alignment rule, wherein the image stitching pair is used to indicate a combination that needs to be stitched.

[0181] In an optional embodiment, the determination module 1450 is further used to obtain upper edge height information and lower edge height information of the facial area corresponding to the first image, the upper edge height information is used to indicate the ratio of the upper edge of the facial area to the height of the first image, and the lower edge height information is used to indicate the ratio of the lower edge of the facial area to the height of the first image; in response to the first upper edge height information of the first facial area and the second upper edge height information of the second facial area meeting the first height difference requirement, and the first lower edge height information of the first facial area and the second lower edge height information of the second facial area meeting the second height difference requirement, the first facial area and the second facial area are combined into the image stitching pair.

[0182] In an optional embodiment, the determination module 1450 is further used to obtain line of sight data corresponding to the facial area, the line of sight data being used to indicate the line of sight angle of the eyes in the facial area; in response to the first line of sight data of the first facial area and the second line of sight data of the second facial area meeting the line of sight difference requirement, the first facial area and the second facial area are formed into the image splicing pair.

[0183] In an optional embodiment, the determination module 1450 is further used to divide the reference line into the first image image and the second image image based on a preset division rule; determine a first position relationship between the first facial area and the reference line; determine a second position relationship between the second facial area and the reference line; in response to the first position relationship and the second position relationship meeting the position requirements, form the first facial area and the second facial area into the image splicing pair.

[0184] In an optional embodiment, the reorganization module 1440 is further used to splice the first image and the second image to obtain the spliced ​​image; superimpose the spliced ​​image on the designated background image to obtain the second image corresponding to the target multimedia program.

[0185] In an optional embodiment, the reorganization module 1440 is further used to splice the first image image and the second image image to obtain a candidate spliced ​​image; stretch the candidate spliced ​​image according to a preset stretching rule to obtain the spliced ​​image, and the preset stretching rule is used to adjust the positional relationship between the first image image and the second image image.

[0186] In an optional embodiment, the reorganization module 1440 is further configured to expand the candidate stitched image in a specified stretching direction at a first stretching ratio;

[0187] or,

[0188] The reorganization module 1440 is further configured to expand the distance between the first image and the second image in the candidate spliced ​​image at a second stretching ratio.

[0189] In an optional embodiment, the reorganization module 1440 is further configured to receive the designated background image; and to overlay and display the spliced ​​image after the reorganization of the character image on the designated background image;

[0190] or,

[0191] The recombining module 1440 is further configured to obtain a background layer in the first image in response to the first image including at least two image layers, and to overlay and display a spliced ​​image after the recombined character image on the background layer.

[0192] To summarize, the image generating device provided in the embodiment of the present application, after obtaining the first image corresponding to the target multimedia program (such as: the poster of the target multimedia program), performs face detection on the first image, and obtains the character image in the first image based on the detected face area, thereby generating multiple images corresponding to the target multimedia program based on the combination of different character images, and using different character combination dimensions to fit the interests of different users, thereby improving the production efficiency of multimedia program posters and saving manpower and material resources in the poster production process.

[0193] It should be noted that the image generation device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the image generation device provided in the above embodiment and the image generation method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0194] Fig.16 A schematic diagram of the structure of a server provided by an exemplary embodiment of the present application is shown. The server may be Figure 2 The server shown.

[0195] Specifically, the server 1600 includes a central processing unit (CPU) 1601, a system memory 1604 including a random access memory (RAM) 1602 and a read only memory (ROM) 1603, and a system bus 1605 connecting the system memory 1604 and the central processing unit 1601. The server 1600 also includes a mass storage device 1606 for storing an operating system 1613, application programs 1614, and other program modules 1615.

[0196] The mass storage device 1606 is connected to the central processing unit 1601 through a mass storage controller (not shown) connected to the system bus 1605. The mass storage device 1606 and its associated computer readable media provide non-volatile storage for the server 1600. That is, the mass storage device 1606 may include a computer readable medium (not shown) such as a hard disk or a compact disc read only memory (CD-ROM) drive.

[0197] Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above. The above-mentioned system memory 1604 and mass storage device 1606 can be collectively referred to as memory.

[0198] According to various embodiments of the present application, the server 1600 can also be connected to a remote computer on the network through a network such as the Internet. That is, the server 1600 can be connected to the network 1612 through the network interface unit 1611 connected to the system bus 1605, or the network interface unit 1611 can be used to connect to other types of networks or remote computer systems (not shown).

[0199] The above-mentioned memory also includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.

[0200] The embodiment of the present application also provides a computer device, which can be implemented as follows: Figure 2 The computer device includes a processor and a memory, wherein at least one instruction, at least one program, code set or instruction set is stored in the memory, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the image generation method provided by the above-mentioned method embodiments.

[0201] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the image generation method provided by the above-mentioned method embodiments.

[0202] The embodiments of the present application also provide a computer program product or a computer program, which includes 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 the processor executes the computer instructions, so that the computer device executes the image generation method described in any of the above embodiments.

[0203] Optionally, the computer readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0204] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0205] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. An image generation method, characterized in that: The method comprises: Acquire a first image corresponding to a target multimedia program, wherein the first image includes at least two facial images associated with the target multimedia program, wherein the at least two facial images include a first facial image and a second facial image; Performing face detection on the first image to obtain facial regions corresponding to at least two facial images in the first image, wherein the facial regions include a first facial region of the first facial image and a second facial region of the second facial image; Based on the facial region, at least two character image images corresponding to the facial region are obtained by cropping, wherein the i-th facial region corresponds to the i-th character image image, and i is a positive integer; the at least two character image images include a first image image corresponding to the first facial region, and a second image image corresponding to the second facial region; Acquire upper edge height information and lower edge height information of the facial region corresponding to the first image, wherein the upper edge height information is used to indicate a ratio of an upper edge of the facial region to a height of the first image, and the lower edge height information is used to indicate a ratio of a lower edge of the facial region to a height of the first image; In response to the first upper edge height information of the first facial region and the second upper edge height information of the second facial region meeting a first height difference requirement, and the first lower edge height information of the first facial region and the second lower edge height information of the second facial region meeting a second height difference requirement, the first facial region and the second facial region are combined into an image stitching pair, the image stitching pair being used to indicate a combination that needs to be stitched with an image; The spliced ​​image after the character image is reorganized is superimposed and displayed on a designated background image to obtain a second image corresponding to the target multimedia program, wherein the spliced ​​image after the character image is reorganized includes a spliced ​​image of the first image and the second image.

2. The method according to claim 1, characterized in that The first image includes at least two image layers; The performing face detection on the first image to obtain face regions corresponding to at least two face images in the first image includes: Performing face detection on at least two image layers of the first image to obtain face detection results corresponding to the at least two image layers respectively, wherein the face detection results are used to indicate face inclusion status of the image layers; In response to the image layer containing a human face, at least two face regions in the image layer are acquired.

3. The method according to claim 2, characterized in that In response to the image layer containing a human face, obtaining at least two face regions in the image layer includes: At least two image layers including a face region are acquired, and the face region in the at least two image layers is acquired.

4. The method according to claim 3, characterized in that The step of obtaining at least two character image images corresponding to the facial region by clipping the facial region includes: The i-th character image corresponding to the i-th facial region is obtained by cutting out from the image layer where the i-th facial region is located.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Acquire sight line data corresponding to the facial region, where the sight line data is used to indicate an eye sight line angle in the facial region; In response to the first sight line data of the first facial region and the second sight line data of the second facial region meeting the sight line difference requirement, the first facial region and the second facial region are combined into the image splicing pair.

6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: dividing reference lines into the first image map and the second image map based on a preset division rule; Determining a first positional relationship between the first facial area and the reference line; determining a second positional relationship between the second facial area and the reference line; In response to the first positional relationship and the second positional relationship meeting the positional requirement, the first facial region and the second facial region are combined into the image stitching pair.

7. The method according to any one of claims 1 to 4, characterized in that: The step of superimposing and displaying the spliced ​​image after the character image is reorganized on the designated background image to obtain a second image corresponding to the target multimedia program includes: splicing the first image image and the second image image to obtain the spliced ​​image; The spliced ​​image is superimposed and displayed on the designated background image to obtain the second image corresponding to the target multimedia program.

8. The method according to claim 7, characterized in that The step of splicing the first image image and the second image image to obtain the spliced ​​image includes: splicing the first image image and the second image image to obtain a candidate spliced ​​image; The candidate stitched image is stretched according to a preset stretching rule to obtain the stitched image, and the preset stretching rule is used to adjust the positional relationship between the first image image and the second image image.

9. The method according to claim 8, characterized in that The step of stretching the candidate stitched image according to a preset stretching rule includes: Expanding the candidate stitched image in a specified stretching direction at a first stretching ratio; or, The distance between the first image and the second image in the candidate stitched image is expanded at a second stretching ratio.

10. The method according to any one of claims 1 to 4, characterized in that: The step of superimposing and displaying the spliced ​​image after the character image is reorganized on the designated background image comprises: Receiving the designated background image; and displaying the spliced ​​image after the character image is reorganized on the designated background image; or, In response to the first image including at least two image layers, a background layer in the first image is obtained, and a spliced ​​image after the character image is reorganized is superimposed and displayed on the background layer.

11. An image generating device, characterized in that: The device comprises: An acquisition module, configured to acquire a first image corresponding to a target multimedia program, wherein the first image includes at least two facial images associated with the target multimedia program, wherein the at least two facial images include a first facial image and a second facial image; a detection module, configured to perform face detection on the first image to obtain face regions corresponding to at least two face images in the first image, wherein the face regions include a first face region of the first face image and a second face region of the second face image; A cropping module, configured to crop the facial region to obtain at least two character image images corresponding to the facial region, wherein the i-th facial region corresponds to the i-th character image image, and i is a positive integer; the at least two character image images include a first image image corresponding to the first facial region, and a second image image corresponding to the second facial region; A reorganization module is used to obtain the upper edge height information and the lower edge height information of the facial area corresponding to the first image, the upper edge height information is used to indicate the ratio of the upper edge of the facial area to the height of the first image, and the lower edge height information is used to indicate the ratio of the lower edge of the facial area to the height of the first image; in response to the first upper edge height information of the first facial area and the second upper edge height information of the second facial area meeting the first height difference requirement, and the first lower edge height information of the first facial area and the second lower edge height information of the second facial area meeting the second height difference requirement, the first facial area and the second facial area are combined into an image splicing pair, and the image splicing pair is used to indicate the combination that needs to be spliced; the spliced ​​image after the character image is reorganized is superimposed and displayed on the specified background image to obtain the second image corresponding to the target multimedia program, and the spliced ​​image after the character image is reorganized includes the spliced ​​image of the first image and the second image.

12. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the image generation method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the image generation method according to any one of claims 1 to 10.

14. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the image generation method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image processing method and computer device

    CN110210494A

  • Poster generation method and system

    CN111489419A

  • Image processing method and related equipment

    CN112492197A

  • Smart camera

    CN305281279S