Word cloud generation method based on movable component and frame field coupling optimization
By combining movable components and optimized word cloud generation methods, the problem of mismatch between word cloud layout and model shape was solved, achieving reasonable word placement on planar and curved models, thus improving the aesthetics and user experience of word clouds.
Patent Information
- Application Number
- CN202211444766.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-18
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-11-18
AI Technical Summary
Existing word cloud layout methods do not match the shape of the container model that holds the words, resulting in word placement and angles that do not conform to user perception and aesthetics. Moreover, most existing methods are based on planes and are difficult to adapt to three-dimensional curved surfaces.
We employ a method based on the coupling optimization of movable components and frame fields. By establishing a layout optimization model of words in the distance field and frame field, we use hyperelliptical implicit functions to represent word shapes, combine grid models and parameterization methods to optimize the position and angle of words in the model, and use quadtrees for collision detection to generate a word cloud layout that conforms to the model features.
It achieves a reasonable arrangement of words in the model, conforms to user perception and aesthetics, is applicable to both planar and curved surface models, and improves the aesthetics and user experience of word clouds.
Smart Images

Figure CN115861484B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of data visualization, and particularly relates to a word cloud generation method based on movable component and frame field coupling optimization. BACKGROUND
[0002] In the era of rapid development of the Internet, a large amount of data is generated, and the data visualization methods are also increasingly diversified. Word cloud is a visualization method for summarizing text information, reflecting the importance of keywords through the size of words, and displaying in the corresponding model shape. Through the display of word cloud, people can quickly obtain the key important information in big data, so it is often used in social, advertising, news media and other industries.
[0003] In addition to the size of the word reflecting the importance of information in the word cloud, the shape of the container model containing the word also greatly affects the aesthetics of the word cloud, and the layout of the word cloud also affects the user's focus of attention. The layout of the word in the word cloud (the position and angle of the word) and the model shape are closely related. The current layout methods mainly include horizontal and vertical arrangement, spiral line arrangement, and arrangement based on force, etc.
[0004] However, the existing word cloud layout method is not strongly related to the shape of the container model containing the word, and the placement position and angle of the word do not match the geometric feature line of the model, which does not conform to people's perception process and aesthetics. At the same time, with the development of visualization devices, the existing word cloud is still mostly based on a plane, and if the existing word layout method is simply applied to a three-dimensional curved surface, the inadaptation and strangeness between the word layout and the features of the model will be more intense. SUMMARY
[0005] The present application aims at the deficiencies of the prior art, and provides a word cloud generation method based on movable component and frame field coupling optimization, which can generate a word cloud layout conforming to the field features in the model according to the distance field and the frame field on the model. The method uses the above two fields, uses a super-elliptical implicit function to approximate the shape of the word, regards it as a movable component, establishes a layout optimization model of the word in the two fields with collision and overlapping constraints, and solves it to fill a part of important words, and then fills the remaining space of the model with the remaining words through the feature flow line extracted from the frame field. Based on the above strategy, the method uses a grid model input, and uses a parameterization method to support plane and curved surface models at the same time.
[0006] The specific scheme of the present application is as follows: a word cloud generation method based on movable component and frame field coupling optimization, which comprises the following steps:
[0007] Step 1, input the words and the corresponding weights of their importance in the text, and divide them into two parts: important words and less important words. Place important words by establishing a word cloud layout optimization model, and place less important words by streamlines extracted from the frame field;
[0008] Step 2, input the planar or curved triangular mesh model as the container model for filling words, and calculate the geodesic distance field of the mesh model by the heat diffusion equation. The weight of the distance field is used to distinguish the key areas of the model. Through the frame field theory, the frame field that meets the characteristics of the mesh model is calculated;
[0009] Step 3, for the curved mesh model in step 2, perform planar parameterization, and consider the deformation degree generated in the parameterization process. Use the Jacobian to measure the deformation degree, which is 1 for planar mesh models. Use the scan line algorithm to generate the boundary contour background picture of the planar model or the parameterized curved model for subsequent boundary collision detection.
[0010] Step 4, use the super-ellipse function to represent the bounding box of the word, which is regarded as a movable component. Using its mathematical form, a target function is established in the distance field representing the key area to measure the weight sum of the component covering the sampling points. In the frame field representing the model characteristics, a target function is established to measure the consistency of the word placement angle with the frame direction. Use the above optimization model to fill important words first. To avoid overlapping between words during the optimization process, use the separation axis theorem to add collision overlap constraints in the optimization model;
[0011] Step 5, the solution of the optimization problem is divided into four stages:
[0012] The first stage only considers the position of the word and does not consider the collision overlap constraint. The initial position of the word is solved using a heuristic algorithm;
[0013] The second stage only considers the position of the word and does not consider the collision overlap constraint. The position of the word in the model is solved using a nonlinear optimization algorithm;
[0014] The third stage only considers the placement angle of the word and does not consider the collision overlap constraint. The placement angle of the word is solved using a nonlinear optimization algorithm;
[0015] The fourth stage considers the position, angle and collision overlap constraint of the word. The final placement position and angle of the word are solved using a nonlinear optimization algorithm;
[0016] Step 6, using the position and angle of the word in the solution obtained in step 5, generate the corresponding word on the picture. To ensure the accuracy of the results and to lay the foundation for the subsequent steps, for the picture of the word, generate a four-ary tree based on the font pixels for fast pixel-level collision detection between each other; In the process of tiling, a dynamic four-ary tree needs to be established on the picture to screen out the potential overlapping word set and avoid unnecessary collision detection;
[0017] Step 7, using the frame field in step 2, extract the streamline in the frame field. Use the streamline to guide the filling of the non-important word set S2, so as to fill the remaining space of the model.
[0018] Step 8, if it is a two-dimensional plane model, directly generate the final word cloud map; if it is a three-dimensional curved surface model, the generated word cloud map can be viewed in the three-dimensional model visualization software by taking it as the model texture map.
[0019] More specifically:
[0020] Step 1, for the input word and the corresponding importance weight of the word in the text, sort from large to small to determine its relative size, and divide the word into two sets, one part is the important word set S1, and the other part is the less important word S2. First, place the important word by establishing a layout optimization model, and then place the less important word by extracting the feature streamline from the frame field.
[0021] Step 2, process the input mesh model to generate a distance field and a frame field to guide the word layout:
[0022] 2.1 For the input triangular mesh model M and the m sample point set V on the mesh, the sample point coordinates are denoted as x j (j=0,…,m), the user specifies the key area of the model through the mouse brush interaction, and then solves the geodesic distance field W that distinguishes the key area of the model based on the heat diffusion equation, then the weight (distance field value) on each sample point is w j (j=0,…,m). At the same time, in order to ensure that the word will not exceed the solving area during optimization, an additional layer of negative weight key is set on the periphery of the model;
[0023] 2.2 For the input triangular mesh model, based on the frame field theory, the frame field Q conforming to the characteristics of the model is calculated to guide the placement angle of the word. At the same time, the mouse brush interaction can also be used to specify the constraints in the calculation of the frame field, so as to obtain a specific frame field. The frame on the sample point can be denoted as q j (j=0,…,m).
[0024] Step 3, consider two-dimensional plane and three-dimensional curved surface uniformly, and generate the outline picture of the model:
[0025] 3.1 If the mesh is a curved surface model, the mesh is planar parameterized, and the Jacobian J is used to represent each triangle p j The degree of deformation caused by parameterization If it is a planar mesh model, it can be recorded as 1;
[0026] 3.2 Use the scan line algorithm to generate the boundary contour background picture according to the boundary data of the triangular mesh.
[0027] Step 4, regarding the word as a movable component, using a super-ellipse implicit function as an expression form, a continuous optimization model based on two fields is established:
[0028] 4.1 For n words in S1, determine the word Word i The size of the bounding box of (i=0,...,n) is l i =(l i0 , l i1 ) T (l i0 and l i1 represent the width and height of its bounding box, respectively), and its placement angle is θ i , then their edge unit direction vectors are e i0 =(cosθ i , sinθ i ) T , e i1 =(-sinθ i , cosθ i ) T , and the center is located at c i =(c i0 , c i1 ) T . Introduce the super-ellipse function:
[0029]
[0030] Use the implicit function about x∈R 2 to represent the component shape of Word i :
[0031]
[0032] Where,
[0033]
[0034] p is an even number greater than or equal to 2, and we use p=4 in this method. Therefore, if the model shape area is D, its area in the word region Ω iThe following states are included:
[0035]
[0036] 4.2 The objective function for the word placement model to focus on the important regions. In order to make the word positions cover the important regions as much as possible, the weight contributed by a word covering a sampling point x j can be expressed as:
[0037] w j max(f0(x j , c i , θ i ),..., f n (x j , c n , θ n ), 0)
[0038] Therefore, the objective function for all sampling points is:
[0039]
[0040] If the degree of deformation caused by the grid parameters is added, the layout optimization objective function for the word placement model to focus on the important regions is:
[0041]
[0042] 4.3 The objective function for the word placement angle to be consistent with the model frame field. For a word located at c i , if the frame at this position is q(c i ), and the word direction vector d i (θ i ) = (sinθ i , cosθ i ) T , in order to make the word placement angle as consistent as possible with the frame field, the layout optimization objective function for their consistency is:
[0043]
[0044] 4.4 The final layout optimization objective is a combination of the above steps 4.2 and 4.3:
[0045]
[0046] where u, v are optional adjustment parameters that balance the two sub-objective functions, indicating which field the layout is more convenient to.
[0047] 4.5 The Separating Axis Theorem gives the condition that two convex polygons do not overlap, if there exists a projection axis on which the projections of the two convex polygons do not overlap. For two rectangles, it is sufficient to check four projection axes, which are parallel to the edges of the rectangles.
[0048] Let the projection axis direction be L, and the two words be Word i and Word j The vector difference between the centers is T, then if satisfies
[0049]
[0050] It is shown that the two words do not overlap, where t ijp (p = 0, 1, 2, 3) represent the test values of Word i and Word j on the four projection axes. Therefore, the constraints that any two words do not overlap are in total, which can be represented as:
[0051]
[0052] Step 5, solve the layout optimization model of the important words in Step 4 by fixing variables and relaxing constraints, etc. The following sub-steps can quickly solve the solution that meets the required optimization objective function by this method:
[0053] 5.1 The first stage of calculation only considers the coordinates of the words, and uses a heuristic algorithm to solve the following optimization objective:
[0054]
[0055] The solved c i can be used as the initial value as the initial value of the next optimization.
[0056] 5.2 The second stage uses a nonlinear optimization algorithm to solve the following objective function:
[0057]
[0058] 5.3 According to the solution of the second stage as input, use a nonlinear optimization algorithm to solve the objective function of the third stage:
[0059]
[0060] 5.4 According to the solution of the third stage as input, use a nonlinear optimization algorithm to solve the objective function with collision overlap constraints:
[0061]
[0062]
[0063] Step 6, according to the solution in step 5, fill the words into the picture to ensure complete accuracy of non-overlapping collision:
[0064] 6.1 generate a pixel-level quadtree for each word, and also generate a quadtree for the boundary contour background picture in step 3;
[0065] 6.2 generate a word dynamic management background quadtree with the word-filled area as the background, to filter out the set of filled words that may have potential overlap with the current filled word, so as to avoid unnecessary collision detection;
[0066] 6.3 use the quadtree to perform collision detection with the set of potential overlapping words and the boundary contour background picture every time a word is filled, and if no collision occurs, fill the word into the picture;
[0067] Step 7, according to the scaffold field in step 2, extract the streamline, and use the streamline to guide the layout of the word set S2 to fill the remaining area of the model:
[0068] 7.1 construct a BVH (Bounding Volume Hierarchy) for the three-dimensional curved surface model, with the boundary points of the model as the starting points, and extract a set of streamlines according to the direction of the scaffold field and the selection of appropriate step length;
[0069] 7.2 traverse all the streamlines in the set, and use the forward direction of the streamline as the guide to fill the words with appropriate step length using the similar collision detection algorithm in step 6, if overlap occurs at the current position, continue to advance until all the streamlines are traversed;
[0070] 7.3 for the word filling guided by the streamline, according to the spatial locality of the word filling guided by the streamline, the words filled in the previous times can be used as the collision detection cache to detect with the current filled word, as long as the current filled word overlaps with the cache, the advance is directly performed.
[0071] Step 8, for a two-dimensional plane model, the output in step 7 is the final word cloud layout picture; for a three-dimensional curved surface model, output the word cloud layout picture in the form of a texture map, and give the corresponding texture coordinate file, the output can be viewed in a general three-dimensional model visualization software.
[0072] The beneficial effects of the present application are:
[0073] 1, The words to be filled in the model are divided into two parts: the first part, for important words, the layout optimization model is used to solve its layout in the model; the second part, for less important words, using the way based on the feature flow line guide, combined with the collision detection algorithm of quadtree, quickly fill the remaining space in the model;
[0074] 2, The layout optimization algorithm model in the first stage of this method, combined with the distance field in the model, can distinguish the key areas of the model, so that important words occupy these more conspicuous positions; combined with the frame field, the geometric features of the model can be displayed, so that the posture of the word cloud is consistent with the features of the model. At the same time, since the field is used to guide the layout of the word cloud, users can also modify the word cloud layout by indirectly modifying the field.
[0075] 3, This method is based on grid model, and the layout optimization model considers both two-dimensional plane and three-dimensional surface, so the mature parameterization algorithm in computer graphics can be used to generate two-dimensional plane shape word cloud and three-dimensional surface shape word cloud. BRIEF DESCRIPTION OF DRAWINGS
[0076] Figure 1 is a flowchart of the method;
[0077] Figure 2 is an input plane grid model;
[0078] Figure 3 is a distance field weight map representing Figure 2 the key area of the model;
[0079] Figure 4 is a frame field map representing Figure 2 the geometric features of the model;
[0080] Figure 5 is a parameterization diagram of a three-dimensional curved surface model;
[0081] Figure 6 is a boundary contour background map generated according to the model;
[0082] Figure 7 is a schematic diagram of a super-elliptic function;
[0083] Figure 8 is a layout diagram generated in the first stage of solving the layout optimization target;
[0084] Figure 9 is a layout diagram generated in the second stage of solving the layout optimization target;
[0085] Figure 10 is a layout diagram generated in the third stage of solving the layout optimization target;
[0086] Figure 11 The layout diagram generated in the fourth stage to solve the layout optimization objective;
[0087] Figure 12 A schematic diagram of a pixel quadtree for a word;
[0088] Figure 13 A schematic diagram of a quadtree for dynamic background management in a scene;
[0089] Figure 14 The result image after filling in the important word set S1;
[0090] Figure 15 This is a partial streamline diagram extracted from the frame diagram;
[0091] Figure 16 The result after filling in the set of secondary important words S2;
[0092] Figure 17 This is the result image on a three-dimensional curved surface.
[0093] Detailed Implementation Instructions
[0094] The invention will be further described below with reference to the accompanying drawings.
[0095] like Figure 1 As shown, the word cloud generation method based on movable components and frame field coupling optimization has the following specific steps:
[0096] Step 1: Input words and their corresponding weights based on their importance in the text. These weights can be word frequencies or other quantities that represent the relative importance of words. Sort them from largest to smallest to determine their relative size, and divide the words into two sets: one set of important words S1 and the other set of less important words S2. Determine the layout of S1 using a layout optimization model, and determine the layout of S2 using streamlines extracted from the frame field.
[0097] Step 2, Input as follows Figure 2 The mesh model generates, as follows Figure 3 The distance field shown and as Figure 4 The frame shown is used to guide word layout:
[0098] 2.1 For the input triangular mesh model M and the set V of m sampling points on the mesh, the coordinates of the sampling points are denoted as x. j (j=0,…,m), the user specifies the key areas of the model through mouse and pen interaction. Then, the geodesic distance field W that distinguishes the key areas of the model is solved based on the heat diffusion equation. The weight of each sampling point can be denoted as w. j (j=0,…,m). To ensure that words do not exceed the solution region during optimization, an additional layer of negative weights is added around the model.
[0099] 2.2 For the input triangular mesh model, the frame field Q conforming to the characteristics of the mesh model is calculated to guide the placement angle of the word. Meanwhile, the mouse brush interaction can be used to specify constraints in the calculation of the frame field, so as to obtain a specific frame field. The frame on the sampling point can be recorded as q j (j = 0,..., m);
[0100] Step 3, the two-dimensional plane and the three-dimensional curved surface are considered uniformly, and the boundary contour picture of the model is generated:
[0101] 3.1 As shown in Figure 5 , if the mesh is a three-dimensional curved surface model, the mesh is parameterized, and the data of the two fields are mapped through the parameterization method. And the Jacobian J is used to represent that each triangle p j The deformation degree caused by parameterization If it is a two-dimensional plane, it can be recorded as 1;
[0102] 3.2 According to the boundary data of the triangular mesh, the boundary contour background picture as shown in Figure 6 is generated by using the scan line algorithm;
[0103] Step 4, the word is regarded as a movable component, and a continuous optimization model based on the two fields is established by using the super-ellipse implicit function as the expression form:
[0104] 4.1 For the n words in S1, the bounding box size of the word Word i (i = 0,..., n) is l i = (l i0 , l i1 ) T (l i0 and l i1 represent the width and height of the bounding box respectively), and the placement angle is θ i , then the unit direction vectors of their edges are e i0 = (cosθ i , sinθ i ) T , e i1 = (-sinθ i , cosθ i ) T , and the center position is c i = (c i0 , c i1 ) T . The super-ellipse function as shown in Figure 7 is introduced:
[0105]
[0106] The shape of the word 2 is represented by an implicit function about x∈R i :
[0107]
[0108] where,
[0109]
[0110] p is an even number greater than or equal to 2, and we use p = 4 in this method. Therefore, if the shape area of the model is D, it has the following state in the area Ω i of the word:
[0111]
[0112] 4.2 Consider the objective function of the word occupying the key area of the model. In order to make the word position cover the area with large weight as much as possible, for a single sampling point, the weight contributed by the word covering it can be represented in the following form:
[0113] w j max(f0(x j ,c i ,θ i ),...,f n (x j ,c n ,θ n ),0)
[0114] Therefore, for all sampling points, the objective function is:
[0115]
[0116] If the degree of deformation generated by the grid parameters is added, the layout optimization objective function for measuring the word occupying the key area of the model is:
[0117]
[0118] 4.3 Consider the objective function of the word placing angle being consistent with the model frame field. For a word located at c i , if the frame at this position is q(c i ), the word direction vector d i (θ i ) = (sinθ i , cosθ i ) TTo make the angle of the word as consistent as possible with the frame field, the layout optimization objective function is measured by the consistency between them:
[0119]
[0120] 4.4 Synthesizing the previous steps 4.2 and 4.3, the final layout optimization objective is:
[0121]
[0122] Where u, v are optional adjustment parameters as a balance between the two sub-objective functions, indicating which field the layout is more convenient for.
[0123] 4.5 The Separating Axis Theorem gives the condition for any two convex polygons not to overlap, as long as there is a projection axis on which the projections of the two convex polygons do not overlap, then the convex polygons do not overlap. And for two rectangles, only four projection axes in the same direction as their edges need to be detected.
[0124] Let the projection axis direction be L, and the two words Word i and Word j The vector difference between the centers is T, then if satisfies
[0125]
[0126] It means that the two words do not overlap, where t ijp (p = 0, 1, 2, 3) respectively represent the test values of Word i and Word j on the four projection axes. Therefore, the constraints for any two words not to overlap and collide have , which can be expressed as:
[0127]
[0128] The specific form of t ijk in the constraint is as follows:
[0129]
[0130] Let e ijpq = |e jp · e iq |, then e ij00 = e ij11 = |cos(θ i - θ j )|, e ij01 = e ij10 = |sin(θ i - θ j )|:
[0131]
[0132] then:
[0133]
[0134]
[0135] Step 5, solve the layout optimization model of important words in Step 4 by methods such as fixing variables and relaxing constraints, including the following sub-steps, through which the solution that meets the required optimization objective function can be quickly solved:
[0136] 5.1 The first stage of calculation only considers the coordinates of the words, and uses a heuristic algorithm to solve the following optimization objective:
[0137]
[0138] As shown in Figure 8 , the solved c i can be used as the initial layout as the initial value for the next optimization.
[0139] 5.2 The second stage uses a nonlinear optimization algorithm to solve the following objective function:
[0140]
[0141] As shown in Figure 9 , the layout diagram generated according to the solution of the second stage;
[0142] 5.3 Use a nonlinear optimization algorithm to solve the objective function of the third stage according to the solution of the second stage as input:
[0143]
[0144] As shown in Figure 10 , the layout diagram generated according to the solution of the third stage;
[0145] 5.4 Use a nonlinear optimization algorithm to solve the objective function with collision overlap constraints according to the solution of the third stage as input for the fourth stage:
[0146]
[0147]
[0148] As shown in Figure 11 , the layout diagram generated according to the solution of the fourth stage;
[0149] 5.6 The max function in the above optimization problem is approximated by:
[0150]
[0151] The absolute value function is approximated by:
[0152]
[0153] The gradient with respect to F1 is:
[0154]
[0155] where
[0156]
[0157] Thus
[0158]
[0159] where since
[0160]
[0161]
[0162] Thus
[0163]
[0164] The gradient with respect to F2, using the distance c i to the nearest sample point, (sin γ, cos γ) to represent q(c i ), is:
[0165]
[0166] The gradient with respect to the constraint is given by:
[0167] t ij0 The gradients with respect to the coordinates and angle of Word i and Word j are:
[0168]
[0169]
[0170]
[0171]
[0172]
[0173]
[0174] t ij1 About Word i and Word j The gradients of the coordinates and angles for Word
[0175]
[0176]
[0177]
[0178]
[0179]
[0180]
[0181] t ij2 About Word i and Word j The gradients of the coordinates and angles for Word
[0182]
[0183]
[0184]
[0185]
[0186]
[0187]
[0188] t ij3 About Word i and Word j The gradients of the coordinates and angles for Word
[0189]
[0190]
[0191]
[0192]
[0193]
[0194]
[0195] Step 6, according to the solution in step 5, fill the words into the picture to ensure complete accuracy without overlapping:
[0196] 6.1 As shown in Figure 12 , generate a pixel-level quadtree for each word, and also generate a quadtree for the boundary contour background picture in step 3;
[0197] 6.2 As shown in Figure 13 , generate a word dynamic management background quadtree with the word-filled area as the background, to filter out the set of already-filled words that may have potential overlap with the current filled word, thereby avoiding unnecessary collision detection;
[0198] 6.3 Use the quadtree to do collision detection with the set of potentially overlapping words and the boundary contour background picture every time a word is filled, and if no collision occurs, fill the picture; the final result is shown in Figure 14 ;
[0199] Step 7, according to the frame field in step 2, extract the feature flow lines as shown in Figure 15 , use the flow lines to guide the layout of the word set S2 to fill the remaining area of the model:
[0200] 7.1 Construct a BVH (Bounding Volume Hierarchy) for the three-dimensional curved surface model, with the boundary points of the model as the starting points, and extract the flow line set according to the direction of the frame field and the selected step size; the following is the algorithm for extracting flow lines:
[0201] 1) Construct a BVH;
[0202] 2) The initial A vertex coordinates are p, and the frame direction is q, then the forward point o = p + q * StepSize;
[0203] 3) The ray o1 starts at o and has a direction of normal n; the ray o2 starts at o and has a direction of normal -n;
[0204] 4) If the first forward movement does not collide, update the direction to the opposite direction for detection, otherwise exit;
[0205] 5) The next point is the collision point of the shortest one of the two rays, denoted as B;
[0206] 6) Generate the normal vector at the intersection point A by interpolation method, select the frame of the 0th point (optional) of the unit grid as the frame of the intersection point B, and adjust it to be perpendicular to the normal vector;
[0207] 7) Select the direction with the smallest angle with the moving direction of A in the B frame as the moving direction of B, and proceed in turn;
[0208] 7.2 Traverse all the streamlines in the set, guided by the forward direction of the streamlines, fill in the words with the similar collision detection algorithm in step 6 at a suitable step length, and continue to advance if there is an overlap at the current position until all the streamlines are traversed;
[0209] 7.3 For the word filling of the streamline guided mode, according to the spatial locality of the word filling guided by the streamlines, the words filled in the previous times can be first detected with the word filled in the current time as the cache for the collision detection, and as long as the word filled in the current time overlaps with the cache, the advance is directly performed;
[0210] Step 8, for a two-dimensional plane model, as shown in Figure 16 , the output in step 7 is the final word cloud layout picture; for a three-dimensional curved surface model, as shown in Figure 17 , the word cloud layout picture is output in the form of a texture map, and a corresponding texture coordinate file is given, and the output can be viewed in a general three-dimensional model visualization software.
Claims
1. A method for word cloud generation based on movable component and frame field coupling optimization, characterized in that: The method comprises the following steps: Step 1, input the word and its corresponding importance weight in the text, and divide it into two parts: important words and less important words; place the important words by establishing the word cloud layout optimization target, and place the less important words by the streamline extracted from the frame field; Step 2, input the planar or curved triangular mesh model as the container model for filling the words, and solve the geodesic distance field of the mesh model by the heat diffusion equation; the weight of the distance field is used to distinguish the key areas of the model; the frame field conforming to the characteristics of the mesh model is calculated through the frame field theory; Step 3, for the curved mesh model in step 2, it is planar parameterized, and the deformation degree generated in the parameterization process is considered, and the Jacobian is used for measurement; if it is a planar mesh model, the deformation degree can be recorded as 1; the boundary contour background picture of the planar model or the parameterized curved model is generated by using the scan line algorithm, which is used for subsequent boundary collision detection; Step 4, the super-elliptical function is used to represent the bounding box of the word, which is regarded as a movable component; using its mathematical form, the target function of the weight sum of the component covering the sampling points is established in the distance field representing the key area; in the frame field representing the characteristics of the model, the target function of measuring the consistency of the word placement angle with the frame direction is established; the above optimization model is used to fill the important words first; in order to avoid overlapping between the words in the optimization process, the separation axis theorem is used to add collision overlap constraints in the optimization model; Step 5, the solution of the optimization problem is divided into four stages: in the first stage, only the position of the word is considered, and the collision overlap constraint is not considered, and the initial position of the word is solved by using a heuristic algorithm; in the second stage, only the position of the word is considered, and the collision overlap constraint is not considered, and the position of the word in the model is solved by using a nonlinear optimization algorithm; in the third stage, only the placement angle of the word is considered, and the collision overlap constraint is not considered, and the placement angle of the word is solved by using a nonlinear optimization algorithm; in the last fourth stage, the position, angle and collision overlap constraint of the word are considered, and the final placement position and angle of the word are solved by using a nonlinear optimization algorithm; Step 6, the position and placement angle of the word in the solution obtained in step 5 are used to generate the corresponding word on the picture; in order to ensure the accuracy of the result and to lay the foundation for the subsequent steps, a four-ary tree based on the font pixels is generated for the word picture, which is used for fast pixel-level collision detection between each other; in the filling process, a scene management dynamic quadtree needs to be established on the picture to screen out the potential overlapping word set and avoid unnecessary collision detection; Step 7, the streamline in the frame field in step 2 is extracted; the streamline is used to guide the filling of the non-important word set S2, so as to fill the remaining space of the model; Step 8, if it is a two-dimensional planar model, the final word cloud map is directly generated; if it is a three-dimensional curved surface model, the generated word cloud map is used as the model texture map to be viewed in the three-dimensional model visualization software.
2. The method of claim 1, wherein: Step 3 also considers the case of three-dimensional curved surface model, and introduces the curved surface parameterization method for unified processing with the two-dimensional planar case.
3. The method of claim 1, wherein: In step 4, the layout optimization model of the word with collision overlap constraint in two fields is established by using the super-elliptic implicit function in step 4: where x j is the position coordinate of the sampling point in the model, p j is the triangle that x j belongs to, J is the Jacobian, w j is the weight value of the distance field, θ i and c i are the placement angle and center position of the word respectively, q(c i ) is the direction of the frame closest to c i , d i (θ i ) is the direction vector of the word i, Γ ij is the collision constraint between word i and word j, t ijs (s = 0, 1, 2, 3) are the test quantities of the two words on the four projection axes between them; In step 5, in order to solve the solution of the optimization objective function in step 4, the optimization solution is divided into four stages by fixing variables and relaxing constraints to quickly solve the solution of the optimization problem.
4. The method of claim 1, wherein: Step 6 also includes: establishing a pixel-based quadtree for fast and accurate detection of whether collision overlap occurs between words, and establishing a dynamic background quadtree for fast query collision detection of the word set in the scene management; Step 7 also includes: establishing BVH bounding box by modeling, using the frame field, quickly extracting the streamline on the model surface, and guiding the layout of the secondary important word set S2.
Citation Information
Patent Citations
Method and device for generating shape word cloud
CN110189393A
Triad-based word cloud display method and device
CN111143559A