CN111145310A - Poster generation method and device - Google Patents

Poster generation method and device Download PDF

Info

Publication number
CN111145310A
CN111145310A CN201911382558.XA CN201911382558A CN111145310A CN 111145310 A CN111145310 A CN 111145310A CN 201911382558 A CN201911382558 A CN 201911382558A CN 111145310 A CN111145310 A CN 111145310A
Authority
CN
China
Prior art keywords
poster
generated
elements
attribute
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911382558.XA
Other languages
Chinese (zh)
Inventor
姚晓宇
何晶
谭颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201911382558.XA priority Critical patent/CN111145310A/en
Publication of CN111145310A publication Critical patent/CN111145310A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0621Item configuration or customization

Landscapes

  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Theoretical Computer Science (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides a poster generation method and a poster generation device, wherein the method comprises the following steps: obtaining elements contained in the poster to be generated, and obtaining a position attribute of a first element determined according to the requirement of a user for the poster to be generated; determining the position attribute of each second element according to the obtained position attribute of the first element; determining the positions of the first element and the second element contained in the poster to be generated according to the obtained position attributes of the first element and the second element; determining color matching attributes of the other elements according to the determined positions and the color matching attributes of the existing color matching elements; and generating the poster to be generated according to the first element and the second element after the typesetting and the color configuration. When the scheme provided by the embodiment of the invention is applied to poster generation, the poster generation efficiency can be improved.

Description

Poster generation method and device
Technical Field
The invention relates to the technical field of image processing, in particular to a poster generation method and a poster generation device.
Background
At present, most posters are produced manually. However, manual poster production wastes time, resulting in low poster production efficiency. In order to improve the poster generation efficiency, a poster generation network model is generally adopted in the prior art to generate the poster. The poster generation network model is generally pre-trained by adopting a large number of sample posters, and the model can learn the typesetting rules of various typesetting modes of elements in the posters, which enable users to consider the posters to be attractive in appearance, from the large number of sample posters in the training process. On the basis, when the poster to be generated needs to contain a plurality of elements and the generated network model is used for generating the poster to be generated, each element which needs to be contained in the poster to be generated can be typeset according to the typesetting rule learned in the training process, and therefore the poster which is considered to be attractive by the user is generated.
However, in the case where the user has a personalized requirement for the poster to be generated, for example: the user specifies that elements in the poster to be generated are in a preset position and the like, and because the poster generated by the poster generation network model is a poster which is considered to be attractive by the user, the poster needs to be generated for multiple times by the poster generation network model until the poster meeting the personalized requirement of the user on the poster is obtained, so that the poster generation efficiency is low.
Disclosure of Invention
The embodiment of the invention aims to provide a poster generation method and a poster generation device, so that the poster generation efficiency is improved. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a poster generation method, where the method includes:
obtaining elements contained in the poster to be generated, and obtaining a position attribute of a first element determined according to the requirement of a user for the poster to be generated;
determining the position attribute of each second element according to the obtained position attribute of the first element, wherein the second elements are as follows: elements except the first element in the elements contained in the poster to be generated;
determining the positions of the first element and the second element contained in the poster to be generated according to the obtained position attributes of the first element and the second element;
determining color matching attributes of the other elements according to the determined position and the color matching attributes of the existing color matching elements, wherein the existing color matching elements are as follows: the poster to be generated comprises elements which are preset with color matching attributes, and the rest elements are as follows: elements except the existing color matching elements in the elements contained in the poster to be generated;
generating the poster to be generated according to the first element and the second element after typesetting and configuring the colors, wherein the typesetting is as follows: in the poster to be generated, typesetting the first element and the second element according to the determined positions of the first element and the second element in the poster to be generated, wherein the configuration color is as follows: and configuring the colors of the first element and the second element in the poster to be generated according to the determined color attributes of the first element and the second element.
In an embodiment of the present invention, the determining the location attribute of each second element according to the obtained location attribute of the first element includes:
calculating a candidate region Q' according to the obtained position attribute of the first element by the following expression:
Figure BDA0002342653520000021
wherein Q denotes the poster area of the poster to be generated, PiRepresenting the area of the ith first element in the poster to be generated, n representing the total number of the first elements, and i representing the sequence number of the first elements;
determining the area where each second element is located in the alternative area;
and calculating the position attribute of each second element according to the determined area where each second element is located.
In an embodiment of the present invention, the determining, in the alternative area, an area where each second element is located includes:
and determining the area where each second element is located according to the element type of each second element and the corresponding rule of the preset element type and the area where the second element is located.
In an embodiment of the present invention, the obtaining of the elements included in the poster to be generated and the position attribute of the first element determined according to the requirement of the user for the poster to be generated includes:
determining elements contained in a poster to be generated according to a pre-generated poster template with a tree structure, and obtaining the determined elements, wherein the poster template comprises: information of elements contained in the poster and position attributes of the elements;
and obtaining the position attribute of the first element contained in the poster to be generated according to the position attribute included in the poster template.
In an embodiment of the present invention, obtaining the position attribute of the first element included in the poster to be generated according to the position attribute included in the poster template includes:
judging whether a position conflict exists in a first element position represented by the position attribute included in the poster template;
if not, determining the position attribute included in the poster template as the position attribute of the first element included in the poster to be generated;
if so, feeding back the position conflict information to the user.
In an embodiment of the present invention, the determining, according to the position attributes of the first element and the second element, the position of each element included in the poster to be generated includes:
determining the typesetting mode of the elements contained in the poster to be generated according to the position attributes of the first element and the second element;
adopting the poster aesthetic feeling evaluation network model trained in advance, right the typesetting mode is subjected to aesthetic feeling evaluation to obtain an evaluation result, wherein the poster aesthetic feeling evaluation network model is as follows: the method comprises the steps that a sample typesetting mode is used as model input, a sample evaluation result is used as a training reference, a preset neural network model is trained to obtain a model which is used for carrying out aesthetic feeling evaluation on the typesetting mode of elements, and the sample evaluation result is obtained by counting results of the aesthetic feeling evaluation of a plurality of sample users on the sample typesetting mode;
adjusting the position attributes of the first element and the second element according to the evaluation result;
and determining the position of each element contained in the poster to be generated according to the adjusted position attribute.
In an embodiment of the present invention, the determining, according to the position attributes of the first element and the second element, a typesetting manner of the elements included in the poster to be generated includes:
judging whether the position attribute of each first element and the element position represented by the position attribute of the second element have an overlapping area or not;
if so, adjusting the position attribute of each element with the element position overlapping area, so that the element position represented by the adjusted position attribute has no overlapping area.
In an embodiment of the present invention, the adjusting the position attribute according to the evaluation result includes:
calculating the loss value of the evaluation result according to the evaluation result and a preset loss value calculation rule;
determining the adjustment direction of the position attribute according to the loss value;
and adjusting the position attribute according to the adjusting direction.
In an embodiment of the present invention, the determining color matching attributes of the remaining elements according to the determined position and the color matching attributes of the existing color matching elements includes:
determining a color system of the poster to be generated according to the color matching attributes of the existing color matching elements, and obtaining the color distribution information of the poster to be generated;
determining a saliency region of the poster to be generated according to the determined position;
and determining the color matching attributes of the rest elements according to the color system, the color distribution information and the saliency areas.
In a second aspect, embodiments of the present invention provide a poster generating apparatus, the apparatus comprising:
the element and position attribute obtaining module is used for obtaining elements contained in the poster to be generated and obtaining the position attribute of the first element determined according to the requirement of a user for the poster to be generated;
a position attribute determining module, configured to determine a position attribute of each second element according to the obtained position attribute of the first element, where the second element is: elements except the first element in the elements contained in the poster to be generated;
a position determining module, configured to determine, according to the obtained position attributes of the first element and the second element, positions of the first element and the second element included in the poster to be generated;
and the color matching attribute determination module is used for determining the color matching attributes of the other elements according to the determined position and the color matching attributes of the existing color matching elements, wherein the existing color matching elements are as follows: the poster to be generated comprises elements which are preset with color matching attributes, and the rest elements are as follows: elements except the existing color matching elements in the elements contained in the poster to be generated;
the poster generation module is used for generating the poster to be generated according to the first element and the second element after the typesetting and the color configuration, wherein the typesetting is as follows: typesetting the first element and the second element in the poster to be generated according to the determined positions of the first element and the second element in the poster to be generated, wherein the configuration color is as follows: and configuring the colors of the first element and the second element according to the determined color attributes of the first element and the second element in the poster to be generated.
In a third aspect, an embodiment of the present invention provides a terminal device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor configured to implement the method steps of the first aspect when executing the program stored in the memory.
As can be seen from the above description, when a poster is generated by applying the scheme provided by the embodiment of the present invention, the position attribute of the second element is determined according to the position attribute of the first element, so that the position of each element included in the poster to be generated is determined according to the position attributes of the first element and the second element, and the position attribute of the first element is determined according to the requirement of a user for the poster to be generated, so that the position corresponding to the first element in the poster to be generated can be determined according to the requirement of the user. In this way, the generated poster can fully meet the personalized requirements of the user.
In addition, in determining the second elements contained in the poster, a position attribute of each of the second elements is determined in accordance with the position attribute of the first element. Therefore, the position of the second element in the poster to be generated can be determined on the basis of meeting the personalized requirements of the user, and the poster to be generated is further generated. Compared with the prior art, the poster is generated according to the determined element position, and the poster generation efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a first poster generation method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a second poster generation method provided by an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a third poster generation method provided by embodiments of the present invention;
FIG. 4 is a diagram illustrating a layout manner of elements according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a method for adjusting a location attribute according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a first poster generating apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a second poster generating apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a third poster generating apparatus according to embodiments of the present invention;
fig. 9 is a schematic structural diagram of a location attribute adjusting unit according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
When a poster is generated, because the poster generation efficiency is low in the prior art, in order to solve the technical problem, the embodiment of the invention provides a poster generation method and a poster generation device.
In one embodiment of the present invention, there is provided a poster generation method including:
obtaining elements contained in the poster to be generated, and obtaining the position attribute of the first element determined according to the requirement of a user for the poster to be generated;
determining the position attribute of each second element according to the obtained position attribute of the first element, wherein the second elements are as follows: elements except the first element in the elements contained in the poster to be generated;
determining the positions of the first element and the second element contained in the poster to be generated according to the obtained position attributes of the first element and the second element;
determining the color matching attributes of the other elements according to the determined positions and the color matching attributes of the existing color matching elements, wherein the existing color matching elements are as follows: the elements contained in the poster to be generated are the elements with the color matching attributes preset, and the rest elements are as follows: elements except the existing color matching elements in the elements contained in the poster to be generated;
generating a poster to be generated according to the first element and the second element after typesetting and configuring the colors, wherein the typesetting is as follows: in the poster to be generated, typesetting the first element and the second element according to the determined positions of the first element and the second element in the poster to be generated, and configuring the colors as follows: and configuring the colors of the first element and the second element according to the determined color attributes of the first element and the second element in the poster to be generated.
As can be seen from the above description, when a poster is generated by applying the scheme provided by the embodiment of the present invention, the position attribute of the second element is determined according to the position attribute of the first element, so that the position of each element included in the poster to be generated is determined according to the position attributes of the first element and the second element, and the position attribute of the first element is determined according to the requirement of a user for the poster to be generated, so that the position corresponding to the first element in the poster to be generated can be determined according to the requirement of the user. In this way, the generated poster can fully meet the personalized requirements of the user.
In addition, in determining the second elements contained in the poster, a position attribute of each of the second elements is determined in accordance with the position attribute of the first element. Therefore, the position of the second element in the poster to be generated can be determined on the basis of meeting the personalized requirements of the user, and the poster to be generated is further generated. Compared with the prior art, the poster is generated according to the determined element position, and the poster generation efficiency is improved.
Referring to fig. 1, fig. 1 is a schematic flow chart of a first poster generation method provided by an embodiment of the present invention, where the method includes:
s101: and obtaining the elements contained in the poster to be generated, and obtaining the position attribute of the first element determined according to the requirement of the user for the poster to be generated.
The poster to be generated may be: movie posters, advertising posters, and the like.
The elements contained in the poster to be generated can be elements such as text, pictures, backgrounds and frames of the poster to be generated. For example: assuming that the poster to be generated is a movie poster, the elements contained in the poster to be generated can be the text with the movie name as the content, the pictures with the movie picture as the content, and other elements; assuming that the poster to be generated is a business promotion poster, the elements contained in the poster to be generated can be the text with the content being the name of a business, the picture with the content being the identification of the business, and other elements.
The position attribute of the first element is used for representing the position of the element in the poster to be generated. The position attribute may be represented by an absolute position of the element in the poster to be generated, for example, the absolute position may be (100,1000), etc., where 100 and 1000 are respectively an abscissa and an ordinate of a starting point of the element in the poster to be generated. The position attribute may also be expressed in a relative position between elements, for example, the position may be expressed as: element a is located to the left of element B, etc. Of course, the above-mentioned position attribute may also be expressed by a combination of absolute and relative positions.
The position attribute of the first element is determined according to the requirement of the user for the poster to be generated.
Since the poster to be generated may include a plurality of elements, when the position attributes of the elements included in the poster to be generated are obtained, the obtained position attributes may be the position attributes of all the elements included in the poster to be generated, or may also be the position attributes of part of the elements included in the poster to be generated, which may be specifically referred to as the following first to third cases.
In the first case, when the user has fully specified the position of the individual elements in the poster to be generated, the position attributes of the individual elements can be determined. Assuming that the poster to be generated contains 3 elements, and the user completely specifies the positions of the 3 elements in the poster to be generated, the position attributes of the 3 elements can be determined, and then the position attributes of the 3 elements can be obtained.
In the second case, when the user specifies only the positions of the partial elements in the poster to be generated, the position attributes of the partial elements can be determined. Assuming that 3 elements are contained in the poster to be generated, and the user only specifies the positions of 2 elements in the poster to be generated, the position information of the 2 elements can be determined, in which case the position attributes of some of the 3 elements can be obtained.
In a third case, when the user does not specify the positions of the respective elements in the poster to be generated, in this case, the obtained position attribute may be considered as null information when the position attribute of the element is obtained.
In one embodiment of the invention, the element contained in the poster to be generated and the position attribute of the element contained in the poster to be generated can be obtained according to the way that the user manually inputs the element and sets the position attribute of the element. Specifically, after determining the element included in the poster to be generated, the user inputs the determined element to a terminal device serving as an execution body, and in addition, the user can manually set the position attribute of the element at the terminal device, so that the terminal device can obtain the element included in the poster to be generated and the position attribute of the element included in the poster to be generated.
The specific manner of obtaining the elements contained in the poster to be generated and obtaining the position attribute of the first element determined according to the requirement of the user for the poster to be generated can be referred to in the embodiment corresponding to fig. 2, and will not be described in detail here.
S102: and determining the position attribute of each second element according to the obtained position attribute of the first element.
The second elements are: and generating elements except the first element in the elements contained in the poster.
In the above S101, there are three cases of the position attribute of the first element, and accordingly, there are also a plurality of cases of determining the position attribute of each second element.
First, when the position attributes of some elements in the poster to be generated are obtained, the position attributes of the respective second elements can be randomly determined by the execution body of the embodiment of the present invention, based on the obtained position attribute of the first element.
In one embodiment of the present invention, determining the position attribute of each second element according to the obtained position attribute of the first element can also be realized according to the following steps A1-A3.
Step A1: calculating a candidate region Q' according to the obtained position attribute of the first element by the following expression:
Figure BDA0002342653520000091
wherein Q denotes the poster area of the poster to be generated, PiThe method comprises the steps of representing an area where the ith first element is located in a poster to be generated, n representing the total number of the first elements, and i representing the sequence number of the first elements.
Step A2: and determining the area of each second element in the alternative area.
After the area where the second element is located in the poster to be generated is obtained, when the area where each second element is located is determined, the area where each second element is located can be randomly determined.
In an embodiment of the present invention, in the alternative area, when determining the area where each second element is located, the area where each second element is located may also be determined according to the element type of each second element and the preset corresponding relationship between the element type of the element and the area where the element is located.
The element types may be: text type, picture type, border type, decorative pattern type, etc.
The correspondence between the preset element type and the area where the element is located may be: the elements of the text type and the picture type correspond to the central area of the alternative area, and the elements of the frame type and the decorative pattern type correspond to the edge area of the alternative area.
Therefore, when the element type of the element is a text type or a picture type, the area where the element is located can be determined to be the central area of the candidate area according to the preset corresponding relationship, and when the element type of the element is a frame type or a decorative pattern type, the area where the element is located can be determined to be the edge area of the candidate area according to the preset corresponding relationship.
Step A3: and calculating the position attribute of each second element according to the determined area where each second element is located.
In the determined area where each second element is located, the position attribute of each second element can be calculated according to the area of the second element and the element type of the second element.
For example: the size of the determined area where the second element is located is 200 × 200, the unit is a pixel point, the area of the second element is 200 × 100, and if the element type of the second element is a text, coordinates of the second element which can be placed at the center position of the determined area are (0,50,200,50), wherein the first coordinate, the second coordinate, the abscissa starting point, the ordinate starting point, the third coordinate, the length of the area where the center position is located, and the fourth coordinate, the width of the area where the center position is located are the first coordinate, the second coordinate, the length of the area where the center position is located, and the fourth coordinate.
Thus, the position attribute of each second element can be accurately calculated by applying the present embodiment.
In the second case, when the position attributes of the respective elements included in the poster to be generated are obtained, the position attributes of the respective elements in the poster to be generated can be directly determined.
In the third case: when the position attributes of the respective elements contained in the poster to be generated are not obtained, in this case, the position attributes of the respective second elements may be determined at random.
S103, determining the positions of the first element and the second element contained in the poster to be generated according to the obtained position attributes of the first element and the second element.
After the position attributes of the first element and the second element are determined, due to the problems of calculation errors and the like, the positions of the position attribute representations of the first element and the second element are overlapped, and on the basis that the personalized requirements of a user are met, the generated poster to be generated is more attractive. The positions of the obtained position attribute representations of the first element and the second element can be finely adjusted, and the positions of the first element and the second element contained in the poster to be generated are determined.
Determining the positions of the first element and the second element contained in the poster to be generated according to the obtained position attributes of the first element and the second element can be referred to in an embodiment corresponding to fig. 3, and details will not be provided here.
S104: the color matching attributes of the remaining elements are determined based on the determined positions and the color matching attributes of the existing color matching elements.
The existing color matching elements are as follows: the elements contained in the poster to be generated are the elements with the color matching attributes preset, and the rest elements are as follows: and generating elements except the existing color matching elements in the elements contained in the poster to be generated.
Since the poster to be generated may include some elements that themselves have color matching properties, for example: pictures, etc., and may also include some elements that do not themselves have color matching properties, such as: text, background, etc. And because the user requires that each element on the poster has the color matching attribute, the generated poster is more visually attractive, and then the color matching attribute of the element which does not have the color matching attribute can be calculated according to the color matching attribute of the element which already has the color matching attribute.
There are a number of implementations for determining the color matching attributes of the remaining elements based on the determined position and the color matching attributes of the existing color matching elements. Specifically, the color matching attributes of the remaining elements may be determined according to the distance between the elements, that is, the distance relationship and the color matching attributes of the existing color matching elements. For example: the positions of the element a and the element B in the poster to be generated are relatively close, and the color of the element a is green, so that the color of the element B is relatively harmonious in the same region, and the color of the element B can be determined to be the same as or similar to that of the element a, such as light green, dark green, and the like.
In one embodiment of the invention, the color matching attributes of the remaining elements may be determined according to the following steps B1-B3:
step B1: and determining the color system of the poster to be generated according to the color matching attributes of the existing color matching elements, and obtaining the color distribution information of the poster to be generated.
Specifically, the color information of the existing color matching elements represented by the color matching attributes of the existing color matching elements can be counted to determine the color system of the poster to be generated. For example: if the color information of each existing color matching element is black, gray, blue and the like, determining that the color system of the poster to be generated is a cold color system; if the color information of each existing color matching element is red, yellow, orange and the like, the color system of the poster to be generated can be determined to be a warm color system; if the color information of each existing color matching element is red, yellow, gray, black and the like, the color system of the poster to be generated can be determined to be an intermediate color system.
The color distribution information reflects the composition distribution of each color information in the poster to be generated. By counting the color information represented by the color matching attributes of the existing color matching elements, the color types of the existing color matching elements and the frequency of occurrence of various colors can be obtained.
Step B2: and determining a saliency area of the poster to be generated according to the determined position.
The saliency area of the poster to be generated can be understood as an area which is obvious in the poster to be generated and is easy to attract the attention of a user.
There are various implementations for determining the prominence region of the poster to be generated based on the determined location. Specifically, the method comprises the following steps: the saliency area of the poster to be generated may be determined according to the area where the determined position is located on the poster to be generated, for example: when the position of the element is detected to be in the middle position of the poster to be generated, the area where the element is located can be determined as the saliency area of the poster to be generated. The saliency area of the poster to be generated can also be determined by the position of each element in the foreground or background of the poster to be generated, for example: when the element is identified to be located in the foreground of the poster to be generated, the area where the element is located can be determined as the saliency area of the poster to be generated.
Step B3: and determining the color matching attributes of the rest elements according to the color system, the color distribution information and the saliency areas.
Specifically, when determining the color matching attributes of the remaining elements, the color system to which the color information represented by the color matching attributes of the remaining elements belongs may be determined according to the color system. And according to the color distribution information and the saliency areas, obtaining the color matching attributes of the rest elements in the determined color system.
In the above-mentioned color system, according to the color distribution information and the saliency region, there may be a plurality of implementation manners for obtaining the color matching attributes of the remaining elements: the color matching attributes of the remaining elements may be obtained according to the color distribution range reflected by the color distribution information. For example: according to the wide red distribution range reflected by the color distribution information and located in the saliency region, when the position attributes of the remaining elements represent that the positions of the remaining elements are located in the saliency region, in order to coordinate color matching of the saliency region, the color matching attributes of the remaining elements may be determined to be deep red and light red. The dominant hue of the poster to be generated may also be reflected in accordance with the color distribution information, for example: the maximum distribution range of the red, yellow and blue colors is obtained according to the color distribution information, and the color matching attribute of the rest elements can be determined to be the same as or similar to any one of the red, yellow and blue colors.
S105: and generating a poster to be generated according to the first element and the second element after the typesetting and the color configuration.
The typesetting is as follows: typesetting the first element and the second element in the poster to be generated according to the determined positions of the first element and the second element in the poster to be generated, wherein the configuration colors are as follows: and configuring the colors of the first element and the second element according to the determined color attributes of the first element and the second element in the poster to be generated.
When the poster to be generated is generated according to the first element and the second element after the typesetting and the color configuration, because the determined position of the second element and the color matching attributes of the other elements may not be unique, the poster to be generated according to the method has a plurality of different posters. The execution body of the embodiment of the invention can send a plurality of posters to the user interface so that the user can select a favorite poster.
As can be seen from the above description, when a poster is generated by applying the scheme provided by the embodiment of the present invention, the position attribute of the second element is determined according to the position attribute of the first element, so that the position of each element included in the poster to be generated is determined according to the position attributes of the first element and the second element, and the position attribute of the first element is determined according to the requirement of a user for the poster to be generated, so that the position corresponding to the first element in the poster to be generated can be determined according to the requirement of the user. In this way, the generated poster can fully meet the personalized requirements of the user.
In addition, in determining the second elements contained in the poster, a position attribute of each of the second elements is determined in accordance with the position attribute of the first element. Therefore, the position of the second element in the poster to be generated can be determined on the basis of meeting the personalized requirements of the user, and the poster to be generated is further generated. Compared with the prior art, the poster is generated according to the determined element position, and the poster generation efficiency is improved.
Referring to fig. 2, fig. 2 is a schematic flow chart of a second poster generation method according to an embodiment of the present invention, where the method includes S101A-S101B based on S101.
S101A: and determining the elements contained in the poster to be generated according to the pre-generated poster template with the tree structure, and obtaining the determined elements.
The poster template may include: the poster contains information of the element, which may be an identification of the element, a type of the element, etc., and a location attribute of the element. But may also include basic information such as poster size.
Before generating the poster to be generated, the user may input information related to the poster to be generated to the terminal device, and the terminal device stores the information input by the user in the poster template of the tree structure.
When generating the poster to be generated, the terminal device may determine, according to the information of the elements stored in the poster template, the element type of the element contained in the poster to be generated, for example: the element types may include element types such as pictures, text, backgrounds, and the like. Displaying an input box of the element type in the user interaction interface according to the determined element type, so that the user can input the element of the corresponding type in the input box of the element type.
S101B: and obtaining the position attribute of the first element contained in the poster to be generated according to the position attribute included in the poster template.
Since the position attribute of an element can be expressed in both an absolute position and a relative position, there may be a case where the absolute position and the relative position of one element conflict due to user carelessness or the like.
There may be many situations for the above-mentioned position conflict, which may be the existence of a position conflict between the element position and an alternative area of the poster, for example: the area of the position of the element A is larger than or equal to the alternative area of the poster where the element can be placed, and the position of the element A is considered to be in position conflict with the alternative area of the poster. It may also be that there is a position conflict between the positions of the various elements. For example: the absolute position attribute of element a is (100,200) and the absolute position attribute of element B is (300,200), where the first number in parentheses represents the abscissa of the element position and the second number represents the ordinate of the element position. And the requirement element B is located at the left side of the element a, since the requirement cannot be satisfied at the same time, it can be considered that there is a position conflict between the positions of the element a and the element B.
In one embodiment of the present invention, obtaining the position attribute of the first element contained in the poster to be generated according to the position attribute included in the poster template can also be realized in the following manner.
Judging whether position conflicts exist in the element positions represented by the position attributes included in the poster template; and if not, determining the position attribute included by the poster template as the position attribute of the element contained in the poster to be generated, and if so, feeding back position conflict information to the user.
For example: and assuming that the poster to be generated contains an element A, an element B and an element C, and taking the upper left corner of the poster as a coordinate origin.
If the position attribute of the element A characterizes the position of the element A as (100,200), the position attribute of the element B characterizes the position of the element B as (100,300), and the element B is below the element A. It may be determined that there is no conflict between the location attributes of element a and element B, and the location attribute included in the poster template may be determined to be the location attribute of the element contained in the poster to be generated.
If the position attribute of the element C characterizes the position of the element C as (50,200), and the element C is positioned at the right side of the element A. If the position attributes of the element a and the element C are determined to be in conflict, the conflict information is fed back to the user, for example, the conflict information may be displayed on the user interaction interface, and an error sound may be sounded to the user. Thus, the embodiment can timely monitor the situation that the position attributes of the elements conflict due to the fact that the user considers the elements carelessly.
As can be seen from the above, in the scheme provided by this embodiment, the element information of the poster to be generated and the position attribute of the element are stored in the pre-established template, and the position attribute of the element is established according to the requirement of the user on the poster to be generated, so that the element can meet the requirement of the user at the position corresponding to the poster to be generated.
Referring to fig. 3, fig. 3 is a schematic flow chart of a third poster generation method provided in an embodiment of the present invention, and the above-mentioned S103 may be implemented according to S103A to S103D.
S103A: and determining the typesetting mode of the elements contained in the poster to be generated according to the position attributes of the first element and the second element.
The typesetting mode of the elements can be understood as an overall style for describing the types of the elements, the positions of the elements in the poster to be generated and the relative positions between the elements. For example: referring to fig. 4, a diagram of the layout of an element is shown. In fig. 4, four small rectangles represent 4 elements in the poster to be generated, and the positions of the elements in the poster to be generated and the relative positions between the elements can be seen from the figure.
The types of the above elements may be: pictures, text, background, etc.
For example: the element A, the element B and the element C contained in the poster to be generated are used as pictures, the element B is a text and the element C is a background, the element C is used as the background, the absolute position attribute of the element A is (100 ) and the relative position attribute of the element B is positioned on the left side of the element A, and the typesetting modes of the element A, the element B and the element C can be determined according to the position attributes of the element A and the element B and the type of the element C.
In one embodiment of the invention, the determination of the typesetting mode of the elements contained in the poster to be generated according to the position attributes of the first element and the second element can be realized in the following manner
Judging whether the position attribute of each first element and the element position represented by the position attribute of the second element have an overlapping area or not; if so, adjusting the position attribute of each element with the element position overlapping area, so that the element position represented by the adjusted position attribute has no overlapping area.
Specifically, IoU (interaction-over-interaction) may be used to perform overlap detection on the element positions represented by the position attribute of each first element and the position attribute of each second element.
In one embodiment of the invention, overlay detection may be performed based on the absolute position attribute of the element. For example: the absolute position attribute of the element A is (100 ), the first coordinate and the second coordinate in the brackets represent the initial abscissa and the initial ordinate of the element, and the third coordinate and the fourth coordinate in the brackets represent the width and the height of the area where the element is located. The absolute position attribute of the element B is (100, 50,50), and an overlapping region between the positions of the two elements can be detected based on the absolute position attributes of the element a and the element B. Overlap detection can also be performed based on the relative position attributes of the elements, for example: the element A is positioned at the left side of the element B and is adjacent to the element B in position, the element C is also positioned at the left side of the element B and is adjacent to the element B in position, and the overlapping area can be detected according to the relative position attributes of the element A, the element B and the element C. Of course, overlap detection may also be performed based on the absolute position attribute and the relative position attribute of the element.
If the overlapping region is detected, a position optimization method such as simulated annealing and the like can be adopted, and a position attribute of each element can be adjusted by adopting a random position adjustment method.
In an embodiment of the present invention, if there is no overlapping area in the element positions represented by the position attribute of each of the first elements and the position attribute of the second element, the position attribute of the element does not need to be adjusted.
In this way, the application of the scheme provided by the embodiment can determine the elements for which the position attributes are not obtained, and after the position attributes of the respective elements are determined, the positions of the respective elements in the poster to be generated are ensured not to be overlapped by adjusting the position attributes of the respective elements, so that the respective elements can be completely displayed in the poster.
S103B: and adopting a pre-trained poster aesthetic feeling evaluation network model to carry out aesthetic feeling evaluation on the typesetting mode to obtain an evaluation result.
The poster aesthetic feeling evaluation network model comprises the following steps: and training a preset neural network model by taking the sample typesetting mode as model input and the sample evaluation result as a training reference, and obtaining the model which is used for performing aesthetic evaluation on the element typesetting mode.
The sample evaluation result is obtained by performing statistics on aesthetic feeling evaluation on the sample typesetting modes by a plurality of sample users.
When the poster aesthetic feeling evaluation network model is trained, a large number of typesetting modes can be collected in advance to serve as sample typesetting modes, then a large number of sample users carry out aesthetic feeling evaluation on the sample typesetting modes, and evaluation results of the sample users on the sample typesetting modes are obtained. Thus, a plurality of evaluation results can be obtained for each sample typesetting mode, the plurality of evaluation results are counted, and the statistical result can be used as the sample evaluation result of the sample typesetting mode. The sample evaluation result is obtained by integrating the evaluation results of a large number of sample users, so that the aesthetic feeling of the public on the sample typesetting mode can be reflected, and the sample evaluation result can be used as the reference evaluation result of the sample typesetting mode.
After obtaining the sample layout mode and the sample evaluation result, the sample layout mode may be input into the initial model of the poster aesthetic feeling evaluation network model to obtain an aesthetic feeling evaluation result, the obtained aesthetic feeling evaluation result is compared with the sample evaluation result, and the model parameters of the initial model are adjusted according to the difference between the two results, so that the initial model tends to converge, thereby obtaining the aesthetic feeling evaluation network model. Therefore, the model can learn the typesetting rules of various typesetting modes with high aesthetic evaluation from the sample typesetting modes.
S103C: and adjusting the position attribute according to the evaluation result.
Specifically, the evaluation result reflects the aesthetic degree of the current typesetting mode, if the evaluation result is low, the current typesetting mode is represented to be less attractive, and the position attribute can be greatly adjusted; if the grading result is higher, the current typesetting mode is more attractive, and the position attribute can be finely adjusted.
A specific implementation manner of adjusting the position attribute according to the evaluation result may refer to the embodiment corresponding to fig. 5, and will not be described in detail here.
S103D: and determining the position of the element contained in the poster to be generated according to the adjusted position attribute.
Since the position attribute is used for representing the position, the position of the element contained in the poster to be generated can be determined according to the adjusted position attribute.
As can be seen from the above, in the scheme provided by this embodiment, the layout mode is evaluated by using the poster aesthetic feeling evaluation network model, and the position attributes of each element are adjusted according to the evaluation result, so that the layout mode of the elements contained in the poster to be generated is more beautiful.
Referring to fig. 5, fig. 5 is a schematic flow chart of a method for adjusting a location attribute according to an embodiment of the present invention, where in this embodiment, the step S103C mentioned above adjusts the location attribute according to the evaluation result, and the method can be implemented by the following steps S501 to S503.
S501: and calculating the loss value of the evaluation result according to the evaluation result and a preset loss value calculation rule.
The preset loss value calculation rule is used for defining the corresponding relation between the evaluation result and the loss value. Specifically, the correspondence relationship may be summarized by a developer according to an experimental result. For example, the above correspondence relationship may be a negative correlation relationship, that is, the higher the value of the evaluation result, the better the evaluation result, the smaller the loss value, and conversely, the lower the value of the evaluation result, the worse the evaluation result, the larger the loss value. For example, if the evaluation result takes a value of 9, the loss value corresponding to the evaluation result may be 10, and if the evaluation result takes a value of 2, the loss value corresponding to the evaluation result may be 70.
When the corresponding relationship is a negative correlation relationship, the evaluation result and the loss value may be linearly or nonlinearly negatively correlated. The present embodiments are described only by way of examples, and are not intended to limit the present embodiments.
S502: and determining the adjustment direction of the position attribute according to the loss value.
When the poster aesthetics evaluation network model is used to obtain the evaluation result, and after the position attribute is adjusted according to the evaluation result, the poster aesthetics evaluation network model is used again to evaluate the layout style determined by the adjusted position attribute, the evaluation result may not necessarily meet the requirement of the user on the aesthetics of the layout style, and for this specific application, the position attribute of the element may need to be repeatedly adjusted according to the above steps S103A-S103C.
In addition, each time the layout method is evaluated using the poster aesthetics evaluation network model, the evaluation result may be higher than the previous evaluation result, indicating that the adjustment direction is correct, or lower than the previous evaluation result, indicating that the adjustment direction is wrong, for example, a reverse adjustment may be performed.
In view of the above, in one embodiment of the present invention, when determining the adjustment direction of the position attribute based on the loss value, the adjustment direction at the present time of the position attribute adjustment may be determined in consideration of the loss value, the previous evaluation result, the loss value at the previous time of the position attribute adjustment, and the adjustment direction at the previous time of the position attribute adjustment.
For example: when the typesetting mode input for the first time is evaluated, the evaluation result is represented by a ten-degree score, the first-time evaluation result is 1 score, the current typesetting mode input for the branch is not attractive, the loss value of the first-time evaluation result is 20, the adjusting direction of the first-time position attribute can be randomly determined, and the position attribute of the element can be adjusted according to the adjusting direction. When the layout mode after the first adjustment is evaluated, the evaluation result is 5 points, the loss value of the evaluation result is 15, and since the loss value of the current evaluation result is reduced compared with the loss value of the first evaluation result and the current evaluation result is increased compared with the first evaluation result, it indicates that the adjustment direction of the first position attribute is correct, and at this time, the position attribute of the element can be continuously adjusted according to the second adjustment direction.
S503: and adjusting the position attribute according to the adjusting direction.
As can be seen from the above, with the position attribute adjusting method provided in this embodiment, the adjusting direction of the position attribute is determined in real time according to the evaluation result loss value of the poster aesthetics evaluation, and the determined adjusting direction can meet the requirement of the poster aesthetics evaluation model, so that the typesetting manner formed by the element positions represented by the adjusted position attribute is more beautiful.
Corresponding to the poster generation method, the embodiment of the invention also provides a poster generation device.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a first poster generation apparatus provided in an embodiment of the present invention, where the apparatus includes:
an element and position attribute obtaining module 601, configured to obtain the elements included in the poster to be generated, and obtain the position attribute of the first element determined according to the requirement of the user for the poster to be generated
A location attribute determining module 602, configured to determine, according to the obtained location attribute of the first element, a location attribute of each second element, where the second elements are: elements except the first element in the elements contained in the poster to be generated;
a position determining module 603, configured to determine, according to the obtained position attributes of the first element and the second element, positions of the first element and the second element included in the poster to be generated;
a color matching attribute determining module 604, configured to determine color matching attributes of the remaining elements according to the determined position and color matching attributes of existing color matching elements, where the existing color matching elements are: the poster to be generated comprises elements which are preset with color matching attributes, and the rest elements are as follows: elements except the existing color matching elements in the elements contained in the poster to be generated;
a poster generating module 605, configured to generate the poster to be generated according to the first element and the second element after the composition and the configuration of the color, where the composition is: typesetting the first element and the second element in the poster to be generated according to the determined positions of the first element and the second element in the poster to be generated, wherein the configuration color is as follows: and configuring the colors of the first element and the second element according to the determined color attributes of the first element and the second element in the poster to be generated.
As can be seen from the above description, when a poster is generated by applying the scheme provided by the embodiment of the present invention, the position attribute of the second element is determined according to the position attribute of the first element, so that the position of each element included in the poster to be generated is determined according to the position attributes of the first element and the second element, and the position attribute of the first element is determined according to the requirement of a user for the poster to be generated, so that the position corresponding to the first element in the poster to be generated can be determined according to the requirement of the user. In this way, the generated poster can fully meet the personalized requirements of the user.
In addition, in determining the second elements contained in the poster, a position attribute of each of the second elements is determined in accordance with the position attribute of the first element. Therefore, the position of the second element in the poster to be generated can be determined on the basis of meeting the personalized requirements of the user, and the poster to be generated is further generated. Compared with the prior art, the poster is generated according to the determined element position, and the poster generation efficiency is improved.
In an embodiment of the invention, the location attribute determining module 602 includes:
a candidate region calculation submodule, configured to calculate a candidate region Q' according to the following expression according to the obtained position attribute of the first element:
Figure BDA0002342653520000201
wherein Q denotes the poster area of the poster to be generated, PiRepresenting the area of the ith first element in the poster to be generated, n representing the total number of the first elements, and i representing the sequence number of the first elements;
the area determining submodule is used for determining the area where each second element is located in the alternative area;
and the position attribute calculation submodule is used for calculating the position attribute of each second element according to the determined area where each second element is located.
Thus, the position attribute of each second element can be accurately calculated by applying the present embodiment.
In an embodiment of the present invention, the area determination submodule is specifically configured to:
and determining the area where each second element is located according to the element type of each second element and the corresponding relation between the preset element type of the element and the area where the element is located.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a second poster generating apparatus according to an embodiment of the present invention, where the element and position attribute obtaining module 601 includes:
an element determining unit 601A, configured to determine, according to a pre-generated poster template with a tree structure, an element included in a poster to be generated, and obtain the determined element, where the poster template includes: the poster contains information of the elements and location attributes of the elements.
And the position attribute determining unit 601B is used for obtaining the position attribute of the element contained in the poster to be generated according to the position attribute included in the poster template.
As can be seen from the above, in the scheme provided by this embodiment, the element information of the poster to be generated and the position attribute of the element are stored in the pre-established template, and the position attribute of the element is established according to the requirement of the user on the poster to be generated, so that the element can meet the requirement of the user at the position corresponding to the poster to be generated.
In an embodiment of the present invention, the location attribute determining unit 601B is specifically configured to:
judging whether position conflicts exist in the element positions represented by the position attributes included in the poster template; if not, determining the position attribute included in the poster template as the position attribute of the element contained in the poster to be generated; if so, feeding back the position conflict information to the user.
Thus, the embodiment can timely monitor the situation that the position attributes of the elements conflict due to the fact that the user considers the elements carelessly.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a third poster generating apparatus according to an embodiment of the present invention, and the position determining module 603 includes:
the layout mode determining unit 603A is configured to determine, according to the position attribute, a layout mode of an element included in the poster to be generated.
An evaluation result obtaining unit 603B, configured to perform aesthetic evaluation on the layout mode by using a pre-trained poster aesthetic feeling evaluation network model, and obtain an evaluation result, where the poster aesthetic feeling evaluation network model is: and training a preset neural network model by taking the sample typesetting mode as model input and taking the sample evaluation result as a training reference, wherein the model is obtained by training the preset neural network model and is used for carrying out aesthetic feeling evaluation on the typesetting mode of the elements, and the sample evaluation result is obtained by counting the results of the aesthetic feeling evaluation of the sample typesetting mode by a plurality of sample users.
And a position attribute adjusting unit 603C configured to adjust the position attribute according to the evaluation result.
And a position determining unit 603D, configured to determine, according to the adjusted position attribute, a position of an element included in the poster to be generated.
As can be seen from the above, in the scheme provided by this embodiment, the layout mode is evaluated by using the poster aesthetic feeling evaluation network model, and the position attributes of each element are adjusted according to the evaluation result, so that the layout mode of the elements contained in the poster to be generated is more beautiful.
In an embodiment of the present invention, the layout mode determining unit 603A includes:
and the overlapping area judging unit is used for judging whether the position attribute of each first element and the element position represented by the position attribute of the second element have overlapping areas. If so, triggering the position attribute adjusting unit.
And the position attribute adjusting unit is used for adjusting the position attribute of each element of which the element position has the overlapping area, so that the element position represented by the adjusted position attribute does not have the overlapping area.
In this way, the application of the scheme provided by the embodiment can determine the elements for which the position attributes are not obtained, and after the position attributes of the respective elements are determined, the positions of the respective elements in the poster to be generated are ensured not to be overlapped by adjusting the position attributes of the respective elements, so that the respective elements can be completely displayed in the poster.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a position attribute adjusting unit according to an embodiment of the present invention, where the position attribute adjusting unit 603C includes:
and a loss value operator unit 901, configured to calculate a loss value of the evaluation result according to the evaluation result and a preset loss value calculation rule.
An adjustment direction determining subunit 902, configured to determine an adjustment direction of the position attribute according to the loss value.
And a position attribute adjusting subunit 903, configured to adjust the position attribute according to the adjustment direction.
As can be seen from the above, with the position attribute adjusting method provided in this embodiment, the adjusting direction of the position attribute is determined in real time according to the evaluation result loss value of the poster aesthetics evaluation, and the determined adjusting direction can meet the requirement of the poster aesthetics evaluation model, so that the typesetting manner formed by the element positions represented by the adjusted position attribute is more beautiful.
In an embodiment of the present invention, the color matching attribute determining module 604 includes:
and the color system determining unit is used for determining the color system of the poster to be generated according to the color matching attributes of the existing color matching elements and obtaining the color distribution information of the poster to be generated.
And the saliency area determination unit is used for determining the saliency area of the poster to be generated according to the determined position.
And the color matching attribute determining unit is used for determining the color matching attributes of the rest elements according to the color system, the color distribution information and the saliency areas.
Thus, the color matching attributes of the elements of the poster to be generated can be determined by applying the embodiment.
Corresponding to the poster generation method, the embodiment of the invention also provides terminal equipment.
Referring to fig. 10, fig. 10 is a terminal device according to an embodiment of the present invention, which includes a processor 1001, a communication interface 1002, a memory 1003, and a communication bus 1004, where the processor 1001, the communication interface 1002, and the memory 1003 complete mutual communication through the communication bus 1004,
a memory 1003 for storing a computer program;
the processor 1001 is configured to implement the poster generation method according to the embodiment of the present invention when executing the program stored in the memory 1003.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In still another embodiment provided by the present invention, there is also provided a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the poster generation method provided by the embodiment of the present invention.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to carry out the poster generation method provided by an embodiment of the present invention when executed.
As can be seen from the above description, when a poster is generated by applying the scheme provided by the embodiment of the present invention, the position attribute of the second element is determined according to the position attribute of the first element, so that the position of each element included in the poster to be generated is determined according to the position attributes of the first element and the second element, and the position attribute of the first element is determined according to the requirement of a user for the poster to be generated, so that the position corresponding to the first element in the poster to be generated can be determined according to the requirement of the user. In this way, the generated poster can fully meet the personalized requirements of the user.
In addition, in determining the second elements contained in the poster, a position attribute of each of the second elements is determined in accordance with the position attribute of the first element. Therefore, the position of the second element in the poster to be generated can be determined on the basis of meeting the personalized requirements of the user, and the poster to be generated is further generated. Compared with the prior art, the poster is generated according to the determined element position, and the poster generation efficiency is improved.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the embodiments of the apparatus, the terminal device, and the computer-readable storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and for the relevant points, reference may be made to the partial description of the embodiments of the method.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (11)

1. A poster generation method, characterized in that the method comprises:
obtaining elements contained in the poster to be generated, and obtaining a position attribute of a first element determined according to the requirement of a user for the poster to be generated;
determining the position attribute of each second element according to the obtained position attribute of the first element, wherein the second elements are as follows: elements except the first element in the elements contained in the poster to be generated;
determining the positions of the first element and the second element contained in the poster to be generated according to the obtained position attributes of the first element and the second element;
determining color matching attributes of the other elements according to the determined position and the color matching attributes of the existing color matching elements, wherein the existing color matching elements are as follows: the poster to be generated comprises elements which are preset with color matching attributes, and the rest elements are as follows: elements except the existing color matching elements in the elements contained in the poster to be generated;
generating the poster to be generated according to the first element and the second element after typesetting and configuring the colors, wherein the typesetting is as follows: in the poster to be generated, typesetting the first element and the second element according to the determined positions of the first element and the second element in the poster to be generated, wherein the configuration color is as follows: and configuring the colors of the first element and the second element in the poster to be generated according to the determined color attributes of the first element and the second element.
2. The method of claim 1, wherein determining the location attribute of each second element according to the obtained location attribute of the first element comprises:
calculating a candidate region Q' according to the obtained position attribute of the first element by the following expression:
Figure FDA0002342653510000011
wherein Q denotes the poster area of the poster to be generated, PiRepresenting the area of the ith first element in the poster to be generated, n representing the total number of the first elements, and i representing the sequence number of the first elements;
determining the area where each second element is located in the alternative area;
and calculating the position attribute of each second element according to the determined area where each second element is located.
3. The method of claim 2, wherein determining the area of each second element in the alternative area comprises:
and determining the area where each second element is located according to the element type of each second element and the corresponding relation between the preset element type of the element and the area where the element is located.
4. The method of claim 1, wherein the obtaining the elements contained in the poster to be generated and obtaining the location attribute of the first element determined by the user's requirements for the poster to be generated comprises:
determining elements contained in a poster to be generated according to a pre-generated poster template with a tree structure, and obtaining the determined elements, wherein the poster template comprises: information of elements contained in the poster and position attributes of the elements;
and obtaining the position attribute of the first element contained in the poster to be generated according to the position attribute included in the poster template.
5. The method of claim 4, wherein obtaining the location attribute of the first element contained in the poster to be generated according to the location attribute included in the poster template comprises:
judging whether a position conflict exists in a first element position represented by the position attribute included in the poster template;
if not, determining the position attribute included in the poster template as the position attribute of the first element included in the poster to be generated;
if so, feeding back the position conflict information to the user.
6. The method of any one of claims 1-5, wherein the determining, from the position attributes of the first element and the second element, a position of each element contained in the poster to be generated comprises:
determining the typesetting mode of the elements contained in the poster to be generated according to the position attributes of the first element and the second element;
adopting the poster aesthetic feeling evaluation network model trained in advance, right the typesetting mode is subjected to aesthetic feeling evaluation to obtain an evaluation result, wherein the poster aesthetic feeling evaluation network model is as follows: the method comprises the steps that a sample typesetting mode is used as model input, a sample evaluation result is used as a training reference, a preset neural network model is trained to obtain a model which is used for carrying out aesthetic feeling evaluation on the typesetting mode of elements, and the sample evaluation result is obtained by counting results of the aesthetic feeling evaluation of a plurality of sample users on the sample typesetting mode;
adjusting the position attributes of the first element and the second element according to the evaluation result;
and determining the position of each element contained in the poster to be generated according to the adjusted position attribute.
7. The method according to claim 6, wherein the determining the layout mode of the elements contained in the poster to be generated according to the position attributes of the first element and the second element comprises:
judging whether the position attribute of each first element and the element position represented by the position attribute of the second element have an overlapping area or not;
if so, adjusting the position attribute of each element with the element position overlapping area, so that the element position represented by the adjusted position attribute has no overlapping area.
8. The method of claim 6, wherein said adjusting the location attribute according to the evaluation comprises:
calculating the loss value of the evaluation result according to the evaluation result and a preset loss value calculation rule;
determining the adjustment direction of the position attribute according to the loss value;
and adjusting the position attribute according to the adjusting direction.
9. The method of any of claims 1-6, wherein determining the color matching attributes of the remaining elements based on the determined positions and the color matching attributes of existing color matching elements comprises:
determining a color system of the poster to be generated according to the color matching attributes of the existing color matching elements, and obtaining the color distribution information of the poster to be generated;
determining a saliency region of the poster to be generated according to the determined position;
and determining the color matching attributes of the rest elements according to the color system, the color distribution information and the saliency areas.
10. A poster generating apparatus, characterized in that the apparatus comprises:
the element and position attribute obtaining module is used for obtaining elements contained in the poster to be generated and obtaining the position attribute of the first element determined according to the requirement of a user for the poster to be generated;
a position attribute determining module, configured to determine a position attribute of each second element according to the obtained position attribute of the first element, where the second element is: elements except the first element in the elements contained in the poster to be generated;
a position determining module, configured to determine, according to the obtained position attributes of the first element and the second element, positions of the first element and the second element included in the poster to be generated;
and the color matching attribute determination module is used for determining the color matching attributes of the other elements according to the determined position and the color matching attributes of the existing color matching elements, wherein the existing color matching elements are as follows: the poster to be generated comprises elements which are preset with color matching attributes, and the rest elements are as follows: elements except the existing color matching elements in the elements contained in the poster to be generated;
the poster generation module is used for generating the poster to be generated according to the first element and the second element after the typesetting and the color configuration, wherein the typesetting is as follows: in the poster to be generated, typesetting the first element and the second element according to the determined positions of the first element and the second element in the poster to be generated, wherein the configuration color is as follows: and configuring the colors of the first element and the second element according to the determined color attributes of the first element and the second element in the poster to be generated.
11. The terminal equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-9 when executing a program stored in the memory.
CN201911382558.XA 2019-12-27 2019-12-27 Poster generation method and device Pending CN111145310A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911382558.XA CN111145310A (en) 2019-12-27 2019-12-27 Poster generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911382558.XA CN111145310A (en) 2019-12-27 2019-12-27 Poster generation method and device

Publications (1)

Publication Number Publication Date
CN111145310A true CN111145310A (en) 2020-05-12

Family

ID=70521207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911382558.XA Pending CN111145310A (en) 2019-12-27 2019-12-27 Poster generation method and device

Country Status (1)

Country Link
CN (1) CN111145310A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105654534A (en) * 2015-12-29 2016-06-08 南京大学 Academic poster automatic composition generation method
CN108416826A (en) * 2018-02-07 2018-08-17 李荣陆 A kind of planar design Automatic color matching device
CN109756783A (en) * 2017-11-07 2019-05-14 上海全土豆文化传播有限公司 The generation method and device of poster
CN109978836A (en) * 2019-03-06 2019-07-05 华南理工大学 User individual image esthetic evaluation method, system, medium and equipment based on meta learning
CN110060317A (en) * 2019-03-16 2019-07-26 平安城市建设科技(深圳)有限公司 Poster method of automatic configuration, equipment, storage medium and device
CN110472222A (en) * 2019-08-22 2019-11-19 宁波奥克斯电气股份有限公司 Automatic composing method, device, electronic equipment and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105654534A (en) * 2015-12-29 2016-06-08 南京大学 Academic poster automatic composition generation method
CN109756783A (en) * 2017-11-07 2019-05-14 上海全土豆文化传播有限公司 The generation method and device of poster
CN108416826A (en) * 2018-02-07 2018-08-17 李荣陆 A kind of planar design Automatic color matching device
CN109978836A (en) * 2019-03-06 2019-07-05 华南理工大学 User individual image esthetic evaluation method, system, medium and equipment based on meta learning
CN110060317A (en) * 2019-03-16 2019-07-26 平安城市建设科技(深圳)有限公司 Poster method of automatic configuration, equipment, storage medium and device
CN110472222A (en) * 2019-08-22 2019-11-19 宁波奥克斯电气股份有限公司 Automatic composing method, device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US10579737B2 (en) Natural language image editing annotation framework
JP4572669B2 (en) Layout rule generation system, layout system, layout rule generation method, and layout rule generation program
CN106648319B (en) Operation method and device for mind map
CN109461167A (en) The training method of image processing model scratches drawing method, device, medium and terminal
CN108492294B (en) Method and device for evaluating harmony degree of image colors
CN110874618B (en) OCR template learning method and device based on small sample, electronic equipment and medium
WO2021135945A1 (en) Image processing method and apparatus, storage medium, and electronic device
US20190114780A1 (en) Systems and methods for detection of significant and attractive components in digital images
CN111741327B (en) Media processing method and media server
CN111639527A (en) English handwritten text recognition method and device, electronic equipment and storage medium
WO2020244074A1 (en) Expression interaction method and apparatus, computer device, and readable storage medium
CN112150347B (en) Image modification patterns learned from a limited set of modified images
KR102111720B1 (en) Method for design recommending using cloud literary work analysis
US20200320165A1 (en) Techniques for generating templates from reference single page graphic images
CN111274370A (en) Bullet screen answer distribution method based on online question and answer activities, server and storage medium
CN112101231A (en) Learning behavior monitoring method, terminal, small program and server
CN113205024A (en) Engineering drawing preprocessing method and device, electronic equipment and storage medium
CN110728129B (en) Method, device, medium and equipment for typesetting text content in picture
CN111859893A (en) Image-text typesetting method, device, equipment and medium
CN110321882A (en) Learning resource acquisition method and device, learning terminal and storage medium
Anscomb Creating art with AI
CN111145310A (en) Poster generation method and device
CN114708363A (en) Game live broadcast cover generation method and server
JP6892557B2 (en) Learning device, image generator, learning method, image generation method and program
CN111966850A (en) Picture screening method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination