Vector drawing information identification method and device and computer program product

By clustering and merging the annotation vector lines in vector drawings, the annotation information box is generated, which solves the problem of difficult to identify and extract vector annotation information in PDF drawings in the prior art, and realizes efficient and accurate information extraction and processing.

CN119580290APending Publication Date: 2025-03-07GLODON CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411634712.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In infrastructure highway calculation software, it is difficult to process vector annotation information in portable document format (PDF) drawings, and it is difficult for the prior art to effectively identify and extract these contents.

Method used

By obtaining vector drawings, analyzing and determining multiple annotation vector lines, clustering them based on line attributes, and using line position relationships to merge continuous lines to generate annotation information box, and finally identifying and extracting the annotation information in the vector drawing.

Benefits of technology

It realizes efficient analysis and extraction of labeled information in vector drawings, improves the accuracy and efficiency of information extraction, adapts to vector drawings of different forms and complexities, reduces manual intervention, and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119580290A_ABST
    Figure CN119580290A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of drawing recognition, and discloses an information recognition method and device of a vector drawing and a computer program product. The method comprises the following steps: acquiring a vector drawing, analyzing the vector drawing, and determining a plurality of labeled vector lines in the vector drawing; based on the attribute relationship of the plurality of labeled vector lines, clustering the plurality of labeled vector lines to generate a line cluster set; combining the plurality of vector lines in the line cluster set by utilizing the position relationship among the plurality of labeled vector lines to generate a labeled information box; and identifying characters in the annotation information box to obtain annotation information of the vector drawing. By implementing the technical scheme of the invention, the labeling information in the vector drawing can be effectively identified and extracted, and the automation and accuracy of drawing analysis are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of drawing recognition, and in particular to a method, device and computer program product for identifying information of vector drawings. Background Art

[0002] In the application of infrastructure highway quantity calculation software, there are many technical challenges in processing vector annotation information in portable document format (PDF) drawings. These annotations contain key engineering data, such as steel bar specifications, roadbed cross sections, and geological longitudinal sections. Since PDF drawings use vector format and express information through lines and shapes, current image processing technology often has difficulty in effectively identifying and extracting these contents. Summary of the invention

[0003] In view of this, the present invention provides a method, device and computer program product for identifying information of vector drawings to solve the problem of how to effectively extract and aggregate annotation information in PDF drawings from complex vector lines.

[0004] In a first aspect, the present invention provides a method for identifying information of a vector drawing, comprising: obtaining a vector drawing, and parsing the vector drawing to determine a plurality of annotated vector lines in the vector drawing; clustering the plurality of annotated vector lines based on an attribute relationship among the plurality of annotated vector lines to generate a line cluster set; utilizing a positional relationship between the plurality of annotated vector lines to merge a plurality of continuous lines in the line cluster set to generate an annotation information box; and identifying characters in the annotation information box to obtain annotation information of the vector drawing.

[0005] The information recognition method of the vector drawing provided by the embodiment of the present invention can efficiently parse and extract the annotation information in the vector drawing. By clustering the attribute relationship of the annotated vector lines and merging them based on the positional relationship between the lines, the annotation information box can be accurately generated, and then the character information therein can be identified. Therefore, this method not only improves the accuracy and efficiency of information extraction, but also can adapt to vector drawings of different forms and complexities, has strong versatility and scalability, can effectively reduce manual intervention, and improve work efficiency.

[0006] In an optional implementation, based on the attribute relationship of the multiple labeled vector lines, the multiple labeled vector lines are clustered to generate a line cluster set, including: based on the attribute relationship of the multiple labeled vector lines, the multiple labeled vector lines are merged to obtain multiple continuous lines; based on the multiple continuous lines, a line cluster set is generated.

[0007] The information recognition method for vector drawings provided by the embodiment of the present invention can reduce redundant information and improve the accuracy of drawing analysis by merging multiple annotated vector lines into continuous lines. At the same time, generating a line clustering set based on these continuous lines helps to more accurately identify the annotated content and information box, ensuring that the annotated information can be accurately located and recognized in the subsequent recognition and extraction process.

[0008] In an optional embodiment, based on the attribute relationship of the multiple labeled vector lines, the multiple labeled vector lines are merged to obtain multiple continuous lines, including: for any labeled vector line, determining the corresponding starting point and end point; determining other labeled vector lines connected to the starting point to obtain a first edge set; and determining other labeled vector lines connected to the end point to obtain a second edge set; merging the first edge set, the second edge set and the labeled vector line to obtain a continuous line corresponding to the labeled vector line.

[0009] The information recognition method of the vector drawing provided by the embodiment of the present invention can accurately identify other lines connected to the vector lines by analyzing the starting point and end point of the annotated vector lines, and merge them into continuous lines. This not only improves the accuracy of line connection, but also ensures the neatness and clarity of the graphic structure. At the same time, by reducing redundant annotation information, the efficiency of data integration can be improved.

[0010] In an optional embodiment, the positional relationship between multiple annotation vector lines is utilized to merge multiple continuous lines in a line clustering set to generate an annotation information box, including: based on the positional relationship between multiple annotation vector lines, merging multiple continuous lines to obtain multiple character units; determining a target character unit frame corresponding to the character unit; based on the positional relationship between multiple character unit frames, merging multiple character units to obtain multiple annotation characters; determining an annotation character frame corresponding to the annotation character; based on the positional relationship between multiple annotation character frames, merging multiple annotation characters to generate an annotation information box.

[0011] The information recognition method of the vector drawing provided by the embodiment of the present invention combines continuous lines into multiple character units according to the position relationship, and then further combines them into annotation characters according to the position relationship of the character units, and finally integrates the annotation characters into a complete annotation information box. This process can efficiently extract and integrate annotation information, reduce redundant data, and ensure the accuracy and coherence of the annotation box, thereby improving the recognition accuracy of graphics and text.

[0012] In an optional embodiment, based on the positional relationship between multiple annotated vector lines, multiple continuous lines are merged to obtain multiple character units, including: for any two continuous lines, determining whether the two continuous lines intersect; when it is determined that the two continuous lines intersect, merging the two continuous lines to obtain a character unit.

[0013] The information recognition method of the vector drawing provided by the embodiment of the present invention can accurately identify and merge intersecting lines by judging the intersection relationship between continuous lines, thereby forming a more accurate character unit. This method ensures that the connection relationship between lines is reasonably handled, helps to reduce errors and redundancy, improves the accuracy of character units, and provides a clearer and more reliable basis for subsequent data processing and analysis.

[0014] In an optional embodiment, the two continuous lines include a first continuous line and a second continuous line; determining whether the two continuous lines intersect includes: for any labeled vector line in the first continuous line, determining the starting point and end point of the labeled vector line; respectively determining the distances from the starting point and end point of the labeled vector line to the starting points and end points of each labeled vector line in the second continuous line; when it is determined that any distance is less than a preset distance threshold, determining that the first continuous line and the second continuous line intersect.

[0015] The information recognition method of the vector drawing provided by the embodiment of the present invention can more carefully judge whether two continuous lines intersect by accurately calculating the distance between the starting point and the end point of the annotated vector line. By setting a preset distance threshold, it is possible to effectively avoid erroneous judgments caused by slight deviations, thereby improving the accuracy and robustness of the judgment. At the same time, by independently comparing the start and end point distances of multiple lines, the intersection between the lines can be considered more comprehensively, thereby improving the accuracy and flexibility of merging character units.

[0016] In an optional embodiment, determining a target character unit frame corresponding to a character unit includes: determining multiple endpoints of the character unit, and determining an endpoint located at a preset position among the multiple endpoints as a starting endpoint; determining a next endpoint having a minimum angle with the starting endpoint; determining a convex hull corresponding to multiple endpoints based on the next endpoint; and generating a target character unit frame corresponding to the character unit based on boundary information of the convex hull.

[0017] The information recognition method of vector drawings provided by the embodiment of the present invention can ensure the consistency of starting point selection and reduce errors by locating the endpoint of the preset position as the starting point. The next endpoint is determined based on the minimum angle between the starting endpoint and the other endpoints, so as to more accurately capture the shape of the character. The convex hull algorithm is used to extract the boundaries of the character unit, which can effectively remove irrelevant details and ensure that the generated character unit frame is compact and accurate. Therefore, this method not only improves the stability of the character unit frame, but also provides a more reliable boundary for subsequent character recognition and image processing, thereby improving overall processing efficiency and accuracy.

[0018] In an optional embodiment, a target character cell frame corresponding to the character unit is generated based on the boundary information of the convex hull, including: determining each edge of the convex hull as the bottom edge of the character cell frame to be generated, and determining the length of the bottom edge; for any bottom edge, determining the height of the character cell frame to be generated in a direction perpendicular to the bottom edge; generating each candidate character cell frame based on the length and height; and determining the character cell frame with the smallest area among the candidate character cell frames as the target character cell frame corresponding to the character unit.

[0019] The information recognition method of the vector drawing provided by the embodiment of the present invention uses each side of the convex hull as the bottom side of the character unit frame to be generated, and determines the length of the bottom side, thereby ensuring the preliminary positioning of the frame. For each bottom side, the height of the character unit frame in the vertical direction is determined, so that the size and shape of the frame can be effectively controlled. By combining the length and height of the bottom side to generate multiple candidate frames, and finally selecting the candidate frame with the smallest area as the target character unit frame, it is possible to reduce redundant blank areas or unnecessary space waste, and ensure that the generated character unit frame is compact and accurate. Therefore, this method optimizes the boundary extraction of the character unit and improves the accuracy and efficiency of character recognition.

[0020] In an optional embodiment, based on the positional relationship between multiple character unit frames, multiple character units are merged to obtain multiple marked characters, including: for any two character units, determining whether the target character unit frames corresponding to the two character units intersect; when it is determined that the two target character unit frames intersect, merging the two character units to obtain the marked characters.

[0021] The information recognition method of the vector drawing provided by the embodiment of the present invention determines whether any two character unit frames intersect. When the two frames are found to intersect, they can be merged into one annotated character. In this way, it is possible to handle overlapping or close situations between characters, avoid erroneous splitting or omission, and help improve the accuracy and completeness of character recognition. Therefore, this method can better adapt to the diversity of character arrangements and improve the rationality and accuracy of annotations in the process of processing complex texts.

[0022] In an optional implementation, based on the positional relationship between multiple annotation character boxes, multiple annotation characters are merged to generate an annotation information box, including: extending each annotation character box by a preset distance along a preset direction to obtain multiple extended bounding boxes; for any two extended bounding boxes, determining whether the two extended bounding boxes intersect; when it is determined that the two extended bounding boxes intersect, merging the corresponding two annotation characters to generate an annotation information box.

[0023] The information recognition method for vector drawings provided by the embodiment of the present invention extends each annotation character box by a certain distance along a preset direction to form multiple extended bounding boxes. It is determined whether these extended bounding boxes intersect. When an intersection is found, the corresponding annotation characters are merged to generate a new annotation information box. Therefore, this method can handle the proximity or overlap between characters, avoid erroneous segmentation or omission, and improve the coherence and accuracy of the annotation information.

[0024] In a second aspect, the present invention provides an information identification device for vector drawings, comprising: an acquisition module, used to acquire the vector drawings, and parse the vector drawings to determine multiple annotated vector lines in the vector drawings; a clustering module, used to cluster the multiple annotated vector lines based on the attribute relationship of the multiple annotated vector lines to generate a line clustering set; a merging module, used to merge the multiple vector lines in the line clustering set using the positional relationship between the multiple annotated vector lines to generate an annotation information box; and an identification module, used to identify the characters in the annotation information box to obtain the annotation information of the vector drawings.

[0025] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the information recognition method of vector drawing of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0026] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the vector drawing information recognition method of the first aspect or any corresponding embodiment thereof.

[0027] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the vector drawing information recognition method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 is a schematic flow chart of a method for identifying information of a vector drawing according to an embodiment of the present invention;

[0030] Figure 2 is a schematic diagram of a character style according to an embodiment of the present invention;

[0031] Figure 3 is a schematic diagram of a character arrangement according to an embodiment of the present invention;

[0032] Figure 4 is a flow chart of another method for identifying information of a vector drawing according to an embodiment of the present invention;

[0033] Figure 5 is a schematic diagram of a plurality of annotated vector lines according to an embodiment of the present invention;

[0034] Figure 6 is a schematic diagram of a line clustering set according to an embodiment of the present invention;

[0035] Figure 7 is a schematic flow chart of another method for identifying information of a vector drawing according to an embodiment of the present invention;

[0036] Figure 8 is a schematic diagram of a single character clustering result according to an embodiment of the present invention;

[0037] Fig. 9 It is a schematic diagram of a marking information box in a steel bar detail drawing according to an embodiment of the present invention;

[0038] Fig.10 It is a schematic diagram of a marking information box in another steel bar detail drawing according to an embodiment of the present invention;

[0039] Fig.11 is a schematic diagram of a marked information box in a roadbed cross-section drawing according to an embodiment of the present invention;

[0040] Fig.12 is a schematic diagram of a marked information box in a geological longitudinal section drawing according to an embodiment of the present invention;

[0041] Fig.13 is a schematic diagram of annotation information to be identified in a vector drawing according to an embodiment of the present invention;

[0042] Fig.14 is a schematic diagram of another plurality of labeled vector lines according to an embodiment of the present invention;

[0043] Fig.15 is a schematic diagram of a plurality of character units and their corresponding target character unit frames according to an embodiment of the present invention;

[0044] Fig.16 is a schematic diagram of a plurality of annotation characters and their corresponding annotation character frames according to an embodiment of the present invention;

[0045] Fig.17 is a schematic diagram of multiple extended bounding boxes according to an embodiment of the present invention;

[0046] Fig.18 is a schematic diagram of yet another marking information box according to an embodiment of the present invention;

[0047] Fig.19 is a structural block diagram of an information recognition device for vector drawings according to an embodiment of the present invention;

[0048] Fig. 20 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0050] In the application of infrastructure highway quantity calculation software, accurate identification of the annotation information in the vector drawings is the prerequisite for effective engineering calculation and management. For example, the key parameters that need to be identified in the steel bar drawing include the steel bar number, grade, diameter, quantity and length; the roadbed cross-section drawing needs to extract the pile number and elevation information; and the geological longitudinal section drawing involves data such as advance support, starting and ending pile numbers, etc. These annotation information are crucial to the design, construction and later maintenance of the project.

[0051] However, the annotation information to be identified is usually presented in the form of vector lines, which are often dense and complex. Therefore, how to effectively extract and aggregate annotation information from these complex vector lines has become a key issue in current technology applications.

[0052] In view of this, the technical solution of the present invention first obtains and parses the vector drawing, identifies multiple annotated vector lines, and clusters them based on line attributes to generate continuous lines. Subsequently, the directed bounding boxes of these lines are calculated, and the vector lines related to the characters are further aggregated according to the spatial direction of the bounding box, thereby improving the accuracy and efficiency of information extraction.

[0053] According to an embodiment of the present invention, an embodiment of a method for information recognition of vector drawings is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0054] In this embodiment, a vector graphics information recognition method is provided, which can be used in computer devices, such as laptop computers, desktop computers, etc. Figure 1 is a flow chart of a method for identifying information of a vector drawing according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0055] Step S101, obtaining a vector drawing, and analyzing the vector drawing to determine a plurality of annotated vector lines in the vector drawing.

[0056] Vector drawings refer to graphic files that use mathematical equations to describe the shapes, lines, and colors of graphics. Specifically, in computer-aided design (CAD), after the design is completed, the drawings can be exported as vector format (such as DWG, DXF) files to obtain vector drawings. It is also possible to scan paper drawings and convert them into vector drawings using vectorization software. Of course, other methods can also be used to obtain vector drawings, and the specific methods are not limited.

[0057] Multiple annotated vector lines refer to lines used to express dimensions, annotations or other information in a vector drawing, and these lines have specific attributes, such as color, style, annotation content, etc. Specifically, through a specific library or tool, the vector drawing can be read, the annotated vector lines can be identified and extracted, or preset rules can be applied to filter and select corresponding annotated vector lines according to specific features (such as the color, style, position, etc. of the line). Of course, other methods can also be used to determine the annotated lines in the vector drawing, and the specific method is not limited.

[0058] In addition, the annotation information in the vector drawing also includes character style and character arrangement. Figure 2 As shown in , character styles include letters, numbers, Chinese characters, etc. Figure 3 As shown, the characters can be arranged horizontally, vertically or obliquely.

[0059] Step S102: clustering the plurality of labeled vector lines based on the attribute relationship of the plurality of labeled vector lines to generate a line cluster set.

[0060] Attribute relationships refer to the characteristics of the annotated vector lines and their relationships with each other, such as the position, length, direction, and other attributes of the annotated vector lines. A line cluster set refers to a set formed by grouping similar annotated vector lines using a clustering algorithm, such as lines at similar positions. Specifically, attribute information can be extracted from each annotated vector line, and multiple annotated lines can be clustered according to the attribute information to generate a line cluster set.

[0061] Attribute relationships refer to the characteristics of annotated vector lines and their relationships, such as location, length, direction, and other attributes. A line cluster set is a set formed by grouping similar annotated lines using a clustering algorithm, for example, groups lines with similar positions into one category. Specifically, the attribute information of each annotated line can be extracted, and the lines can be clustered based on this information to generate a line cluster set.

[0062] Step S103 , using the positional relationship between the multiple annotation vector lines, multiple continuous lines in the line cluster set are merged to generate an annotation information box.

[0063] The positional relationship between multiple annotation vector lines refers to their relative position and arrangement in space, for example, whether any two lines intersect. A continuous line refers to a line formed by connecting multiple annotation vector lines. An annotation information box is a rectangular area containing annotation information and is used to carry character text. Specifically, by analyzing the positional relationship of multiple annotation vector lines, continuous lines that meet the conditions are merged based on the analysis results, and finally the corresponding annotation information box is obtained.

[0064] Step S104, recognizing the characters in the annotation information box to obtain the annotation information of the vector drawing.

[0065] The annotation information refers to the text or symbols used to explain or annotate the content in the vector drawing, such as text labels, symbols and numerical values, etc. Specifically, through the optical character recognition (OCR) technology, the characters in the annotation information box can be recognized and integrated into the complete annotation information.

[0066] The information recognition method for vector drawings provided by the embodiments of the present invention can efficiently analyze and extract the annotation information in vector drawings. By clustering the attribute relationships of the annotation vector lines and merging them based on the positional relationships between the lines, an annotation information box can be accurately generated, and then the character information therein can be recognized. Therefore, this method not only improves the accuracy and efficiency of information extraction, but also can adapt to vector drawings of different forms and complexities, has strong versatility and scalability, can effectively reduce manual intervention, and improve work efficiency.

[0067] In this embodiment, an information recognition method for vector drawings is provided, which can be used in computer devices, such as laptops, desktop computers, etc. Figure 4 It is a flowchart of the information recognition method for vector drawings according to the embodiments of the present invention, as Figure 4 shown, and this process includes the following steps:

[0068] Step S201, obtain a vector drawing and parse the vector drawing to determine multiple annotation vector lines in the vector drawing. For details, please refer to Figure 1 step S101 of the embodiment shown herein, which will not be elaborated herein.

[0069] Step S202, cluster multiple annotation vector lines based on the attribute relationships of the multiple annotation vector lines to generate a line clustering set.

[0070] Specifically, the above step S202 includes:

[0071] Step S2021, merge multiple annotation vector lines based on the attribute relationships of the multiple annotation vector lines to obtain multiple continuous lines.

[0072] Specifically, define and obtain a directed graph structure. For example, use a hash table (hash table <int, vector line>) to store the edge set, and associate each edge with a unique integer (such as the ID or index of the edge). At the same time, use a mapping (map <point, set of edges>) to establish the relationship between the end points and the edges. Through the combination of the hash table and the mapping, the edge set and the relationship between the end points and the edges can be systematically stored.

[0073] After obtaining the directed graph structure, for any annotation vector line, extract its start point and end point, and check whether the start point and end point are in the directed graph. If they already exist, update the record of this point in the relationship between the end points and the edges; if they do not exist, create a new relationship between the end points and the edges, and add the line to the graph. Repeat the above steps until all annotation vector lines are processed, and finally obtain a directed graph representing the relationship between multiple annotation vector lines. Perform a depth-first search (DFS) on the generated directed graph to identify and cluster continuous lines.

[0074] In some optional implementations, the above step S2021 includes:

[0075] Step a1: for any annotated vector line, determine the corresponding starting point and end point.

[0076] Specifically, all the labeled vector lines in the directed graph are traversed, and any labeled vector line is selected as the current labeled vector line e1. Check whether e1 has been visited. If it has been visited, skip the line and continue to process the next one; if it has not been visited, mark it as visited and add it to the current line cluster set. Then, based on the vector representation of the labeled vector line (such as the start and end coordinates of the line segment), determine its corresponding start and end points.

[0077] Step a2, determining other labeled vector lines connected to the starting point to obtain a first edge set; and determining other labeled vector lines connected to the end point to obtain a second edge set.

[0078] The first edge set is a set of other label vector lines connected to the starting point of the current label vector line; the second edge set is a set of other label vector lines connected to the end point of the current label vector line.

[0079] Starting from the starting point of the current labeled vector line e1, determine the first edge set R1 associated with it and traverse it. Specifically, for each labeled vector line e2 in the first edge set R1, check whether it has been visited: if it has been visited, continue to traverse the next labeled vector line; if it has not been visited, mark e2 as visited, add it to the line cluster set, and use e2 as the current labeled vector line. Starting from the starting point of e2, obtain the first edge set R1 associated with it. This process will continue until starting from the starting point of the current labeled vector line, it is found that all the labeled vector lines associated with it have been marked as visited, at which time the search process stops.

[0080] Similarly, starting from the end point of the current labeled vector line e1, determine the second edge set R2 associated with it, and traverse until it is found that all the labeled vector lines associated with it have been marked as visited, and the search process stops at this time.

[0081] Step a3: merge the first edge set, the second edge set and the labeled vector line to obtain a continuous line corresponding to the labeled vector line.

[0082] Connect the current labeled vector line (e.g., e1) with the labeled vector lines in the first edge set R1 and the second edge set R2 to form a complete continuous line. Specifically, the result of the connection is a continuous path from the starting point to the end point, covering the current labeled vector line and the lines in all edge sets connected to it.

[0083] In the above implementation, by analyzing the start and end points of the annotated vector lines, other lines connected to them can be accurately identified and merged into continuous lines. This not only improves the accuracy of line connection, but also ensures the neatness and clarity of the graphic structure. At the same time, by reducing redundant annotation information, data integration efficiency can be improved.

[0084] Step S2022: generating a line cluster set based on multiple continuous lines.

[0085] The line cluster set is a set formed by merging multiple continuous lines. Specifically, multiple continuous lines are combined into a larger cluster, thereby forming a line cluster set G.

[0086] In one specific example, Figure 5 The figure shows the multiple annotated vector lines determined after parsing the vector drawing. Figure 6 As shown, the corresponding line cluster set is obtained, and the purple box represents the tight bounding box of the continuous lines.

[0087] Step S203, using the positional relationship between the multiple labeled vector lines, multiple continuous lines in the line cluster set are merged to generate a label information box. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0088] Step S204: Recognize the characters in the annotation information box to obtain the annotation information of the vector drawing. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0089] The information recognition method for vector drawings provided by the embodiment of the present invention can reduce redundant information and improve the accuracy of drawing analysis by merging multiple annotated vector lines into continuous lines. At the same time, generating a line clustering set based on these continuous lines helps to more accurately identify the annotated content and information box, ensuring that the annotated information can be accurately located and recognized in the subsequent recognition and extraction process.

[0090] In this embodiment, a vector graphics information recognition method is provided, which can be used in computer devices, such as laptop computers, desktop computers, etc. Figure 7 is a flow chart of a method for identifying information of a vector drawing according to an embodiment of the present invention. Figure 7 As shown, the process includes the following steps:

[0091] Step S301, obtain a vector drawing, and parse the vector drawing to determine a plurality of annotated vector lines in the vector drawing. Figure 4Step S201 of the illustrated embodiment will not be described in detail here.

[0092] Step S302: cluster the multiple labeled vector lines based on the attribute relationship of the multiple labeled vector lines to generate a line cluster set. Figure 4 Step S202 of the illustrated embodiment will not be described in detail here.

[0093] Step S303: merging a plurality of continuous lines in the line clustering set by utilizing the positional relationship between the plurality of annotated vector lines to generate an annotation information box.

[0094] Specifically, the above step S303 includes:

[0095] Step S3031, based on the positional relationship between the multiple annotation vector lines, multiple continuous lines are merged to obtain multiple character units.

[0096] The positional relationship between multiple labeled vector lines refers to their relative positions in space. For example, two labeled vector lines may intersect. A character unit is a new grouping generated by merging multiple continuous lines. Specifically, when traversing multiple continuous lines (such as g1, g2...) in the line cluster set G, the spatial relationship between any two continuous lines is determined based on the position information of each labeled vector line. If it is determined that the two labeled vector lines are closely related in position and can be regarded as a whole, they are merged to form a character unit.

[0097] In some optional implementations, the above step S3031 includes:

[0098] Step b1: for any two continuous lines, determine whether the two continuous lines intersect.

[0099] Specifically, for any two continuous lines gi and gj, a geometric algorithm (such as a line segment intersection detection algorithm) can be used to determine whether they intersect. Alternatively, a preset distance threshold can be used to determine whether two lines intersect. The specific method can be selected according to actual needs.

[0100] In some optional implementations, the two continuous lines include a first continuous line and a second continuous line, and the step b1 includes:

[0101] Step c1: for any labeling vector line in the first continuous lines, determine the starting point and the end point of the labeling vector line.

[0102] All the labeled vector lines are extracted from the first continuous line, and the labeled vector lines are stored in the form of coordinates, and each labeled vector line has a starting point P1 and an end point P2. Specifically, for any labeled vector line in the first continuous line, the coordinates of its starting point P1 and end point P2 are obtained.

[0103] Step c2, respectively determining the starting point and the end point of the labeled vector line, and the distances to the starting point and the end point of each labeled vector line in the second continuous line.

[0104] After obtaining the start point Q1 and the end point Q2 of all the labeled vector lines in the second continuous line, the distance from P1 and P2 to each Q1 and Q2 is calculated using the Euclidean distance formula.

[0105] Step c3: when it is determined that any distance is less than a preset distance threshold, determining that the first continuous line intersects the second continuous line.

[0106] The preset distance threshold is used to determine whether two continuous lines intersect, and can be set to, for example, 1 / 50 of the character height. Specifically, all calculated distances are traversed, and if any distance is less than the preset distance threshold, it is determined that the first continuous line intersects the second continuous line.

[0107] In the above implementation, by accurately calculating the distance between the start and end points of the annotated vector line, it is possible to more carefully determine whether two continuous lines intersect. By setting a preset distance threshold, it is possible to effectively avoid erroneous judgments caused by slight deviations, thereby improving the accuracy and robustness of the judgment. At the same time, by independently comparing the start and end point distances of multiple lines, it is possible to more comprehensively consider the intersection between the lines, thereby improving the accuracy and flexibility of merging character units.

[0108] Step b2: when it is determined that two continuous lines intersect, the two continuous lines are merged to obtain a character unit.

[0109] Specifically, when it is determined that two continuous lines gi and gj intersect, they are merged into a new line gij, and the newly generated line gij is added to the line clustering set G, while gi and gj are deleted from the set G.

[0110] The merge operation will cause the line cluster set G to change, so the set G needs to be traversed again. At this time, new intersections may appear because the merged new line gij may intersect with other lines. This process will continue until no lines that can be merged are found in a complete traversal. In other words, all intersecting lines have been merged and cannot be merged further, thus generating a single character cluster result G' containing multiple character units.

[0111] In one specific example, Figure 6 The line clustering set generated based on multiple labeled vector lines is shown. After the above steps, Figure 8 The corresponding single-character clustering results are shown, for example, the three consecutive lines in H are clustered into one group.

[0112] In the above implementation, by determining the intersection relationship between continuous lines, the intersecting lines can be accurately identified and merged to form a more accurate character unit. This method ensures that the connection relationship between the lines is properly handled, helps reduce errors and redundancy, improves the accuracy of the character unit, and provides a clearer and more reliable basis for subsequent data processing and analysis.

[0113] Step S3032, determine the target character unit frame corresponding to the character unit.

[0114] The target character cell frame is used to surround a character cell. Its purpose is to provide clear boundaries for each character cell during the processing process to facilitate subsequent merging and analysis. Specifically, a target frame is calculated for each character cell, for example, it can be the smallest rectangular frame that can completely surround the character cell. Finally, the target frame is determined as the target character cell frame of the corresponding character cell.

[0115] In some optional implementations, the above step S3032 includes:

[0116] Step d1, determining multiple endpoints of the character unit, and determining an endpoint located at a preset position among the multiple endpoints as a starting endpoint.

[0117] The preset position can be defined according to the shape or structural features of the character unit, in order to ensure the consistency and accuracy of subsequent processing. Specifically, all endpoints related to the character unit, such as the starting point, turning point, and end point of the character, are collected. Then, an endpoint located at the preset position (such as the upper left corner or lower right corner of the character unit) is selected as the starting endpoint.

[0118] Step d2, determining the next endpoint whose included angle with the starting endpoint is the smallest included angle.

[0119] After selecting the starting endpoint, determine the next endpoint connected to it. Specifically, calculate the angle between the starting endpoint and the other endpoints, and select the endpoint with the smallest angle as the next endpoint.

[0120] Step d3, determining the convex hull corresponding to the multiple endpoints based on the next endpoint.

[0121] The convex hull is the smallest convex polygon that can enclose all endpoints. Specifically, the Jarvis stepping method (or other algorithms) can be used to effectively find the boundaries of the endpoints to provide an overall framework for the outline of the character unit.

[0122] Step d4, generating a target character unit frame corresponding to the character unit based on the boundary information of the convex hull.

[0123] The boundary information calculated by the convex hull is used to generate the corresponding target character unit box. The shape and position of the target character unit box reflect the structural characteristics of the character unit. For example, the target character unit box can be a tight bounding box (OBB) to ensure that it is tightly surrounded by the character unit shape, which is convenient for subsequent clustering and analysis.

[0124] In the above implementation, by locating the endpoint at the preset position as the starting point, the consistency of the starting point selection can be ensured and the error can be reduced. The next endpoint is determined based on the minimum angle between the starting endpoint and the other endpoints, so as to more accurately capture the shape of the character. The convex hull algorithm is used to extract the boundaries of the character unit, which can effectively remove irrelevant details and ensure that the generated character unit frame is compact and accurate. Therefore, this method not only improves the stability of the character unit frame, but also provides a more reliable boundary for subsequent character recognition and image processing, thereby improving the overall processing efficiency and accuracy.

[0125] In some optional implementations, the above step d4 includes:

[0126] Step e1, determining each side of the convex hull as the bottom side of the character unit frame to be generated, and determining the length of the bottom side.

[0127] Select each edge from the boundary of the convex hull as the bottom edge of the character unit box, and calculate the length of each bottom edge.

[0128] Step e2: for any bottom edge, determine the height of the character unit frame to be generated in a direction perpendicular to the bottom edge.

[0129] For each base, determine its vertical height. Specifically, extend outward from the two end points of the base and expand vertically to a sufficient height to ensure that all points in the convex hull are included.

[0130] Step e3, generating each candidate character unit frame based on the length and height.

[0131] According to the known bottom edge length and height, a plurality of candidate character unit frames are generated, wherein the shape and size of each candidate character unit frame may vary due to the difference in bottom edge length and height.

[0132] Step e4, determining the character cell frame with the smallest area among the candidate character cell frames as the target character cell frame corresponding to the character unit.

[0133] For all generated candidate character cell frames, their areas (e.g., length multiplied by height) are calculated. Among these candidate character cell frames, the character cell frame with the smallest area is determined, which can more closely surround the character cell, and is marked as the target character cell frame.

[0134] In the above implementation, each side of the convex hull is used as the bottom side of the character unit frame to be generated, and the length of the bottom side is determined to ensure the initial positioning of the frame. For each bottom side, the height of the character unit frame in the vertical direction is determined, which can effectively control the size and shape of the frame. By combining the length and height of the bottom side to generate multiple candidate frames, and finally selecting the candidate frame with the smallest area as the target character unit frame, it is possible to reduce redundant blank areas or unnecessary space waste, and ensure that the generated character unit frame is compact and accurate. Therefore, this method optimizes the boundary extraction of the character unit and improves the accuracy and efficiency of character recognition.

[0135] Step S3033: Based on the positional relationship between the multiple character unit frames, multiple character units are merged to obtain multiple marked characters.

[0136] The marked character is formed by merging one or more character units, representing a complete glyph or symbol, and is the final recognition or marking target. Specifically, by merging adjacent character units, it is determined which character units can be merged according to their positional relationship to form a new marked character.

[0137] In some optional implementations, the above step S3033 includes:

[0138] Step f1, for any two character units, determine whether the target character unit frames corresponding to the two character units intersect.

[0139] For any two character units, by obtaining their bounding boxes (e.g., upper left corner and lower right corner coordinates), determine whether the target character boxes corresponding to the two character units intersect. Specifically, if the right boundary of a character unit is to the left of the left boundary of another character unit, or its left boundary is to the right of the right boundary of another character unit, the two character boxes do not intersect; otherwise, it means that they intersect.

[0140] Step f2: when it is determined that two target character unit frames intersect, the two character units are merged to obtain the marked character.

[0141] When two target character unit frames intersect, the two character units are merged into a new marked character. If the target character unit frames of two character units gi' and gj' intersect, they are merged into a new group gij', and gi' and gj' are removed from the single character clustering result G' to obtain a new Chinese character clustering result.

[0142] In the above implementation, it is determined whether any two character unit frames intersect. When the two frames are found to intersect, they can be merged into one annotated character. In this way, it is possible to handle overlapping or close situations between characters, avoid erroneous splitting or omission, and help improve the accuracy and completeness of character recognition. Therefore, this method can better adapt to the diversity of character arrangements in the process of processing complex texts, and improve the rationality and accuracy of annotation.

[0143] Step S3034, determining the marked character box corresponding to the marked character.

[0144] The label character box is used to enclose the label characters, and the purpose is to provide a clear boundary for each label character to facilitate subsequent merging and analysis. Specifically, the label character box can be determined by calculating the minimum enclosing rectangle.

[0145] Step S3035: Based on the positional relationship between the multiple annotation character boxes, multiple annotation characters are merged to generate an annotation information box.

[0146] The annotation information box is used to surround one or more annotation characters and provide the overall boundary of the final recognized characters. It can contain not only a single character, but also multiple merged characters for easy subsequent processing or display. Specifically, according to the positional relationship of the annotation character boxes, adjacent or overlapping annotation characters are merged to generate the final annotation information box.

[0147] In some optional implementations, the above step S3035 includes:

[0148] Step g1, expanding each labeled character box by a preset distance along a preset direction to obtain multiple extended bounding boxes.

[0149] The preset direction refers to the direction selected when expanding the label character box, which can be preset according to the character layout and actual application requirements. The preset distance refers to the specific distance of the outward expansion when expanding the label character box, which can be a fixed value (such as 5 pixels) or dynamically adjusted according to actual conditions.

[0150] The extended bounding box refers to a new bounding box formed by expanding the original annotation character box. The extended bounding box is larger than the original character box and can better cover the possible overlapping areas between characters. Specifically, for each annotation character box, the boundary is extended along the selected direction. For example, if the direction is horizontal, the left and right sides are extended outward by a preset distance, thereby increasing the size of the annotation character box and better capturing possible overlapping areas. After the expansion is completed, multiple new bounding boxes will be generated, that is, multiple extended bounding boxes.

[0151] Step g2: for any two extended bounding boxes, determine whether the two extended bounding boxes intersect.

[0152] From the set of expanded bounding boxes, select any two expanded bounding boxes and use a geometric algorithm (such as the intersection test of axis-aligned bounding boxes) to determine whether they intersect. If an intersection is detected, mark the two bounding boxes as intersecting.

[0153] Step g3: when it is determined that two extended bounding boxes intersect, the corresponding two annotation characters are merged to generate an annotation information box.

[0154] According to the intersection detection results, all intersecting extended bounding boxes are determined. For each pair of intersecting bounding boxes, their corresponding labeled characters are merged. Specifically, the merge operation can merge the annotation information of the two labeled characters, or create a new annotation box to represent the composite area of ​​the two characters. After merging, a new annotation box (such as a tight bounding box) is generated to cover the merged character area, such as Figures 9 to 12 shown.

[0155] In the above implementation, each label character frame is extended a certain distance along a preset direction to form multiple extended bounding boxes. It is determined whether these extended bounding boxes intersect. When an intersection is found, the corresponding label characters are merged to generate a new label information frame. Therefore, this method can handle the proximity or overlap between characters, avoid erroneous segmentation or omission, and improve the consistency and accuracy of the label information.

[0156] Step S304: Recognize the characters in the annotation information box to obtain the annotation information of the vector drawing. Figure 4 Step S204 of the illustrated embodiment will not be described in detail here.

[0157] The information recognition method of the vector drawing provided by the embodiment of the present invention combines continuous lines into multiple character units according to the position relationship, and then further combines them into annotation characters according to the position relationship of the character units, and finally integrates the annotation characters into a complete annotation information box. This process can efficiently extract and integrate annotation information, reduce redundant data, and ensure the accuracy and coherence of the annotation box, thereby improving the recognition accuracy of graphics and text.

[0158] In the following of this embodiment, examples are given through actual application scenarios.

[0159] like Fig.13 As shown in the figure, the annotation information to be identified in the vector drawing is displayed.

[0160] After obtaining and parsing the vector drawing, determine the multiple annotation vector lines in the drawing, such as Fig.14 shown.

[0161] Based on the positional relationship between these annotation lines, the continuous lines are merged into multiple character units, and the corresponding target character unit frame is determined for each character unit, such as Fig.15 shown.

[0162] Next, based on the positional relationship between the multiple character unit frames, the character units are further merged to obtain multiple marked characters, and a corresponding marked character frame is determined for each marked character, such as Fig.16 shown.

[0163] Then, each label character box is extended by a specified distance along a preset direction to generate multiple extended bounding boxes, such as Fig.17 shown.

[0164] When two extended bounding boxes are detected to intersect, the corresponding annotation characters are merged and an annotation information box is generated, such as Fig.18 shown.

[0165] The information recognition method for vector drawings provided by the embodiment of the present invention parses the vector drawings and identifies the annotation lines, providing a basis for subsequent processing. According to the positional relationship of the annotation lines, adjacent lines are merged into character units, and a corresponding character box is determined for each character unit. Further merging is performed based on the relationship between the character boxes to ensure the accurate positioning of each annotated character. The character box is expanded to generate a bounding box to solve the problem of character overlap and avoid erroneous splitting. When the intersection of the bounding boxes is detected, the corresponding annotation characters are automatically merged to generate the final annotation information box. Therefore, this method can effectively improve the integrity and processing efficiency of the annotation information, and is particularly suitable for complex drawings and closely arranged characters, reducing manual intervention and improving the reliability of automated processing.

[0166] In this embodiment, a vector drawing information recognition device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0167] This embodiment provides a vector graphics information recognition device, such as Fig.19 As shown, including:

[0168] The acquisition module 401 is used to acquire the vector drawing, analyze the vector drawing, and determine a plurality of annotated vector lines in the vector drawing;

[0169] A clustering module 402, for clustering the plurality of labeled vector lines based on the attribute relationship of the plurality of labeled vector lines to generate a line cluster set;

[0170] A merging module 403 is used to merge multiple vector lines in the line clustering set by utilizing the positional relationship between the multiple annotated vector lines to generate an annotation information box;

[0171] The recognition module 404 is used to recognize the characters in the annotation information box to obtain the annotation information of the vector drawing.

[0172] In some optional implementations, the clustering module 402 includes:

[0173] A first merging submodule is used to merge the multiple labeled vector lines based on the attribute relationship of the multiple labeled vector lines to obtain multiple continuous lines;

[0174] The generation submodule is used to generate a line clustering set based on multiple continuous lines.

[0175] In some optional implementations, the merging submodule includes:

[0176] A first determining unit is used to determine a corresponding starting point and an end point for any marked vector line;

[0177] A second determining unit is used to determine other labeled vector lines connected to the starting point to obtain a first edge set; and determine other labeled vector lines connected to the end point to obtain a second edge set;

[0178] The first merging unit is used to merge the first edge set, the second edge set and the labeled vector line to obtain a continuous line corresponding to the labeled vector line.

[0179] In some optional implementations, the merging module 403 includes:

[0180] A second merging submodule is used to merge multiple continuous lines based on the positional relationship between the multiple annotation vector lines to obtain multiple character units;

[0181] A first determination submodule is used to determine a target character unit frame corresponding to a character unit;

[0182] A third merging submodule is used to merge multiple character units based on the positional relationship between multiple character unit frames to obtain multiple marked characters;

[0183] The second determination submodule is used to determine the marked character box corresponding to the marked character;

[0184] The fourth merging submodule is used to merge the multiple annotation characters based on the positional relationship between the multiple annotation character frames to generate an annotation information frame.

[0185] In some optional implementations, the second merging submodule includes:

[0186] A judging unit, used for judging whether any two continuous lines intersect each other;

[0187] The second merging unit is used to merge the two continuous lines to obtain a character unit when it is determined that the two continuous lines intersect.

[0188] In some optional implementations, the judging unit includes:

[0189] A third determining unit, configured to determine a start point and an end point of a labeling vector line for any labeling vector line in the first continuous lines;

[0190] a fourth determining unit, for respectively determining the distances from the start point and the end point of the labeled vector line to the start point and the end point of each labeled vector line in the second continuous line;

[0191] The fifth determining unit is configured to determine that the first continuous line intersects the second continuous line when it is determined that any distance is less than a preset distance threshold.

[0192] In some optional implementations, the first determining submodule includes:

[0193] A sixth determining unit, configured to determine a plurality of endpoints of the character unit, and determine an endpoint located at a preset position among the plurality of endpoints as a starting endpoint;

[0194] A seventh determining unit, used to determine a next endpoint having a minimum angle with the starting endpoint;

[0195] An eighth determining unit, configured to determine a convex hull corresponding to a plurality of endpoints based on a next endpoint;

[0196] The first generating unit is used to generate a target character unit frame corresponding to the character unit based on the boundary information of the convex hull.

[0197] In some optional implementations, the generating unit includes:

[0198] A ninth determining unit, used to determine each side of the convex hull as the bottom side of the character unit frame to be generated, and determine the length of the bottom side;

[0199] a tenth determining unit, configured to determine, for any bottom edge, a height of the character unit frame to be generated in a direction perpendicular to the bottom edge;

[0200] A second generating unit, used to generate each candidate character unit frame based on the length and height;

[0201] The eleventh determining unit is used to determine the character cell frame with the smallest area among the candidate character cell frames as the target character cell frame corresponding to the character unit.

[0202] In some optional implementations, the third merging submodule includes:

[0203] A judging unit, used for judging, for any two character units, whether target character unit frames corresponding to the two character units intersect;

[0204] The third merging unit is used to merge the two character units to obtain the marked character when it is determined that the two target character unit frames intersect.

[0205] In some optional implementations, the fourth merging submodule includes:

[0206] An expansion unit, used to expand each labeled character box by a preset distance along a preset direction to obtain multiple extended bounding boxes;

[0207] A twelfth determining unit, configured to determine, for any two extended bounding boxes, whether the two extended bounding boxes intersect;

[0208] The fourth merging unit is used to merge the corresponding two annotation characters to generate an annotation information box when it is determined that the two extended bounding boxes intersect.

[0209] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0210] The information recognition device of the vector drawing in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0211] The information recognition device of the vector drawing provided by the embodiment of the present invention can efficiently parse and extract the annotation information in the vector drawing. By clustering the attribute relationship of the annotated vector lines and merging them based on the positional relationship between the lines, the annotation information box can be accurately generated, and then the character information therein can be identified. Therefore, this method not only improves the accuracy and efficiency of information extraction, but also can adapt to vector drawings of different forms and complexities, has strong versatility and scalability, can effectively reduce manual intervention, and improve work efficiency.

[0212] The embodiment of the present invention also provides a computer device having the above Fig.19 The information recognition device of the vector drawing shown.

[0213] See also Fig. 20 , Fig. 20 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 20As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 20 A processor 10 is taken as an example.

[0214] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0215] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0216] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0217] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0218] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig. 20 The example of connecting through bus is taken in the following.

[0219] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0220] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0221] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0222] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for identifying information of a vector drawing, characterized in that: The method comprises: Acquire a vector drawing, and parse the vector drawing to determine a plurality of annotated vector lines in the vector drawing; Based on the attribute relationship of the plurality of labeled vector lines, clustering the plurality of labeled vector lines to generate a line cluster set; Merging a plurality of continuous lines in the line cluster set by utilizing the positional relationship between the plurality of annotated vector lines to generate an annotation information box; The characters in the annotation information box are recognized to obtain the annotation information of the vector drawing.

2. The method according to claim 1, characterized in that The clustering of the plurality of labeled vector lines based on the attribute relationship of the plurality of labeled vector lines to generate a line cluster set includes: Based on the attribute relationship of the plurality of labeled vector lines, the plurality of labeled vector lines are merged to obtain the plurality of continuous lines; The set of line clusters is generated based on the plurality of continuous lines.

3. The method according to claim 2, characterized in that The merging of the plurality of labeled vector lines based on the attribute relationship of the plurality of labeled vector lines to obtain the plurality of continuous lines comprises: For any of the annotated vector lines, determining a corresponding starting point and an end point; Determine other labeled vector lines connected to the starting point to obtain a first edge set; and determine other labeled vector lines connected to the end point to obtain a second edge set; The first edge set, the second edge set and the labeled vector line are merged to obtain the continuous line corresponding to the labeled vector line.

4. The method according to claim 1, characterized in that: The step of merging a plurality of continuous lines in the line cluster set by utilizing the positional relationship between the plurality of annotated vector lines to generate an annotation information box includes: Based on the positional relationship between the plurality of annotation vector lines, the plurality of continuous lines are merged to obtain a plurality of character units; Determine a target character unit frame corresponding to the character unit; Based on the positional relationship between the plurality of character unit frames, the plurality of character units are merged to obtain a plurality of marked characters; Determine a marked character box corresponding to the marked character; Based on the positional relationship between the multiple annotation character frames, the multiple annotation characters are merged to generate the annotation information frame.

5. The method according to claim 4, characterized in that The step of merging the plurality of continuous lines based on the positional relationship between the plurality of annotated vector lines to obtain a plurality of character units includes: For any two of the continuous lines, determining whether the two continuous lines intersect; When it is determined that the two continuous lines intersect, the two continuous lines are merged to obtain the character unit.

6. The method according to claim 5, characterized in that The two continuous lines include a first continuous line and a second continuous line; Determining whether the two continuous lines intersect includes: For any of the labeled vector lines in the first continuous lines, determine the starting point and the end point of the labeled vector line; Respectively determine the starting point and the end point of the labeled vector line, and the distances to the starting point and the end point of each labeled vector line in the second continuous line; When it is determined that any of the distances is less than a preset distance threshold, it is determined that the first continuous line intersects with the second continuous line.

7. The method according to claim 4, characterized in that The step of determining a target character unit frame corresponding to the character unit includes: Determine a plurality of endpoints of the character unit, and determine an endpoint located at a preset position among the plurality of endpoints as a starting endpoint; Determine the next endpoint whose included angle with the starting endpoint is the smallest included angle; Determine the convex hull corresponding to the multiple endpoints based on the next endpoint; Based on the boundary information of the convex hull, a target character unit frame corresponding to the character unit is generated.

8. The method according to claim 7, characterized in that The step of generating a target character unit frame corresponding to the character unit based on the boundary information of the convex hull includes: Determine each side of the convex hull as the bottom side of the character unit frame to be generated, and determine the length of the bottom side; For any of the bottom edges, determining the height of the character unit frame to be generated in a direction perpendicular to the bottom edge; Generate each candidate character unit frame based on the length and height; The character cell frame with the smallest area among the candidate character cell frames is determined as the target character cell frame corresponding to the character unit.

9. The method according to claim 8, characterized in that Based on the positional relationship between the plurality of character unit frames, the plurality of character units are merged to obtain a plurality of marked characters, including: For any two of the character units, determining whether the target character unit frames corresponding to the two character units intersect; When it is determined that two target character unit frames intersect, the two character units are merged to obtain the marked character.

10. The method according to claim 9, characterized in that Based on the positional relationship between the plurality of the annotation character frames, the plurality of annotation characters are merged to generate the annotation information frame, including: Expand each of the label character boxes by a preset distance along a preset direction to obtain a plurality of extended bounding boxes; For any two of the extended bounding boxes, determining whether the two extended bounding boxes intersect; When it is determined that the two extended bounding boxes intersect, the corresponding two annotation characters are merged to generate the annotation information box.

11. A vector drawing information recognition device, characterized in that: The device comprises: An acquisition module, used for acquiring a vector drawing, parsing the vector drawing, and determining a plurality of annotated vector lines in the vector drawing; A clustering module, configured to cluster the plurality of labeled vector lines based on the attribute relationship of the plurality of labeled vector lines to generate a line clustering set; A merging module, used to merge the multiple vector lines in the line clustering set by utilizing the positional relationship between the multiple annotated vector lines to generate an annotation information box; The recognition module is used to recognize the characters in the annotation information box to obtain the annotation information of the vector drawing.

12. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the vector drawing information recognition method according to any one of claims 1 to 10.

Citation Information

Cited By

  • Architectural drawing processing method and device and medium

    CN120656188A