A method, device and readable storage medium for identifying line type

Through the combination of clustering and machine learning models, the line type categories of lines in the board identification layer are identified, which solves the problems of inaccurate and inefficient identification in the prior art, and achieves efficient and accurate line type recognition.

CN111882534BActive Publication Date: 2025-04-11GLODON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010694470.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-17
Publication Date
2025-04-11
Estimated Expiration
2040-07-17

AI Technical Summary

Technical Problem

In the prior art, it is difficult to accurately identify the line type categories of lines in the board identification layer during the board identification process, especially when there are many types of lines and cross-connected, resulting in inaccurate identification and inefficient efficiency.

Method used

By obtaining line information in the board identification layer, lines with connected relationships are clustered into line clusters, and the line cluster category is determined using the first classification model. If the line cluster is a mixed line cluster, the line type category of each line is identified using a second classification model.

Benefits of technology

It realizes efficient and accurate identification of each line in the board identification layer, and can handle multiple line types in complex scenarios, improving identification efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111882534B_ABST
    Figure CN111882534B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and readable storage medium for identifying line types, the method comprising: obtaining a plate identification layer to be identified, and determining line information in the plate identification layer; clustering lines with connectivity to form line clusters; using a first classification model to respectively determine the line cluster category of each line cluster; wherein the line cluster category comprises: a mixed line cluster or a single line cluster; when any line cluster is a mixed line cluster, using a second classification model to respectively determine the line type category of each line in the line cluster; the line type category of each line in the plate identification layer can be efficiently and accurately identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graphics processing technology, and in particular to a method and device for identifying line types and a readable storage medium. Background Art

[0002] In the field of architecture, drawing remodeling refers to the 3D modeling of the designer's CAD engineering drawings; the existing drawing remodeling process is generally divided into: importing CAD design drawings, drawing sorting, manual extraction of layer information, information verification process, information identification process, information sorting process and 3D modeling process. Due to the openness of CAD drawing, there are no strong drawing specifications to constrain the designer's detailed design. There are only some commonly known rules, but these rules are not enough to guide the smooth implementation of the remodeling process.

[0003] In CAD engineering drawings, the main sources of information are lines and texts. Lines are used to illustrate structural information, while texts serve as auxiliary explanations. In order to facilitate the identification of different components, there will be a layer extraction step before identification, that is, extracting the lines and texts related to the current component in the drawing. In plate identification, the plate identification layer will be extracted from the structural plan; among them, the plate identification layer includes some lines about elevation, plate thickness and various auxiliary explanation texts. In order to smoothly carry out the subsequent identification work, it is necessary to identify the line type of each line in the plate identification layer. The existing solution is to identify it by manually defining features through coding; however, there are many types of lines in the plate identification layer. Due to the limited ability of manually defining features for identification, it can only handle limited specific mode scenes, and cannot identify complex scenes; in addition, there are cross-connections between different types of lines. The existing identification method cannot solve the problem of cross-connections between lines, resulting in inaccurate identification and low efficiency. Summary of the invention

[0004] The object of the present invention is to provide a method, device and readable storage medium for identifying line types, which can efficiently and accurately identify the line type category of each line in a plate identification layer.

[0005] According to one aspect of the present invention, a method for identifying a line type is provided, the method comprising:

[0006] Acquire a board identification layer to be identified, and determine line information in the board identification layer;

[0007] Cluster the lines with connectivity to form line clusters;

[0008] Using the first classification model, determining the line cluster category of each line cluster respectively; wherein the line cluster category includes: a mixed line cluster or a single line cluster;

[0009] When any line cluster is a mixed line cluster, the line type category of each line in the line cluster is determined respectively by using the second classification model.

[0010] Optionally, the line type categories include one or more of the following: polygons, elevations, single board leaders, straight lines without text, tables, range slashes, leaders with circles, range dimension types with circles, dimension types with arrows, rulers, ellipses, single board embedded rectangles, and other line types.

[0011] Optionally, the method further includes:

[0012] Acquire a line cluster sample set; wherein the line cluster sample set includes: a plurality of line cluster samples and a line cluster category of each line cluster sample;

[0013] Extracting the first characteristic parameter from each line cluster sample respectively;

[0014] The preset model is trained according to the first characteristic parameter and the line cluster category of each line cluster sample to obtain a first classification model.

[0015] Optionally, using the first classification model to determine the line cluster category of each line cluster includes:

[0016] For a line cluster, extracting a first characteristic parameter from the line cluster;

[0017] Inputting the first feature parameter into the first classification model;

[0018] Obtain an output result of the first classification model; wherein the output result is: a mixed line cluster or a single line cluster.

[0019] Optionally, the first characteristic parameter includes one or more of the following:

[0020] The number of lines in a line cluster, the number of sides of a polygon formed by the lines in a line cluster, whether the polygon formed by the lines in a line cluster contains text, the number of closed areas enclosed by the border of a line cluster, the number of closed areas enclosed by the polygon formed by a line cluster, the number of text primitives that are closest to and parallel to the straight lines in the line cluster, the number of intersections between lines in a line cluster, the number of pairs of parallel lines contained in a line cluster, the number of pairs of vertical lines contained in a line cluster, whether all texts parallel to the straight lines in a line cluster are numbers, the number of texts intersecting with lines in a line cluster, the distance to the text closest to the line cluster, the number of texts contained in the border of a line cluster, the horizontal coordinate value of the center of the border of a line cluster, the vertical coordinate value of the center of the border of a line cluster, all lines in the line cluster are straight lines and whether all straight lines are parallel or vertical, the average length of lines in a line cluster, the ratio of the number of endpoints of one straight line in a line cluster that is the endpoint of another straight line to the total number of straight line endpoints, whether the endpoints of straight lines in a line cluster are within a circle, and the variance of line lengths in a line cluster.

[0021] Optionally, the method further includes:

[0022] Acquire a line sample set; wherein the line sample set includes: a plurality of line samples and a line type category of each line sample;

[0023] Extracting the second characteristic parameter from each line sample respectively;

[0024] The preset model is trained according to the second characteristic parameter and line type category of each line sample to obtain a second classification model.

[0025] Optionally, when any line cluster is a mixed line cluster, using the second classification model to respectively determine the line type category of each line in the line cluster specifically includes:

[0026] For a line in the line cluster, extract a second characteristic parameter from the line;

[0027] inputting the second feature parameter into the second classification model;

[0028] Obtain an output result of the second classification model; wherein the output result is a line type category.

[0029] Optionally, the second characteristic parameter includes one or more of the following:

[0030] The length of the line, whether the line is on the polygon, the type of the line, the number of intersections between the line and other lines, the number of closed areas enclosed by the line's border, the number of other lines parallel to the line when the line is a straight line, the number of other lines perpendicular to the line when the line is a straight line, whether the text parallel to the line is pure numbers when the line is a straight line, whether the line is located inside a closed area, the number of texts intersecting the line, the number of other lines intersecting the line at a 45-degree angle when the line is a straight line, the number of other lines sharing a common endpoint with the line, and whether the line is closed.

[0031] In order to achieve the above-mentioned purpose, the present invention also provides a computer device, which specifically includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method for identifying line types introduced above when executing the computer program.

[0032] In order to achieve the above object, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for identifying line types introduced above are implemented.

[0033] The method, device and readable storage medium for identifying line types provided by the present invention first identify all lines from the board identification layer, and then cluster multiple connected lines together according to the positional relationship between the lines to form a line cluster; for each line cluster, first identify the line cluster category to which the line cluster belongs through the first machine learning model; if the line cluster category of a line cluster is a mixed line cluster, then identify the line type category of each line in the line cluster through the second machine learning model; in the present invention, the line cluster is classified by the first machine learning model, and each line in the line cluster is classified by the second machine learning model. The first machine learning model can quickly identify lines of the same line type category, and the second machine learning model can solve the problem of identifying lines in a line cluster containing two or more line type categories. The two-level machine learning model can efficiently and accurately identify the line type category of each line in the board identification layer. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0035] Figure 1 An optional flow chart of the method for identifying line type provided in Embodiment 1;

[0036] Figure 2 is a schematic diagram of a structural plan view in Embodiment 1;

[0037] Figure 3 It is a schematic diagram of the plate identification layer in the first embodiment;

[0038] Figure 4 is an example diagram of the line cluster in the first embodiment;

[0039] Figure 5 This is an example diagram of a line cluster of mixed line types in the first embodiment;

[0040] Figure 6 A schematic diagram of an optional composition structure of the device for identifying line type provided in Embodiment 2;

[0041] Figure 7 A schematic diagram of an optional hardware architecture of a computer device provided in Example 3. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention 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 invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0043] Embodiment 1

[0044] The embodiment of the present invention provides a method for identifying line type, such as Figure 1 As shown, the method specifically comprises the following steps:

[0045] Step S101: obtaining a board identification layer to be identified, and determining line information in the board identification layer.

[0046] In plate recognition, Figure 2 The structural plan shown in the figure is extracted as follows Figure 3 The plate identification layer shown includes some lines for indicating elevation, plate thickness and various auxiliary explanatory texts.

[0047] Step S102: clustering the lines with connectivity to form line clusters.

[0048] Specifically, step S102 includes:

[0049] Step A1: for a target line, determining a level 1 line connected to the target line in the board identification layer;

[0050] Step A2: determining the level 2 lines connected to each level 1 line in the board identification layer, and so on, determining the level N+1 lines connected to each level N line in the board identification layer; wherein N is a positive integer;

[0051] Step A3: The target line and the lines at all levels are formed into a line cluster.

[0052] In this embodiment, all lines included in the board identification layer are clustered and grouped, and the clustering condition is whether the lines are connected; for example, if line A is connected to line B, line B is connected to line C and line D respectively, and line D is connected to line E, then line A, line B, line C, line D, and line E form a line cluster. Figure 4 As shown, there are three example diagrams of line clusters.

[0053] Step S103: using the first classification model, respectively determining the line cluster category of each line cluster; wherein the line cluster category includes: a mixed line cluster or a single line cluster, and a single line cluster corresponds to one line type category.

[0054] Among them, the mixed line cluster is used to represent the lines of different line types in the line cluster; the single line cluster is used to represent that all the lines in the line cluster are of the same line type;

[0055] The line type categories include one or more of the following: polygon, elevation, single board leader, straight line without text, table, range slash, leader with circle, range dimension type with circle, dimension type with arrow, ruler, ellipse, single board embedded rectangle, and other line types;

[0056] It should be noted that, through the first classification model, a line cluster can be identified as a mixed line cluster or a single line cluster. When a line cluster is a single line cluster, the first classification model can specifically identify the line type category to which all lines in the single line cluster belong.

[0057] In this embodiment, according to business needs, the lines in the board identification layer are divided into 13 line type categories. Since a line cluster may contain multiple lines, if the lines in the line cluster all belong to one line type category, the line cluster category of the line cluster is a single line cluster, for example: ruler; if all the lines in the line cluster belong to two or more line type categories, the line cluster category of the line cluster is a mixed line cluster. Figure 5 As shown, there are two rulers and a range slash, but one of the rulers intersects with the range slash, so it belongs to a line cluster. Since this line cluster includes two line type categories, the line cluster category of this line cluster is a mixed line cluster; and the other line cluster only includes the ruler line type category, so the line cluster category of this line cluster is ruler.

[0058] Specifically, before step S103, the method further includes:

[0059] Step B1: obtaining a line cluster sample set; wherein the line cluster sample set includes: a plurality of line cluster samples and a line cluster category of each line cluster sample;

[0060] Wherein, the line cluster category includes: mixed line cluster or single line cluster, and the single line cluster corresponds to one line type category;

[0061] Step B2: extracting the first characteristic parameter from each line cluster sample respectively;

[0062] Step B3: training the preset model according to the first characteristic parameter and the line cluster category of each line cluster sample to obtain a first classification model.

[0063] Preferably, the first classification model adopts a random forest model, and the random forest model is trained by a line cluster sample set to obtain a first classification model that can identify the line cluster category of the line cluster.

[0064] Further, step S103 specifically includes:

[0065] Step C1: for a line cluster, extracting a first characteristic parameter from the line cluster;

[0066] Step C2: inputting the first feature parameter into the first classification model;

[0067] Step C3: Obtaining the output result of the first classification model; wherein the output result is: a mixed line cluster or a single line cluster, and the single line cluster corresponds to one line type category.

[0068] In this embodiment, for a line cluster, the first characteristic parameter of the line cluster is input into the first classification model, and the output result of the first classification model is a mixed line cluster or a single line cluster. When the output result of the first classification model is a single line cluster, the single line cluster corresponds to one line type category among multiple line type categories.

[0069] Furthermore, the first characteristic parameter includes one or more of the following:

[0070] The number of lines in a line cluster, the number of sides of a polygon formed by the lines in a line cluster, whether the polygon formed by the lines in a line cluster contains text, the number of closed areas enclosed by the border Bounding Box of the line cluster, the number of closed areas enclosed by the polygon Poly formed by the line cluster, the number of text primitives closest to and parallel to the straight lines in the line cluster, the number of intersections between lines in a line cluster, the number of pairs of parallel lines contained in a line cluster, the number of pairs of vertical lines contained in a line cluster, whether all text parallel to the straight lines in the line cluster are numbers, the number of texts intersecting with the lines in the line cluster, the distance to the text closest to the line cluster, the number of texts contained in the border Bounding Box of the line cluster, the horizontal coordinate value of the center of the border Bounding Box of the line cluster, the border Bounding of the line cluster The ordinate value of the center of the Box, whether all the lines in the line cluster are straight lines and whether all the straight lines are parallel or vertical, the average length of the line cluster, the ratio of the number of straight line endpoints in the line cluster that is the endpoint of another straight line to the total number of straight line endpoints, whether the endpoints of the straight lines in the line cluster are within the circle, and the variance of the line lengths in the line cluster.

[0071] Preferably, the quantization method of each first characteristic parameter is as shown in Table 1:

[0072] Table 1

[0073]

[0074]

[0075]

[0076] It should be noted that the first characteristic parameter can be obtained according to the line information of all lines included in the line cluster.

[0077] Step S104: when any line cluster is a mixed line cluster, using the second classification model, respectively determining the line type category of each line in the line cluster.

[0078] Specifically, before step S104, the method further includes:

[0079] Step D1: obtaining a line sample set; wherein the line sample set includes: a plurality of line samples and a line type category of each line sample;

[0080] Step D2: extracting the second characteristic parameter from each line sample respectively;

[0081] Step D3: According to the second characteristic parameter and line type category of each line sample, the preset model is trained to obtain a second classification model.

[0082] Preferably, the second classification model adopts a random forest model, and the random forest model is trained with a line sample set to obtain a second classification model that can identify the line type category of the line.

[0083] Further, step S104 specifically includes:

[0084] Step E1: for a line in the line cluster, extracting a second characteristic parameter from the line;

[0085] Step E2: inputting the second feature parameter into the second classification model;

[0086] Step E3: Obtain the output result of the second classification model; wherein the output result is a line type category.

[0087] Furthermore, the second characteristic parameter includes one or more of the following:

[0088] The length of the line, whether the line is on the polygon, the type of the line, the number of intersections between the line and other lines, the number of closed areas enclosed by the line's bounding box, the number of other lines parallel to the line when the line is a straight line, the number of other lines perpendicular to the line when the line is a straight line, whether the text parallel to the line is pure numbers when the line is a straight line, whether the line is located inside a closed area, the number of texts intersecting the line, the number of other lines intersecting the line at a 45-degree angle when the line is a straight line, the number of other lines sharing a common endpoint with the line, and whether the line is closed.

[0089] Preferably, the quantization method of each second characteristic parameter is as shown in Table 2:

[0090] Table 2

[0091]

[0092]

[0093] It should be noted that the second characteristic parameter can be obtained according to the line information of the line.

[0094] In this embodiment, all the lines in the board identification layer that have been identified in advance are first clustered, and then each line cluster obtained by clustering is input into the first classification model. If the output of the first classification model is a single line cluster, all the lines in the line cluster are marked as a unified line type category; if the classification result of the first classification model for the current line cluster is a mixed line cluster, all the lines in the line cluster are respectively input into the second classification model, and the second classification model determines the line type category of each line. In the above manner, the line type category of each line in the board identification layer can be obtained.

[0095] In this embodiment, by clustering and extracting features of the lines in the plate identification layer, a two-level machine learning model is trained, and the coarse-grained line clusters are classified using the primary model. When the line type of each line cannot be clearly identified by the coarse granularity, the secondary model is used to classify each line in the line cluster. All lines in the layer can obtain the final line type category by either passing through the primary model or the secondary model.

[0096] Embodiment 2

[0097] The embodiment of the present invention provides a device for identifying line type, such as Figure 6 As shown, the device specifically includes the following components:

[0098] An acquisition module 601 is used to acquire a board identification layer to be identified and determine line information in the board identification layer;

[0099] A clustering module 602, used for clustering lines with connectivity to form line clusters;

[0100] The first determination module 603 is used to determine the line cluster category of each line cluster by using the first classification model; wherein the line cluster category includes: mixed line cluster or single line cluster;

[0101] The second determination module 604 is used to determine the line type category of each line in the line cluster by using the second classification model when any line cluster is a mixed line cluster.

[0102] Specifically, the line type categories include one or more of the following: polygons, elevations, single board leaders, straight lines without text, tables, range slashes, leaders with circles, range annotation types with circles, annotation types with arrows, rulers, ellipses, single board embedded rectangles, and other line types.

[0103] Furthermore, the device also includes:

[0104] The first training module is used to obtain a line cluster sample set; wherein the line cluster sample set includes: multiple line cluster samples and a line cluster category of each line cluster sample; extracting a first feature parameter from each line cluster sample respectively; training a preset model according to the first feature parameter and line cluster category of each line cluster sample to obtain a first classification model.

[0105] Furthermore, the first determining module 603 is specifically configured to:

[0106] For a line cluster, extract a first feature parameter from the line cluster; input the first feature parameter into the first classification model; obtain an output result of the first classification model; wherein the output result is: a mixed line cluster or a single line cluster.

[0107] Furthermore, the first characteristic parameter includes one or more of the following:

[0108] The number of lines in a line cluster, the number of sides of a polygon formed by the lines in a line cluster, whether the polygon formed by the lines in a line cluster contains text, the number of closed areas enclosed by the border of a line cluster, the number of closed areas enclosed by the polygon formed by a line cluster, the number of text primitives that are closest to and parallel to the straight lines in the line cluster, the number of intersections between lines in a line cluster, the number of pairs of parallel lines contained in a line cluster, the number of pairs of vertical lines contained in a line cluster, whether all texts parallel to the straight lines in a line cluster are numbers, the number of texts intersecting with lines in a line cluster, the distance to the text closest to the line cluster, the number of texts contained in the border of a line cluster, the horizontal coordinate value of the center of the border of a line cluster, the vertical coordinate value of the center of the border of a line cluster, all lines in the line cluster are straight lines and whether all straight lines are parallel or vertical, the average length of lines in a line cluster, the ratio of the number of endpoints of one straight line in a line cluster that is the endpoint of another straight line to the total number of straight line endpoints, whether the endpoints of straight lines in a line cluster are within a circle, and the variance of line lengths in a line cluster.

[0109] Furthermore, the device also includes:

[0110] The second training module is used to obtain a line sample set; wherein the line sample set includes: multiple line samples and a line type category of each line sample; extracting a second feature parameter from each line sample respectively; and training a preset model according to the second feature parameter and line type category of each line sample to obtain a second classification model.

[0111] Furthermore, the second determining module 604 is specifically configured to:

[0112] For a line in the line cluster, extract a second feature parameter from the line; input the second feature parameter into the second classification model; obtain an output result of the second classification model; wherein the output result is a line type category.

[0113] Furthermore, the second characteristic parameter includes one or more of the following:

[0114] The length of the line, whether the line is on the polygon, the type of the line, the number of intersections between the line and other lines, the number of closed areas enclosed by the line's border, the number of other lines parallel to the line when the line is a straight line, the number of other lines perpendicular to the line when the line is a straight line, whether the text parallel to the line is pure numbers when the line is a straight line, whether the line is located inside a closed area, the number of texts intersecting the line, the number of other lines intersecting the line at a 45-degree angle when the line is a straight line, the number of other lines sharing a common endpoint with the line, and whether the line is closed.

[0115] Embodiment 3

[0116] This embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. Figure 7 As shown, the computer device 70 of this embodiment includes at least but not limited to: a memory 701 and a processor 702 that can be interconnected through a system bus. It should be noted that Figure 7 Only computer device 70 is shown with components 701 - 702 , but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0117] In this embodiment, the memory 701 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 701 may be an internal storage unit of the computer device 70, such as a hard disk or a memory of the computer device 70. In other embodiments, the memory 701 may also be an external storage device of the computer device 70, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 70. Of course, the memory 701 may also include both the internal storage unit and the external storage device of the computer device 70. In this embodiment, the memory 701 is generally used to store the operating system and various application software installed on the computer device 70. In addition, the memory 701 may also be used to temporarily store various types of data that have been output or are to be output.

[0118] In some embodiments, the processor 702 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 702 is generally used to control the overall operation of the computer device 70 .

[0119] Specifically, in this embodiment, the processor 702 is used to execute a program of a method for identifying a line type stored in the processor 702, and the program of the method for identifying a line type implements the following steps when being executed:

[0120] Acquire a board identification layer to be identified, and determine line information in the board identification layer;

[0121] Cluster the lines with connectivity to form line clusters;

[0122] Using the first classification model, determining the line cluster category of each line cluster respectively; wherein the line cluster category includes: a mixed line cluster or a single line cluster;

[0123] When any line cluster is a mixed line cluster, the line type category of each line in the line cluster is determined respectively by using the second classification model.

[0124] The specific implementation process of the above method steps can be found in the first embodiment, and this embodiment will not be repeated here.

[0125] Embodiment 4

[0126] This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored. When the computer program is executed by a processor, the following method steps are implemented:

[0127] Acquire a board identification layer to be identified, and determine line information in the board identification layer;

[0128] Cluster the lines with connectivity to form line clusters;

[0129] Using the first classification model, determining the line cluster category of each line cluster respectively; wherein the line cluster category includes: a mixed line cluster or a single line cluster;

[0130] When any line cluster is a mixed line cluster, the line type category of each line in the line cluster is determined respectively by using the second classification model.

[0131] The specific implementation process of the above method steps can be found in the first embodiment, and this embodiment will not be repeated here.

[0132] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0133] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0135] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for identifying line type, characterized in that: The method comprises: Acquire a board identification layer to be identified, and determine line information in the board identification layer; Cluster the lines with connectivity to form line clusters; Using the first classification model, the line cluster category of each line cluster is determined respectively; wherein the line cluster category includes: a mixed line cluster or a single line cluster, the mixed line cluster is used to characterize that the line cluster includes lines of different line type categories, and the single line cluster is used to characterize that all lines in the line cluster are of the same line type category; When any line cluster is a mixed line cluster, using the second classification model to respectively determine the line type category of each line in the line cluster; Wherein, the method further comprises: The random forest model is trained by using the acquired line cluster sample set including a plurality of line cluster samples and a line cluster category of each line cluster sample to obtain a first classification model for identifying the line cluster category of the line cluster.

2. The method for identifying line type according to claim 1, characterized in that: The line type categories include one or more of the following: polygon, elevation, single board leader, straight line without text, table, range slash, leader with circle, range dimension type with circle, dimension type with arrow, ruler, ellipse, single board embedded rectangle, and other line types.

3. The method for identifying line type according to claim 1, characterized in that: The method further comprises: Acquire a line cluster sample set; wherein the line cluster sample set includes: a plurality of line cluster samples and a line cluster category of each line cluster sample; Extracting the first characteristic parameter from each line cluster sample respectively; The preset model is trained according to the first characteristic parameter and the line cluster category of each line cluster sample to obtain a first classification model.

4. The method for identifying line type according to claim 1, characterized in that: The method of using the first classification model to respectively determine the line cluster category of each line cluster includes: For a line cluster, extracting a first characteristic parameter from the line cluster; Inputting the first feature parameter into the first classification model; Obtain an output result of the first classification model; wherein the output result is: a mixed line cluster or a single line cluster.

5. The method for identifying line type according to claim 3 or 4, characterized in that: The first characteristic parameter includes one or more of the following: The number of lines in a line cluster, the number of sides of a polygon formed by the lines in a line cluster, whether the polygon formed by the lines in a line cluster contains text, the number of closed areas enclosed by the border of a line cluster, the number of closed areas enclosed by the polygon formed by a line cluster, the number of text primitives that are closest to and parallel to the straight lines in the line cluster, the number of intersections between lines in a line cluster, the number of pairs of parallel lines contained in a line cluster, the number of pairs of vertical lines contained in a line cluster, whether all texts parallel to the straight lines in a line cluster are numbers, the number of texts intersecting with lines in a line cluster, the distance to the text closest to the line cluster, the number of texts contained in the border of a line cluster, the horizontal coordinate value of the center of the border of a line cluster, the vertical coordinate value of the center of the border of a line cluster, all lines in the line cluster are straight lines and whether all straight lines are parallel or vertical, the average length of lines in a line cluster, the ratio of the number of endpoints of one straight line in a line cluster that is the endpoint of another straight line to the total number of straight line endpoints, whether the endpoints of straight lines in a line cluster are within a circle, and the variance of line lengths in a line cluster.

6. The method for identifying line type according to claim 1, characterized in that: The method further comprises: Acquire a line sample set; wherein the line sample set includes: a plurality of line samples and a line type category of each line sample; Extracting the second characteristic parameter from each line sample respectively; The preset model is trained according to the second characteristic parameter and line type category of each line sample to obtain a second classification model.

7. The method for identifying line type according to claim 1, characterized in that: When any line cluster is a mixed line cluster, using the second classification model to respectively determine the line type category of each line in the line cluster, specifically includes: For a line in the line cluster, extract a second characteristic parameter from the line; inputting the second feature parameter into the second classification model; Obtain an output result of the second classification model; wherein the output result is a line type category.

8. The method for identifying line type according to claim 6 or 7, characterized in that: The second characteristic parameter includes one or more of the following: The length of the line, whether the line is on the polygon, the type of the line, the number of intersections between the line and other lines, the number of closed areas enclosed by the line's border, the number of other lines parallel to the line when the line is a straight line, the number of other lines perpendicular to the line when the line is a straight line, whether the text parallel to the line is pure numbers when the line is a straight line, whether the line is located inside a closed area, the number of texts intersecting the line, the number of other lines intersecting the line at a 45-degree angle when the line is a straight line, the number of other lines sharing a common endpoint with the line, and whether the line is closed.

9. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, 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 8 are implemented.

Citation Information

Patent Citations

  • Hydrographic curve extraction method based on machine learning

    CN106203496A

  • Machine learning-oriented column sample architectural drawing layer classification method and system

    CN111368757A