Cover generation method and device, equipment and storage medium

By processing video material pictures, target layout pictures are generated based on the layout and character elements of multiple cover templates, the problem of lack of attractiveness of existing video cover pictures is solved, and a more aesthetic and attractive cover picture generation is achieved.

CN119520939APending Publication Date: 2025-02-25BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411665303.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-02-25

Smart Images

  • Figure CN119520939A_ABST
    Figure CN119520939A_ABST
Patent Text Reader

Abstract

The invention relates to a cover generation method and device, equipment and a storage medium, and the method comprises the steps: obtaining a video material graph comprising at least one character and a plurality of different cover templates, and enabling the cover templates to comprise layout elements and character elements; for each cover template, processing the video material graph according to layout elements in the cover template to obtain a layout graph conforming to the layout elements; in the plurality of layout diagrams, determining a target layout diagram conforming to the character elements in the corresponding cover template; and based on the target layout diagram, generating a cover diagram corresponding to the video material diagram. The cover image determined by the method conforms to a certain composition rule, and the composition rule enables the cover image to have a certain aesthetic feeling and have greater attraction to users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a cover generation method, device, equipment and storage medium. Background Art

[0002] With the booming development of short video and long video platforms, the amount of video content has increased dramatically, and the demand for video cover images has also increased. High-quality cover images can attract users to click and increase the exposure and playback volume of the video.

[0003] However, the current video cover Figure 1 Generally, a video frame is selected from the first few frames in the video and determined as the cover image.

[0004] The above cover image is just a video frame in the video, and the cover image obtained based on this is unlikely to be attractive to users. Summary of the invention

[0005] The present application provides a cover generation method, device, equipment and storage medium. The cover image determined by the method conforms to a certain composition rule, which will make the cover image have a certain aesthetic appeal and be more attractive to users.

[0006] In a first aspect, the present application provides a cover generation method, the method comprising:

[0007] Acquire a video material image including at least one character and a plurality of different cover templates, wherein the cover templates include layout elements and character elements;

[0008] For each cover template, the video material image is processed according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements;

[0009] Determine a target layout diagram that matches the character elements in the corresponding cover template among the multiple layout diagrams;

[0010] Based on the target layout image, a cover image corresponding to the video material image is generated.

[0011] Optionally, the processing of the material image according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements includes:

[0012] Acquire a face detection frame in the layout element, position information of the face detection frame in the layout diagram, and a size of the layout diagram;

[0013] Detecting whether the face detection frame can match the face in the video material image;

[0014] When the face detection frame can match the face in the video material image, the layout area to be cropped is obtained according to the position information of the face detection frame in the layout image and the size of the layout image;

[0015] The video material image is cropped according to the layout area to obtain a layout image that conforms to the layout elements.

[0016] Optionally, determining a target layout diagram that matches the character elements in the corresponding cover template from among the multiple layout diagrams includes:

[0017] Obtain the standard sight direction and standard body direction of the character elements in each cover template;

[0018] For each cover template, determining whether the cover template matches the layout diagram according to the standard sight line orientation, the standard body orientation, and the layout diagram corresponding to the cover template;

[0019] When the cover template matches the layout diagram, the layout diagram is determined as a target layout diagram.

[0020] Optionally, determining whether the cover template matches the layout diagram according to the standard sight line orientation, the standard body orientation, and the layout diagram corresponding to the cover template includes:

[0021] Obtaining the sight direction of the person in the layout diagram;

[0022] Detecting whether an angle between the sight line direction and the standard sight line direction is greater than a first preset value;

[0023] When the included angle is greater than the first preset value, it is determined that the cover template does not match the layout diagram;

[0024] When the angle is less than or equal to the first preset value, it is determined whether the cover template matches the layout diagram according to the body orientation of the character in the layout diagram and the standard body orientation.

[0025] Optionally, determining whether the cover template matches the layout diagram according to the body orientation of the character in the layout diagram and the standard body orientation includes:

[0026] Detecting whether an angle between the body orientation and the standard body orientation is greater than a second preset value;

[0027] When the included angle is greater than the second preset value, it is determined that the cover template does not match the layout diagram;

[0028] When the included angle is less than or equal to the second preset value, it is determined that the cover template matches the layout diagram.

[0029] Optionally, the cover template includes a standard aspect ratio of a logo and position information of the logo in the layout diagram, and generating a cover diagram corresponding to the video material diagram based on the target layout diagram includes:

[0030] In the video to which the video material image belongs, obtain the target logo whose aspect ratio is closest to the standard aspect ratio;

[0031] According to the position information of the logo in the layout diagram, the target logo is set in the target layout diagram to obtain the target layout diagram with the target logo added;

[0032] According to the target layout diagram with the target logo added, a cover image corresponding to the video material image is generated.

[0033] Optionally, generating a cover image corresponding to the video material image according to the target layout image to which the target logo is added includes:

[0034] Detecting whether the color of the target logo is close to the color of its adjacent area;

[0035] When the color of the target logo is close to the color of its adjacent area, the color of the target logo is adjusted so that the color of the target logo is obviously different from the color of its adjacent area.

[0036] In a second aspect, the present application provides a cover generation device, the device comprising:

[0037] An acquisition unit, used to acquire a video material image including at least one character and a plurality of different cover templates, wherein the cover templates include layout elements and character elements;

[0038] A processing unit, configured to process the video material image for each cover template according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements;

[0039] A determination unit, used to determine a target layout diagram that matches the character elements in the corresponding cover template among the multiple layout diagrams;

[0040] A generating unit is used to generate a cover image corresponding to the video material image based on the target layout image.

[0041] Optionally, a processing unit for:

[0042] Acquire a face detection frame in the layout element, position information of the face detection frame in the layout diagram, and a size of the layout diagram;

[0043] Detecting whether the face detection frame can match the face in the video material image;

[0044] When the face detection frame can match the face in the video material image, the layout area to be cropped is obtained according to the position information of the face detection frame in the layout image and the size of the layout image;

[0045] The video material image is cropped according to the layout area to obtain a layout image that conforms to the layout elements.

[0046] Optionally, a processing unit for:

[0047] Obtain the standard sight direction and standard body direction of the character elements in each cover template;

[0048] For each cover template, determining whether the cover template matches the layout diagram according to the standard sight line orientation, the standard body orientation, and the layout diagram corresponding to the cover template;

[0049] When the cover template matches the layout diagram, the layout diagram is determined as a target layout diagram.

[0050] Optionally, a processing unit for:

[0051] Obtaining the sight direction of the person in the layout diagram;

[0052] Detecting whether an angle between the sight line direction and the standard sight line direction is greater than a first preset value;

[0053] When the included angle is greater than the first preset value, it is determined that the cover template does not match the layout diagram;

[0054] When the angle is less than or equal to the first preset value, it is determined whether the cover template matches the layout diagram according to the body orientation of the character in the layout diagram and the standard body orientation.

[0055] Optionally, a processing unit for:

[0056] Detecting whether an angle between the body orientation and the standard body orientation is greater than a second preset value;

[0057] When the included angle is greater than the second preset value, it is determined that the cover template does not match the layout diagram;

[0058] When the included angle is less than or equal to the second preset value, it is determined that the cover template matches the layout diagram.

[0059] Optionally, the cover template includes a standard aspect ratio of a logo and position information of the logo in the layout diagram, and the generating unit is used to:

[0060] In the video to which the video material image belongs, obtain the target logo whose aspect ratio is closest to the standard aspect ratio;

[0061] According to the position information of the logo in the layout diagram, the target logo is set in the target layout diagram to obtain the target layout diagram with the target logo added;

[0062] According to the target layout diagram with the target logo added, a cover image corresponding to the video material image is generated.

[0063] Optionally, the generating unit is used to:

[0064] Detecting whether the color of the target logo is close to the color of its adjacent area;

[0065] When the color of the target logo is close to the color of its adjacent area, the color of the target logo is adjusted so that the color of the target logo is obviously different from the color of its adjacent area.

[0066] In a third aspect, the present application provides a cover generation device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; at least one memory connected to the at least one bus, wherein the processor is configured to:

[0067] Acquire a video material image including at least one character and a plurality of different cover templates, wherein the cover templates include layout elements and character elements;

[0068] For each cover template, the video material image is processed according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements;

[0069] Determine a target layout diagram that matches the character elements in the corresponding cover template among the multiple layout diagrams;

[0070] Based on the target layout image, a cover image corresponding to the video material image is generated.

[0071] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the above-mentioned cover generation method when executed by a processor.

[0072] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the embodiment of the present application first obtains a video material image and a plurality of different cover templates, and then processes the material image according to the layout elements in each cover template to obtain a layout image corresponding to each cover template, and the layout image meets the requirements of the layout elements in the corresponding cover template. Then, in these layout images, find a target layout image that matches the character elements in the corresponding cover template. Based on the target layout image, generate a cover image corresponding to the video material image. It can be seen that the target layout image determined by the present application meets the layout elements and character elements of a certain cover template, and the layout elements and character elements reflect certain composition rules, so that the cover image determined by the present application meets certain composition rules, and the composition rules will make the cover image have a certain aesthetic feeling and have a greater appeal to users. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0074] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0075] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0076] Figure 1 A schematic diagram of a flow chart of a cover generation method provided in an embodiment of the present application;

[0077] Figure 2 A schematic diagram of a flow chart of a layout diagram determination method provided in an embodiment of the present application;

[0078] Figure 3 A schematic diagram of a flow chart of a method for determining a target layout diagram provided in an embodiment of the present application;

[0079] Figure 4 A flowchart of a data matching method provided in an embodiment of the present application;

[0080] Figure 5 A schematic flow chart of another method for detecting body orientation provided in an embodiment of the present application;

[0081] Figure 6A flowchart of another cover generation method provided in an embodiment of the present application;

[0082] Figure 7 A flowchart of another cover generation method provided in an embodiment of the present application;

[0083] Figure 8 A schematic diagram of a flow chart of a cover generation device provided in an embodiment of the present application;

[0084] Fig. 9 A schematic diagram of a cover generation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0085] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0086] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0087] In one usage scenario of an embodiment of the present application, a user can upload a video file produced by himself in a video playback application of a terminal. When the server receives the video file, the server can select a video material image including at least one character in the video file, or obtain a video material image specified by the user in the video file. Afterwards, the server can execute the method described in the present application on the video material image to obtain a cover image corresponding to the video material image. If the server obtains multiple cover images, the server can directly send the cover image to the terminal, or filter the cover image and send the filtered cover image to the terminal. When the terminal receives the cover image sent by the server, the terminal displays the cover image so that the user can select the last used cover image from these cover images.

[0088] In summary, the embodiment of the present application provides a cover generation method, and the cover generated by the method has a certain aesthetic feeling and is more attractive to users, such as Figure 1 As shown, the specific steps include:

[0089] Step 101, obtaining a video material image including at least one person and a plurality of different cover templates.

[0090] Among them, the cover template is generated based on a template image with certain composition rules, for example, the template image can be a movie poster. The cover template includes layout elements and character elements. For a template image including a character, the position and size of the character in the template image will reflect the overall layout of the image. Therefore, the layout element is the position of the character in the template image, that is, the character layout in the template image. In order to make the generated cover more consistent with the requirements of the template image, the character element is the orientation of the character in the template image, so that the generated cover image is more consistent with the template image.

[0091] In this step, when the server receives a video uploaded by a user, the server can select a video material image including at least one person in the video according to a preset rule, and simultaneously obtain multiple cover templates to be used.

[0092] In addition, before executing the method described in this application, the technician also needs to upload the pre-generated cover template to the server so that the server executes the method described in this application based on the uploaded cover template. The method for generating the cover template is that the technician can pre-select several poster images with obvious and different characteristics. For each poster image, the terminal can extract the layout elements and character elements in the poster image and generate a cover template based on this. Afterwards, the terminal can upload the generated cover template to the server.

[0093] Further, the preset rule may be to obtain the first preset video frames in the video, and find the video frames including the characters in these video frames, and determine them as the video material pictures. Of course, the preset rule may be to first find the video frames including the characters in the video, and determine the first few frames of these video frames as the video material pictures. The preset rule may also be other rules set by the technician, which are not limited here.

[0094] Step 102: for each cover template, the video material image is processed according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements.

[0095] In this step, for each cover template, the server can find the layout area that meets the layout elements in the cover template in the video material image, and cut the video material image according to the layout area to obtain a layout image that meets the layout elements.

[0096] Step 103, determining a target layout diagram that matches the character elements in the corresponding cover template among the multiple layout diagrams.

[0097] In this step, when a certain layout diagram conforms to both the layout elements of a certain cover template and the character elements of the cover template, since the layout elements and the character elements reflect the composition rules of the cover template, the layout diagram conforms to the composition rules of the cover template. Therefore, for each layout diagram corresponding to the cover template, it is also necessary to determine whether the layout diagram conforms to the character elements of the corresponding cover template. When the layout diagram conforms to the character elements of the corresponding cover template, the server determines the layout diagram as the target layout diagram. When the layout diagram does not conform to the character elements of the corresponding cover template, the server determines that the layout diagram is not the target layout diagram.

[0098] Step 104, generating a cover image corresponding to the video material image based on the target layout image.

[0099] In this step, the server can directly determine the target layout image as the cover image corresponding to the video material image, or continue to process the target layout image to generate a cover image corresponding to the video material image. For example, the server can put a logo on the target layout image to make the cover image more attractive, and can also add other words, pictures, etc. that attract users to the target layout image to increase the attractiveness of the cover image.

[0100] Furthermore, the embodiment of the present application can process multiple video material images to obtain a cover image corresponding to each video material image, or can only process one video material image to obtain a cover image corresponding to the video material image. The cover image obtained based on the above video material image may not exist, or there may be at least one. When there is one cover image, the server can directly push the cover image to the user. When there are multiple cover images, the server can directly push these cover images to the user, and can also first obtain the user portrait of the user who uploaded the video, filter these cover images based on the user portrait, and push the filtered cover images to the user to recommend cover images that meet the user's preferences to the user.

[0101] The embodiment of the present application first obtains a video material image and a plurality of different cover templates, and then processes the material image according to the layout elements in each cover template to obtain a layout image corresponding to each cover template, and the layout image meets the requirements of the layout elements in the corresponding cover template. Afterwards, in these layout images, a target layout image that matches the character elements in the corresponding cover template is found. Based on the target layout image, a cover image corresponding to the video material image is generated. It can be seen that the target layout image determined by the present application meets the layout elements and character elements of a certain cover template, and the layout elements and character elements reflect certain composition rules, so that the cover image determined by the present application meets certain composition rules, and the composition rules will make the cover image have a certain aesthetic feeling and have a greater appeal to users.

[0102] In an embodiment of the present application, after obtaining the template image, the server can detect the person in the template image, obtain the face detection frame of the person, the position information of the face detection frame in the template image, and at the same time, obtain the size of the template image. In order to make the character layout of the layout image and the template image the same, the present application can set the size of the layout image to be the same as the size of the template image, so the face detection frame of the person, the position information of the face detection frame in the layout image, and the size of the layout image can be set as layout elements. After that, the server can obtain a layout image that conforms to the layout elements in each cover template. Therefore, an embodiment of the present application provides a layout image determination method, which is a further limitation of step 102, such as Figure 2 As shown, the specific steps are:

[0103] Step 201, obtaining a face detection frame in a layout element, position information of the face detection frame in a layout diagram, and a size of the layout diagram.

[0104] In the actual storage process, the server may only store the height and width of the face detection frame, and then determine the face detection frame based on the height and width, so that the server can obtain the face detection frame.

[0105] Step 202, detecting whether the face detection frame can match the face in the video material image.

[0106] In this step, the server can detect whether the face in the video material image is enclosed in the face frame. When the face is enclosed in the face detection frame, the server determines that the face detection frame matches the face in the video material image. When the face is not enclosed in the face detection frame, the server determines that the face detection frame does not match the face in the video material image.

[0107] Furthermore, when the face is too small or too large, the cover generated based on the face may not conform to the composition rule of the template image, so the server can detect the area ratio of the face in the face detection frame, and when the area ratio is greater than the first area ratio and less than the second area ratio, it is determined that the face detection frame matches the face in the video material image, and step 203 can be continued. Otherwise, the server determines that the face detection frame does not match the face in the video material image.

[0108] Further, the server sets the face detection frame to an adjustable size, and uses the face detection frame of each size to match the face, and when the face is within the face detection frame of a certain size, and the occupied area is greater than the first occupied area and less than the second occupied area, it is determined that the face detection frame matches the face in the video material image, and step 203 can be continued. Otherwise, the server determines that the face detection frame does not match the face in the video material image.

[0109] Step 203, when the face detection frame can match the face in the video material image, the layout area to be cropped is obtained according to the position information of the face detection frame in the layout image and the size of the layout image.

[0110] In this step, when the face detection frame can match the face in the video material image, the server finds the layout area to be cropped in the material image based on the position information of the face detection frame in the layout image and the size of the layout image, and obtains the layout area to be cropped.

[0111] It should be noted that for each cover template, the layout area of ​​the cover template may be generated, or the layout area of ​​the cover template may not be generated. In other words, not every cover template has a layout area.

[0112] Step 204, cropping the video material image according to the layout area to obtain a layout image that meets the layout elements.

[0113] In this step, the server may crop the video material image according to the layout area to obtain a layout image that meets the layout elements.

[0114] In an embodiment of the present application, for some cover templates, the server will determine the layout diagram corresponding to the cover template, and for other cover templates, the server cannot determine the layout diagram corresponding to the cover template. Therefore, for the layout diagrams corresponding to certain cover templates, when the orientation of the characters in the template diagram is the same as the orientation of the characters in the layout diagram, the layout rules of the template diagram and the layout diagram remain consistent. Therefore, the present application also needs to detect the orientation of the characters in the layout diagram to determine the target layout diagram in the layout diagram. Therefore, an embodiment of the present application provides a method for determining a target layout diagram, specifically, Figure 3 As shown, the method includes:

[0115] Step 301, obtaining the standard sight line direction and standard body direction of the character elements in each cover template.

[0116] In this step, since a person generally includes a head and a body, the person element may include a face orientation and a body orientation, and the person in the layout diagram is then detected by the face orientation and the body orientation.

[0117] Step 302: for each cover template, determine whether the cover template matches the layout diagram according to the standard sight line orientation, the standard body orientation, and the layout diagram corresponding to the cover template.

[0118] In this step, for each cover template, the server detects the layout diagram corresponding to the cover template according to the standard sight line orientation and the standard body orientation to determine whether the cover template matches the layout diagram.

[0119] Step 303: when the cover template matches the layout diagram, the layout diagram is determined as the target layout diagram.

[0120] In this step, when the server determines that the cover template matches the layout diagram, it means that the layout rules of the template diagram corresponding to the cover template and the layout diagram are consistent. Therefore, the server can determine the layout diagram as the target layout diagram.

[0121] In the embodiment of the present application, the server can detect the sight direction of the person in the layout diagram, and then compare the sight direction with the standard sight direction. If the comparison does not match, it is directly determined that the cover template does not match the layout diagram. If the comparison does match, further detection is performed based on the standard body direction. Therefore, the embodiment of the present application provides a data matching method, which is a further limitation of step 302, such as Figure 4 As shown, specifically including:

[0122] Step 401, obtaining the sight direction of the person in the layout diagram.

[0123] In this step, the server may use line-of-sight-related technologies to analyze the characters in the layout diagram to determine the line-of-sight directions of the characters in the layout diagram.

[0124] Specifically, the server obtains the sight line vector of the person in the layout diagram. The specific method is to align the image with the human face and obtain the coordinates of the key points of the face, including 68 3D key points and 5 2D key points (left eye center, right eye center, nose tip, left mouth corner, right mouth corner). The facial key point data is preprocessed and converted into a format suitable for model input. Based on the preprocessed data, the input data of the model is generated, including image data and meta information. The pre-trained sight line estimation model is used to infer the input data to obtain the sight line vector of each face, that is, the sight line direction described in step 401.

[0125] Step 402: Detect whether the angle between the sight line direction and the standard sight line direction is greater than a first preset value.

[0126] In this step, the server may first calculate the difference between the sight line direction and the standard sight line direction, and determine the absolute value of the difference as the angle between the sight line direction and the standard sight line direction, and then detect whether the angle is greater than a first preset value. When the angle is greater than the first preset value, it means that the angle between the sight line direction and the standard sight line direction is too large, and the two directions are inconsistent. When the angle is less than the first preset value, it means that the sight line direction and the standard sight line direction are basically consistent.

[0127] Step 403: When the included angle is greater than a first preset value, it is determined that the cover template does not match the layout diagram.

[0128] In this step, when the angle is greater than the first preset value, it means that the sight direction is not consistent with the standard sight direction. Therefore, the characters in the cover image of the cover template and the characters in the layout image have different orientations, so the server determines that the cover template does not match the layout image.

[0129] Step 404, when the angle is less than or equal to the first preset value, determine whether the cover template matches the layout diagram according to the body orientation of the character in the layout diagram and the standard body orientation.

[0130] In an embodiment of the present application, the server may also store a body orientation range, detect whether the body orientation of the person in the layout diagram is within the range, so as to detect whether the body orientation of the person in the layout diagram and the face orientation of the person in the template diagram are consistent. Of course, the server may also store a standard body orientation and a second preset value, and detect the body orientation of the person in the layout diagram according to the standard body orientation and the second preset value, so as to detect whether the body orientation of the person in the layout diagram and the face orientation of the person in the template diagram are consistent. Therefore, the present application provides a body orientation detection method, which is a further limitation of step 404, such as Figure 5 As shown, specifically including:

[0131] Step 501, detecting whether the angle between the body orientation and the standard body orientation is greater than a second preset value.

[0132] In this step, the server may calculate the difference between the body orientation and the standard body orientation, and determine the absolute value of the difference as the angle between the body orientation and the standard body orientation, and then determine whether the angle is greater than a second preset value.

[0133] Further, the body bounding boxes in the layout diagram are traversed: for each detected body bounding box, the following steps are performed: according to the current body bounding box, the corresponding area is cropped from the original image to obtain a smaller image. The cropped image is preprocessed and converted into a format suitable for model input, usually including resizing, normalization and other operations. The preprocessed image is input into the pre-trained body posture estimation model, and the body angle is inferred to obtain the body vector, that is, the body orientation described in this step. After that, the body orientation in the layout diagram is detected and this step is performed.

[0134] Step 502: When the included angle is greater than a second preset value, it is determined that the cover template does not match the layout diagram.

[0135] In this step, when the server determines that the angle is greater than the second preset value, it means that the orientation of the character in the layout diagram is different from the orientation of the character in its corresponding cover diagram, and the server determines that the cover template does not match the layout diagram.

[0136] Step 503: When the included angle is less than and equal to the second preset value, it is determined that the cover template matches the layout diagram.

[0137] In this step, when the server determines that the angle is less than and equal to the second preset value, it means that the orientation of the character in the layout diagram is the same as the orientation of the character in its corresponding cover diagram, and the server determines that the cover template matches the layout diagram.

[0138] It should be noted that when there are multiple characters in the layout diagram, in order to facilitate identification, a character ID can be set for each character, and the face and body of the same character can be set to correspond to the character ID. In this way, when executing the method described in this application, the method described in this application can be executed based on a character with a certain character ID first, and then based on a character with another character ID, until the method described in this application is completed based on all the characters with all the character IDs. Therefore, after executing Figure 4 After the above steps, the target person ID corresponding to the currently detected face can be obtained, and the reference person ID corresponding to each body in the layout diagram can be obtained, and the two can be compared. When a reference person ID and the target person ID are compared, the body corresponding to the reference person ID is used as Figure 5 The body to be tested.

[0139] In the embodiment of the present application, the server can directly determine the target layout map as the final cover map. Of course, the server can also add a logo to the target layout map, and then generate a cover map corresponding to the video material map based on the target layout map with the logo added. Therefore, the present application provides a cover map generation method, which is as follows: Figure 6 As shown, the specific steps include:

[0140] Step 601, in the video to which the video material image belongs, obtain a target logo whose corresponding aspect ratio is closest to the standard aspect ratio.

[0141] The cover template also includes the standard aspect ratio of the logo and the position information of the logo in the layout diagram. The logo is the logo in the template diagram corresponding to the cover template, that is, the logo is originally set in the template diagram, and then the standard aspect ratio of the logo and the position information of the logo in the template diagram are obtained and determined as the position information of the logo in the layout diagram.

[0142] In this step, the server finds all logos in the video to which the video material image belongs, and then determines the aspect ratio of each logo. The server compares the aspect ratio of each logo with the standard aspect ratio, finds the logo closest to the standard aspect ratio, and determines it as the target logo.

[0143] Step 602, according to the position information of the logo in the layout diagram, the target logo is set in the target layout diagram to obtain the target layout diagram with the target logo added.

[0144] The position information may be the center coordinates of the logo, or the position coordinates of the upper left corner and the upper right corner of the logo, or the position coordinates of the upper right corner and the upper left corner of the logo, which is not limited here.

[0145] In this step, when the position information is the center coordinate of the logo, the server can find its corresponding position in the target layout diagram according to the center coordinate, and align the center position of the logo with the position to obtain the target layout diagram with the target logo added.

[0146] Since the target logo found may be too large or too small, this step can also adjust the size of the target logo so that the logo in the target layout image is consistent with the logo in the template image corresponding to the cover template. For example, the cover template also includes the size of the logo, and then the server adjusts the logo in the target layout image according to the size of the logo.

[0147] Of course, when the location information is the position coordinates of the upper left corner and the upper right corner of the logo, the server can find the corresponding position in the target layout map based on these two position coordinates, and align the upper left corner and the upper right corner of the logo with these two positions respectively to obtain the target layout map with the target logo added.

[0148] Step 603, generating a cover image corresponding to the video material image according to the target layout image with the target logo added.

[0149] In this step, the server may determine the target layout image with the target logo added as the cover image corresponding to the video material image, or may continue to perform other operations on the target layout image with the target logo added to generate a cover image corresponding to the video material image. For example, text and images may be added to the target layout image with the target logo added to generate a cover image corresponding to the video material image.

[0150] In the embodiment of the present application, after the server adds the target logo to the target layout diagram, if the target logo is not obvious in the target layout diagram, the target logo cannot attract users, and the generated cover image is not attractive to users. Therefore, the embodiment of the present application provides a cover image generation method, which is a further limitation of step 603, such as Figure 7 As shown, the specific steps include:

[0151] Step 701, detecting whether the color of the target logo is close to the color of its adjacent area.

[0152] In this step, the server can detect whether the color of the target logo is close to the color of its adjacent area. If the colors of the two are close, it means that the target logo is not obvious in the target layout diagram, and the server can adjust the color of the target logo to make the color of the target logo clearly different from the color of its adjacent area. If the colors of the two are not close, it means that the target logo is obvious in the target layout diagram, and the server does not need to adjust the color of the target logo.

[0153] Step 702: When the color of the target logo is close to the color of its adjacent area, the color of the target logo is adjusted so that the color of the target logo is obviously different from the color of its adjacent area.

[0154] like Figure 8 As shown, the embodiment of the present application provides a cover generation device, which corresponds to the method embodiment and specifically includes:

[0155] An acquisition unit 801 is used to acquire a video material image including at least one character and a plurality of different cover templates, wherein the cover templates include layout elements and character elements;

[0156] The processing unit 802 is used to process the video material image according to the layout elements in the cover template for each cover template, so as to obtain a layout image that meets the layout elements;

[0157] A determination unit 803 is used to determine a target layout diagram that matches the character elements in the corresponding cover template from among the multiple layout diagrams;

[0158] The generating unit 804 is used to generate a cover image corresponding to the video material image based on the target layout image.

[0159] Optionally, the processing unit 802 is configured to:

[0160] Acquire a face detection frame in the layout element, position information of the face detection frame in the layout diagram, and a size of the layout diagram;

[0161] Detecting whether the face detection frame can match the face in the video material image;

[0162] When the face detection frame can match the face in the video material image, the layout area to be cropped is obtained according to the position information of the face detection frame in the layout image and the size of the layout image;

[0163] The video material image is cropped according to the layout area to obtain a layout image that conforms to the layout elements.

[0164] Optionally, the processing unit 803 is configured to:

[0165] Obtain the standard sight direction and standard body direction of the character elements in each cover template;

[0166] For each cover template, determining whether the cover template matches the layout diagram according to the standard sight line orientation, the standard body orientation, and the layout diagram corresponding to the cover template;

[0167] When the cover template matches the layout diagram, the layout diagram is determined as a target layout diagram.

[0168] Optionally, the processing unit 803 is configured to:

[0169] Obtaining the sight direction of the person in the layout diagram;

[0170] Detecting whether an angle between the sight line direction and the standard sight line direction is greater than a first preset value;

[0171] When the included angle is greater than the first preset value, it is determined that the cover template does not match the layout diagram;

[0172] When the angle is less than or equal to the first preset value, it is determined whether the cover template matches the layout diagram according to the body orientation of the character in the layout diagram and the standard body orientation.

[0173] Optionally, the processing unit 803 is configured to:

[0174] Detecting whether an angle between the body orientation and the standard body orientation is greater than a second preset value;

[0175] When the included angle is greater than the second preset value, it is determined that the cover template does not match the layout diagram;

[0176] When the included angle is less than or equal to the second preset value, it is determined that the cover template matches the layout diagram.

[0177] Optionally, the cover template includes a standard aspect ratio of a logo and position information of the logo in the layout diagram, and the generating unit 804 is used to:

[0178] In the video to which the video material image belongs, obtain the target logo whose aspect ratio is closest to the standard aspect ratio;

[0179] According to the position information of the logo in the layout diagram, the target logo is set in the target layout diagram to obtain the target layout diagram with the target logo added;

[0180] According to the target layout diagram with the target logo added, a cover image corresponding to the video material image is generated.

[0181] Optionally, the generating unit 804 is configured to:

[0182] Detecting whether the color of the target logo is close to the color of its adjacent area;

[0183] When the color of the target logo is close to the color of its adjacent area, the color of the target logo is adjusted so that the color of the target logo is obviously different from the color of its adjacent area.

[0184] like Fig. 9 As shown, the embodiment of the present application provides a cover generation device, including a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0185] Memory 903, used for storing computer programs;

[0186] In one embodiment of the present application, the processor 901 is used to execute the program stored in the memory 903 to implement the cover generation method provided by any of the above method embodiments, including:

[0187] Acquire a video material image including at least one character and a plurality of different cover templates, wherein the cover templates include layout elements and character elements;

[0188] For each cover template, the video material image is processed according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements;

[0189] Determine a target layout diagram that matches the character elements in the corresponding cover template among the multiple layout diagrams;

[0190] Based on the target layout image, a cover image corresponding to the video material image is generated.

[0191] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the cover generation method provided in any of the aforementioned method embodiments are implemented.

[0192] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0193] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0194] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0195] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A cover generation method, characterized in that: The method comprises: Acquire a video material image including at least one character and a plurality of different cover templates, wherein the cover templates include layout elements and character elements; For each cover template, the video material image is processed according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements; Determine a target layout diagram that matches the character elements in the corresponding cover template among the multiple layout diagrams; Based on the target layout image, a cover image corresponding to the video material image is generated.

2. The method according to claim 1, characterized in that: The processing of the material image according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements includes: Acquire a face detection frame in the layout element, position information of the face detection frame in the layout diagram, and a size of the layout diagram; Detecting whether the face detection frame can match the face in the video material image; When the face detection frame can match the face in the video material image, the layout area to be cropped is obtained according to the position information of the face detection frame in the layout image and the size of the layout image; The video material image is cropped according to the layout area to obtain a layout image that conforms to the layout elements.

3. The method according to claim 1, characterized in that: Determining a target layout diagram that matches the character elements in the corresponding cover template among the multiple layout diagrams includes: Obtain the standard sight direction and standard body direction of the character elements in each cover template; For each cover template, determining whether the cover template matches the layout diagram according to the standard sight line orientation, the standard body orientation, and the layout diagram corresponding to the cover template; When the cover template matches the layout diagram, the layout diagram is determined as a target layout diagram.

4. The method according to claim 3, characterized in that: The determining whether the cover template matches the layout diagram according to the standard sight line orientation, the standard body orientation, and the layout diagram corresponding to the cover template includes: Obtaining the sight direction of the person in the layout diagram; Detecting whether an angle between the sight line direction and the standard sight line direction is greater than a first preset value; When the included angle is greater than the first preset value, it is determined that the cover template does not match the layout diagram; When the angle is less than or equal to the first preset value, it is determined whether the cover template matches the layout diagram according to the body orientation of the character in the layout diagram and the standard body orientation.

5. The method according to claim 4, characterized in that: The determining whether the cover template matches the layout diagram according to the body orientation of the character in the layout diagram and the standard body orientation comprises: Detecting whether an angle between the body orientation and the standard body orientation is greater than a second preset value; When the included angle is greater than the second preset value, it is determined that the cover template does not match the layout diagram; When the included angle is less than or equal to the second preset value, it is determined that the cover template matches the layout diagram.

6. The method according to claim 1, characterized in that: The cover template includes a standard aspect ratio of the logo and position information of the logo in the layout diagram, and generating a cover diagram corresponding to the video material diagram based on the target layout diagram includes: In the video to which the video material image belongs, obtain the target logo whose aspect ratio is closest to the standard aspect ratio; According to the position information of the logo in the layout diagram, the target logo is set in the target layout diagram to obtain the target layout diagram with the target logo added; According to the target layout diagram with the target logo added, a cover image corresponding to the video material image is generated.

7. The method according to claim 1, characterized in that: The step of generating a cover image corresponding to the video material image according to the target layout image to which the target logo is added includes: Detecting whether the color of the target logo is close to the color of its adjacent area; When the color of the target logo is close to the color of its adjacent area, the color of the target logo is adjusted so that the color of the target logo is obviously different from the color of its adjacent area.

8. A cover generation device, characterized in that: The device comprises: An acquisition unit, used to acquire a video material image including at least one character and a plurality of different cover templates, wherein the cover templates include layout elements and character elements; A processing unit, configured to process the video material image for each cover template according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements; A determination unit, used to determine a target layout diagram that matches the character elements in the corresponding cover template among the multiple layout diagrams; A generating unit is used to generate a cover image corresponding to the video material image based on the target layout image.

9. A cover generation device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; at least one memory connected to the at least one bus, wherein the processor is configured to: Acquire a video material image including at least one character and a plurality of different cover templates, wherein the cover templates include layout elements and character elements; For each cover template, the video material image is processed according to the layout elements in the cover template to obtain a layout image that conforms to the layout elements; Determine a target layout diagram that matches the character elements in the corresponding cover template among the multiple layout diagrams; Based on the target layout image, a cover image corresponding to the video material image is generated.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the cover generation method described in any one of claims 1 to 7 is implemented.