Graphics generation method, device, computer equipment and storage medium

By identifying and normalizing the point sequence in the graph trajectory, directly generating graphs that meet the needs, solving the problem of low graphics generation efficiency in traditional technology, and achieving flexible and accurate graph generation.

CN113763505BActive Publication Date: 2025-01-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110460674.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-27
Publication Date
2025-01-10
Estimated Expiration
2041-04-27

AI Technical Summary

Technical Problem

In traditional technology, users need to select the shape of the graph first and then drag and draw it, resulting in the drawn graphics that do not meet the actual needs and need to be adjusted repeatedly, making the operation efficiency inefficient.

Method used

By identifying the sequence of points in the input graphic track, identifying the graphic types and shapes step by step, normalizing according to the target shape to generate standardized graphics, and directly drawing graphics that meet the needs.

Benefits of technology

Improves the efficiency and accuracy of graphics generation, and users can draw graphic tracks at will without first selecting shapes. They support the identification and standardization of various types of graphics, reduce memory loss and realize real-time processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113763505B_ABST
    Figure CN113763505B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for generating graphics. The method comprises: according to a point sequence in an input graphic trajectory, performing closed recognition on a graphic to be standardized represented by the graphic trajectory to obtain a graphic type; according to at least part of the points in the point sequence, identifying the shape of the graphic to be standardized under the graphic type that the graphic to be standardized conforms to, and using the conforming shape as the current shape; if the current shape has a subordinate shape, then according to the target recognition point that identifies the current shape, identifying the subordinate shape that the graphic to be standardized conforms to, and using the subordinate shape as the new current shape to continue execution; if the current shape does not have a subordinate shape, determining the current shape as a target shape; according to the target shape, normalizing the graphic to be standardized to generate a standardized graphic. The use of this method can improve the efficiency of graphics generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of science and technology, electronic devices and various apps have emerged in an endless stream. People are no longer limited to drawing graphics on paper or blackboards, but can draw graphics on electronic screens, which has important applications in scenarios such as remote conferencing, online education, and electronic notes.

[0003] In the conventional technology, the user is generally required to first select the desired graphic shape, and then drag on the electronic screen to draw a standard graphic that conforms to the graphic shape. However, the method of first selecting the graphic shape and then dragging and drawing often does not meet the actual needs of the user. The user needs to repeatedly adjust the drawn graphic to obtain a satisfactory graphic. This makes the operation more cumbersome and inefficient. Summary of the invention

[0004] Based on this, it is necessary to provide a graphics generation method, device, computer equipment and storage medium that can improve efficiency in response to the above technical problems.

[0005] A method for generating a graph, characterized in that the method comprises:

[0006] According to the point sequence in the input graphic trajectory, closed recognition is performed on the graphic to be standardized represented by the graphic trajectory to obtain the graphic type;

[0007] According to at least some points in the point sequence, identifying a shape of the graphic type to be standardized that matches, and using the matching shape as a current shape;

[0008] If the current shape has subordinate shapes, then

[0009] According to the target recognition point of the current shape, a subordinate shape to which the to-be-standardized figure conforms is recognized, and the subordinate shape is used as a new current shape to continue execution;

[0010] If the current shape does not have a subordinate shape, determining the current shape as a target shape;

[0011] According to the target shape, the graphic to be standardized is standardized to generate a standardized graphic.

[0012] A graphics generating device, characterized in that the device comprises:

[0013] A graphic recognition module, used for performing closed recognition on the graphic to be standardized represented by the graphic trajectory according to the point sequence in the input graphic trajectory, and obtaining the graphic type;

[0014] The graphic recognition module is further used to identify the shape of the graphic to be standardized under the graphic type according to at least some points in the point sequence, and use the shape that meets the requirements as the current shape;

[0015] The graphic recognition module is further configured to, if the current shape has a subordinate shape, identify the subordinate shape that the graphic to be standardized conforms to based on the target recognition point identified for the current shape, and use the subordinate shape as a new current shape to continue execution;

[0016] The graphic recognition module is further configured to determine the current shape as a target shape if the current shape does not have a subordinate shape;

[0017] The graphic standardization module is used to standardize the graphic to be standardized according to the target shape to generate a standardized graphic.

[0018] In one embodiment, the graphic recognition module is also used to, if it is identified based on at least some points in the point sequence that the graphic to be standardized does not conform to the current shape to be recognized under the graphic type, then use the next shape under the graphic type as the current shape to be recognized to continue execution; if it conforms to the current shape to be recognized, use the current shape to be recognized as the current shape.

[0019] In one embodiment, the graphic type is a non-closed graphic type; the shape under the non-closed graphic type includes a straight line; the graphic recognition module is also used to identify the graphic to be standardized as a straight line based on the concentration degree of at least some points in the point sequence relative to the selected reference straight line, and then use the straight line as the current shape.

[0020] In one of the embodiments, the graphic type is a non-closed graphic type; the shape under the non-closed graphic type includes a corner; the graphic recognition module is also used to deduplicate the convex hull points in the point sequence to obtain target convex hull points; if the graphic to be standardized is identified as a corner according to the number of the target convex hull points, the corner is used as the current shape.

[0021] In one of the embodiments, the graphic type is a closed graphic type; the shape under the closed graphic type includes a polygon; the graphic recognition module is also used to deduplicate the convex hull points in the point sequence to obtain target convex hull points; if the shape composed of points between adjacent target convex hull points is a straight line, the graphic to be standardized is identified as a polygon, and the polygon is used as the current shape.

[0022] In one of the embodiments, the target identification point is the target convex hull point; the graphic recognition module is also used to identify the subordinate shape that the graphic to be standardized conforms to from the subordinate shapes of the polygon according to the number of the target convex hull points; and use the subordinate shape as the new current shape to continue execution.

[0023] In one of the embodiments, the graphic recognition module is also used to assign corresponding position numbers to each of the target convex hull points according to the arrangement order of the target convex hull points if the new current shape is a pentagon and the length difference between the sides of the pentagon composed of adjacent target convex hull points is less than or equal to a first threshold; determine the difference between the position numbers corresponding to the adjacent target convex hull points in the input order; and determine that the graphic to be standardized is a five-pointed star if the difference satisfies the convex hull point constraint condition of the five-pointed star.

[0024] In one of the embodiments, the graphic type is a closed graphic type; the shapes under the closed graphic type include ellipses; the graphic recognition module is also used to perform principal component analysis on the point sequence to determine the principal component direction of the graphic to be standardized; rotate the graphic to be standardized according to the angle between the principal component direction and the first coordinate axis in the plane rectangular coordinate system; project the rotated graphic to be standardized onto each coordinate axis in the plane rectangular coordinate system to obtain the major axis and minor axis of the graphic to be standardized; if the degree of proximity between the lengths of the major axis and the minor axis is greater than or equal to a second threshold, identify the graphic to be standardized as an ellipse, and use the ellipse as the current shape.

[0025] In one embodiment, the target shape is an ellipse; the figure to be standardized is an ellipse figure to be standardized; the graphic standardization module is also used to determine the center position coordinates of the ellipse figure to be standardized based on the position coordinates of at least some points in the point sequence in the plane rectangular coordinate system; based on the center position coordinates of the ellipse figure to be standardized, the lengths of the major axis and the minor axis, and the angle, a standardized target ellipse figure is generated.

[0026] In one of the embodiments, the graphic specification module is further configured to determine key points of the target shape if the target shape matches the first normalization method, and connect the key points to generate a standard graphic.

[0027] In one of the embodiments, the graphic standardization module is further used to fix the positions of some target convex hull points in the target convex hull points after deduplication in the point sequence if the target shape matches the second normalization method; adjust the positions of the unfixed target convex hull points according to the shape characteristics of the target shape and the size characteristics of the graphic to be standardized to generate a standardized graphic.

[0028] In one of the embodiments, the graphic standardization module is also used to determine the position features, angle features and size features of the graphic to be standardized based on the target convex hull points after deduplication in the point sequence if the target shape matches the third normalization method; and perform affine transformation on the graphic template corresponding to the target shape according to the position features, angle features and size features to generate a standardized graphic.

[0029] In one embodiment, the target shape is a five-pointed star; the figure to be standardized is a five-pointed star figure to be standardized; the figure standardization module is also used to determine the center position coordinates of the five-pointed star figure to be standardized according to the position coordinates of the target convex hull points after deduplication in the point sequence; determine the rotation angle of the five-pointed star figure to be standardized according to the deviation position information of any of the target convex hull points relative to the preset coordinate axis; determine the side length of the regular pentagon corresponding to the five-pointed star figure to be standardized according to the side lengths of the figures composed of the target convex hull points; perform affine transformation on the regular pentagon template according to the center position coordinates of the five-pointed star figure to be standardized, the rotation angle and the side length of the corresponding regular pentagon to generate a standardized regular pentagon figure; connect the vertices of the standardized regular pentagon figure in sequence according to the input order of the corresponding target convex hull points to generate a standardized target five-pointed star figure.

[0030] A computer device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps in the graphics generation method described in each embodiment of the present application.

[0031] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps in the graphics generation method described in each embodiment of the present application.

[0032] A computer program product or a computer program, wherein the computer program product or the computer program comprises computer instructions, wherein the computer instructions are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the graphics generation method described in each embodiment of the present application.

[0033] The above-mentioned graphics generation method, device, computer equipment and storage medium first perform closed recognition on the graphics to be standardized represented by the graphics trajectory according to the point sequence in the input graphics trajectory to obtain the graphics type, then identify the shape under the graphics type that the graphics to be standardized conform to according to at least part of the points in the point sequence, and use the conforming shape as the current shape, then, if the current shape has a subordinate shape, then identify the subordinate shape that the graphics to be standardized conform to according to the target recognition point that identifies the current shape, and use the subordinate shape as the new current shape to continue execution, if the current shape does not have a subordinate shape, determine the current shape as the target shape, and finally, according to the target shape, perform normalization processing on the graphics to be standardized to generate a standardized graphics. In this way, directly according to the point sequence in the input graphics trajectory, the shape of the graphics to be standardized represented by the input graphics trajectory is sequentially identified layer by layer, and then according to the target shape, the graphics to be standardized are normalized to generate a standardized graphics, which can flexibly perform normalization processing on any input graphics trajectory to generate a standardized graphics, without the need to first select the graphics shape, then drag and draw and repeatedly adjust, thereby improving the efficiency of graphics generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 An application environment diagram of a graphics generation method in an embodiment;

[0035] Figure 2 A diagram of an application environment of a graphics generation method in another embodiment;

[0036] Figure 3 A schematic diagram of a flow chart of a method for generating a graph in one embodiment;

[0037] Figure 4 A schematic diagram showing a comparison between a non-closed graphic type graphic and a closed graphic type graphic in one embodiment;

[0038] Figure 5 A comparison diagram of the effects before and after normalization processing in one embodiment;

[0039] Figure 6 A schematic diagram of a flow chart of graphic recognition in one embodiment;

[0040] Figure 7 is a schematic diagram of a curve graph to be standardized in one embodiment;

[0041] Figure 8 A schematic diagram of identifying and normalizing a straight line to be normalized in one embodiment;

[0042] Fig. 9 is a schematic diagram of a convex hull point in one embodiment;

[0043] Fig.10 is a schematic diagram of a convex hull point before deduplication processing in one embodiment;

[0044] Fig.11 It is a schematic diagram of the effect after deduplication processing is performed on convex hull points in one embodiment;

[0045] Fig.12 A schematic diagram showing a comparison between a polygon and a non-polygon in one embodiment;

[0046] Fig.13 A schematic diagram of the recognition and normalization processing of a five-pointed star pattern to be normalized in one embodiment;

[0047] Fig.14 A schematic diagram of an ellipse figure to be standardized and a normalization process in one embodiment;

[0048] Fig.15 A schematic diagram of a standardized target curve graph obtained after normalization processing in one embodiment;

[0049] Fig.16 A schematic diagram showing a comparison of a straight line graph to be standardized before and after normalization processing in one embodiment;

[0050] Fig.17 A schematic diagram showing a comparison of an angle to be standardized before and after normalization processing in one embodiment;

[0051] Fig.18 A schematic diagram showing a comparison of a normal triangle to be standardized before and after normalization in one embodiment;

[0052] Fig.19 A schematic diagram showing a comparison of a common quadrilateral to be standardized before and after normalization in one embodiment;

[0053] Fig. 20 A schematic diagram showing a comparison of a common pentagon to be standardized before and after normalization in one embodiment;

[0054] Fig.21 A schematic diagram showing a comparison of a common hexagon to be standardized before and after normalization in one embodiment;

[0055] Fig. 22 A schematic diagram showing a comparison of a right triangle to be standardized before and after normalization in one embodiment;

[0056] Fig.23 A schematic diagram showing a comparison of a trapezoid to be standardized before and after normalization processing in an embodiment;

[0057] Fig.24 A schematic diagram showing a comparison of a parallelogram to be standardized before and after normalization in one embodiment;

[0058] Fig.25 A schematic diagram showing a comparison of an equilateral triangle to be standardized before and after normalization in one embodiment;

[0059] Fig.26 A schematic diagram showing a comparison of a square to be standardized before and after normalization in one embodiment;

[0060] Fig. 27 A schematic diagram showing a comparison of a regular pentagon to be standardized before and after normalization in one embodiment;

[0061] Fig.28 A schematic diagram showing a comparison of a regular hexagon to be standardized before and after normalization in one embodiment;

[0062] Fig.29 A schematic diagram showing a comparison of a rectangle to be standardized before and after normalization in one embodiment;

[0063] Fig.30 A schematic diagram showing a comparison of a diamond to be standardized before and after normalization processing in an embodiment;

[0064] Fig.31 is a structural block diagram of a graphics generating device in one embodiment;

[0065] Fig.32 is an internal structure diagram of a computer device in one embodiment;

[0066] Fig.33 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0068] In one embodiment, the graphics generation method provided by the present application can be applied to Figure 1 In the application environment shown. Among them, the first terminal 102 communicates with the server 104 through the network. The second terminal 106 communicates with the server 104 through the network. The number of second terminals 106 is at least one. Among them, the first terminal 102 and the second terminal 106 can be but are not limited to various personal computers, laptops, smart phones, tablets and portable wearable devices. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. It can be understood that Figure 1The two first terminals 102 in the figure are actually the same terminal. The two terminals are drawn here to illustrate the different screen contents displayed by the first terminal 102 before and after the graphics are normalized.

[0069] Specifically, user A can input a graphic trajectory through the first terminal 102, the first terminal 102 can obtain a point sequence in the graphic trajectory, and then send the point sequence in the graphic trajectory to the server 104. The server 104 can execute the graphic specification method in each embodiment of the present application according to the point sequence in the graphic trajectory to generate a standard graphic. The server 104 can send the standard graphic to the first terminal 102 used by user A and the second terminal 106 used by other users (such as user B, user C and user D) who join the same remote session scene with user A. The first terminal 102 and the second terminal 106 can display the standard graphic. It is also possible that the first terminal 102 sends the graphic trajectory to the server 104, and the server 104 determines the point sequence in the graphic trajectory, which is not limited.

[0070] In other application environments, the first terminal 102 may also execute the graphics generation method in each embodiment of the present application, and then the first terminal 102 may directly send the generated standard graphics to the second terminal 106, thereby realizing end-to-end communication between the terminals.

[0071] It can be understood that the application scenarios in the above embodiments can be applied to scenarios such as remote conferences or online education. In a remote conference scenario, user A can be the conference host, and other users (such as user B, user C, and user D) who join the same remote session scenario with user A can be participants other than the conference host. In an online education scenario, user A can be a lecturer, and other users (such as user B, user C, and user D) who join the same online education scenario with user A can be students attending the class.

[0072] In one embodiment, the graphics generation method provided by the present application can be applied to Figure 2 In the application environment shown. The first terminal 102 communicates with the server 104 through the network. The first terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. It can be understood that Figure 2The two first terminals 102 in the figure are actually the same terminal. The two terminals are drawn here to illustrate the different screen contents displayed by the first terminal 102 before and after the graphics are normalized.

[0073] Specifically, user A can input a graphic trajectory through the first terminal 102, the first terminal 102 can obtain a point sequence in the graphic trajectory, and then send the point sequence in the graphic trajectory to the server 104. The server 104 can execute the graphic specification method in each embodiment of the present application according to the point sequence in the graphic trajectory to generate a standard graphic. The server 104 can send the standard graphic to the first terminal 102, and the first terminal 102 can display the standard graphic. Alternatively, the first terminal 102 can send the graphic trajectory to the server 104, and the server 104 determines the point sequence in the graphic trajectory, which is not limited.

[0074] In other application environments, the first terminal 102 may also execute the graphics generation method in each embodiment of the present application to generate and display a standard graphics without being processed by the server.

[0075] It can be understood that the application scenarios in the above embodiments can be applied to scenarios such as recording electronic notes. In the scenario of recording electronic notes, user A is the user who records the electronic notes.

[0076] In one embodiment, the graphic generation method in each embodiment of the present application can be implemented by using a machine learning method in the field of artificial intelligence. For example, the step of identifying the shape that the graphic to be standardized conforms to can be implemented by using a machine learning method.

[0077] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0078] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0079] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0080] In one embodiment, Figure 3 As shown, a method for generating a graph is provided. The method for generating a graph can be executed by a server or a terminal, or by both the terminal and the server. In the embodiment of the present application, the method is applied to Figure 1 or Figure 2 The server in the example is used to illustrate the following steps:

[0081] Step 302: According to the point sequence in the input graphic trajectory, closed recognition is performed on the graphic to be standardized represented by the graphic trajectory to obtain the graphic type.

[0082] Among them, the figure trajectory is the trajectory line that constitutes the figure. The point sequence is a sequence of points. The figure to be standardized is the figure represented by the figure trajectory. Closure recognition is to identify whether the figure to be standardized is closed. The figure type is the type divided according to the closure of the figure to be standardized.

[0083] In one embodiment, the graphic trajectory may be a graphic trajectory input by hand-drawing. In another embodiment, the graphic trajectory may be a graphic trajectory in an existing image. In other embodiments, the graphic trajectory may also be in other forms, which are not limited.

[0084] In one embodiment, the graphic trajectory of hand-drawn input may be a graphic trajectory generated by a user dragging on a display screen by at least one of a finger, a mouse cursor, a stylus, etc. In one embodiment, if a user generates a graphic trajectory by dragging a finger on a display screen, the terminal may determine that the input of the graphic trajectory is finished when it detects that the finger is moved away from the display screen. In one embodiment, if a user generates a graphic trajectory by clicking a mouse and dragging a cursor on a display screen, the terminal may determine that the input of the graphic trajectory is finished when it detects that the mouse is released. In one embodiment, if a user generates a graphic trajectory by dragging a stylus on a display screen, the terminal may determine that the input of the graphic trajectory is finished when it detects that the stylus is moved away from the display screen.

[0085] In one embodiment, the user can draw a graphic track on a drawing board or canvas displayed on the terminal, and the drawing board or canvas can obtain the stroke coordinates of the graphic track.

[0086] In one embodiment, the terminal can sample the input graphic trajectory at a preset frequency during the process of receiving the hand-drawn input graphic trajectory, and obtain a point sequence when the end of the input is detected, and then send the sampled point sequence to the server. The server can perform closed recognition on the graphic to be standardized represented by the graphic trajectory according to the point sequence.

[0087] In another embodiment, the terminal may sample the input completed graphic trajectory at a preset distance interval, and then send the point sequence in the sampled graphic trajectory to the server. The server may perform closed recognition on the graphic to be standardized represented by the graphic trajectory based on the point sequence in the sampled graphic trajectory.

[0088] In other embodiments, the terminal may send the received input completed graphic trajectory to the server, and the server may sample the graphic trajectory at a preset distance interval, and perform closed recognition on the to-be-standardized graphic represented by the graphic trajectory based on the point sequence in the sampled graphic trajectory.

[0089] In one embodiment, the points in the point sequence may be arranged in the order of input time.

[0090] In one embodiment, the information of the obtained point sequence may include the position coordinates of each point in the point sequence in a plane rectangular coordinate system. The position coordinates of each point in the point sequence include the coordinate values ​​of the point on each coordinate axis in the plane rectangular coordinate system. The position coordinates of each point in the point sequence can be represented by an array. For example: assuming that the length of the point sequence is N, and the plane rectangular coordinate system includes an x-axis and a y-axis, the position coordinates of each point in the point sequence include the coordinate value of the point on the x-axis and the coordinate value on the y-axis, and the array size of the point sequence is N*2, that is, each point corresponds to two values.

[0091] In one embodiment, the graphic type may include a closed graphic type and a non-closed graphic type, wherein the closed graphic type refers to a graphic to be standardized that is a closed graphic, and the non-closed graphic type refers to a graphic to be standardized that is an open graphic.

[0092] In one embodiment, the server may perform closed recognition on the to-be-standardized graphic represented by the graphic trajectory according to the distance between the starting point and the ending point in the point sequence to obtain the graphic type.

[0093] In one embodiment, the server may compare the distance between the starting point and the ending point in the point sequence with the first distance threshold to determine the graphic type of the graphic to be standardized.

[0094] In one embodiment, if the distance between the starting point and the ending point in the point sequence is greater than or equal to the first distance threshold, the server may determine that the graphic type of the graphic to be standardized is a non-closed graphic type. In one embodiment, if the distance between the starting point and the ending point in the point sequence is less than the first distance threshold, the server may determine that the graphic type of the graphic to be standardized is a closed graphic type.

[0095] like Figure 4 As shown, the distance between the starting point and the end point of the to-be-standardized figure 402 is obviously large, greater than or equal to the first distance threshold, so the server can identify the figure type of the to-be-standardized figure 402 as a non-closed figure type. The distance between the starting point and the end point of the to-be-standardized figure 404 is obviously small, less than the first distance threshold, so the server can identify the figure type of the to-be-standardized figure 404 as a closed figure type.

[0096] Step 304: identifying a shape of a graphic type that the graphic to be standardized conforms to based on at least some of the points in the point sequence, and using the conforming shape as the current shape.

[0097] The shapes under the graphic type refer to the shapes belonging to the graphic type.

[0098] In one embodiment, the shape under the closed figure type may include at least one of a polygon, an ellipse, a circle, and the like.

[0099] In one embodiment, the shape under the non-closed figure type may include at least one of a straight line, an angle, and a curve.

[0100] In one embodiment, the server can sequentially identify whether the graphic to be standardized conforms to each shape to be identified under the graphic type. If it does not conform to the current shape to be identified, it will continue to identify whether it conforms to the next shape to be identified until the shape to be identified that the graphic to be standardized conforms to is identified, and the conforming shape to be identified is used as the current shape.

[0101] In another embodiment, the server may directly identify at one time which shape of the graphic to be standardized matches the graphic type, and use the identified matching shape as the current shape.

[0102] Step 306, if the current shape has a subordinate shape, then according to the target recognition point of the current shape, the subordinate shape that the figure to be standardized conforms to is recognized, and the subordinate shape is used as the new current shape to continue execution.

[0103] The subordinate shape refers to the subordinate shape obtained by further dividing the current shape, and the target recognition point is the point used to recognize the current shape.

[0104] For example, the subordinate shapes of polygons may include at least one of triangles, quadrilaterals, pentagons, and hexagons, etc. The subordinate shapes of triangles may include at least one of right triangles, equilateral triangles, and ordinary triangles that are not right angles or equilateral.

[0105] It can be understood that the current shape can have multiple levels of subordinate shapes. For example, as in the above example, the subordinate shapes of the polygon include triangles, and the triangle itself also has subordinate shapes.

[0106] Specifically, if the current shape has a subordinate shape, the server can identify the subordinate shape that the figure to be standardized conforms to based on the target identification point identified by the current shape, and use the subordinate shape as the new current shape. If the new current shape has a subordinate shape, the server can identify the subordinate shape that the figure to be standardized conforms to based on the target identification point identified by the new current shape, and use the subordinate shape as the new current shape, and so on, until the new current shape does not have a subordinate shape, and then execute step 308 to determine the current shape as the target shape.

[0107] Step 308: If the current shape does not have a subordinate shape, the current shape is determined as the target shape.

[0108] The target shape refers to the shape that the identified graphic to be standardized conforms to.

[0109] Specifically, if the current shape determined for the first time does not have a subordinate shape, the server can directly perform the step of determining the current shape as the target shape. If the current shape determined for the first time has a subordinate shape, the server can iteratively determine a new current shape according to step 306 until the new current shape does not have a subordinate shape, and then perform the step of determining the current shape as the target shape.

[0110] Step 310: According to the target shape, the standard graphic is normalized to generate a standard graphic.

[0111] The normalization process refers to the process of correcting a non-standardized figure to be standardized into a standardized figure with a standardized shape. The standardized figure refers to a figure that meets the target shape of the figure to be standardized and has a standardized shape.

[0112] It is understandable that the figure represented by the figure trajectory may not be a figure of standard shape, therefore, it is necessary to perform standardization processing on the figure to be standardized represented by the figure trajectory to generate a corresponding standard figure. For example, the standardization processing may be to correct the opposite sides that are not exactly parallel in the figure to be standardized to be exactly parallel sides, or to correct the angles that are approximately right angles (i.e., 90 degrees) in the figure to be standardized to be exactly right angles (i.e., 90 degrees), or to correct the lines that are not straight enough to be straight lines, etc.

[0113] like Figure 5 As shown, 502 is the graphic trajectory input by the user by dragging the mouse. It can be seen that the shape of the graphic to be standardized represented by the input graphic trajectory is not standardized, and is approximately a triangle, but not a triangle with a standardized shape. 504 is the standardized graphic generated after the normalization process. It can be seen that the standardized graphic is a triangle with a standardized shape, and its shape is more standardized than the graphic in the left figure.

[0114] Specifically, the server can determine a normalization method that matches the target shape according to the target shape, and then perform normalization processing on the standard graphic according to the matched normalization method to generate a standard graphic that meets the target shape and has a normalized shape. The server can send the standard graphic to the terminal, and the terminal can display the standard graphic.

[0115] In one embodiment, the terminal may clear the input graphic track displayed on the display screen, and display a standard graphic at a corresponding position, so as to transform the non-standard graphic track into a standard graphic for display.

[0116] In one embodiment, the graphic generation method in each embodiment of the present application can be executed by a graphic recognition module and a graphic beautification module. The server can execute steps 302 to 308 through the graphic recognition module and execute step 310 through the graphic beautification module.

[0117] The graphic recognition module is a hierarchical model recognition model, which is used to identify the shapes of the graphics to be standardized in order according to the hierarchy. The graphic beautification module is used to standardize the graphics to be standardized according to the target shapes recognized by the graphic recognition module to generate standardized graphics.

[0118] In one embodiment, the graphic recognition module and the graphic beautification module can be independently configured, and the graphic recognition module and the graphic beautification module can be replaced respectively.

[0119] In one embodiment, the method for performing pattern recognition in each embodiment of the present application adopted by the pattern recognition module can be replaced by a multi-layer perceptron. Specifically, a classification neural network can be defined and trained, and then the trained classification neural network can be used to perform pattern recognition.

[0120] The above-mentioned graphics generation method firstly performs closed recognition on the graphics to be standardized represented by the graphics trajectory according to the point sequence in the input graphics trajectory to obtain the graphics type, then identifies the shape under the graphics type that the graphics to be standardized conform to according to at least part of the points in the point sequence, and uses the conforming shape as the current shape, then, if the current shape has a subordinate shape, identifies the subordinate shape that the graphics to be standardized conform to according to the target recognition point that identifies the current shape, and uses the subordinate shape as the new current shape to continue execution, if the current shape does not have a subordinate shape, determines the current shape as the target shape, and finally, according to the target shape, performs normalization processing on the graphics to be standardized to generate a standardized graphics. In this way, directly according to the point sequence in the input graphics trajectory, the shape of the graphics to be standardized represented by the input graphics trajectory is sequentially identified layer by layer, and then according to the target shape, the graphics to be standardized are normalized to generate a standardized graphics, which can flexibly perform normalization processing on any input graphics trajectory to generate a standardized graphics, without first selecting the graphics shape, and then dragging and drawing and repeatedly adjusting, thereby improving the graphics generation efficiency, and the user has no constraints in drawing the graphics trajectory, and can draw at will, thereby improving the interaction efficiency.

[0121] In addition, by successively identifying the shape of the graphics to be standardized represented by the input graphics trajectory level by level, a large number of graphics types can be identified, which increases the number of graphics types supported by the method, and can accurately identify the shape of the graphics to be standardized and perform corresponding standardization processing, thereby generating accurate standardized graphics and improving the accuracy of graphics generation. And based on the point sequence in the graphics trajectory, the algorithm is simple, reduces memory loss, and supports online real-time processing.

[0122] In one embodiment, based on at least some points in a point sequence, a shape under a graphic type that a graphic to be standardized conforms to is identified, and the conforming shape is used as a current shape, including: if based on at least some points in a point sequence, it is identified that the graphic to be standardized does not conform to the current shape to be identified under the graphic type, then the next shape under the graphic type is used as the current shape to be identified to continue execution; if it conforms to the current shape to be identified, then the current shape to be identified is used as the current shape.

[0123] Specifically, the server can first identify whether the graphic to be standardized conforms to the first shape to be identified under the graphic type. If not, it can continue to identify whether the graphic to be standardized conforms to the second shape to be identified under the graphic type. If not, it can continue to identify whether the graphic to be standardized conforms to the third shape to be identified under the graphic type, and so on, until it is identified that the shape to be identified that the graphic to be standardized conforms to is found, and the conforming shape to be identified is used as the current shape.

[0124] For example, Figure 6As shown, if the graphic type is a closed graphic type, the server can first identify whether the graphic to be standardized conforms to the first shape to be identified under the closed graphic type, that is, whether it conforms to a polygon. If not, the server can continue to identify whether the graphic to be standardized conforms to the second shape to be identified under the closed graphic type, that is, whether it conforms to an ellipse, until the shape to be identified that the graphic to be standardized conforms to is identified. If the graphic type is a non-closed graphic type (that is, not a closed graphic type), the server can first identify whether the graphic to be standardized conforms to the first shape to be identified under the non-closed graphic type, that is, whether it conforms to a straight line. If not, the server can continue to identify whether the graphic to be standardized conforms to the second shape to be identified under the non-closed graphic type, that is, whether it conforms to an angle, until the shape to be identified that the graphic to be standardized conforms to is identified.

[0125] In the above embodiment, the server can identify, according to at least part of the points in the point sequence and the graphic type of the graphic to be identified, whether the shape of the graphic to be standardized conforms to the current shape to be identified under the graphic type. It can accurately determine the shape of the graphic to be standardized, supports a wide variety of shapes, and is highly practical.

[0126] In one embodiment, the graphic type is a non-closed graphic type. The shapes under the non-closed graphic type include straight lines. In this embodiment, the shape under the graphic type that the graphic to be standardized conforms to is identified based on at least some of the points in the point sequence, and the conforming shape is used as the current shape, including: if the graphic to be standardized is identified as a straight line based on the concentration degree of at least some of the points in the point sequence relative to the selected reference straight line, the straight line is used as the current shape.

[0127] The degree of concentration refers to the degree to which at least some points in the point sequence are close to the reference straight line.

[0128] It can be understood that the greater the concentration, the closer at least some points in the point sequence are to the reference straight line, and the shape of the figure to be standardized conforms to the straight line. The smaller the concentration, the farther at least some points in the point sequence are from the reference straight line, and the shape of the figure to be standardized does not conform to the straight line.

[0129] Specifically, the server may first select a reference straight line, determine the concentration of at least some points in the point sequence relative to the reference straight line, and then identify whether the shape of the figure to be standardized is a straight line according to the concentration. If the figure to be standardized is identified as a straight line, the server may use the straight line as the current shape, because the straight line does not have a subordinate shape, so the server may determine the straight line as the target shape. If the figure to be standardized is identified as not a straight line, the server may identify whether the figure to be standardized meets the next shape to be identified under the non-closed figure type to continue execution.

[0130] In one embodiment, the shapes under the non-closed figure type also include angles. If it is identified that the figure to be standardized is not a straight line, the server can identify whether the figure to be standardized is an angle. If it is identified that the figure to be standardized is an angle, the server can use the angle as the current shape, and if the angle does not have a subordinate shape, the server can determine the angle as the target shape.

[0131] In one embodiment, the shape under the non-closed figure type also includes a curve. If the figure to be standardized is not a straight line and is not an angle, the server can identify the figure to be standardized as a curve. Figure 7 The figure shows the graphical trajectory when it is identified as a curve.

[0132] In one embodiment, the server may select a line connecting the starting point and the ending point in the point sequence as a reference line. Figure 8 As shown, 8002 is a straight line figure to be standardized, and straight line 8004 is the selected reference straight line. The server can select the line connecting the starting point and the end point 8008 and 8010 as the reference straight line.

[0133] In one embodiment, the concentration degree of at least some points in the point sequence relative to the selected reference straight line may be the concentration degree of each point in the point sequence relative to the selected reference straight line. In another embodiment, the concentration degree of at least some points in the point sequence relative to the selected reference straight line may be the concentration degree of some points selected from the point sequence according to a preset selection rule relative to the selected reference straight line.

[0134] In one embodiment, the server may determine the degree of concentration according to the distance of at least some of the points in the point sequence relative to the reference straight line.

[0135] In one embodiment, the server may determine a distance characterization value based on the distance of each point in at least part of the points in the point sequence relative to the reference straight line, and then determine the degree of concentration based on the distance characterization value.

[0136] In one embodiment, the server may use the maximum value of the distances of at least some of the points in the point sequence relative to the reference straight line as the distance representation value. Figure 8 The distance between point 8006 in the point sequence and reference line 8004 is the maximum distance relative to the reference line, which can be used as the distance representation value. In another embodiment, the server can also use the average value of the distances of at least some of the points in the point sequence relative to the reference line as the distance representation value. In other embodiments, the server can also use other statistical values ​​corresponding to the distances of at least some of the points in the point sequence relative to the reference line as the distance representation value, without limitation.

[0137] In one embodiment, the server may compare the distance characterization value with the second distance threshold to determine the degree of concentration. If the distance characterization value is greater than or equal to the second distance threshold, it indicates that the degree of concentration is large, and the server may determine that the shape of the figure to be standardized does not conform to a straight line. If the distance characterization value is less than the second distance threshold, it indicates that the degree of concentration is small, and the server may determine that the shape of the figure to be standardized is a straight line.

[0138] In the above embodiment, if the graphic type is a non-closed graphic type, the server can accurately identify whether the graphic to be standardized is a straight line according to the concentration degree of at least some points in the point sequence relative to the selected reference straight line.

[0139] In one embodiment, the graphic type is a non-closed graphic type. The shapes under the non-closed graphic type include corners. In this embodiment, according to at least part of the points in the point sequence, identifying the shape under the graphic type that the graphic to be standardized conforms to, and taking the conforming shape as the current shape includes: performing deduplication processing on the convex hull points in the point sequence to obtain target convex hull points; if the graphic to be standardized is identified as a corner according to the number of target convex hull points, taking the corner as the current shape.

[0140] The convex hull is the smallest convex polygon that can contain all input points. The convex hull point is the input point on the convex hull. The convex hull point in the point sequence refers to the point on the smallest convex polygon that can contain all the points in the point sequence. Fig. 9 As shown, all the points in the figure are input points, the convex shape in the figure is the smallest convex shape that can contain all the input points, and the points in the figure located on the convex shape are convex hull points.

[0141] De-duplication is the process of retaining the points that can reflect the shape characteristics of the graphics in the convex hull points and removing the rest of the points. Fig.10 The points in are the convex hull points in the point sequence before deduplication. Fig.11 The points in Fig.10 The target convex hull point is obtained after deduplication of each convex hull point in .

[0142] Specifically, the server may first determine the convex hull points in the point sequence, then perform deduplication processing on the convex hull points in the point sequence to obtain the target convex hull points, and then identify whether the figure to be standardized is a corner according to the number of the target convex hull points. If the figure to be standardized is identified as a corner, the server may use the corner as the current shape, because the corner does not have a lower-level shape, so the server may determine the corner as the target shape. If the figure to be standardized is identified as not a corner, the server may identify whether the figure to be standardized conforms to the next shape to be identified under the non-closed figure type to continue execution.

[0143] In one embodiment, the convex hull points in the point sequence may be arranged in a preset order, for example, in a clockwise order.

[0144] In one embodiment, the server can perform deduplication processing according to the distance between the convex hull points in the point sequence. In one embodiment, the server can arbitrarily select a convex hull point from the convex hull points in the point sequence as the current convex hull point, and then determine the distance between the next convex hull point and the current convex hull point according to the arrangement order of the convex hull points, and compare the distance between the next convex hull point and the current convex hull point with the third distance threshold. If the distance between the next convex hull point and the current convex hull point is greater than or equal to the third distance threshold, the next convex hull point is used as the new current convex hull point, and the step of determining the next convex hull point according to the arrangement order of the convex hull points is returned to continue execution. If the distance between the next convex hull point and the current convex hull point is less than the third distance threshold, the average value of the position coordinates of the current convex hull point and the next convex hull point is determined, and the current convex hull point and the next convex hull point are removed, and the point corresponding to the average value of the position coordinates of the determined current convex hull point and the next convex hull point is used as the new current convex hull point, and the step of determining the next convex hull point according to the arrangement order of the convex hull points is returned to continue execution. The iteration ends when all convex hull points in the point sequence are processed, and the final convex hull points are used as target convex hull points.

[0145] In another embodiment, the server may perform deduplication processing according to the size of the angle formed between the lines connecting adjacent convex hull points in the point sequence. In one embodiment, the server may arbitrarily select a convex hull point from the convex hull points in the point sequence as the first convex hull point, and determine the second convex hull point and the third convex hull point according to the arrangement order of the convex hull points. The server may respectively determine the first straight line formed by the first convex hull point and the second convex hull point, and the second straight line formed by the second convex hull point and the third convex hull point, and then compare the angle formed between the first straight line and the second straight line with the angle threshold. If the angle formed between the first straight line and the second straight line is greater than or equal to the angle threshold, it indicates that the slopes of the first straight line and the second straight line are similar, then the server may remove the second convex hull point, and use the third convex hull point (i.e., the new second convex hull point after removing the second convex hull point) as the new first convex hull point, and return to the step of determining the second convex hull point and the third convex hull point according to the arrangement order of the convex hull points to continue execution. If the angle formed by the first straight line and the second straight line is less than the angle threshold, the server can use the second convex hull point as the new first convex hull point, and return to the step of determining the second convex hull point and the third convex hull point according to the arrangement order of the convex hull points to continue execution. The iteration ends when all convex hull points in the point sequence are processed, and the final convex hull points are used as the target convex hull points.

[0146] It can be understood that the target convex hull point may be a point among the convex hull points in the point sequence, or may not be a point among the convex hull points in the point sequence. When the target convex hull point is obtained by performing a deduplication process based on the distance between the convex hull points in the point sequence, because some of the target convex hull points may be determined based on the average value of the position coordinates of two convex hull points, the target convex hull points determined based on the average value of the position coordinates may not be a point among the convex hull points in the point sequence.

[0147] In one embodiment, if the number of target convex hull points satisfies the convex hull point constraint of the corner, the server may identify the figure to be standardized as a corner and use the corner as the current shape. If the number of target convex hull points does not satisfy the convex hull point constraint of the corner, the server may identify that the figure to be standardized is not a corner.

[0148] In one embodiment, the convex hull point constraint condition of the corner may be that the number of target convex hull points is 3. If the number of target convex hull points is 3, the server may recognize that the figure to be standardized is a corner and use the corner as the current shape. If the number of target convex hull points is not 3, the server may recognize that the figure to be standardized is not a corner.

[0149] In the above embodiment, if the graphic type is a non-closed graphic type, the server can perform deduplication processing on the convex hull points in the point sequence to obtain target convex hull points, and accurately identify whether the graphic to be standardized is a corner according to the number of target convex hull points.

[0150] In one embodiment, the graphic type is a closed graphic type. The shapes under the closed graphic type include polygons. In this embodiment, according to at least part of the points in the point sequence, identifying the shape under the graphic type that the graphic to be standardized conforms to, and taking the conforming shape as the current shape includes: performing deduplication processing on the convex hull points in the point sequence to obtain target convex hull points; if the shape composed of points between adjacent target convex hull points is a straight line, then identifying the graphic to be standardized as a polygon, and taking the polygon as the current shape.

[0151] In one embodiment, the server may determine points in a point sequence located between adjacent target convex hull points, and then identify whether a shape composed of the determined points is a straight line.

[0152] In one embodiment, the server may identify whether the shape composed of the determined points is a straight line according to the method in each embodiment for identifying whether the figure to be standardized is a straight line.

[0153] In one embodiment, if the shapes formed by the points between each group of adjacent target convex hull points are all straight lines, the server can identify that the figure to be standardized is a polygon. If at least one of the shapes formed by the points between each group of adjacent target convex hull points is not a straight line, the server can identify that the figure to be standardized is not a polygon. Fig.12As shown, in the figure to be standardized 1202, there is at least one shape composed of points between each group of adjacent target convex hull points that is not a straight line, such as the shape between target convex hull points 1206 and 1208 is not a straight line, so the server can recognize that the figure to be standardized 1202 is not a polygon. In the figure to be standardized 1204, the shapes composed of points between each group of adjacent target convex hull points are all straight lines, such as the shape between target convex hull points 1210 and 1212 can be identified as a straight line, and the shapes between other groups of target convex hull points can also be identified as straight lines, which will not be repeated, so the server can recognize that the figure to be standardized 1204 is a polygon.

[0154] In another embodiment, if the number of straight lines formed by the points between each group of adjacent target convex hull points is greater than or equal to a preset ratio threshold, the server can identify the figure to be standardized as a polygon. If the number of straight lines formed by the points between each group of adjacent target convex hull points is less than the preset ratio threshold, the server can identify that the figure to be standardized is not a polygon.

[0155] Specifically, the server can identify whether the figure to be standardized is a polygon according to whether the shape composed of points between adjacent target convex hull points is a straight line. If the figure to be standardized is identified as a polygon, the server can use the polygon as the current shape. If the polygon has a subordinate shape, the server can identify the subordinate shape of the polygon that the figure to be standardized conforms to according to the target identification point that identifies the polygon, and use the subordinate shape as the new current shape to continue execution. If the figure to be standardized is not identified as a polygon, the server can identify whether the figure to be standardized conforms to the next shape to be identified under the closed figure type to continue execution.

[0156] In one embodiment, the shapes under the closed figure type also include ellipses. If the figure to be standardized is not identified as a polygon, the server may identify whether the figure to be standardized is an ellipse. If the figure to be standardized is identified as an ellipse, the server may use the ellipse as the current shape, and if the ellipse does not have a subordinate shape, the server may determine the ellipse as the target shape.

[0157] In one embodiment, the shapes under the closed figure type also include circles. If the figure to be standardized is not a polygon and is not an ellipse, the server may identify the figure to be standardized as a circle.

[0158] In the above embodiment, if the figure to be standardized is a closed figure type, the server can accurately identify whether the figure to be standardized is a polygon according to whether the shape formed by the points between the target convex hull points obtained by deduplication is a straight line.

[0159] In one embodiment, the target recognition point is a target convex hull point. In this embodiment, if the current shape has a subordinate shape, then according to the target recognition point of the current shape, the subordinate shape that the figure to be standardized conforms to is identified, and the subordinate shape is used as the new current shape to continue to execute, including: according to the number of target convex hull points, from the subordinate shapes of the polygon, the subordinate shape that the figure to be standardized conforms to is identified; and the subordinate shape is used as the new current shape to continue to execute.

[0160] Specifically, the server may identify the subordinate shape that the to-be-standardized figure conforms to from the subordinate shapes of the polygon according to the number of target convex hull points, and then use the subordinate shape as the new current shape. If the new current shape still has subordinate shapes, the server may identify the subordinate shape of the new current shape that the to-be-standardized figure conforms to from the subordinate shapes of the new current shape according to the number of target convex hull points. If the new current shape does not have subordinate shapes, the server may determine the new current shape as the target shape.

[0161] like Figure 6 As shown in FIG. 1 , if the current shape is a polygon, the server can identify the subordinate shape of the polygon that the figure to be standardized conforms to, that is, identify which shape the figure to be standardized conforms to, such as a triangle, a quadrilateral, a pentagon, a hexagon, or other polygons (i.e., a polygon with more than 6 sides). The server can then use the identified subordinate shape of the polygon as the new current shape and continue to identify the subordinate shape of the current shape that the figure to be standardized conforms to, such as Figure 6 As shown, assuming that the current shape is a triangle, the server can continue to identify the subordinate shape of the triangle that the figure to be standardized conforms to, that is, identify which shape the figure to be standardized conforms to, such as an equilateral triangle, a right triangle, or a common triangle.

[0162] In one embodiment, the subordinate shape of the polygon may include at least one of a triangle, a quadrilateral, a pentagon, a hexagon, a heptagon, ... and an n-gon, etc., wherein n is an integer greater than 2.

[0163] In one embodiment, the server can determine the number of sides of the subordinate shape of the polygon that the figure to be standardized conforms to according to the number of target convex hull points, that is, determine how many polygons the figure to be standardized is. If the number of target convex hull points is 3, the server can identify the subordinate shape of the figure to be standardized as a triangle. If the number of target convex hull points is 4, the server can identify the subordinate shape of the figure to be standardized as a quadrilateral. By analogy, if the number of target convex hull points is n, the server can identify the subordinate shape of the figure to be standardized as an n-gon.

[0164] In one embodiment, if the server identifies that the subordinate shape of the polygon to be standardized is a triangle, the server can use the triangle as the new current shape. If the triangle has a subordinate shape, the server can continue to identify the subordinate shape of the triangle to be standardized according to the target convex hull point, and use the subordinate shape as the new current shape to continue execution. For example: assuming that the subordinate shape of the triangle to be standardized is identified as a right triangle, the right triangle is used as the new current shape to continue execution. If the right triangle does not have a subordinate shape, the server can determine the right triangle as the target shape. Further identification of the subordinate shapes of other polygons is similar to that of the triangle and will not be repeated.

[0165] In one embodiment, the subordinate shape of the triangle may include at least one of a right triangle, an equilateral triangle (ie, a regular triangle), and a non-right-angled and non-equilateral ordinary triangle.

[0166] In one embodiment, the subordinate shape of the quadrilateral may include at least one of a parallelogram, a trapezoid, a square, a rectangle, a rhombus, and a common quadrilateral other than the subordinate shapes of the quadrilateral.

[0167] In one embodiment, the subordinate shapes of the pentagon may include at least one of a regular pentagon, a five-pointed star, and a common pentagon other than the subordinate shapes of the pentagon.

[0168] In one embodiment, the subordinate shape of the hexagon may include at least one of a regular hexagon and a common hexagon that is not a regular hexagon.

[0169] In one embodiment, the subordinate shape of the n-gon may include at least one of a regular n-gon and a common n-gon that is a non-regular n-gon.

[0170] In one embodiment, if the current shape is a triangle, the server may identify, from the subordinate shapes of the triangle, the subordinate shape of the triangle to which the figure to be standardized conforms according to the number of target convex hull points.

[0171] In one embodiment, if the current shape is a triangle, the server can determine the angle of each angle in the triangle composed of the target convex hull points, and determine whether there is a right angle in the composed triangle according to the degree of deviation between the angle of each angle and the right angle, so as to identify whether the figure to be standardized is a right triangle. In one embodiment, the server can determine the difference between the angle of each angle in the triangle composed of the target convex hull points and the right angle, and then compare the determined differences with the angle difference threshold to determine whether there is a right angle in the composed triangle, so as to identify whether the figure to be standardized is a right triangle. If the determined difference is greater than or equal to the angle difference threshold, the server can determine that the corresponding angle is not a right angle, and if the determined difference is less than the angle difference threshold, the server can identify that the corresponding angle is a right angle. If there is a right angle in each angle of the composed triangle, the server can identify that the figure to be standardized is a right triangle, and if there is no right angle in each angle of the composed triangle, the server can identify that the figure to be standardized is not a right triangle.

[0172] In one embodiment, if the current shape is a triangle, the server can determine the length of each side in the triangle formed by the target convex hull points, and then identify whether the figure to be standardized is an equilateral triangle (i.e., a regular triangle) based on the degree of difference between the lengths of each side. In one embodiment, the server can determine the variance of the lengths of each side in the triangle formed by the target convex hull points, and then compare the variance of the lengths of each side in the triangle with the first variance threshold to identify whether the figure to be standardized is an equilateral triangle. If the variance of the lengths of each side in the triangle is less than or equal to the first variance threshold, the server can identify that the figure to be standardized is an equilateral triangle. If the variance of the lengths of each side in the triangle is greater than the first variance threshold, the server can identify that the figure to be standardized is not an equilateral triangle.

[0173] In one embodiment, if the current shape is a triangle, and the figure to be standardized is neither a right triangle nor an equilateral triangle, the server may identify the figure to be standardized as a common triangle that is neither right-angled nor equilateral.

[0174] In one embodiment, if the current shape is a quadrilateral, the server can determine at least one of the information such as the number of right angles in each angle of the quadrilateral formed by the target convex hull points, the length of each side, and the number of pairs of parallel sides (i.e., several pairs of parallel sides) to identify the subordinate shape of the quadrilateral that the figure to be standardized conforms to.

[0175] In one embodiment, the server can determine whether each angle is a right angle according to the degree of deviation between the angle of each angle in the quadrilateral and the right angle, thereby determining the number of right angles. The specific embodiment of determining whether it is a right angle can be the same as the embodiment of identifying a right triangle, which will not be repeated.

[0176] In one embodiment, the server can select each group of opposite sides in the formed quadrilateral and determine the angle between two sides in each group of opposite sides (the angle has a value range of [0,180] degrees). If the angle between two sides in a group of opposite sides is less than or equal to the parallel determination threshold, the server can determine that the group of opposite sides is parallel sides. If the angle between two sides in a group of opposite sides is greater than the parallel determination threshold, the server can determine that the group of opposite sides is not parallel sides.

[0177] In one embodiment, if the current shape is a quadrilateral, the quadrilateral formed by the target convex hull points does not contain any right angles (i.e., the number of right angles is 0), and the variance between the lengths of each side is less than or equal to the second variance threshold, the server can identify the figure to be standardized as a rhombus.

[0178] In one embodiment, if the current shape is a quadrilateral, the quadrilateral formed by the target convex hull points does not contain a right angle, and the variance between the lengths of the sides is greater than a second variance threshold, the server may identify the figure to be standardized as a common quadrilateral.

[0179] In one embodiment, if the current shape is a quadrilateral, the quadrilateral formed by the target convex hull points contains a right angle (that is, the number of right angles is at least one), and the variance between the lengths of each side is less than or equal to the second variance threshold, the server can identify the figure to be standardized as a square.

[0180] In one embodiment, if the current shape is a quadrilateral, the quadrilateral formed by the target convex hull points contains a right angle (that is, the number of right angles is at least one), contains two pairs of parallel sides, and the variance between the lengths of each side is greater than a second variance threshold, then the server can identify the figure to be standardized as a rectangle.

[0181] In one embodiment, if the current shape is a quadrilateral, and the quadrilateral formed by the target convex hull points has one and only one pair of parallel sides, the server may identify the figure to be standardized as a trapezoid.

[0182] In one embodiment, if the current shape is a quadrilateral, and the quadrilateral formed by the target convex hull points contains two pairs of parallel sides and no right angles (ie, the number of right angles is 0), the server may identify the figure to be standardized as a parallelogram.

[0183] In one embodiment, if the current shape is a pentagon, the server may determine the length of each side of the pentagon formed by each target convex hull point, and then identify the subordinate shape of the pentagon that the figure to be standardized conforms to based on the degree of difference between the lengths of the sides of the formed pentagon.

[0184] In one embodiment, the server may compare the variance of the lengths of the sides of the composed pentagons with the first threshold value to identify the subordinate shape of the pentagon that the figure to be standardized conforms to. If the variance of the lengths of the sides of the composed pentagons is greater than the first threshold value, the server may identify the figure to be standardized as a common pentagon. If the variance of the lengths of the sides of the composed pentagons is less than or equal to the first variance threshold value, the server may identify the figure to be standardized as a regular pentagon or a five-pointed star.

[0185] In one embodiment, if the figure to be standardized is a regular pentagon or a five-pointed star, the server can identify whether the figure to be standardized is a five-pointed star. If it is identified as a five-pointed star, the server can use the five-pointed star as the current shape. If it is not identified as a five-pointed star, the server can identify the figure to be standardized as a regular pentagon and use the regular pentagon as the current shape.

[0186] In one embodiment, if the current shape is a polygon with six sides or more (i.e., a hexagon, a heptagon, ... an n-gon, where n is greater than or equal to 6), the server can identify whether the figure to be standardized is a regular n-gon based on the degree of difference between the lengths of the sides of the n-gon composed of the target convex hull points.

[0187] In one embodiment, the server may compare the variance of the lengths of the edges of the n-gon composed of the target convex hull points with the fourth variance threshold to identify whether the figure to be standardized is a regular n-gon. If the variance of the lengths of the edges of the composed n-gon is less than or equal to the fourth variance threshold, the server may identify the figure to be standardized as a regular n-gon. If the variance of the lengths of the edges of the composed n-gon is greater than the fourth variance threshold, the server may identify that the figure to be standardized is not a regular n-gon. In one embodiment, if the current shape is an n-gon and is not identified as a regular n-gon, the server may identify the figure to be standardized as a normal n-gon.

[0188] In the above embodiment, if the current shape is a polygon, the server can accurately identify the subordinate shape of the polygon that the to-be-standardized figure conforms to based on the number of target convex hull points.

[0189] In one embodiment, if the current shape has a subordinate shape, identifying the subordinate shape that the figure to be standardized conforms to according to the target identification point that identifies the current shape includes: if the new current shape is a pentagon, and the length difference between the sides of the pentagon composed of adjacent target convex hull points is less than or equal to a first threshold, assigning a corresponding position number to each target convex hull point according to the arrangement order of the target convex hull points; determining the difference between the position numbers corresponding to the target convex hull points that are adjacent in the input order; and determining that the figure to be standardized is a five-pointed star if the difference satisfies the convex hull point constraint condition of the five-pointed star.

[0190] In one embodiment, if the new current shape is a pentagon, and the length difference between the sides of the pentagon composed of adjacent target convex hull points is less than or equal to the first threshold, the server can determine that the figure to be standardized is a regular pentagon or a five-pointed star, and then the server can identify whether the figure to be standardized is a five-pointed star.

[0191] In one embodiment, the length difference between the sides of the composed pentagon may be the variance of the length of the sides.

[0192] In one embodiment, the server can assign corresponding position numbers to each target convex hull point according to the arrangement order of the target convex hull points, and then determine the difference between the position numbers corresponding to the target convex hull points adjacent in the input order, and identify whether the figure to be standardized is a five-pointed star based on the difference. If the difference satisfies the convex hull point constraint of the five-pointed star, the server can determine that the figure to be standardized is a five-pointed star. If the difference does not satisfy the convex hull point constraint of the five-pointed star, the server can determine that the figure to be standardized is a regular pentagon.

[0193] In one embodiment, the assigned position numbers may be integers that are incremented in sequence. For example, 1, 2, 3, 4, and 5. Fig.13 As shown, the target convex hull point 1302 may be assigned position number 1, the target convex hull point 1304 may be assigned position number 2, the target convex hull point 1306 may be assigned position number 3, the target convex hull point 1308 may be assigned configuration number 4, and the target convex hull point 1310 may be assigned position number 5 in clockwise order.

[0194] It can be understood that the target convex hull points that are input in adjacent order refer to the order in which the two target convex hull points are input in adjacent order. For example: the target convex hull point of the first input and the target convex hull point of the second input (such as Fig.13 1308 and 1302 in ), that is, the target convex hull points that are adjacent in the input order. For example, the target convex hull point of the third input and the target convex hull point of the fourth input (such as Fig.13 1306 and 1310), which are also target convex hull points that are adjacent in the input order.

[0195] In one embodiment, some target convex hull points may not be points in the input point sequence. For target convex hull points that are not in the input points, the input order of the points closest to the target convex hull points may be used as the input order of the target convex hull points.

[0196] In one embodiment, the convex hull point constraint condition may be that the difference between the position numbers corresponding to the target convex hull points that are adjacent in the input sequence only contains a preset value.

[0197] In one embodiment, the convex hull point constraint condition may be that the difference between the position numbers corresponding to the adjacent target convex hull points in the input sequence only contains 2 or 3, that is, does not contain values ​​other than 2 and 3.

[0198] For example: Fig.13 The position numbers corresponding to the input order adjacent target convex hull points 1308 and 1302 are 4 and 1 respectively, and the difference between 4 and 1 is 3. The position numbers corresponding to the input order adjacent target convex hull points 1302 and 1306 are 1 and 3 respectively, and the difference between 1 and 3 is 2. The position numbers corresponding to the input order adjacent target convex hull points 1306 and 1310 are 3 and 5 respectively, and the difference between 3 and 5 is 2. The position numbers corresponding to the input order adjacent target convex hull points 1310 and 1304 are 5 and 2 respectively, and the difference between 5 and and is 3. The position numbers corresponding to the input order adjacent target convex hull points 1304 and 1308 are 2 and 4 respectively, and the difference between 2 and 4 is 2. Therefore, the difference between the position numbers corresponding to the target convex hull points in the input order in the figure only contains 2 or 3, and does not contain values ​​other than 2 and 3. Therefore, it can be Fig.13 The graphic 1312 to be standardized is identified as a five-pointed star.

[0199] It is understandable because the target convex hull points adjacent to each other in the input sequence are equivalent to the two endpoints of an edge of the five-pointed star (for example Fig.13 Therefore, according to the shape of the five-pointed star, the target convex hull points adjacent in the input sequence are generally separated by one vertex or two vertices in the five-pointed star (equivalent to one target convex hull point or two target convex hull points). Therefore, the position numbers corresponding to the target convex hull points adjacent in the input sequence are also separated by 1 or 2 position numbers, that is, the difference between the position numbers corresponding to the target convex hull points adjacent in the input sequence is 2 or 3.

[0200] In the above embodiment, if the new current shape is a pentagon, and the length difference between the sides of the pentagon composed of adjacent target convex hull points is less than or equal to the first threshold, the server can accurately identify whether the figure to be standardized is a five-pointed star based on the difference between the position numbers corresponding to the adjacent target convex hull points in the input order. In this way, the present application not only supports the recognition of conventional shapes, but also supports the recognition of five-pointed stars.

[0201] In one embodiment, the graphic type is a closed graphic type. The shapes under the closed graphic type include ellipses. In this embodiment, according to at least part of the points in the point sequence, the shape under the graphic type that the graphic to be standardized conforms to is identified, and the conforming shape is used as the current shape, including: performing principal component analysis on the point sequence to determine the principal component direction of the graphic to be standardized; rotating the graphic to be standardized according to the angle between the principal component direction and the first coordinate axis in the plane rectangular coordinate system; projecting the rotated graphic to be standardized onto each coordinate axis in the plane rectangular coordinate system to obtain the major axis and minor axis of the graphic to be standardized; if the degree of proximity between the lengths of the major axis and the minor axis is greater than or equal to the second threshold value, identifying the graphic to be standardized as an ellipse, and using the ellipse as the current shape.

[0202] In one embodiment, the server may perform principal component analysis (PCA) on the point sequence to determine the principal component direction of the figure to be standardized, and then determine the angle between the principal component direction and the first coordinate axis in the plane rectangular coordinate system, and rotate the figure to be standardized in the direction of the first coordinate axis according to the determined angle. The server may project the rotated figure to be standardized onto each coordinate axis in the plane rectangular coordinate system, and determine the lengths of the major axis and minor axis of the figure to be standardized based on the lengths projected onto each coordinate axis.

[0203] like Fig.14 As shown, 1402 is the figure to be standardized, and the server can determine that the main component direction of the figure to be standardized 1402 is 1406. 1408 is the direction of the first coordinate axis. The server can rotate the figure to be standardized 1402 in the direction of the first coordinate axis according to the angle between 1406 and 1408. The rotated figure to be standardized is 1404. The main component direction of the rotated figure to be standardized 1404 is 1408, which is consistent with the direction of the first coordinate axis.

[0204] It can be understood that the principal component direction is the long axis of the figure to be identified, and the angle between the principal component direction and the first coordinate axis is the angle between the long axis of the figure to be identified and the first coordinate axis.

[0205] In one embodiment, the first coordinate axis in the plane rectangular coordinate system may be an x-axis or a y-axis.

[0206] In one embodiment, the server can identify whether the figure to be standardized is an ellipse or a circle according to the proximity between the lengths of the major axis and the minor axis of the figure to be standardized. If the proximity between the lengths of the major axis and the minor axis of the figure to be standardized is greater than or equal to a second threshold, the figure to be standardized is identified as an ellipse, and the ellipse is used as the current shape. If the proximity between the lengths of the major axis and the minor axis of the figure to be standardized is less than the second threshold, the figure to be standardized is identified as a circle, and the circle is used as the current shape.

[0207] In one embodiment, the expression min(a / b-1, b / a-1) can be used to measure the closeness between the lengths of the major axis and the minor axis, where a represents the major axis and b represents the minor axis.

[0208] It can be understood that the meaning of the above expression is to compare the ratio of the length of the major axis to the length of the minor axis with 1. The closer the ratio is to 1, the smaller the calculation result of the above expression is, which indicates that the figure to be standardized is closer to a circle. The farther the ratio is from 1, the larger the calculation result of the above expression is, which indicates that the figure to be standardized is less close to a circle, that is, it is an ellipse.

[0209] In the above embodiment, if the graphic type is a closed graphic type, the server can determine the principal component direction of the graphic to be standardized through principal component analysis, and then rotate the graphic to be standardized according to the angle between the principal component direction and the first coordinate axis in the plane rectangular coordinate system, and project the rotated graphic to be standardized onto each coordinate axis in the plane rectangular coordinate system to obtain the major axis and minor axis of the graphic to be standardized, and then accurately identify whether the graphic to be standardized is an ellipse based on the degree of proximity between the lengths of the major axis and the minor axis, and can accurately identify ellipses in any orientation.

[0210] In one embodiment, the target shape is an ellipse. The figure to be standardized is an ellipse figure to be standardized. In this embodiment, according to the target shape, the figure to be standardized is standardized to generate a standardized figure, including: determining the center position coordinates of the ellipse figure to be standardized according to the position coordinates of at least some points in the point sequence in a plane rectangular coordinate system; generating a standardized target ellipse figure according to the center position coordinates, the lengths of the major axis and the minor axis, and the angle of the ellipse figure to be standardized.

[0211] The center position coordinates of the ellipse figure to be standardized refer to the position coordinates of the center point of the ellipse figure to be standardized.

[0212] In one embodiment, the server may determine the center position coordinates of the ellipse figure to be standardized based on the average value of the position coordinates of at least some of the points in the point sequence in the plane rectangular coordinate system. In other embodiments, the server may also determine the center position coordinates of the ellipse figure to be standardized based on other statistical values ​​of the position coordinates of at least some of the points in the point sequence, without limitation.

[0213] In one embodiment, the server may determine the center position coordinates of the ellipse figure to be standardized according to the position coordinates of each point in the point sequence in the plane rectangular coordinate system. In another embodiment, the server may select some points from the point sequence according to a preset selection condition, and determine the center position coordinates of the ellipse figure to be standardized according to the position coordinates of each selected point in the plane rectangular coordinate system.

[0214] In one embodiment, the server can generate a target ellipse shape that meets the center position coordinates, the lengths of the major axis and the minor axis, and the angle between the major axis and the first coordinate axis determined in the step of identifying the ellipse at the center position coordinates of the ellipse shape to be standardized. Fig.14 As shown, 1402 is the ellipse figure to be standardized, and 1410 is the standardized target ellipse figure obtained after the standardization process.

[0215] In the above embodiment, if the identified target shape is an ellipse, the server can determine the center position coordinates of the ellipse figure to be standardized based on the position coordinates of at least some points in the point sequence, and then accurately generate a standardized target ellipse figure based on the center position coordinates of the ellipse figure to be standardized, the lengths of the major axis and the minor axis, and the angle between the major axis and the first coordinate axis, and support the normalization of ellipses in any orientation.

[0216] In one embodiment, if the target shape is a circle, the server can determine the center position coordinates of the circle to be standardized based on the position coordinates of at least some points in the point sequence in the plane rectangular coordinate system, and then determine the radius of the circle to be standardized based on the major axis and minor axis determined in the step of identifying the circle, and then generate a standardized target circle based on the center position coordinates and radius of the circle to be standardized.

[0217] The center position coordinates of the circle to be standardized are the position coordinates of the center point of the circle to be standardized.

[0218] It can be understood that the embodiments for determining the center position coordinates of the circle to be standardized are similar to the embodiments for determining the ellipse figure to be standardized, and will not be described in detail.

[0219] In one embodiment, the server may determine the radius of the circle to be standardized based on the average value of the major axis and the minor axis. In other embodiments, the server may also determine the radius of the circle to be standardized based on other statistical values ​​of the major axis and the minor axis.

[0220] In the above embodiment, if the identified target shape is a circle, the server can determine the center position coordinates of the circle to be standardized based on the position coordinates of at least some of the points in the point sequence, and determine the radius of the circle based on the major axis and the minor axis, and then accurately generate a standardized target circle based on the center position coordinates and radius of the circle to be standardized.

[0221] In one embodiment, if the target shape is a curve, the server may perform anti-aliasing processing on the graph composed of the point sequence to generate a standard target curve graph. Fig.15 The curve shown is the standard target curve graph obtained by anti-aliasing processing.

[0222] In one embodiment, the generating of the standard graph by normalizing the standard graph according to the target shape includes: if the target shape matches the first normalization method, determining the key points of the target shape, and connecting the key points to generate the standard graph.

[0223] Among them, the key points are the points required to generate a standard graph that conforms to the target shape.

[0224] In one embodiment, the target shape matched with the first normalization method may include at least one of a straight line, an angle, and a common n-gon, etc. In one embodiment, the common n-gon figure may include at least one of a common triangle, a common quadrilateral, a common pentagon, a common hexagon, ... a common n-gon, etc., wherein n is an integer greater than or equal to 3.

[0225] In one embodiment, if the target shape is a straight line, the server can select two key points from the point sequence according to the preset selection conditions corresponding to the generated straight line, and then connect the selected key points to generate a standard target straight line. In one embodiment, if the target shape is a straight line, the server can select the starting point and the ending point in the point sequence, and then connect the starting point and the ending point to generate a standard target straight line graph. Fig.16 As shown, 1602 is a straight line graph to be standardized, and 1604 is a standardized target straight line graph obtained after the standardization process.

[0226] In one embodiment, if the target shape is an angle, the server may connect adjacent target convex hull points according to the order of the target convex hull points obtained after deduplication processing to generate a standard target angle. That is, connect the first target convex hull point with the second target convex hull point, and connect the second target convex hull point with the third target convex hull point to generate a standard target angle. Fig.17 As shown, 1702 is the angle to be standardized, 1706 is each target convex hull point, and 1704 is obtained by connecting the target convex hull points, which is the standardized target angle obtained after the planning process.

[0227] In one embodiment, if the target shape is a normal n-gon, the server can connect adjacent target convex hull points according to the arrangement order of the target convex hull points obtained after deduplication processing, and connect the first and last target convex hull points to generate a standard target normal n-gon graphic.

[0228] like Fig.18 As shown, 1802 is the common triangle figure to be standardized, 1804 are the target convex hull points, and each adjacent target convex hull point 1804 is connected, and the first and last target convex hull points are connected, and the obtained 1806 is the standardized target common triangle figure.

[0229] like Fig.19 As shown, 1902 is the common quadrilateral figure to be standardized, 1904 are the target convex hull points, and each adjacent target convex hull point 1904 is connected, and the first and last target convex hull points are connected, and the obtained 1906 is the standardized target common quadrilateral figure.

[0230] like Fig. 20 As shown, 2002 is the common pentagonal figure to be standardized, 2004 are the target convex hull points, and each adjacent target convex hull point 2004 is connected, and the first and last target convex hull points are connected, and the obtained 2006 is the standardized target common pentagonal figure.

[0231] like Fig.21 As shown, 2102 is the common hexagonal figure to be standardized, 2104 are the target convex hull points, and each adjacent target convex hull point 2104 is connected, and the first and last target convex hull points are connected, and the obtained 2106 is the standardized target common hexagonal figure.

[0232] In the above embodiment, if the target shape matches the first normalization method, the key points of the target shape are determined, and the key points are connected to accurately generate a normalized shape.

[0233] In one embodiment, the process of normalizing the standard graphic to be standardized according to the target shape to generate the standard graphic further includes: if the target shape matches the second normalization method, fixing the positions of some target convex hull points in the target convex hull points after de-duplication in the point sequence; and adjusting the positions of the unfixed target convex hull points according to the shape characteristics of the target shape and the size characteristics of the standard graphic to generate the standard graphic.

[0234] In one embodiment, the target shape matched with the second normalization method may include at least one of a right triangle, a trapezoid, a parallelogram, and the like.

[0235] In one embodiment, if the target shape is a right triangle, the server can determine the right angle to be standardized whose angle is closest to the right angle from the angles of the triangle formed by the target convex hull points after deduplication in the point sequence, and then select any side forming the right angle to be standardized, fix the positions of the two target convex hull points on the selected side, and adjust the positions of the unfixed target convex hull points, so that the angle of the right angle to be standardized is adjusted to a right angle (i.e., 90 degrees), and the length of the unselected side forming the right angle to be standardized remains unchanged after the adjustment. After the adjustment is completed, the adjacent target convex hull points in each target convex hull point are connected to generate a standardized target right triangle figure.

[0236] In one embodiment, the server can generate a direction vector perpendicular to the selected side based on the right angle to be standardized, and then determine whether the direction vector and the unselected side are both on the same side of the selected side. If the direction vector and the unselected side are both on the same side of the selected side, the server can select a point in the direction of the direction vector whose distance to the right angle to be standardized is equal to the length of the side of the unselected side, use the selected point as the adjusted target convex hull point, connect the adjacent target convex hull points in each target convex hull point, and generate a standardized target right triangle figure. If the direction vector and the unselected side are not on the same side of the selected side (i.e., they are respectively located on both sides of the selected side), the server can select a point in the opposite direction of the direction vector whose distance to the right angle to be standardized is equal to the length of the side of the unselected side, use the selected point as the adjusted target convex hull point, connect the adjacent target convex hull points in each target convex hull point, and generate a standardized target right triangle figure.

[0237] In one embodiment, the server may first adjust the position of the first convex hull point corresponding to the right angle to be standardized to the origin in the plane rectangular coordinate system, and transform the position coordinates of the second convex hull point and the third convex hull point in the plane rectangular coordinate system except the first convex hull point of each target convex hull point into the position coordinates when the first convex hull point is the origin. Then, the server may obtain the lengths of the two sides forming the right angle to be standardized based on the position coordinates of the second convex hull point and the third convex hull point when the first convex hull point is the origin. The server may generate a direction vector perpendicular to the selected side based on the position coordinates of the target convex hull point (i.e., the second convex hull point or the third convex hull point) on the selected side except the first convex hull point when the right angle to be standardized is the origin.

[0238] Next, the server can determine the projection of the direction vector on the unselected edge, and determine whether the direction vector and the unselected edge are both on the same side of the selected edge based on the positive or negative situation of the determined projection. If the determined projection is positive, the server can determine that the direction vector and the unselected edge are both on the same side of the selected edge. The server can then obtain the position coordinates of the point whose distance to the first convex hull point in the direction of the direction vector is equal to the length of the unselected edge based on the direction vector and the length of the two sides forming the right angle to be standardized, with the first convex hull point as the origin, as the position coordinates of the adjusted target convex hull point. Finally, the server can transform the position coordinates of each target convex hull point back to the original plane rectangular coordinate system, and connect them to generate a standardized target right triangle figure.

[0239] If the determined projection is negative, the server can determine that the direction vector and the unselected side are not on the same side of the selected side (i.e., on both sides of the selected side), then the server can determine the direction vector opposite to the direction vector, and based on the opposite direction vector and the lengths of the two sides forming the right angle to be standardized, obtain the position coordinates of the point whose distance to the first convex hull point in the direction opposite to the direction vector is equal to the length of the unselected side when the first convex hull point is the origin, as the position coordinates of the adjusted target convex hull point. Finally, the server can transform the position coordinates of each target convex hull point back to the original plane rectangular coordinate system, and connect them to generate a standardized target right triangle figure.

[0240] In one embodiment, the server may subtract the position coordinates of the target convex hull point (i.e., the second convex hull point or the third convex hull point) in the plane rectangular coordinate system from the position coordinates of the first convex hull point in the plane rectangular coordinate system to obtain the position coordinates of the target convex hull point in the plane rectangular coordinate system other than the first convex hull point with the rectangular angle to be standardized as the origin. For example: assuming that the position coordinates of the first convex hull point in the plane rectangular coordinate system are p1, and the position coordinates of the second convex hull point and the third convex hull point in the plane rectangular coordinate system are p0 and p2 respectively, then the position coordinates of the second convex hull point and the third convex hull point with the first convex hull point as the origin are p0-p1 and p2-p1 respectively.

[0241] In one embodiment, the server may obtain the lengths of two sides forming the right angle to be standardized according to the following code:

[0242] len_p0=np.linalg.norm(p0);

[0243] len_p2=np.linalg.norm(p2);

[0244] Where p0 and p2 are the position coordinates of the second convex hull point and the third convex hull point respectively when the first convex hull point is the origin. len_p0 is the length of the side formed by p0 and the right angle to be normalized, and len_p2 is the length of the side formed by p2 and the right angle to be normalized. np.linalg.norm() is a modulus function.

[0245] In one embodiment, the server may generate a direction vector according to the following code:

[0246] direction=np.array([p2[1],-p2[0]]);

[0247] Where p2 is the position coordinate of the second convex hull point on the selected edge except the first convex hull point when the first convex hull point is the origin, and direction is the direction vector. np.array() is a function to create an array.

[0248] In one embodiment, the server may determine the projection of the direction vector on the unselected edge according to the following code:

[0249] inner_prod=direction.dot(p0);

[0250] Where p0 is the position coordinate of the third convex hull point on the unselected edge except the first convex hull point when the first convex hull point is the origin. Direction is the direction vector. inner_prod is the projection of the direction vector on the unselected edge.

[0251] In one embodiment, the server may determine the position coordinates of the adjusted target convex hull point when the first convex hull point is the origin according to the following code:

[0252] if inner_prod>0:

[0253] p0=direction / len_p2*len_p0;

[0254] else:

[0255] p0=np.array([-p2[1],p2[0]]) / len_p2*len_p0;

[0256] Among them, len_p2 and len_p0 are the lengths of the two sides that form the right angle to be normalized, direction is the direction vector, np.array([-p2[1],p2[0]]) is the direction vector opposite to the direction vector. p0 is the position coordinate of the adjusted target convex hull point when the first convex hull point is the origin.

[0257] In one embodiment, after adjusting the position of the target convex hull point, the server can add the position coordinates of each target convex hull point when the first convex hull point is the origin to the position coordinates of the first convex hull point in the plane rectangular coordinate system, to obtain the position coordinates of each target convex hull point in the plane rectangular coordinate system after the position is adjusted. For example: assuming that the position coordinates of the first convex hull point in the plane rectangular coordinate system are p1, and the position coordinates of the second convex hull point and the third convex hull point when the first convex hull point is the origin are p0 and p2 respectively, then after the position is adjusted, the position coordinates of the second convex hull point and the third convex hull point in the plane rectangular coordinate system are p0+p1 and p2+p1 respectively.

[0258] like Fig. 22As shown, 2210 is a right triangle figure to be standardized, points 2202, 2204 and 2206 are target convex hull points, and the server can fix the positions of the target convex hull points 2202 and 2204, and adjust the position of the target convex hull point 2206 to the position of point 2208, so that after the adjustment, the angle corresponding to point 2204 is a right angle, and the length of the side formed by points 2204 and 2208 is equal to the length of the side formed by points 2204 and 2206 before the adjustment, and the right triangle 2212 is the standardized target right triangle figure.

[0259] In one embodiment, if the target shape is a trapezoid, the server can determine a pair of parallel sides to be standardized in the quadrilateral composed of each target convex hull point, and then arbitrarily select a parallel side to be standardized, fix two target convex hull points on the unselected parallel side to be standardized, and any convex hull point on the selected parallel side to be standardized, and adjust the position of the unfixed target convex hull point on the selected parallel side to be standardized, so that the selected parallel side to be standardized is parallel to the unselected parallel side to be standardized, and the length of the selected parallel side to be standardized remains unchanged after the adjustment. After adjusting the position of the target convex hull point, the server can connect adjacent target convex hull points among the target convex hull points to generate a standardized target trapezoidal figure.

[0260] In one embodiment, the server may determine the parallel edges to be standardized based on the angle between the opposite edges in the quadrilateral formed by each target convex hull point. In one embodiment, if the angle between the opposite edges is less than or equal to the parallel determination threshold, the group of opposite edges is determined to be parallel edges to be standardized.

[0261] In one embodiment, the server may use the fixed target convex hull point on the selected parallel edge to be standardized as the starting point, and select a point whose distance from the starting point is the length of the selected parallel edge to be standardized in a direction parallel to the unselected parallel edge to be standardized as the position of the adjusted unfixed target convex hull point. Fig.23 As shown, assuming that the parallel sides to be standardized in the quadrilateral composed of each target convex hull point are a and b, A1 and A2 are two target convex hull points forming the parallel side a to be standardized, B1 and B2 are two target convex hull points forming the parallel side b to be standardized, the selected parallel side to be standardized is b, and the unselected parallel side to be standardized is a, the server can fix the positions of A1, A2 and B1, and adjust the position of B2 to B2', so that the adjusted side A1A2 is parallel to B1B2', and the side length formed by B2' and B1 is equal to the length of b before adjustment. Specifically, the server can use B1 as the starting point and A2A1 as the direction, and determine the point whose distance from B1 is the length of b as B2' after B2 is adjusted.

[0262] In one embodiment, if the target shape is a parallelogram, the server can determine a pair of opposite sides with the longest average length from two groups of opposite sides in the quadrilateral formed by each target convex hull point as the parallel sides to be standardized, and then arbitrarily select one parallel side to be standardized, fix two target convex hull points on the unselected parallel side to be standardized, and any convex hull point on the selected parallel side to be standardized, and adjust the position of the unfixed target convex hull point on the selected parallel side to be standardized, so that the selected parallel side to be standardized is parallel to the unselected parallel side to be standardized, and the length of the adjusted selected parallel side to be standardized is consistent with the length of the unselected parallel side to be standardized. After adjusting the position of the target convex hull point, the server can connect adjacent target convex hull points among the target convex hull points to generate a standardized target parallelogram figure.

[0263] In one embodiment, the server may use the fixed target convex hull point on the selected parallel edge to be standardized as the starting point, and select a point whose distance from the starting point is the length of the unselected parallel edge to be standardized in a direction parallel to the unselected parallel edge to be standardized as the position of the adjusted unfixed target convex hull point. Fig.24 As shown, assuming that the parallel sides to be standardized in the quadrilateral composed of the target convex hull points are c and d, C1 and C2 are the two target convex hull points that form the parallel side c to be standardized, D1 and D2 are the two target convex hull points that form the parallel side d to be standardized, the unselected parallel side to be standardized is c, and the selected parallel side to be standardized is d, the server can fix the positions of C1, C2 and D1, and adjust the position of D2 to D2', so that after the adjustment, c is parallel to D1D2', and the length of the side formed by D2' and D1 is equal to the length of c. Specifically, the server can use D1 as the starting point and C2C1 as the direction, and determine the point whose distance from D1 is the length of c as D2' after D2 is adjusted.

[0264] In the above embodiment, if the target shape matches the second normalization method, the server can fix the positions of some target convex hull points in the deduplicated target convex hull points in the fixed point sequence, and adjust the positions of the unfixed target convex hull points according to the shape characteristics of the target shape and the size characteristics of the figure to be standardized, so as to accurately generate a standardized figure.

[0265] In one embodiment, the process of normalizing the standard graphic to be standardized according to the target shape to generate the standard graphic also includes: if the target shape matches the third normalization method, determining the position features, angle features and size features of the standard graphic according to the target convex hull points after deduplication in the point sequence; and performing an affine transformation on the graphic template corresponding to the target shape according to the position features, angle features and size features to generate the standard graphic.

[0266] In one embodiment, the target shape matched with the third normalization method may include at least one of a rhombus, a rectangle, a five-pointed star, and a regular n-gon, etc. In one embodiment, the regular n-gon may include at least one of an equilateral triangle (i.e., a regular triangle), a square, a regular pentagon, a regular hexagon, ... a regular n-gon, etc., wherein n is an integer greater than or equal to 3.

[0267] In one embodiment, if the target shape matches the third normalization method, the server can determine the position features, angle features, and size features of the graphic to be standardized based on the target convex hull points after duplication in the point sequence, and then obtain a unit-sized graphic template corresponding to the target shape, and perform an affine transformation on the unit-sized graphic template according to the position features, angle features, and size features to generate a standardized graphic.

[0268] In one embodiment, the position feature of the figure to be standardized is the center position coordinates of the equilateral triangle figure to be standardized. The angle feature of the figure to be standardized is the rotation angle of the equilateral triangle figure to be standardized. The size feature of the figure to be standardized is the side length of the equilateral triangle figure to be standardized. If the target shape is an equilateral triangle, the server can determine the center position coordinates of the equilateral triangle figure to be standardized according to the position coordinates of each target convex hull point after deduplication in the point sequence. The server can determine the rotation angle of the equilateral triangle figure to be standardized according to the deviation position information of any target convex hull point relative to the preset coordinate axis. The server can determine the side length of the equilateral triangle figure to be standardized according to the length of each side in the triangle composed of each target convex hull point. Then the server can obtain an equilateral triangle template of unit size, and perform affine transformation on the equilateral triangle template of unit size according to the center position coordinates, rotation angle and side length of the equilateral triangle figure to be standardized to generate a standardized target equilateral triangle figure.

[0269] Among them, the center position coordinates of the equilateral triangle figure to be standardized are the position coordinates of the center point of the equilateral triangle figure to be standardized.

[0270] In one embodiment, the preset coordinate axis may be an x-axis or a y-axis in a plane rectangular coordinate system.

[0271] In one embodiment, the server may determine the center position coordinates of the equilateral triangle figure to be standardized based on the average value of the position coordinates of each target convex hull point after deduplication in the point sequence. In other embodiments, the server may also determine the center position coordinates of the equilateral triangle figure to be standardized based on other statistical values ​​of the position coordinates of each target convex hull point after deduplication in the point sequence.

[0272] In one embodiment, the server may first translate the center point of the equilateral triangle to be standardized to the origin of the plane rectangular coordinate system, and then determine the position coordinates of any target convex hull point after the translation, and determine the angle between the line between the target convex hull point and the center point of the equilateral triangle to be standardized (translated to the origin) and the preset coordinate axis based on the position coordinates of the target convex hull point after the translation, so as to obtain the rotation angle of the equilateral triangle to be standardized.

[0273] In one embodiment, the server may determine the side length of the equilateral triangle to be standardized based on the average value of the lengths of the sides in the triangle formed by the target convex hull points. In other embodiments, the server may also determine the side length of the equilateral triangle to be standardized based on other statistical values ​​of the lengths of the sides in the triangle formed by the target convex hull points.

[0274] In one embodiment, the equilateral triangle template of unit size may be an equilateral triangle with a center point located at the origin of a plane rectangular coordinate system, one of its vertices located on a preset coordinate axis, and a side length of 1.

[0275] In one embodiment, the server can translate the equilateral triangle template to a position where the center point is located at the center position coordinates of the equilateral triangle figure to be standardized, and rotate it in the direction of a preset coordinate axis according to the rotation angle of the equilateral triangle figure to be standardized, and scale the equilateral triangle template according to the side length of the equilateral triangle figure to be standardized to generate a standardized target equilateral triangle figure.

[0276] like Fig.25 As shown, 2504 is the equilateral triangle figure to be standardized, 2502 are the target convex hull points, and 2506 is the standardized target equilateral triangle figure obtained by performing affine transformation on the equilateral triangle template. It can be seen that the obtained standardized target equilateral triangle figure 2506 is more standardized in shape than the equilateral triangle 2504 to be standardized.

[0277] In one embodiment, the position feature of the figure to be standardized is the center position coordinates of the square figure to be standardized. The angle feature of the figure to be standardized is the rotation angle of the square figure to be standardized. The size feature of the figure to be standardized is the side length of the square figure to be standardized. If the target shape is a square, the server can determine the center position coordinates of the square figure to be standardized based on the position coordinates of each target convex hull point after deduplication in the point sequence. The server can determine the rotation angle of the square figure to be standardized based on the deviation position information of any target convex hull point from the preset coordinate axis. The server can determine the side length of the square figure to be standardized based on the length of each side of the quadrilateral composed of each target convex hull point. Then the server can obtain a square template of unit size, and perform affine transformation on the square template of unit size according to the center position coordinates, rotation angle and side length of the square figure to be standardized to generate a standardized target square figure.

[0278] The center position coordinates of the square to be standardized are the position coordinates of the center point of the square figure to be standardized.

[0279] It can be understood that the specific embodiments of determining the center position coordinates, rotation angle and side length of the square figure to be standardized are similar to the embodiments of determining the center position coordinates, rotation angle and side length of the equilateral triangle figure to be standardized, and will not be repeated here.

[0280] In one embodiment, the square template of unit size may be a square with a center point located at the origin of a plane rectangular coordinate system, one vertex of which is on a preset coordinate axis, and a side length of 1.

[0281] In one embodiment, the server can translate the square template to a position where the center point is located at the center position coordinates of the square figure to be standardized, rotate it in the direction of a preset coordinate axis according to the rotation angle of the square figure to be standardized, and scale the square template according to the side length of the square figure to be standardized to generate a standardized target square figure.

[0282] like Fig.26 As shown, 2602 is the square figure to be standardized, 2604 are the target convex hull points, and 2606 is the standardized target square figure obtained by affine transformation of the square template. It can be seen that the obtained standardized target square figure 2606 has a more standardized shape and straighter lines than the square figure 2602 to be standardized.

[0283] It can be understood that the steps for normalizing regular polygons such as regular pentagons, regular hexagons, regular n-gons (n ​​is an integer greater than or equal to 5) are similar to the steps for normalizing regular triangles and squares, and will not be repeated here. Fig. 27As shown, 2702 is a regular pentagonal figure to be standardized, 2704 is each target convex hull point, and 2706 is a standardized target regular pentagonal figure obtained after the normalization process. Fig.28 As shown, 2802 is a regular hexagonal figure to be standardized, 2804 is each target convex hull point, and 2806 is a standardized target regular hexagonal figure obtained after the normalization process.

[0284] In one embodiment, the position feature of the figure to be standardized is the center position coordinates of the five-pointed star figure to be standardized, the angle feature of the figure to be standardized is the rotation angle of the five-pointed star figure to be standardized, and the size feature of the figure to be standardized is the side length of the regular pentagon corresponding to the five-pointed star figure to be standardized. If the target shape is a five-pointed star, the server can determine the center position coordinates, rotation angle and side length of the five-pointed star figure to be standardized, and then generate a standardized regular pentagon figure according to the center position coordinates, rotation angle and side length of the regular pentagon corresponding to the five-pointed star figure to be standardized, according to the normalization processing method for generating a standardized target regular pentagon figure, and then connect the vertices of the standardized regular pentagon figure in sequence according to the input order of the corresponding target convex hull points to generate a standardized target five-pointed star figure.

[0285] In another embodiment, if the target shape matches the third normalization method, the server can determine the position features, angle features, and size features of the graphic to be standardized based on the target convex hull points after deduplication in the point sequence, and then obtain a graphic template corresponding to the target shape and consistent with the size features, and perform affine transformation on the obtained graphic template according to the position features and angle features to generate a standardized graphic.

[0286] In one embodiment, the position feature of the figure to be standardized is the center position coordinates of the rectangular figure to be standardized. The angle feature of the figure to be standardized is the rotation angle of the rectangular figure to be standardized. The size feature of the figure to be standardized is the length and width of the rectangular figure to be standardized. If the target shape is a rectangle, the server can determine the center position coordinates of the rectangular figure to be standardized based on the position coordinates of each target convex hull point after deduplication in the point sequence. The server can determine the rotation angle of the rectangular figure to be standardized based on the angle between any one side of the quadrilateral composed of each target convex hull point and the preset coordinate axis. The server can determine the length and width of the rectangular figure to be standardized based on the length of each side of the quadrilateral composed of each target convex hull point. Then the server can obtain a rectangular template that matches the length and width of the rectangular figure to be standardized, and perform an affine transformation on the rectangular template that matches the length and width according to the center position coordinates and rotation angle of the rectangular figure to be standardized to generate a standardized target rectangular figure.

[0287] The center position coordinates of the rectangle to be standardized are the position coordinates of the center point of the rectangular figure to be standardized.

[0288] It can be understood that the specific embodiments of determining the center position coordinates of the rectangular figure to be standardized are similar to the embodiments of determining the center position coordinates of the equilateral triangle figure to be standardized, and will not be repeated here.

[0289] In one embodiment, the server may determine the length of the rectangular figure to be standardized according to the average of the lengths of the first two sides of the four sides of the quadrilateral formed by the target convex hull points. The server may determine the width of the rectangular figure to be standardized according to the average of the lengths of the last two sides of the four sides of the quadrilateral formed by the target convex hull points.

[0290] In one embodiment, the rectangular template that matches the length and width of the rectangular figure to be standardized can be a rectangle whose center point is located at the origin of the plane rectangular coordinate system, whose length and width match the length and width of the rectangular figure to be standardized, and whose directions of two pairs of parallel sides are respectively consistent with any coordinate axis in the plane rectangular coordinate system. It can be understood that because the rotation angle of the rectangular figure to be standardized is the angle between any side of the quadrilateral composed of each target convex hull point and the preset coordinate axis, the direction of the corresponding side in the rectangular template should be consistent with the preset coordinate axis. For example: if the rotation angle of the rectangular figure to be standardized is the angle between the long side of the quadrilateral composed of each target convex hull point and the x-axis, the long side in the rectangular template should be consistent with the direction of the x-axis. For another example: if the rotation angle of the rectangular figure to be standardized is the angle between the short side of the quadrilateral composed of each target convex hull point and the x-axis, the short side in the rectangular template should be consistent with the direction of the x-axis.

[0291] In one embodiment, the server can translate a rectangular template with matching length and width to move the center point to the center position coordinates of the rectangular figure to be standardized, and rotate it in the direction of a preset coordinate axis according to the rotation angle of the rectangular figure to be standardized to obtain a standardized target rectangular figure.

[0292] like Fig.29 As shown, 2902 is the rectangle to be standardized, 2906 are the target convex hull points, and 2904 is the standardized target rectangular figure obtained by performing affine transformation on the rectangular template. It can be seen that the obtained standardized target rectangular figure 2904 is more standardized in shape and has straighter lines than the rectangle 2902 to be standardized.

[0293] In one embodiment, the position feature of the figure to be standardized is the center position coordinates of the diamond figure to be standardized. The angle feature of the figure to be standardized is the rotation angle of the diamond figure to be standardized. The size feature of the figure to be standardized is the length of each diagonal line of the diamond figure to be standardized. If the target shape is a diamond, the server can determine the center position coordinates of the diamond figure to be standardized according to the position coordinates of each target convex hull point after deduplication in the point sequence. The server can determine the rotation angle of the diamond figure to be standardized according to the angle between any diagonal line in the quadrilateral composed of each target convex hull point and the preset coordinate axis. The server can determine the length of each diagonal line of the diamond figure to be standardized according to the length of each side in the quadrilateral composed of each target convex hull point. Then the server can obtain a diamond template that matches the length of each diagonal line of the diamond figure to be standardized, and perform an affine transformation on the diamond template that matches the length of each diagonal line according to the center position coordinates and the rotation angle of the diamond figure to be standardized to generate a standardized target diamond figure.

[0294] The center position coordinates of the rhombus to be standardized are the position coordinates of the center point of the rhombus figure to be standardized.

[0295] It can be understood that the specific embodiments of determining the center position coordinates of the diamond figure to be standardized are similar to the embodiments of determining the center position coordinates of the equilateral triangle figure to be standardized, and will not be repeated here.

[0296] In one embodiment, the server may determine the length of each diagonal line of the diamond figure to be standardized according to the distance between non-adjacent target convex hull points.

[0297] In one embodiment, the rhombus template that matches the length of each diagonal line of the rhombus figure to be standardized can be a rhombus whose center point is located at the origin of the plane rectangular coordinate system, the length of each diagonal line matches the length of each diagonal line of the rhombus figure to be standardized, and each diagonal line is located on any coordinate axis in the plane rectangular coordinate system. It can be understood that because the rotation angle of the rhombus figure to be standardized is the angle between any diagonal line in the quadrilateral composed of each target convex hull point and the preset coordinate axis, the direction of the corresponding diagonal line in the rhombus template should be consistent with the preset coordinate axis. For example: if the rotation angle of the rhombus figure to be standardized is the angle between the long diagonal line in the quadrilateral composed of each target convex hull point and the x-axis, the long diagonal line in the rhombus template should be consistent with the direction of the x-axis. For another example: if the rotation angle of the rhombus figure to be standardized is the angle between the short diagonal line in the quadrilateral composed of each target convex hull point and the y-axis, the short diagonal line in the rhombus template should be consistent with the direction of the y-axis.

[0298] In one embodiment, the server can translate a diamond template with the same length of each diagonal line to move the center point to the center position coordinates of the diamond figure to be standardized, and rotate it in the direction of the preset coordinate axis according to the rotation angle of the diamond figure to be standardized to obtain a standardized target diamond figure.

[0299] like Fig.30 As shown, 3002 is the rhombus figure to be standardized, 3006 are the target convex hull points, and it can be seen that the figure to be standardized is approximately a rhombus, and 3004 is the standardized target rhombus figure obtained by performing affine transformation on the rhombus template. It can be seen that the obtained standardized target rhombus figure 3004 is more standardized in shape than the rhombus figure to be standardized 3002.

[0300] In the above embodiment, if the target shape matches the third normalization method, the server can determine the position features, angle features and size features of the graphic to be standardized based on the target convex hull points after duplication in the point sequence, and perform an affine transformation on the graphic template corresponding to the target shape according to the position features, angle features and size features to generate a standardized graphic. This method of performing an affine transformation on the graphic template to generate a standardized graphic can ensure the shape standardization of the generated standardized graphic and improve the accuracy of graphic generation.

[0301] In one embodiment, the target shape is a five-pointed star. The figure to be standardized is a five-pointed star figure to be standardized. In this embodiment, according to the target convex hull points after deduplication in the point sequence, determining the position features, angle features and size features of the figure to be standardized includes: determining the center position coordinates of the five-pointed star figure to be standardized according to the position coordinates of the target convex hull points after deduplication in the point sequence; determining the rotation angle of the five-pointed star figure to be standardized according to the deviation position information of any target convex hull point relative to the preset coordinate axis; determining the side length of the regular pentagon corresponding to the five-pointed star figure to be standardized according to the side lengths of the figures composed of each target convex hull point. In this embodiment, an affine transformation is performed on a graphic template corresponding to a target shape according to position features, angle features, and size features to generate a standardized graphic, including: performing an affine transformation on a regular pentagonal template according to the center position coordinates of the five-pointed star graphic to be standardized, a rotation angle, and the side length of a regular pentagon corresponding to the five-pointed star graphic to be standardized to generate a standardized regular pentagonal graphic; connecting the vertices of the standardized regular pentagonal graphic in sequence according to the input order of the corresponding target convex hull points to generate a standardized target five-pointed star graphic.

[0302] The center position coordinates of the five-pointed star to be standardized are the position coordinates of the center point of the five-pointed star figure to be standardized. The regular pentagon corresponding to the five-pointed star figure to be standardized refers to the regular pentagon obtained by connecting each adjacent vertex of the five-pointed star figure to be standardized.

[0303] In one embodiment, the server may determine the center position coordinates of the five-pointed star figure to be standardized based on the average value of the position coordinates of each target convex hull point after deduplication in the point sequence. In other embodiments, the server may also determine the center position coordinates of the five-pointed star figure to be standardized based on other statistical values ​​of the position coordinates of each target convex hull point after deduplication in the point sequence.

[0304] In one embodiment, the server can first translate the center point of the five-pointed star to be standardized to the origin of the plane rectangular coordinate system, and then determine the position coordinates of any target convex hull point after the translation, and according to the position coordinates of the target convex hull point after the translation, determine the angle between the line between the target convex hull point and the center point of the five-pointed star to be standardized (translated to the origin) and the preset coordinate axis to obtain the rotation angle of the five-pointed star to be standardized.

[0305] In one embodiment, the server may determine the side length of the regular pentagon corresponding to the five-pointed star to be standardized according to the average value of the lengths of the sides in the pentagon formed by the target convex hull points. In other embodiments, the server may also determine the side length of the regular pentagon corresponding to the five-pointed star to be standardized according to other statistical values ​​of the lengths of the sides in the pentagon formed by the target convex hull points.

[0306] In one embodiment, the server can obtain a regular pentagon template of unit size, and then perform an affine transformation on the regular pentagon template of unit size according to the center position coordinates of the five-pointed star figure to be standardized, the rotation angle, and the side length of the regular pentagon corresponding to the five-pointed star figure to be standardized, so as to generate a standardized regular pentagon figure.

[0307] In one embodiment, the regular pentagonal template of unit size may be a regular pentagon with a center point located at the origin of a plane rectangular coordinate system, one of its vertices located on a preset coordinate axis, and a side length of 1.

[0308] In one embodiment, the server can translate a regular pentagon template of unit size to a position where the center point is located at the center position coordinates of the five-pointed star figure to be standardized, and rotate it in the direction of a preset coordinate axis according to the rotation angle of the five-pointed star figure to be standardized, and scale the regular pentagon template according to the side length of the regular pentagon corresponding to the five-pointed star figure to be standardized to generate a standardized regular pentagon figure.

[0309] In one embodiment, the server may connect the vertices of the standard regular pentagonal figure in sequence according to the input order of the corresponding target convex hull points, that is, connect the vertices that are adjacent in the input order, and connect the first and last vertices to generate a standard target five-pointed star figure.

[0310] like Fig.13As shown, 1314 is the standard target five-pointed star shape obtained after normalization processing.

[0311] In the above embodiment, if the target shape is a five-pointed star, the server can first perform an affine transformation on the regular pentagonal template to generate a standardized regular pentagonal figure, and then adjust the connection order of the vertices in the standardized regular pentagonal figure to obtain a standardized target five-pointed star figure. By means of template affine transformation, an accurate five-pointed star figure with a standardized shape can be generated, thereby improving the accuracy of the figure generation. In addition, the present application not only supports the normalization processing of graphics of conventional shapes, but also supports the normalization processing of five-pointed star graphics.

[0312] The present application also provides an application scenario, which is a remote conference scenario, and the above-mentioned graphic generation method is applied to the application scenario. Specifically, the application of the graphic generation method in the application scenario is as follows:

[0313] During a remote conference, the conference host or participant can draw a graphic trajectory on the remote conference canvas displayed by the terminal used. The terminal can obtain the point sequence in the graphic trajectory and send the point sequence in the graphic trajectory to the server. The server can execute the graphics generation method in each embodiment of the present application, identify and standardize the graphics to be standardized represented by the graphic trajectory, generate accurate standard graphics, and send the standard graphics to the terminal used by the party drawing the graphic trajectory and the terminals used by other participants in the meeting. The terminal that receives the standard graphics can display the standard graphics in real time at the corresponding position on the remote conference canvas, thereby realizing the standardization of the graphics drawn during the remote conference, displaying the standardized graphics in real time, and improving the meeting efficiency.

[0314] The present application also provides an application scenario, which is a scenario of recording electronic notes, and the above-mentioned graphic generation method is applied to the application scenario. Specifically, the application of the graphic generation method in the application scenario is as follows:

[0315] In the process of using a terminal to record electronic notes, the user can draw a graphic track in the recording area of ​​the notebook displayed by the terminal used. The terminal can obtain the point sequence in the graphic track and send the point sequence in the graphic track to the server. The server can execute the graphic generation method in each embodiment of the present application, identify and normalize the graphics to be standardized represented by the graphic track, generate accurate standardized graphics, and send the standardized graphics to the terminal. The terminal can display the standardized graphics at the corresponding position of the recording area of ​​the notebook. Thereby, the graphics drawn in the process of recording electronic notes are standardized, and the standardized graphics are displayed in real time, which improves the efficiency of recording electronic notes.

[0316] It should be understood that, although the steps in each flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in each flowchart may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0317] In one embodiment, Fig.31 As shown, a graphic generation device 3100 is provided. The device can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: a graphic recognition module 3102 and a graphic specification module 3104, wherein:

[0318] The graphic recognition module 3102 is used to perform closed recognition on the graphic to be standardized represented by the graphic trajectory according to the point sequence in the input graphic trajectory to obtain the graphic type.

[0319] The graphic recognition module 3102 is further used to identify the shape of the graphic type that the graphic to be standardized conforms to based on at least some points in the point sequence, and use the conforming shape as the current shape.

[0320] The graphic recognition module 3102 is also used to identify the subordinate shape that the graphic to be standardized conforms to based on the target recognition points of the current shape if the current shape has a subordinate shape, and use the subordinate shape as the new current shape to continue execution.

[0321] The graphic recognition module 3102 is further configured to determine the current shape as a target shape if the current shape does not have a subordinate shape.

[0322] The graphic standardization module 3104 is used to standardize the standard graphic according to the target shape to generate a standard graphic.

[0323] In one embodiment, the graphic recognition module 3102 is also used to, if the graphic to be standardized is identified based on at least some points in the point sequence as not conforming to the current shape to be recognized under the graphic type, use the next shape under the graphic type as the current shape to be recognized to continue execution; if it conforms to the current shape to be recognized, use the current shape to be recognized as the current shape.

[0324] In one embodiment, the graphic type is a non-closed graphic type. The shape under the non-closed graphic type includes a straight line. In this embodiment, the graphic recognition module 3102 is also used for identifying the graphic to be standardized as a straight line based on the concentration degree of at least some points in the point sequence relative to the selected reference straight line, and then taking the straight line as the current shape.

[0325] In one embodiment, the graphic type is a non-closed graphic type. The shapes under the non-closed graphic type include corners. In this embodiment, the graphic recognition module 3102 is also used to perform deduplication processing on the convex hull points in the point sequence to obtain target convex hull points; if the graphic to be standardized is identified as a corner according to the number of target convex hull points, the corner is used as the current shape.

[0326] In one embodiment, the graphic type is a closed graphic type. The shapes under the closed graphic type include polygons. In this embodiment, the graphic recognition module 3102 is also used to perform deduplication processing on the convex hull points in the point sequence to obtain target convex hull points; if the shape composed of points between adjacent target convex hull points is a straight line, the graphic to be standardized is identified as a polygon, and the polygon is used as the current shape.

[0327] In one embodiment, the target identification point is a target convex hull point. In this embodiment, the pattern recognition module 3102 is also used to identify the subordinate shape that the pattern to be standardized conforms to from the subordinate shapes of the polygon according to the number of the target convex hull points; and use the subordinate shape as the new current shape to continue execution.

[0328] In one of the embodiments, the graphic recognition module 3102 is further used to assign corresponding position numbers to each target convex hull point according to the arrangement order of the target convex hull points if the new current shape is a pentagon and the length difference between the sides of the pentagon composed of adjacent target convex hull points is less than or equal to the first threshold; determine the difference between the position numbers corresponding to the target convex hull points adjacent in the input order; and determine that the graphic to be standardized is a five-pointed star if the difference satisfies the convex hull point constraint condition of the five-pointed star.

[0329] In one of the embodiments, the graphic type is a closed graphic type. The shapes under the closed graphic type include ellipses. In this embodiment, the graphic recognition module 3102 is also used to perform principal component analysis on the point sequence to determine the principal component direction of the graphic to be standardized; rotate the graphic to be standardized according to the angle between the principal component direction and the first coordinate axis in the plane rectangular coordinate system; project the rotated graphic to be standardized onto each coordinate axis in the plane rectangular coordinate system to obtain the major axis and minor axis of the graphic to be standardized; if the proximity between the lengths of the major axis and the minor axis is greater than or equal to the second threshold, the graphic to be standardized is identified as an ellipse, and the ellipse is used as the current shape.

[0330] In one embodiment, the target shape is an ellipse. The figure to be standardized is an ellipse figure to be standardized. In this embodiment, the figure standardization module 3104 is further used to determine the center position coordinates of the ellipse figure to be standardized according to the position coordinates of at least some points in the point sequence in the plane rectangular coordinate system; and generate a standardized target ellipse figure according to the center position coordinates, the lengths of the major axis and the minor axis, and the angle of the ellipse figure to be standardized.

[0331] In one embodiment, the graphic specification module 3104 is further configured to determine key points of the target shape if the target shape matches the first normalization method, and connect the key points to generate a standard graphic.

[0332] In one embodiment, the graphic standardization module 3104 is further used to fix the positions of some target convex hull points in the target convex hull points after de-duplication in the point sequence if the target shape matches the second normalization method; adjust the positions of the unfixed target convex hull points according to the shape characteristics of the target shape and the size characteristics of the graphic to be standardized to generate a standardized graphic.

[0333] In one of the embodiments, the graphic standardization module 3104 is also used to determine the position features, angle features and size features of the graphic to be standardized based on the target convex hull points after deduplication in the point sequence if the target shape matches the third normalization method; perform affine transformation on the graphic template corresponding to the target shape according to the position features, angle features and size features to generate a standardized graphic.

[0334] In one embodiment, the target shape is a five-pointed star. The figure to be standardized is a five-pointed star figure to be standardized. In this embodiment, the graphic standardization module 3104 is also used to determine the center position coordinates of the five-pointed star figure to be standardized according to the position coordinates of the target convex hull points after deduplication in the point sequence; determine the rotation angle of the five-pointed star figure to be standardized according to the deviation position information of any target convex hull point relative to the preset coordinate axis; determine the side length of the regular pentagon corresponding to the five-pointed star figure to be standardized according to the side lengths of the figures composed of each target convex hull point; perform affine transformation on the regular pentagon template according to the center position coordinates, rotation angle and side length of the corresponding regular pentagon of the five-pointed star figure to be standardized, and generate a standardized regular pentagon figure; connect the vertices of the standardized regular pentagon figure in sequence according to the input order of the corresponding target convex hull points to generate a standardized target five-pointed star figure.

[0335] The above-mentioned graphics generation device first performs closed recognition on the graphics to be standardized represented by the graphics trajectory according to the point sequence in the input graphics trajectory to obtain the graphics type, then identifies the shape of the graphics to be standardized under the graphics type that the graphics to be standardized conform to according to at least part of the points in the point sequence, and uses the conforming shape as the current shape, then, if the current shape has a subordinate shape, then identifies the subordinate shape that the graphics to be standardized conform to according to the target recognition point that identifies the current shape, and uses the subordinate shape as the new current shape to continue execution, if the current shape does not have a subordinate shape, the current shape is determined as the target shape, and finally, according to the target shape, the graphics to be standardized are standardized to generate a standardized graphics. In this way, the shape of the graphics to be standardized represented by the input graphics trajectory is directly identified layer by layer according to the point sequence in the input graphics trajectory, and then the graphics to be standardized are standardized according to the target shape to generate a standardized graphics, which can flexibly perform standardized processing on any input graphics trajectory to generate a standardized graphics, without first selecting the graphics shape, and then dragging and drawing and repeatedly adjusting, thereby improving the graphics generation efficiency, and the user has no constraints on drawing the graphics trajectory, and can draw at will, thereby improving the interaction efficiency.

[0336] In addition, by successively identifying the shape of the graphics to be standardized represented by the input graphics trajectory level by level, a large number of graphics types can be identified, which increases the number of graphics types supported by the method, and can accurately identify the shape of the graphics to be standardized and perform corresponding standardization processing, thereby generating accurate standardized graphics and improving the accuracy of graphics generation. And based on the point sequence in the graphics trajectory, the algorithm is simple, reduces memory loss, and supports online real-time processing.

[0337] For the specific definition of the graphics generation device, please refer to the definition of the graphics generation method above, which will not be repeated here. Each module in the above-mentioned graphics generation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0338] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.32As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store graphic data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a graphic generation method is implemented.

[0339] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.33 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a graphics generation method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0340] Those skilled in the art will understand that Fig.32 and 33 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0341] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0342] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0343] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0344] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0345] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0346] The above embodiments only express several implementation methods of the present application, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present application, which all belong to the protection scope of the present application. Therefore, the protection scope of the patent of this application shall be based on the attached claims.

Claims

1. A method for generating a graph, characterized in that: The method comprises: According to the point sequence in the input graphic trajectory, closed recognition is performed on the graphic to be standardized represented by the graphic trajectory to obtain the graphic type; According to at least part of the points in the point sequence, the shape of the figure to be standardized under the figure type is identified, and the shape that meets the requirements is used as the current shape, including: when the figure type is a closed figure type, and the shape under the closed figure type includes an ellipse, the point sequence is subjected to principal component analysis to determine the principal component direction of the figure to be standardized; according to the angle between the principal component direction and the first coordinate axis in the plane rectangular coordinate system, the figure to be standardized is rotated; the rotated figure to be standardized is projected onto each coordinate axis in the plane rectangular coordinate system to obtain the major axis and the minor axis of the figure to be standardized; if the degree of proximity between the lengths of the major axis and the minor axis is greater than or equal to a second threshold value, the figure to be standardized is identified as an ellipse, and the ellipse is used as the current shape; If the current shape has subordinate shapes, then According to the target recognition point of the current shape, a subordinate shape to which the to-be-standardized figure conforms is recognized, and the subordinate shape is used as a new current shape to continue execution; If the current shape does not have a subordinate shape, determining the current shape as a target shape; According to the target shape, the figure to be standardized is normalized to generate a standard figure, including: determining the center position coordinates of the elliptical figure to be standardized according to the position coordinates of at least some points in the point sequence in the plane rectangular coordinate system; generating a standard target elliptical figure according to the center position coordinates of the elliptical figure to be standardized, the lengths of the major axis and the minor axis, and the angle.

2. The method according to claim 1, characterized in that The step of identifying, based on at least some of the points in the point sequence, a shape of the graphic type that the graphic to be standardized conforms to, and using the conforming shape as the current shape comprises: If, according to at least some of the points in the point sequence, it is identified that the figure to be standardized does not conform to the current shape to be identified under the figure type, then Using the next shape of the graphic type as the current shape to be recognized to continue the execution; If it matches the current shape to be recognized, the current shape to be recognized is used as the current shape.

3. The method according to claim 1, characterized in that The graphic type is a non-closed graphic type; the shape of the non-closed graphic type includes a straight line; The step of identifying, based on at least some of the points in the point sequence, a shape of the graphic type that the graphic to be standardized conforms to, and using the conforming shape as the current shape, comprises: If the figure to be standardized is identified as a straight line based on the concentration degree of at least some points in the point sequence relative to the selected reference straight line, the straight line is used as the current shape.

4. The method according to claim 1, characterized in that: The graphic type is a non-closed graphic type; the shape of the non-closed graphic type includes an angle; The step of identifying, based on at least some of the points in the point sequence, a shape of the graphic type that the graphic to be standardized conforms to, and using the conforming shape as the current shape comprises: De-duplication processing is performed on the convex hull points in the point sequence to obtain target convex hull points; If the figure to be standardized is identified as a corner according to the number of the target convex hull points, the corner is used as the current shape.

5. The method according to claim 1, characterized in that The graphic type is a closed graphic type; the shape under the closed graphic type includes a polygon; The step of identifying, based on at least some of the points in the point sequence, a shape of the graphic type that the graphic to be standardized conforms to, and using the conforming shape as the current shape comprises: De-duplication processing is performed on the convex hull points in the point sequence to obtain target convex hull points; If the shape formed by the points between the adjacent target convex hull points is a straight line, the figure to be standardized is identified as a polygon, and the polygon is used as the current shape.

6. The method according to claim 5, characterized in that The target identification point is the target convex hull point; If the current shape has a subordinate shape, then according to the target recognition point of the current shape, the subordinate shape that the to-be-standardized shape conforms to is recognized, and the subordinate shape is used as the new current shape to continue to execute the following steps: According to the number of the target convex hull points, identifying the subordinate shape to which the to-be-standardized figure conforms from the subordinate shapes of the polygon; The subordinate shape is used as the new current shape to continue execution.

7. The method according to claim 6, characterized in that If the current shape has a subordinate shape, identifying the subordinate shape that the to-be-standardized shape conforms to according to the target recognition point of the current shape includes: If the new current shape is a pentagon, and the length difference between the sides of the pentagon formed by the adjacent target convex hull points is less than or equal to the first threshold, then assigning corresponding position numbers to the target convex hull points according to the arrangement order of the target convex hull points; Determine the difference between the position numbers corresponding to the target convex hull points that are adjacent in the input order; If the difference satisfies the convex hull point constraint condition of the five-pointed star, it is determined that the figure to be standardized is a five-pointed star.

8. The method according to claim 6, characterized in that If the current shape has a subordinate shape, identifying the subordinate shape that the to-be-standardized shape conforms to according to the target recognition point of the current shape includes: If the new current shape is a quadrilateral, the subordinate shape that the to-be-standardized figure conforms to is identified according to the number of right angles in each angle, the length of each side, and the logarithm of parallel sides in the quadrilateral formed by the target convex hull points.

9. The method according to claim 1, characterized in that: The step of performing closed recognition on the to-be-standardized graphic represented by the graphic trajectory according to the point sequence in the input graphic trajectory to obtain the graphic type includes: According to the distance between the starting point and the ending point in the point sequence, closed recognition is performed on the to-be-standardized figure represented by the figure trajectory to obtain the figure type.

10. The method according to claim 1, characterized in that The step of normalizing the to-be-normalized graphic according to the target shape to generate a normalized graphic comprises: If the target shape matches the first normalization method, key points of the target shape are determined, and the key points are connected to generate a normalized shape; If the target shape matches the second normalization method, the positions of some target convex hull points in the deduplicated target convex hull points in the point sequence are fixed; according to the shape characteristics of the target shape and the size characteristics of the figure to be standardized, the positions of the unfixed target convex hull points are adjusted to generate a standardized figure.

11. The method according to claim 10, characterized in that The step of normalizing the to-be-normalized graphic according to the target shape to generate a normalized graphic further comprises: If the target shape matches the third normalization method, determining the position feature, angle feature and size feature of the to-be-normalized figure according to the target convex hull points after deduplication in the point sequence; According to the position features, angle features and size features, an affine transformation is performed on the graphic template corresponding to the target shape to generate a standard graphic.

12. The method according to claim 11, characterized in that The target shape is a five-pointed star; the figure to be standardized is a five-pointed star figure to be standardized; and determining the position feature, angle feature and size feature of the figure to be standardized according to the target convex hull points after deduplication in the point sequence includes: Determine the center position coordinates of the five-pointed star figure to be standardized according to the position coordinates of the target convex hull point after deduplication in the point sequence; Determining the rotation angle of the five-pointed star figure to be standardized according to the deviation position information of any target convex hull point relative to the preset coordinate axis; Determine the side length of the regular pentagon corresponding to the five-pointed star figure to be standardized according to the side lengths of the figures composed of the target convex hull points; The step of performing affine transformation on the graphic template corresponding to the target shape according to the position feature, angle feature and size feature to generate a standard graphic comprises: According to the center position coordinates of the five-pointed star figure to be standardized, the rotation angle and the side length of the corresponding regular pentagon, an affine transformation is performed on the regular pentagon template to generate a standardized regular pentagon figure; Connect the vertices of the standard regular pentagonal figure in sequence according to the input order of the corresponding target convex hull points to generate a standard target five-pointed star figure.

13. A graphics generating device, characterized in that: The device comprises: A graphic recognition module, used for performing closed recognition on the graphic to be standardized represented by the graphic trajectory according to the point sequence in the input graphic trajectory, and obtaining the graphic type; The graphic recognition module is further used to identify the shape of the graphic type that the graphic to be standardized conforms to based on at least part of the points in the point sequence, and use the conforming shape as the current shape, including: when the graphic type is a closed graphic type, and the shape under the closed graphic type includes an ellipse, performing principal component analysis on the point sequence to determine the principal component direction of the graphic to be standardized; rotating the graphic to be standardized according to the angle between the principal component direction and the first coordinate axis in the plane rectangular coordinate system; projecting the rotated graphic to be standardized onto each coordinate axis in the plane rectangular coordinate system to obtain the major axis and minor axis of the graphic to be standardized; if the proximity between the lengths of the major axis and the minor axis is greater than or equal to a second threshold, identifying the graphic to be standardized as an ellipse, and using the ellipse as the current shape; The graphic recognition module is further configured to, if the current shape has a subordinate shape, identify the subordinate shape that the graphic to be standardized conforms to based on the target recognition point identified for the current shape, and use the subordinate shape as a new current shape to continue execution; The graphic recognition module is further configured to determine the current shape as a target shape if the current shape does not have a subordinate shape; The graphic standardization module is used to standardize the graphic to be standardized according to the target shape to generate a standard graphic, including: determining the center position coordinates of the elliptical graphic to be standardized according to the position coordinates of at least some points in the point sequence in the plane rectangular coordinate system; generating a standardized target elliptical graphic according to the center position coordinates of the elliptical graphic to be standardized, the lengths of the major axis and the minor axis, and the angle.

14. The device according to claim 13, characterized in that The graphic recognition module is also used for: If, according to at least some of the points in the point sequence, it is identified that the figure to be standardized does not conform to the current shape to be identified under the figure type, then Using the next shape of the graphic type as the current shape to be recognized to continue the execution; If it matches the current shape to be recognized, the current shape to be recognized is used as the current shape.

15. The device according to claim 13, characterized in that The graphic type is a non-closed graphic type; the shape of the non-closed graphic type includes a straight line; the graphic recognition module is further used for: If the figure to be standardized is identified as a straight line based on the concentration degree of at least some points in the point sequence relative to the selected reference straight line, the straight line is used as the current shape.

16. The device according to claim 13, characterized in that The graphic type is a non-closed graphic type; the shape of the non-closed graphic type includes an angle; and the graphic recognition module is further used for: De-duplication processing is performed on the convex hull points in the point sequence to obtain target convex hull points; If the figure to be standardized is identified as a corner according to the number of the target convex hull points, the corner is used as the current shape.

17. The device according to claim 13, characterized in that The graphic type is a closed graphic type; the shape of the closed graphic type includes a polygon; the graphic recognition module is further used for: De-duplication processing is performed on the convex hull points in the point sequence to obtain target convex hull points; If the shape formed by the points between the adjacent target convex hull points is a straight line, the figure to be standardized is identified as a polygon, and the polygon is used as the current shape.

18. The device according to claim 17, characterized in that The target recognition point is the target convex hull point; the graphic recognition module is also used for: According to the number of the target convex hull points, identifying the subordinate shape to which the to-be-standardized figure conforms from the subordinate shapes of the polygon; The subordinate shape is used as the new current shape to continue execution.

19. The device according to claim 18, characterized in that The graphic recognition module is also used for: If the new current shape is a pentagon, and the length difference between the sides of the pentagon formed by the adjacent target convex hull points is less than or equal to the first threshold, then assigning corresponding position numbers to the target convex hull points according to the arrangement order of the target convex hull points; Determine the difference between the position numbers corresponding to the target convex hull points that are adjacent in the input order; If the difference satisfies the convex hull point constraint condition of the five-pointed star, it is determined that the figure to be standardized is a five-pointed star.

20. The device according to claim 18, characterized in that The graphic recognition module is also used for: If the new current shape is a quadrilateral, the subordinate shape that the to-be-standardized figure conforms to is identified according to the number of right angles in each angle, the length of each side, and the logarithm of parallel sides in the quadrilateral formed by the target convex hull points.

21. The device according to claim 13, characterized in that The graphic recognition module is also used for: According to the distance between the starting point and the ending point in the point sequence, closed recognition is performed on the to-be-standardized figure represented by the figure trajectory to obtain the figure type.

22. The device according to claim 13, characterized in that The graphics specification module is also used to: If the target shape matches the first normalization method, key points of the target shape are determined, and the key points are connected to generate a normalized shape; If the target shape matches the second normalization method, the positions of some target convex hull points in the deduplicated target convex hull points in the point sequence are fixed; according to the shape characteristics of the target shape and the size characteristics of the figure to be standardized, the positions of the unfixed target convex hull points are adjusted to generate a standardized figure.

23. The device according to claim 22, characterized in that The graphics specification module is also used to: If the target shape matches the third normalization method, determining the position feature, angle feature and size feature of the to-be-normalized figure according to the target convex hull points after deduplication in the point sequence; According to the position features, angle features and size features, an affine transformation is performed on the graphic template corresponding to the target shape to generate a standard graphic.

24. The device according to claim 23, characterized in that The target shape is a five-pointed star; the graphic to be standardized is a five-pointed star graphic to be standardized; and the graphic standardization module is further used for: Determine the center position coordinates of the five-pointed star figure to be standardized according to the position coordinates of the target convex hull point after deduplication in the point sequence; Determining the rotation angle of the five-pointed star figure to be standardized according to the deviation position information of any target convex hull point relative to the preset coordinate axis; Determine the side length of the regular pentagon corresponding to the five-pointed star figure to be standardized according to the side lengths of the figures composed of the target convex hull points; The step of performing affine transformation on the graphic template corresponding to the target shape according to the position feature, angle feature and size feature to generate a standard graphic comprises: According to the center position coordinates of the five-pointed star figure to be standardized, the rotation angle and the side length of the corresponding regular pentagon, an affine transformation is performed on the regular pentagon template to generate a standardized regular pentagon figure; Connect the vertices of the standard regular pentagonal figure in sequence according to the input order of the corresponding target convex hull points to generate a standard target five-pointed star figure.

25. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

26. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

27. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Information identification method and device

    CN112083870A

  • System and method for detecting hand-drawn objects inputted by ink

    CN1607540A