Field-based typesetting method, device, electronic device, and computer-readable medium

Through the field-based layout method, the field template and convolution kernel are used to calculate the element position, and the problem of insufficient aesthetics and reusability of element superposition in the existing technology is solved, and multi-scene adaptation and efficient layout are achieved.

CN112308945BActive Publication Date: 2024-12-27BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011084878.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-12
Publication Date
2024-12-27
Estimated Expiration
2040-10-12

AI Technical Summary

Technical Problem

When the machine generates posters, the parameter layout or parameter modeling method is adapted to a single scenario, lacks universality and intelligence, and cannot effectively deal with the needs of multiple typesetting scenarios, resulting in insufficient aesthetics and reusability when the primitives are superimposed.

Method used

Using a field-based layout method, by creating a field template and calculating the convolution kernel of the element, combining rotation angle sampling and convolution scanning, the position and maximum convolution value between the element are determined, and the sequence is sorted to obtain the optimal layout. Sequence, realizes intelligent stacking of primitives.

Benefits of technology

It improves the versatility of element typesetting and the aesthetics of overlayed images, can be compatible with various typesetting scene requirements, and enhances the reusability and layout effect of element typesetting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112308945B_ABST
    Figure CN112308945B_ABST
Patent Text Reader

Abstract

The present application discloses a field-based layout method and device. A specific implementation of the method includes: creating a field template based on field parameters; obtaining at least one primitive, and calculating the convolution kernel of each primitive in at least one primitive; calculating all permutation sequences of at least one primitive; in response to determining each permutation sequence that meets the layout conditions in all permutation sequences, sequentially performing convolution scans on the convolution kernels of each primitive in the permutation sequence and the convolution kernels of the primitive combination with the field template to obtain the position between each primitive in the permutation sequence, and the maximum convolution value of each primitive and the primitive combination in the permutation sequence; sorting the maximum convolution values ​​of all permutation sequences that meet the layout conditions, and taking the permutation sequence with the largest maximum convolution value in all permutation sequences as the layout sequence of at least one primitive. This implementation improves the aesthetics of the superimposed image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, specifically to the field of computer vision technology, and especially to a field-based typesetting method, device, electronic device, and computer-readable medium. Background Art

[0002] In the process of machine-generated posters, in order to enrich the content and layers of the picture, a stacking method is used to combine multiple graphics elements to generate a pattern, which can increase the reusability of the graphics elements and improve the aesthetics of the picture content. The existing technology generally uses parameter layout or parameter modeling to superimpose graphics elements, but parameter layout or parameter modeling only adapts to a single scene requirement. After the scene is changed, the layout will become invalid, lacking versatility and intelligence. Summary of the invention

[0003] The embodiments of the present disclosure provide a field-based typesetting method, device, electronic device, and computer-readable medium.

[0004] In a first aspect, an embodiment of the present disclosure provides a field-based typesetting method, the method comprising: creating a field template based on field parameters; obtaining at least one primitive, and calculating the convolution kernel of each primitive in the at least one primitive; calculating all permutation sequences of at least one primitive; in response to determining each permutation sequence that satisfies a typesetting condition in all permutation sequences, sequentially convolving the convolution kernel of each primitive in the permutation sequence and the convolution kernel of a combination of primitives with the field template to obtain the position between each primitive in the permutation sequence, and the maximum convolution value of each primitive and the combination of primitives in the permutation sequence; sorting the maximum convolution values ​​of all permutation sequences that satisfy the typesetting condition, and taking the permutation sequence with the largest maximum convolution value among all permutation sequences as the typesetting sequence of at least one primitive.

[0005] In some embodiments, the above-mentioned sequentially convolution scanning of the convolution kernel of each image element in the arrangement sequence and the convolution kernel of the image element combination with the field template to obtain the position between each image element in the arrangement sequence and the maximum convolution value of each image element and the image element combination in the arrangement sequence includes the following steps: convolution scanning of the convolution kernel of the first image element in the arrangement sequence with the field template to obtain the convolution value of the convolution kernel of the first image element in the field template; performing multi-angle value sampling on the first rotation angle of the convolution kernel of the i-th image element, performing convolution scanning of the i-th image element and the first i-1 image element combination with the field template to obtain multiple convolution values, i>1; performing multi-angle value sampling on the second rotation angle of the convolution kernel of the i-th image element combination to obtain multiple convolution values, the i-th image element combination is composed of the i-th image element and the first i-1 image element combination. -1 primitive combinations are combined; based on the convolution values ​​corresponding to the first rotation angle and the second rotation angle, the maximum value of the first rotation angle and the maximum value of the second rotation angle of the ith primitive and the first i-1 primitive combinations relative to the field template are calculated; in response to determining that i≤N, N is the number of primitives in the arrangement sequence, i=i+1 is made, and the maximum value of the first rotation angle and the maximum value of the second rotation angle of the ith primitive and the first i-1 primitive combinations relative to the field template are continued to be calculated; in response to determining that i>N, the position of each primitive in the arrangement sequence is determined by the maximum value of the rotation angle of each primitive and the primitive combination; the maximum convolution value of each primitive and the primitive combination in the arrangement sequence is determined by the maximum value of the rotation angle of each primitive and the primitive combination.

[0006] In some embodiments, the method further includes: removing a combination of the i-th primitive and the first i-1 primitives that has a hole.

[0007] In some embodiments, the above-mentioned maximum convolution value based on all arrangement sequences that meet the arrangement condition is used to obtain the arrangement sequence of at least one primitive, including:

[0008] The maximum convolution values ​​of all permutation sequences that meet the layout conditions are sorted, and the permutation sequence with the largest maximum convolution value among all permutation sequences is taken as the layout sequence of at least one primitive.

[0009] In some embodiments, the above-mentioned creation of a field template based on field parameters includes: establishing a single field template or a multi-field template based on the field strength line shape and field strength coefficient input by the user, and the multi-field template is obtained by weighted summation of at least two single field templates.

[0010] In some embodiments, the above-mentioned calculation of all arrangement sequences of graphics elements in at least one graphics element includes: calculating the similarity between each graphics element in at least one graphics element, and obtaining the arrangement sequence based on the similarity between each graphics element.

[0011] In some embodiments, the above method also includes: calculating the coordinate difference vector of the cells of each graphic element in the typesetting sequence; calculating the magnitude of the repulsive force between the cells of each graphic element in the typesetting sequence; obtaining the total repulsive force of each graphic element based on the coordinate difference vector and the magnitude of the repulsive force; calculating the distance offset value of each graphic element based on the total repulsive force of each graphic element; and updating the position of each graphic element based on the distance offset value of each graphic element.

[0012] In a second aspect, an embodiment of the present disclosure provides a field-based typesetting device, comprising: a creation unit, configured to create a field template based on field parameters; an acquisition unit, configured to acquire at least one primitive; a calculation unit, configured to calculate the convolution kernel of each primitive in at least one primitive; a sorting unit, configured to calculate all permutation sequences of at least one primitive; a scanning unit, configured to, in response to determining each permutation sequence that satisfies a typesetting condition in all permutation sequences, sequentially convolute the convolution kernels of each primitive in the permutation sequence and the convolution kernels of a combination of primitives with the field template to obtain the positions between each primitive in the permutation sequence and the maximum convolution values ​​of each primitive and the combination of primitives in the permutation sequence; a typesetting unit, configured to obtain a typesetting sequence of at least one primitive based on the maximum convolution value of all permutation sequences that satisfy the typesetting condition.

[0013] In some embodiments, the scanning unit includes: an obtaining module, configured to perform a convolution scan on the convolution kernel of the first image element in the arrangement sequence and the field template to obtain a convolution value of the convolution kernel of the first image element in the field template; a scanning module, configured to perform multi-angle value sampling on the first rotation angle of the convolution kernel of the i-th image element, so that the i-th image element and the first i-1 image element combination and the field template are convoluted to obtain multiple convolution values, i>1; a sampling module, configured to perform multi-angle value sampling on the second rotation angle of the convolution kernel of the i-th image element combination to obtain multiple convolution values, the i-th image element combination is obtained by combining the i-th image element and the first i-1 image element combination; a calculation module, configured to calculate the convolution value based on the first rotation angle. The convolution value corresponding to the first rotation angle and the second rotation angle is calculated to obtain the maximum value of the first rotation angle and the maximum value of the second rotation angle of the i-th primitive and the first i-1 primitive combination relative to the field template; the repetition module is configured to respond to the determination that i≤N, N is the number of primitives in the arrangement sequence, so that i=i+1, and trigger the scanning module, the sampling module, and the calculation module to continue working; the determination module is configured to respond to the determination that i>N, and determine the position between each primitive in the arrangement sequence according to the maximum value of the rotation angle of each primitive and the primitive combination; the convolution module is configured to determine the maximum convolution value of each primitive and the primitive combination in the arrangement sequence according to the maximum value of the rotation angle of each primitive and the primitive combination.

[0014] In some embodiments, the above-mentioned apparatus further includes: a removing unit configured to remove a combination having a hole from a combination of the i-th primitive and the first i-1 primitives.

[0015] In some embodiments, the above-mentioned layout unit includes: a sorting module, configured to sort the maximum convolution values ​​of all arrangement sequences that meet the layout conditions; a selection module, configured to take the arrangement sequence with the largest maximum convolution value among all arrangement sequences as the layout sequence of at least one graphic element.

[0016] In some embodiments, the creation unit is further configured to establish a single-field template or a multi-field template based on the field strength line shape and field strength coefficient input by the user, and the multi-field template is obtained by weighted summation of at least two single-field templates.

[0017] In some embodiments, the above-mentioned sorting unit includes: a similarity calculation module, configured to calculate the similarity between each graphic element in at least one graphic element; and a similarity arrangement module, configured to obtain an arrangement sequence based on the similarity between each graphic element.

[0018] In some embodiments, the above apparatus further comprises:

[0019] The vector unit is configured to calculate the coordinate difference vector of the cells of each graphic element in the typesetting sequence; the repulsion unit is configured to calculate the magnitude of the repulsion between the cells of each graphic element in the typesetting sequence; the obtaining unit is configured to obtain the total repulsion of each graphic element based on the coordinate difference vector and the magnitude of the repulsion; the offset unit is configured to calculate the distance offset value of each graphic element based on the total repulsion of each graphic element; the updating unit is configured to update the position of each graphic element based on the distance offset value of each graphic element.

[0020] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.

[0021] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.

[0022] The field-based layout method and device provided by the embodiments of the present disclosure create a field template based on field parameters; obtain at least one primitive and calculate the convolution kernel of each primitive in the at least one primitive; calculate all permutation sequences of at least one primitive; in response to determining each permutation sequence that meets the layout conditions in all permutation sequences, sequentially convolute the convolution kernel of each primitive in the permutation sequence and the convolution kernel of the primitive combination with the field template to obtain the position between each primitive in the permutation sequence and the maximum convolution value of each primitive and the primitive combination in the permutation sequence; sort the maximum convolution values ​​of all permutation sequences that meet the layout conditions, and obtain the layout sequence of at least one primitive based on the maximum convolution value of all permutation sequences that meet the layout conditions. Therefore, the present application enables at least one graphic element to obtain a layout sequence of at least one graphic element and the position of each graphic element in the layout sequence according to the field strength distribution of the field template, so that at least one graphic element can be stacked according to the parameters of the field template. The at least one graphic element can be of any number and shape, and because the design of the field template can be compatible with a variety of layout scene requirements, the versatility of the graphic element layout is improved, and the aesthetics of the superimposed image is also improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0024] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;

[0025] Figure 2 is a flow chart of an embodiment of a field-based typesetting method according to the present disclosure;

[0026] Figure 3 is an example diagram of a circular field template according to the present disclosure;

[0027] Figure 4 is an example diagram of a rectangular field template according to the present disclosure;

[0028] Figure 5 is an example diagram of a hand-drawn field template according to the present disclosure;

[0029] Figure 6 is an example diagram in which the various graphic elements are mutually exclusive according to the present disclosure;

[0030] Figure 7 It is a flowchart of an embodiment of a method for obtaining the position between each primitive in an arrangement sequence, the convolution kernel of each primitive, and the maximum convolution value of the convolution kernel of a primitive combination according to the present disclosure;

[0031] Figure 8is a structural schematic diagram of an embodiment of a field-based typesetting device according to the present disclosure;

[0032] Fig. 9 It is a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION

[0033] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0034] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0035] Figure 1 An exemplary system architecture 100 is shown to which the field-based typography method of the present disclosure may be applied.

[0036] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, and may generally include wireless communication links and the like.

[0037] The terminal devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications, such as instant messaging tools, email clients, etc., may be installed on the terminal devices 101, 102, 103.

[0038] The terminal devices 101, 102, 103 can be hardware or software; when the terminal devices 101, 102, 103 are hardware, they can be user devices with communication, user input window and control functions, and the above user devices can communicate with the server 105 to provide the server 105 with one or more of the field parameters, at least one graphic element and typesetting conditions. When the terminal devices 101, 102, 103 are software, they can be installed in the above user devices; the terminal devices 101, 102, 103 can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or can be implemented as a single software or software module. No specific limitation is made here.

[0039] The server 105 may be a server that provides various services, such as a background server that provides image layout support for the image processing system on the terminal devices 101, 102, and 103. The background server may analyze and process the relevant information of each graphic element in the network, and feed back the processing result (such as the layout result based on the field) to the terminal device.

[0040] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0041] It should be noted that the field-based typesetting method provided in the embodiments of the present disclosure is generally executed by the server 105 .

[0042] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0043] like Figure 2 , shows a process 200 of an embodiment of a field-based typesetting method according to the present disclosure, the field-based typesetting method comprising the following steps:

[0044] Step 201: Create a field template based on field parameters.

[0045] In this embodiment, the field template is a template of field strength distribution. The layout requirements of multiple preset image elements can be determined by the distribution of field strength on the field template. The field template includes a single-field template and a multi-field template. The single-field template is a template composed of field strength lines of a certain shape (for example, Figure 3 The multi-field template may be formed by superimposing at least two single-field templates, wherein the superposition includes weighted summation, for example, setting weighted values ​​for different single-field templates, and obtaining the multi-field template by weighted summation of different single-field templates. In this embodiment, the at least two single-field templates may include multiple identical single-field templates, or may include multiple different single-field templates. Furthermore, the user may also change the distribution of the field template by setting the field parameters of the field template, so as to autonomously determine the distribution of the graphic elements.

[0046] In this embodiment, the field parameters are necessary parameters for creating a field template. For example, the field parameters include: field strength line shape, field strength coefficient, number of combined single field templates, shape of combined single field templates, etc.

[0047] In some optional implementations of this embodiment, the field parameters include: field strength line shape and field strength coefficient. The above-mentioned creation of a field template based on the field parameters includes: establishing a single-field template or a multi-field template based on the field strength line shape and the field strength coefficient input by the user, and the multi-field template is obtained by weighted summation of at least two single-field templates.

[0048] In this optional implementation, the field strength line shape is the shape of the field strength lines that make up the field in the field template. The field strength line shapes include: any one or more combinations of circle, rectangle, square, triangle, and the overall appearance shape of the field template can be determined by the user inputting the field strength line shape. In the circular field template, the field strength values ​​on the circles with the same radius are equal; in the rectangular field template, the field strength values ​​on the same rectangular side length are equal; in the triangular field template, the field strength values ​​on the same triangle side are equal.

[0049] Different field intensity gradient functions can be obtained for field templates with different appearance shapes, and different field intensity gradient functions have different field intensity coefficients, for example, Figure 3 The field intensity gradient function w of the circular field template shown in the figure is shown in formula (1), and the circular field radius r is set at a first radius r b Within the range, the field strength remains unchanged at 1.0. As the circular field radius r continues to increase (the radius r is greater than the first set radius r b ), the field strength value begins to weaken (such as Figure 3 The field strength values ​​are respectively related to the first set radius r b , and the second set radius r0. Therefore, in this example, the field strength coefficient of the circular field template includes: the first set radius and the second set radius.

[0050]

[0051] like Figure 4 As shown, since the rectangular field template is symmetrical about the x-axis and the y-axis, only the first quadrant can be expressed, and the other quadrants can be filled using the symmetry of the field template. The rectangular field template calculation is shown in formula (2), where k represents the slope, and the field strength coefficient of the rectangular field template includes: slope.

[0052]

[0053] Furthermore, users can also customize the closed curve field template by manually drawing the curve. For any closed curve drawn by the user, such as Figure 5 As shown, multiple pixels construct a closed curve.

[0054] First, the pixel point vector OX finds the two points M and N where the connecting line on the boundary intersects. Assuming that the field strength at point M and the field strength at point M are both Q, the field strength at point P is the same as that at point M, as shown in formula (3); and for any pixel point X, the field strength Q X The calculation is as shown in formula (4).

[0055] Q M =Q; (3)

[0056]

[0057] The method for creating a field template provided by this optional implementation can quickly and conveniently obtain a single-field template or a multi-field template based on the field strength line shape and field strength coefficient input by the user.

[0058] In this embodiment, after the field template is established, the field template needs to be grid discretized so that the convolution kernel of the primitive can be scanned on the discretized field template.

[0059] Step 202: Obtain at least one graphic element.

[0060] In this embodiment, the primitive is a unit of all the graphics to be stacked together, and the at least one primitive may be a stack of primitives set in advance or a stack of primitives input by a user. And the primitives in the at least one primitive may be all the same primitives, all different primitives, or partially the same and partially different primitives.

[0061] Step 203, calculating the convolution kernel of each primitive in at least one primitive.

[0062] In this embodiment, at least one primitive may be firstly grid discretized to obtain a discrete primitive, and the coordinates of all primitive pixel points may be averaged to obtain the center point of the primitive. The center point is used as the positioning reference point for restoring the discrete primitive to a pixel primitive.

[0063] After the primitives are gridded, they are scanned from left to right and from top to bottom. The first square passed through is used as the coordinate of the starting point of the discrete primitive, and the coordinate of the center point of the primitive is used as the offset vector. After all discrete primitives are laid out, the pixel primitives are restored according to the offset vector.

[0064] Optionally, the primitive may be rotated at multiple discrete angles before being grid discretized, and when restoring the primitive, the primitive may be reversely rotated and the pixel primitive may be restored according to the offset vector.

[0065] Step 204, calculating all permutation sequences of at least one graphic element.

[0066] In this embodiment, since there is at least one primitive, if the arrangement order of more than or equal to two primitives is different, the shape of the composed image is different, and the result of scanning the field template is different.

[0067] Optionally, for a non-unidirectionally symmetric field template, at least one graphic element may be sorted by permutations and combinations to obtain all permutation sequences.

[0068] In some optional implementations of the present embodiment, for a unidirectionally symmetrical (symmetrical in at least one direction) field template (e.g., a rectangular field template), the similarity between each graphic element in at least one graphic element is calculated, and an arrangement sequence is obtained based on the similarity between each graphic element.

[0069] In this optional implementation, when the field template is unidirectionally symmetrical, in order to improve the efficiency of the arrangement calculation of multiple graphics elements, the similarity of all graphics elements is calculated pairwise, and they are grouped in pairs from large to small according to the similarity. Assuming there are n graphics elements, find the two graphics elements with the greatest similarity, and then find the graphics element with the greatest similarity from n-2 graphics elements, and pair them in sequence. After the pairing is completed, they can be arranged in sequence in the symmetry direction of the field template.

[0070] The primitive similarity is calculated as follows:

[0071] Assuming there are two primitives, first scale the two primitives to the same height and generate two convolution kernels discretely. Assuming that the width of primitive A1 is greater than the width of primitive A2, primitive A2 moves from left to right within the range of primitive A1 to find the maximum number of overlapping cells. The similarity value of the two primitives is calculated as shown in formula (5).

[0072]

[0073] In formula (5), the similarity value S A1A2 is the maximum number of overlapping cells between element A1 and element A2 max(N A1∩A2 ) and the total number of cells after merging with element A1 and element A2 (N A1 +N A2 ) ratio.

[0074] In this optional implementation, for a unidirectionally symmetric field template, an arrangement sequence is obtained by calculating the similarity between each graphic element in at least one graphic element, thereby improving the efficiency of the arrangement calculation of multiple graphic elements and the speed of graphic element typesetting.

[0075] Optionally, for a field template that is symmetrical in a single direction, the size of the graphics element can be regressed based on the field template so that the combination of all graphics elements conforms to the outline of the field template. The graphics element size regression calculation process is as follows: Use the regression method to calculate the size of the graphics element, establish a quadratic function of the weight and the image width, and perform least squares fitting on the weight data of graphics elements of several different sizes to obtain a quadratic function curve. Finally, the maximum value is calculated by differentiation, the optimal width of the graphics element is calculated, and the graphics element is adjusted according to the optimal width of the graphics element.

[0076] Step 205, in response to determining each arrangement sequence that meets the layout condition in all arrangement sequences, the convolution kernel of each graphic element in the arrangement sequence and the convolution kernel of the graphic element combination are convolved and scanned with the field template in turn to obtain the position between each graphic element in the arrangement sequence and the maximum convolution value of each graphic element and the graphic element combination in the arrangement sequence.

[0077] In this embodiment, the layout condition may be a layout condition pre-stored by the execution subject on which the field-based layout method runs. Optionally, before step 205, the layout condition may also be obtained from the user terminal, and the layout condition obtained from the user terminal may be a layout condition set by the user and sent to the execution subject.

[0078] The layout conditions include: overlapping ratio conditions or proximity conditions; wherein the overlapping ratio condition means that the overlapping ratio of the area between two adjacent graphic elements is within a preset ratio range, and the preset ratio range includes: 1 to 100%. The proximity condition means that there is no overlapping area between two adjacent graphic elements.

[0079] In this embodiment, the convolution kernel of the primitive B1 can be expanded to adjacent layers, so that the primitive B2 is within a certain range of the covered primitive B1 (for example, within H=H B1 +2*H B2 ,W=W B1 +2*W B2 The range is, where H is the height of the range, W is the width of the range, and H B1 is the height value of the graphic element B1, H B2 is the height value of the element B2, W B1 is the width of the graphic element B1, W B2 Convolution scanning is performed within the width value of the primitive B2). If the convolution kernel of the primitive B2 overlaps with the adjacent layer of the primitive B1 and does not overlap with the convolution kernel of the primitive B1, the convolution kernel of the primitive B2 is adjacent to the convolution kernel of the primitive B1, that is, the proximity condition is met. Furthermore, during the scanning process, when the convolution kernel of the primitive B2 overlaps with the adjacent layer of the primitive B1 and also overlaps with the convolution kernel of the primitive B1, and the overlapping ratio meets the preset ratio requirement, it is determined that the superposition condition is met.

[0080] In this embodiment, the position between each primitive can be determined based on the maximum convolution value in the result of convolution scanning between the convolution kernel of each primitive and the convolution kernel of the primitive combination and the field template.

[0081] In this embodiment, based on the maximum convolution values ​​of each primitive and primitive combination in the arrangement sequence, the sum of the maximum convolution values ​​of all single primitives and combinable primitives in the arrangement sequence can be obtained, that is, the maximum convolution value of the arrangement sequence.

[0082] Step 206, obtaining a layout sequence of at least one primitive based on the maximum convolution value of all arrangement sequences that meet the layout condition.

[0083] In this embodiment, optionally, after obtaining the maximum convolution value of all permutation sequences that meet the typesetting conditions, the maximum convolution values ​​of all permutation sequences that meet the typesetting conditions can be sorted from high to low, and the permutation sequence with the preset position of the maximum convolution value of all permutation sequences that meet the typesetting conditions can be taken, and the permutation sequence can be displayed to the user through the user terminal so that the user can select a typesetting sequence of at least one graphic element.

[0084] In some optional implementations of the present embodiment, the above-mentioned obtaining of a layout sequence of at least one graphic element based on the maximum convolution value of all permutation sequences that satisfy the layout conditions includes: sorting the maximum convolution values ​​of all permutation sequences that satisfy the layout conditions, and taking the permutation sequence with the largest maximum convolution value among all permutation sequences as the layout sequence of at least one graphic element.

[0085] In this optional implementation, after sorting the maximum convolution values ​​of all permutation sequences that meet the layout conditions, the permutation sequence with the largest maximum convolution value is used as the layout sequence of at least one graphic element, so that all graphic elements can be most closely matched to the field strength distribution of the field template, thereby improving the appearance of the graphic element layout.

[0086] In view of the above-mentioned situation where the superposition of graphic elements makes the graphic elements too concentrated and the balance condition is poor. In some optional implementations of the present embodiment, the above-mentioned field-based layout method also includes: calculating the coordinate difference vector of the cells of each graphic element in the layout sequence; calculating the magnitude of the repulsive force between the cells of each graphic element in the layout sequence; based on the coordinate difference vector and the magnitude of the repulsive force, obtaining the total repulsive force of each graphic element; based on the total repulsive force of each graphic element, calculating the distance offset value of each graphic element; based on the distance offset value of each graphic element, updating the position of each graphic element.

[0087] In this optional implementation, see Figure 6 As shown, after a limited number of primitives (the primitives in the sorting sequence in this embodiment) are given, it is necessary to spread these primitives within the image range to form a relatively uniform distribution, such as Figure 6The four picture elements A, B, C, and D shown in the figure are equivalent to a picture element in order to make the picture element within the entire picture area. The field strength calculation formula is as follows:

[0088] The coordinate difference vector of each cell of primitive A: Where i = 1 to 4; j = 1 to 6 (corresponding to 6, 7, 8, 9, 10, 11 in the figure). Calculate the repulsive force between two cells based on the distance. Where k is an empirical value. Add the direction to the repulsive force to generate the repulsive force vector

[0089] The total repulsive force of the cell of element A The total repulsion of a cell is the sum of all the cell repulsion vectors. The total repulsion of element A is: Where N(A) represents the number of units of primitive A; the distance moved by primitive A in each iteration is: Where r is a constant and r is an empirical value; the position of the primitive A is updated: X A ′=X A +ΔX, where X A It is the original position of element A.

[0090] In this optional implementation, repulsion is calculated for all graphics elements in the graphics element layout sequence, and based on the total repulsion of each graphics element, the position of graphics element A is updated so that all graphics elements in the graphics element layout sequence can fill the entire image range, rather than being concentrated in a certain part. This makes the graphics elements in the layout of the entire image show a uniform and balanced visual effect, thereby further improving the effect of the graphics element layout.

[0091] The field-based layout method provided in this embodiment creates a field template based on field parameters; obtains at least one primitive, and calculates the convolution kernel of each primitive in at least one primitive; calculates all permutation sequences of at least one primitive; in response to determining each permutation sequence that meets the layout conditions in all permutation sequences, sequentially convolutes the convolution kernel of each primitive in the permutation sequence and the convolution kernel of the primitive combination with the field template to obtain the position between each primitive in the permutation sequence, the maximum convolution value of each primitive and the primitive combination in the permutation sequence; sorts the maximum convolution values ​​of all permutation sequences that meet the layout conditions, and obtains the layout sequence of at least one primitive based on the maximum convolution value of all permutation sequences that meet the layout conditions. Thus, the present application enables at least one primitive to obtain the layout sequence of at least one primitive and the position of each primitive in the layout sequence according to the field strength distribution of the field template, so that at least one primitive can be stacked according to the parameters of the field template, and the at least one primitive can be of any number and any shape, and because the design of the field template can be compatible with a variety of layout scene requirements, the versatility of primitive layout is improved, and the aesthetics of the superimposed image is also improved.

[0092] In some optional implementations of this embodiment, the position between each primitive and the maximum convolution value of the convolution kernel of each primitive and the convolution kernel of the primitive combination can be obtained based on the overlap ratio condition or the proximity condition. Further, the overlap ratio condition and the proximity condition can be set by the user or preset by the system.

[0093] See also Figure 7 , shows a flow chart 700 of an embodiment of a method for obtaining the position of each primitive in an arrangement sequence, the convolution kernel of each primitive, and the maximum convolution value of the convolution kernel of a primitive combination in the present disclosure, the method for obtaining the position of each primitive in an arrangement sequence, the convolution kernel of each primitive, and the maximum convolution value of the convolution kernel of a primitive combination, comprising the following steps:

[0094] Step 701: Perform convolution scanning on the convolution kernel of the first image element in the arrangement sequence and the field template to obtain the convolution value of the convolution kernel of the first image element in the field template, and then execute step 702.

[0095] In this embodiment, the field template may be a grid point after network discretization processing. The convolution kernel of the first primitive is convolved with the field template, and the convolution value obtained can be the average value obtained by convolving and multiplying each grid point of the field template.

[0096] Optionally, the convolution kernel of the first image element is convolved with the field template, and the obtained convolution value may also be a maximum convolution value obtained by comparing the convolution products of the grid points of the field template.

[0097] Step 702: perform multi-angle value sampling on the first rotation angle of the convolution kernel of the i-th primitive, so that the i-th primitive and the combination of the first i-1 primitives and the field template are convolved and scanned to obtain multiple convolution values, i>1, and then execute step 703.

[0098] In this optional implementation, the first i-1 primitive combinations refer to combinations of all primitives before the i-th primitive. The first i-1 primitive combinations will also obtain the maximum convolution value after scanning the field template.

[0099] In some optional implementations of the present embodiment, when the combination of the i-th primitive and the first i-1 primitives meets the overlapping ratio condition, the combination of the i-th primitive and the first i-1 primitives with holes can be removed to obtain i primitive combinations obtained by combining the combination of the i-th primitive and the first i-1 primitives.

[0100] In this optional implementation, during the stacking process of the primitives, the stacking of multiple (for example, more than 3) primitives may cause a hole in the middle of the multiple primitives. The combined primitive G formed by the stacking of the first n-1 primitives n-1 With the nth element S n After overlapping, the nth element S n With the combined element G n-1 The crossing edge can be composed of two segments, one segment with G n-1 overlap, and the other segment does not overlap. In this case, no holes will be generated during the stacking process. n With the combined element G n-1 If the crossing edge is composed of two overlapping edges, it will cause a hole. Therefore, if only one overlapping edge is selected during the stacking process, no hole stacking primitive will be generated.

[0101] In this optional implementation, removing the combination with holes in the combination of the i-th graphic element and the first i-1 graphic elements can make the overlapping effect of the combination of the i-th graphic element and the first i-1 graphic elements better, and the layout appearance of the obtained layout sequence of at least one graphic element is better.

[0102] Step 703: perform multi-angle value sampling on the second rotation angle of the convolution kernel of the i-element combination to obtain multiple convolution values, and then execute step 704.

[0103] In this optional implementation, i graphic element combinations are obtained by combining the i-th graphic element with the first i-1 graphic element combinations.

[0104] Step 704: Based on the convolution values ​​corresponding to the first rotation angle and the second rotation angle, calculate the maximum value of the first rotation angle and the maximum value of the second rotation angle of the i-th primitive and the first i-1 primitive combinations relative to the field template, and then execute step 705.

[0105] In this optional implementation, since both the first rotation angle and the second rotation angle have multiple angle values, and each angle value corresponds to a convolution value.

[0106] In this optional implementation, for example, the first rotation angle is θ B , the second rotation angle is θ g , for θ B ,θ g Evenly divided into N B With N g segment, generating N B *N gsampling points, and calculate the convolution values ​​corresponding to these points, fit a binary high-order function to each point value, and after fitting the binary high-order function, find the maximum value of the function. Since the square root of the high-order function is not easy to calculate, this optional implementation method can use a fast calculation method of grid approximation, and use n times of narrowing the range to obtain the maximum value of the first rotation angle and the maximum value of the second rotation angle.

[0107] After calculating the maximum value of the first rotation angle and the maximum value of the second rotation angle, the best primitive rotation angle and combined primitive rotation angle in the scanning process can be obtained, so that the positions between the primitives can be determined.

[0108] Step 705: Determine whether i is less than or equal to N, where N is the number of primitives in the arrangement sequence; if the determination result is that i is less than or equal to N, execute step 706; if the determination result is that i is greater than N, execute step 707.

[0109] Step 706: Set i=i+1 and return to step 702.

[0110] Step 707: Determine the position of each graphic element in the arrangement sequence based on the maximum value of the rotation angle of each graphic element and the graphic element combination, and then execute step 708.

[0111] Step 708: Determine the maximum convolution value of each primitive and primitive combination in the arrangement sequence based on the maximum value of the rotation angle of each primitive and primitive combination.

[0112] In this optional embodiment, the maximum value of the rotation angle of each primitive and primitive combination can be input into the above-mentioned fitted binary high-order function to obtain the maximum convolution value of each primitive and primitive combination in the arrangement sequence.

[0113] The method for obtaining the position between each primitive in the arrangement sequence and the maximum convolution value of each primitive and primitive combination in the arrangement sequence provided by this optional embodiment can traverse all primitives in all arrangement sequences and primitive combinations between each primitive to obtain the maximum convolution value of each arrangement sequence, thereby improving the reliability of determining the arrangement sequence. Multi-angle value sampling is performed for the rotation angle of each primitive in each arrangement sequence, thereby improving the reliability of obtaining the position of each primitive.

[0114] Further references Figure 8 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a field-based typesetting device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0115] like Figure 8As shown, an embodiment of the present disclosure provides a field-based typesetting device 800, and the device 800 includes: a creation unit 801, an acquisition unit 802, a calculation unit 803, a sorting unit 804, a scanning unit 805, and a typesetting unit 806. Among them, the creation unit 801 can be configured to be configured to create a field template based on field parameters. The acquisition unit 802 can be configured to be configured to acquire at least one primitive. The calculation unit 803 can be configured to be configured to calculate the convolution kernel of each primitive in at least one primitive. The sorting unit 804 can be configured to calculate all permutation sequences of at least one primitive. The scanning unit 805 can be configured to, in response to determining each permutation sequence that meets the typesetting condition in all permutation sequences, sequentially make the convolution kernel of each primitive in the permutation sequence and the convolution kernel of the primitive combination convolute with the field template to obtain the position between each primitive in the permutation sequence and the maximum convolution value of each primitive and the primitive combination in the permutation sequence. The layout unit 806 may be configured to obtain a layout sequence of at least one primitive based on a maximum convolution value of all arrangement sequences satisfying the layout condition.

[0116] In the field-based typesetting device 800, the specific processing of the creation unit 801, the acquisition unit 802, the calculation unit 803, the sorting unit 804, the scanning unit 805 and the typesetting unit 806 and the technical effects thereof can be referred to in detail. Figure 2 Corresponding to step 201, step 202, step 203, step 204, step 205, and step 206 in the embodiment.

[0117] In some embodiments, the scanning unit 805 includes: an acquisition module (not shown in the figure), a scanning module (not shown in the figure), a sampling module (not shown in the figure), a calculation module (not shown in the figure), a repetition module (not shown in the figure), a determination module (not shown in the figure), and a convolution module (not shown in the figure). Among them, the acquisition module can be configured to perform convolution scanning on the convolution kernel of the first primitive in the arrangement sequence and the field template to obtain the convolution value of the convolution kernel of the first primitive in the field template. The scanning module can be configured to perform multi-angle value sampling on the first rotation angle of the convolution kernel of the i-th primitive, so that the i-th primitive and the first i-1 primitive combination are convoluted with the field template to obtain multiple convolution values, i>1. The sampling module can be configured to perform multi-angle value sampling on the second rotation angle of the convolution kernel of the i-th primitive combination to obtain multiple convolution values, and the i-th primitive combination is obtained by combining the i-th primitive and the first i-1 primitive combination. The calculation module can be configured to calculate the maximum value of the first rotation angle and the maximum value of the second rotation angle of the i-th primitive and the first i-1 primitive combinations relative to the field template based on the convolution values ​​corresponding to the first rotation angle and the second rotation angle. The repetition module can be configured to respond to the determination that i≤N, N is the number of primitives in the arrangement sequence, so that i=i+1, and trigger the scanning module, the sampling module, and the calculation module to continue working. The determination module can be configured to respond to the determination that i>N, and determine the position between each primitive in the arrangement sequence from the maximum value of the rotation angle of each primitive and the primitive combination. The convolution module can be configured to determine the maximum convolution value of each primitive and the primitive combination in the arrangement sequence from the maximum value of the rotation angle of each primitive and the primitive combination.

[0118] In some embodiments, the apparatus 800 further includes a removal unit (not shown in the figure). The removal unit may be configured to remove a combination of the i-th image element and the first i-1 image elements that has a hole.

[0119] In some embodiments, the layout unit 806 includes: a sorting module (not shown in the figure) and a selection module (not shown in the figure). The sorting module can be configured to sort the maximum convolution values ​​of all the arrangement sequences that meet the layout conditions. The selection module can be configured to take the arrangement sequence with the largest maximum convolution value among all the arrangement sequences as the layout sequence of at least one primitive.

[0120] In some embodiments, the creation unit 801 is further configured to establish a single-field template or a multi-field template based on the field strength line shape and field strength coefficient input by the user, and the multi-field template is obtained by weighted summation of at least two single-field templates.

[0121] In some embodiments, the sorting unit 804 includes: a similarity calculation module (not shown in the figure) and a similarity arrangement module (not shown in the figure). The similarity calculation module can be configured to calculate the similarity between each of the at least one primitive. The similarity arrangement module can be configured to obtain an arrangement sequence based on the similarity between each primitive.

[0122] In some embodiments, the above-mentioned device 800 also includes: a vector unit (not shown in the figure), a repulsion unit (not shown in the figure), a obtaining unit (not shown in the figure), an offset unit (not shown in the figure), and an updating unit (not shown in the figure). Among them, the vector unit can be configured to calculate the coordinate difference vector of the cells of each primitive in the typesetting sequence. The repulsion unit can be configured to calculate the magnitude of the repulsion between the cells of each primitive in the typesetting sequence. The obtaining unit can be configured to obtain the total repulsion of each primitive based on the coordinate difference vector and the magnitude of the repulsion. The offset unit can be configured to calculate the distance offset value of each primitive based on the total repulsion of each primitive. The updating unit can be configured to update the position of each primitive based on the distance offset value of each primitive.

[0123] The field-based typesetting device provided by the embodiment of the present disclosure includes a creation unit 801 for creating a field template based on field parameters; an acquisition unit 802 for acquiring at least one primitive; a calculation unit 803 for calculating the convolution kernel of each primitive in at least one primitive; a sorting unit 804 for calculating all permutation sequences of at least one primitive; a scanning unit 805 for, in response to determining each permutation sequence that meets the typesetting condition in all permutation sequences, sequentially performing convolution scans on the convolution kernels of each primitive in the permutation sequence and the convolution kernels of the primitive combination with the field template to obtain the positions between each primitive in the permutation sequence and the maximum convolution values ​​of each primitive and the primitive combination in the permutation sequence; sorting the maximum convolution values ​​of all permutation sequences that meet the typesetting condition; and a typesetting unit 806 for obtaining the typesetting sequence of at least one primitive based on the maximum convolution values ​​of all permutation sequences that meet the typesetting condition. Therefore, the present application enables at least one graphic element to obtain a layout sequence of at least one graphic element and the position of each graphic element in the layout sequence according to the field strength distribution of the field template, so that at least one graphic element can be stacked according to the parameters of the field template. The at least one graphic element can be of any number and shape, and because the design of the field template can be compatible with a variety of layout scene requirements, the versatility of the graphic element layout is improved, and the aesthetics of the superimposed image is also improved.

[0124] Reference below Fig. 9 , which shows a structural schematic diagram of an electronic device 900 suitable for implementing an embodiment of the present disclosure.

[0125] like Fig. 9As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0126] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Fig. 9 The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Fig. 9 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0127] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0128] It should be noted that the computer-readable medium of the embodiment of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiment of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the embodiment of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0129] The computer-readable medium may be included in the server; or it may exist independently without being installed in the server. The computer-readable medium carries one or more programs. When the one or more programs are executed by the server, the server: creates a field template based on field parameters; obtains at least one primitive, and calculates the convolution kernel of each primitive in at least one primitive; calculates all permutation sequences of at least one primitive; in response to determining each permutation sequence that meets the layout conditions in all permutation sequences, sequentially convolutes the convolution kernel of each primitive in the permutation sequence and the convolution kernel of the primitive combination with the field template to obtain the position between each primitive in the permutation sequence, and the maximum convolution value of each primitive and the primitive combination in the permutation sequence; obtains the layout sequence of at least one primitive based on the maximum convolution value of all permutation sequences that meet the layout conditions.

[0130] Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0131] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0132] The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. The units described may also be set in a processor, for example, may be described as: a processor comprising a creation unit, an acquisition unit, a calculation unit, a sorting unit, a scanning unit, and a typesetting unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the creation unit may also be described as a unit "configured to create a field template based on field parameters".

[0133] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.

Claims

1. A field-based typesetting method, the method comprising: Based on the field parameters, a field template is created, wherein a single field template or a multi-field template is established based on the field strength line shape and the field strength coefficient input by the user, and the multi-field template is obtained by weighted summation of at least two single field templates; Obtain at least one primitive, and calculate a convolution kernel for each primitive in the at least one primitive; Calculate all permutation sequences of the at least one primitive; In response to determining each arrangement sequence that meets the typesetting condition in all arrangement sequences, the convolution kernel of the first image element in the arrangement sequence is convolved with the field template to obtain the convolution value of the convolution kernel of the first image element in the field template; the first rotation angle of the convolution kernel of the i-th image element is sampled by multiple angle values, and the i-th image element and the first i-1 image element combination are convolved with the field template to obtain multiple convolution values, i>1; the second rotation angle of the convolution kernel of the i-th image element combination is sampled by multiple angle values ​​to obtain multiple convolution values, and the i-th image element combination is obtained by combining the i-th image element with the first i-1 image element combination; based on the multiple angle values ​​of the first rotation angle and the second The convolution value corresponding to the rotation angle is used to calculate the maximum value of the first rotation angle and the maximum value of the second rotation angle of the i-th primitive and the first i-1 primitive combination relative to the field template; in response to determining that i≤N, N is the number of primitives in the arrangement sequence, i=i+1 is set, and the maximum value of the first rotation angle and the maximum value of the second rotation angle of the i-th primitive and the first i-1 primitive combination relative to the field template are continued to be calculated; in response to determining that i>N, the position between each primitive in the arrangement sequence is determined by the maximum value of the rotation angle of each primitive and the primitive combination; the maximum convolution value of each primitive and the primitive combination in the arrangement sequence is determined by the maximum value of the rotation angle of each primitive and the primitive combination; Based on the maximum convolution value of all arrangement sequences that meet the arrangement condition, the arrangement sequence of the at least one primitive is obtained.

2. The method according to claim 1, further comprising: The combination of the i-th primitive and the first i-1 primitives that has a hole is removed.

3. The method according to claim 1, wherein: The step of obtaining the layout sequence of the at least one primitive based on the maximum convolution value of all arrangement sequences satisfying the layout condition comprises: The maximum convolution values ​​of all the arrangement sequences that meet the layout conditions are sorted, and the arrangement sequence with the largest maximum convolution value among all the arrangement sequences is taken as the arrangement sequence of the at least one primitive.

4. The method according to claim 1, wherein the calculating all permutation sequences of the at least one primitive comprises: The similarity between each of the at least one graphic element is calculated, and an arrangement sequence is obtained based on the similarity between each of the graphic elements.

5. The method according to any one of claims 1 to 4, further comprising: Calculating the coordinate difference vector of each cell of each graphic element in the typesetting sequence; Calculating the magnitude of the repulsive force between cells of each graphic element in the typesetting sequence; Based on the coordinate difference vector and the magnitude of the repulsive force, obtaining the total repulsive force of each primitive; Based on the total repulsion of each primitive, the distance offset value of each primitive is calculated; Update the position of each primitive based on its distance offset value.

6. A field-based typesetting device, the device comprising: A creating unit is configured to create a field template based on the field parameters, wherein a single field template or a multi-field template is established based on the field strength line shape and the field strength coefficient input by the user, and the multi-field template is obtained by weighted summation of at least two single field templates; An acquisition unit, configured to acquire at least one graphic element; A computing unit configured to compute a convolution kernel for each of the at least one primitive; A sorting unit, configured to calculate all permutation sequences of the at least one primitive; The scanning unit is configured to, in response to determining each arrangement sequence that meets the typesetting condition in all arrangement sequences, perform convolution scanning on the convolution kernel of the first image element in the arrangement sequence with the field template to obtain a convolution value of the convolution kernel of the first image element in the field template; perform multi-angle value sampling on the first rotation angle of the convolution kernel of the i-th image element, perform convolution scanning on the i-th image element and the first i-1 image element combination with the field template to obtain multiple convolution values, i>1; perform multi-angle value sampling on the second rotation angle of the convolution kernel of the i-th image element combination to obtain multiple convolution values, the i-th image element combination is obtained by combining the i-th image element with the first i-1 image element combination; based on the multiple angle values ​​of the first rotation angle and The convolution value corresponding to the second rotation angle is used to calculate the maximum value of the first rotation angle and the maximum value of the second rotation angle of the i-th primitive and the first i-1 primitive combination relative to the field template; in response to determining that i≤N, N is the number of primitives in the arrangement sequence, i=i+1 is set, and the maximum value of the first rotation angle and the maximum value of the second rotation angle of the i-th primitive and the first i-1 primitive combination relative to the field template are continued to be calculated; in response to determining that i>N, the position of each primitive in the arrangement sequence is determined by the maximum value of the rotation angle of each primitive and the primitive combination; the maximum convolution value of each primitive and the primitive combination in the arrangement sequence is determined by the maximum value of the rotation angle of each primitive and the primitive combination; The layout unit is configured to obtain the layout sequence of the at least one primitive based on the maximum convolution value of all arrangement sequences that meet the layout conditions.

7. The apparatus according to claim 6, further comprising: The removing unit is configured to remove a combination having a hole from a combination of the i-th primitive and the first i-1 primitives.

8. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

9. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.