CN117994592A - Large-scale pattern recognition method, large-scale pattern recognition device, large-scale pattern recognition apparatus, large-scale pattern recognition storage medium, and large-scale pattern recognition program product - Google Patents

Large-scale pattern recognition method, large-scale pattern recognition device, large-scale pattern recognition apparatus, large-scale pattern recognition storage medium, and large-scale pattern recognition program product Download PDF

Info

Publication number
CN117994592A
CN117994592A CN202410344191.7A CN202410344191A CN117994592A CN 117994592 A CN117994592 A CN 117994592A CN 202410344191 A CN202410344191 A CN 202410344191A CN 117994592 A CN117994592 A CN 117994592A
Authority
CN
China
Prior art keywords
primitive
target
primitives
candidate
target material
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410344191.7A
Other languages
Chinese (zh)
Inventor
孙建军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Glodon Co Ltd
Original Assignee
Glodon Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Glodon Co Ltd filed Critical Glodon Co Ltd
Priority to CN202410344191.7A priority Critical patent/CN117994592A/en
Publication of CN117994592A publication Critical patent/CN117994592A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of computers and discloses a large-scale pattern recognition method, a large-scale pattern recognition device, a large-scale pattern recognition equipment, a storage medium and a program product. The method comprises the following steps: obtaining a large pipe network sample diagram to be identified and a seed picture element of the large pipe network sample diagram; identifying a sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed sub-primitives; extracting a target material text in a sub-pipe network large sample graph; and identifying the target material text to obtain the material information of the sub-network large sample graph. The invention realizes the automatic identification of the large sample graph and improves the identification efficiency of the large sample graph.

Description

Large-scale pattern recognition method, large-scale pattern recognition device, large-scale pattern recognition apparatus, large-scale pattern recognition storage medium, and large-scale pattern recognition program product
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a large-scale pattern recognition method, apparatus, device, storage medium, and program product.
Background
The plane view is a common drawing in pipe network engineering, and the junction of the pipelines in the plane view is called a node, and various wells, valves, water meters, pipe fittings, buttresses and the like can be included in the node. Because of the huge pipe network engineering, the construction of each node in the pipe network engineering cannot be clearly expressed in a plan view. But rather is expressed in detail by a large sample. That is, the large pattern is a detailed installation view of the nodes in the plan view, and the large pattern includes material information corresponding to the nodes, such as a fire-fighting water tank pressure reducing valve, an access hole, etc. Therefore, in pipe network engineering, material is generally calculated based on a large pattern, and purchasing and construction are performed according to the calculation result. However, at present, the material calculation is usually performed by manually identifying and manually calculating a large pattern, so that the identification efficiency is low and errors are easy to occur.
Disclosure of Invention
In view of the above, the present invention provides a large-scale pattern recognition method, apparatus, device, storage medium and program product, so as to solve the problems of low efficiency, error occurrence and the like existing in the manual recognition and calculation of large-scale patterns.
In a first aspect, the present invention provides a pipe network large scale pattern recognition method, where the method includes: obtaining a pipe network large sample diagram to be identified and seed picture elements of the pipe network large sample diagram; identifying a sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed primitives; extracting a target material text in the sub-pipe network large sample graph; and identifying the target material text to obtain the material information of the sub-pipe network large sample graph.
In the large sample graph identification method provided by the invention, a pipe network large sample graph to be identified and a seed picture element of the pipe network large sample graph are obtained; identifying a sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed primitives; and extracting the target material text in the sub-pipe network large sample graph, and identifying the target material text to obtain the material information of the sub-pipe network large sample graph. Therefore, the automatic identification of the large sample graph is realized, the identification efficiency of the large sample graph is greatly improved, and the identification error caused by human factors can be avoided.
In an alternative embodiment, the seed sub-elements include schematic line seed sub-elements and node numbering seed sub-elements; identifying the sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed sub-primitives, wherein the sub-pipe network large sample graph comprises:
Acquiring a first primitive feature of the schematic line seed sub-primitive and a second primitive feature of the node numbering seed sub-primitive;
Determining a target schematic line drawing element, a target node number primitive corresponding to the target schematic line drawing element and a candidate material primitive in the pipe network large-scale sample graph according to the first primitive characteristic and the second primitive characteristic;
And determining the target schematic line element, the target node number primitive corresponding to the target schematic line element and the candidate material primitive as a sub-pipe network large sample graph.
The determining, according to the first primitive feature and the second primitive feature, a target schematic primitive in the pipe network large-scale pattern, a target node number primitive corresponding to the target schematic primitive, and a candidate material primitive includes:
Identifying a target schematic line drawing element in the pipe network large sample graph according to the first primitive characteristics;
According to the second primitive characteristics, identifying a node numbering primitive set and a candidate material primitive set in the pipe network large sample graph;
searching a target node numbering primitive corresponding to the target schematic primitive from the node numbering primitive set according to a first searching rule;
And searching the candidate material primitive corresponding to the target schematic primitive from the candidate material primitive set according to a second searching rule.
In the large sample image recognition method provided by the invention, each target schematic line element corresponds to one sub-large sample image, so that the corresponding sub-large sample image can be rapidly and accurately recognized based on the target schematic line element in the follow-up process by first recognizing the target schematic line element, and the accuracy of the sub-large sample image is ensured.
In an optional implementation manner, the searching, according to a first searching rule, the target node number primitive corresponding to the target schematic primitive from the node number primitive set includes:
Constructing a node numbering search tree according to the node numbering primitive set; nodes in the node numbering search tree are in one-to-one correspondence with the node numbering graphic elements;
Generating a first search range of each node in the node numbering search tree according to the size of the node numbering text in the node numbering graphic element;
and based on the first search range, carrying out search processing in the node number search tree to obtain a target node number primitive corresponding to the target schematic line primitive.
According to the large sample graph identification method provided by the invention, the candidate node number graphic elements can be quickly searched based on the node number search tree by constructing the node number search tree, so that the identification speed of the candidate node number graphic elements is improved, and the identification speed of the large sample graph of the pipe network is further improved.
In an alternative embodiment, the sub-network master pattern includes a plurality of candidate material primitives; the extracting the target material text in the sub-pipe network large sample graph comprises the following steps:
Identifying a target material primitive in the candidate material primitives;
Classifying the target material primitives to obtain primitive categories of the target material primitives;
Determining the material quantity corresponding to the target material primitive according to the primitive category;
And generating a target material text of the sub-pipe network large sample graph according to the primitive category and the material quantity.
According to the large sample graph identification method provided by the invention, the target material primitives are classified, so that the associated primitives can be effectively prevented from being split into different target material texts, the accuracy of the target material texts is ensured, and the guarantee is provided for the accurate identification of the subsequent material information.
In an optional embodiment, the determining, according to the primitive category, the material quantity corresponding to the target material primitive includes:
Generating a search line segment of the target material primitive according to the primitive category;
Determining candidate line primitives intersecting the search line segment;
Selecting target line primitives meeting a third preset condition from the candidate line primitives;
Determining a first number of straight-line primitives that intersect a first end of the target line primitive;
determining a second number of straight line primitives that intersect a second end point of the target line primitive;
and determining the maximum number of the first number and the second number as the material number corresponding to the target material primitive.
According to the large sample graph recognition method provided by the invention, the search line segment is generated, the corresponding material quantity is determined based on the search line segment and the primitive category of the target material primitive, the accuracy of the determined material quantity is ensured, the accuracy of the target material text is further ensured, and the guarantee is provided for the accurate recognition of the subsequent material information.
In an optional implementation manner, the identifying the target material text to obtain the material information of the sub-pipe network big sample graph includes:
determining the priority corresponding to the target material text;
performing first analysis processing on the target material text according to the priority to obtain a material type corresponding to the target material text;
performing second analysis processing on the target material text according to the priority to obtain material properties corresponding to the target material text;
The material information of the sub-network master pattern includes the material type and the material properties.
According to the large sample graph recognition method provided by the invention, the priority of each target material text is determined, and the recognition processing of the material information is carried out according to the priority, so that the recognition order is ensured, the risk of missing recognition can be reduced, and the accuracy of the obtained material information is ensured.
In a second aspect, the present invention provides a large-scale pattern recognition apparatus, the apparatus comprising: the acquisition module is used for acquiring the pipe network large sample graph to be identified and the seed picture elements of the pipe network large sample graph; the first identification module is used for identifying a sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed primitives; the extraction module is used for extracting the target material text in the sub-pipe network large sample graph; and the second recognition module is used for recognizing the target material text to obtain the material information of the sub-pipe network large sample graph.
In a third aspect, the present invention provides a computer device comprising: the processor is in communication connection with the memory, and the memory stores computer instructions, and the processor executes the computer instructions to perform the large-scale pattern recognition method according to the first aspect or any of the corresponding embodiments.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the large-scale pattern recognition method of the first aspect or any of its corresponding embodiments.
In a fifth aspect, the present invention provides a computer program product comprising computer instructions for causing a computer to perform the large scale pattern recognition method of the first aspect or any of its corresponding embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a large scale pattern recognition method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another large sample graph recognition method according to an embodiment of the present invention;
FIG. 3 is a flow chart of yet another large sample graph recognition method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a sub-large sample diagram according to an embodiment of the invention;
FIG. 5 is a schematic diagram of a search line segment according to an embodiment of the invention;
FIG. 6 is a flow chart of a method for identifying a large sample according to an embodiment of the invention
FIG. 7 is a block diagram of a large-scale pattern recognition apparatus according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In pipe network engineering, material calculation based on a pipe network large-scale pattern is an important link for guaranteeing the effective performance of the pipe network engineering. In the related art, material calculation is generally manual recognition and manual calculation. The method comprises the steps that related personnel manually analyze a plane diagram and a large sample diagram, manually acquire node numbers and material information in the large sample diagram of a pipe network, and manually summarize the acquired information to count information such as material types, material quantity and the like. However, each plan view typically has associated therewith a plurality of large patterns, each large pattern in turn comprising a plurality of types of material. Therefore, the manual identification and the manual means not only take more time and have low identification efficiency, but also are extremely easy to cause the problems of missing identification, missing statistics and the like, so that the accuracy of the identification result is low. Based on the method, the invention provides a large sample graph identification method, which is implemented by acquiring a pipe network large sample graph to be identified and seed primitives of the pipe network large sample graph; identifying a sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed primitives; and extracting the target material text in the sub-pipe network large sample graph, and identifying the target material text to obtain the material information of the sub-pipe network large sample graph. Therefore, the automatic identification of the large sample graph is realized, the identification efficiency of the large sample graph is greatly improved, and the identification error caused by human factors can be avoided.
In accordance with an embodiment of the present invention, a large sample pattern recognition method embodiment is provided, it being noted that the steps shown in the flowchart of the figures may be performed 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 may be performed in an order other than that shown or described herein.
In this embodiment, a large-scale pattern recognition method is provided, which can be used in the above-mentioned computer devices, such as a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, a server, etc., fig. 1 is a flowchart of a large-scale pattern recognition method according to an embodiment of the present invention, and as shown in fig. 1, the flowchart includes the following steps:
Step S101, obtaining a large pipe network sample diagram to be identified and seed picture elements of the large pipe network sample diagram.
In some embodiments, at least one pipe network large pattern may be stored in the computer device, and related information of the pipe network large pattern may be displayed through the display module, and a user may select any one of the related information and send an identification request to the computer device. Correspondingly, the computer equipment receives an identification request sent by a user, and determines a pipe network large sample image corresponding to the identification request as the pipe network large sample image to be loaded. Or the computer equipment is in communication connection with the request equipment, receives the identification request sent by the request equipment, and determines the pipe network large-scale pattern in the identification request as the pipe network large-scale pattern to be recorded. And the computer equipment performs loading processing after acquiring the pipe network large sample graph to be loaded and displays the pipe network large sample graph. Acquiring first operation information corresponding to graphic element frame selection operation of a user in a display interface of a pipe network large-scale graphic, and determining graphic elements corresponding to the first operation information as seed graphic elements; and acquiring second operation information corresponding to the identification range frame selection operation of the user in the display interface of the pipe network large sample graph, and determining the pipe network large sample graph in the identification range corresponding to the second operation information as the pipe network large sample graph to be identified. The pipe network large sample graph to be loaded can be any one of dwg format and pdf format.
Step S102, identifying the sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed sub-primitives.
The large pipe network sample graph to be identified can comprise a plurality of sub pipe network large sample graphs, and each sub pipe network large sample graph in the large pipe network sample graph can be identified according to the primitive characteristics of the seed primitives after the seed primitives are acquired.
And step S103, extracting a target material text in the sub-pipe network large sample graph.
As described above, the pipe network large sample graph includes the material text, and considering that the sub-pipe network large sample graph may include the same primitive, in order to avoid multiple recognition on the same primitive and improve the recognition efficiency, the invention extracts the target material text in the sub-pipe network large sample graph. The target material text may include material information and material number of the graphic element, and a specific extraction manner of the target material text may refer to related description hereinafter.
And step S104, identifying the target material text to obtain the material information of the sub-pipe network large sample graph.
Wherein the material information may include a material type and a material property, and the material property may include at least one of a subtype, a specification model, a link manner, a material quantity, and the like.
According to the pipe network large sample graph identification method provided by the embodiment, the pipe network large sample graph to be identified and the seed picture element of the pipe network large sample graph are obtained; identifying a sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed primitives; and extracting the target material text in the sub-pipe network large sample graph, and identifying the target material text to obtain the material information of the sub-pipe network large sample graph. Therefore, automatic identification of the large pipe network pattern is realized, and the identification efficiency and the identification accuracy are greatly improved.
To be able to accurately identify sub-large sample graphs, in some embodiments, seed sub-primitives include schematic line seed sub-primitives and node numbered seed sub-primitives. Correspondingly, in this embodiment, a large-scale pattern recognition method is provided, which can be used for the above-mentioned computer devices, such as a mobile phone, a tablet computer, a desktop computer, a portable notebook, a server, etc., and fig. 2 is a flowchart of the large-scale pattern recognition method according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
step S201, obtaining a large pipe network sample diagram to be identified and seed picture elements of the large pipe network sample diagram.
The implementation manner of step S201 is shown in detail in step S101 in the embodiment of fig. 1, and will not be described herein.
Step S202, identifying the sub-pipe network big-pattern in the pipe network big-pattern according to the primitive feature of the seed primitive, in some embodiments, step S202 may include the following steps S2021 to S2023:
Step S2021 obtains a first primitive feature of a schematic line seed sub-primitive and a second primitive feature of a node-numbered seed sub-primitive included in the seed sub-primitive.
In some embodiments, the pipe network large sample graph can be drawn by a drawing staff through a drawing tool, and the primitive information of each primitive in the pipe network large sample graph can be edited in the drawing process. When the computer device obtains the pipe network large sample to be identified, the pipe network large sample to be identified may be loaded through the drawing tool, and the primitive information of the seed primitive is obtained from the drawing tool, that is, step S2021 may include: acquiring first primitive information of schematic line type sub-primitives and second primitive information of node number type sub-primitives from a drawing tool; and acquiring first pattern information of the schematic line type sub-element and first distances between two schematic lines included in the schematic line type sub-element from the first primitive information, and determining the first pattern information and the first distances as first primitive features of the schematic line type sub-element. The first pattern information may include a first layer identifier, a first display color, a first line direction, a first number of lines, and the like. And acquiring a second layer identifier, a second display color, a text direction, a text height and the like of the node number sub-image element from the second image element information, and determining each piece of information acquired from the second image element information as a second image element characteristic of the node number sub-image element.
Step S2022, determining, according to the first primitive feature and the second primitive feature, a target schematic primitive in the pipe network large-scale sample graph, a target node number primitive corresponding to the target schematic primitive, and a candidate material primitive.
In some embodiments, step S2022 may include the following steps a1 to a4:
and a step a1, identifying target schematic line primitives in the pipe network large-scale pattern according to the first primitive characteristics.
In some embodiments, step a1 may comprise: identifying a plurality of line type graphic elements in the pipe network large-scale graphic sample and second type information of the line type graphic elements; performing matching processing on the first style information and the second style information, and determining the line-type graphic element corresponding to the successfully matched second style information as a candidate line-type graphic element; according to the first distance, grouping the candidate line type graphic elements in pairs to obtain schematic line type candidate graphic elements; and determining the schematic line seed sub-primitives and the schematic line candidate primitives as target schematic line primitives in the pipe network large sample graph.
The primitive information of each primitive in the pipe network large sample graph may include a primitive type, and correspondingly, the identifying the plurality of line primitives and the second style information of the line primitives in the pipe network large sample graph may include: determining the graphic elements corresponding to graphic element information comprising the line graphic element types in the pipe network large sample graph to be identified as line graphic elements; and obtaining second style information of the line primitive from the primitive information of the line primitive. The second style information may include a third layer identification, a third display color, a second line direction, a second number of lines, and the like.
Further, the matching processing of the first style information and the second style information, and determining the line primitive corresponding to the successfully matched second style information as the candidate line primitive may include: and matching the second style information of the line type graphic element with the first style information of the schematic line type sub-graphic element aiming at each line type graphic element, and if the second style information is successfully matched with the first style information, determining the line type graphic element corresponding to the second style information as a candidate line type graphic element. It is noted that when each information (for example, the third display color) of the second style information is identical to the corresponding information (for example, the first display color) of the first style information, it is determined that the matching is successful; when at least one of the second pattern information is different from the corresponding information of the first pattern information, it is determined that the matching fails.
Considering that in practical applications, the distance between different schematic line primitives is often larger than the first distance, i.e. the distance between the line primitives of the different schematic line primitives is larger than the first distance, for example, the schematic line primitive 1 includes the line primitive 1 and the line primitive 2, and the schematic line primitive 2 includes the line primitive 3 and the line primitive 4; the distance between the line primitive 1 and the line primitive 3 is larger than the first distance, and the distance between the line primitive 1 and the line primitive 4 is also larger than the first distance, so that the display primitive 2 is the same. The distance between two line primitives included in the schematic primitive is often not greater than the first distance, for example, the distance between the line primitive 1 and the line primitive 2 is not greater than the first distance, and the distance between the line primitive 3 and the line primitive 4 is also not greater than the first distance. Based on this, in some embodiments, the foregoing grouping candidate line primitives by pairs according to the first distance to obtain schematic line candidate primitives may include: and calculating a second distance between each candidate schematic line primitive and each other candidate schematic line primitive according to each candidate schematic line primitive, determining a target second distance which is not greater than the first distance, and determining the candidate line primitives corresponding to the target second distance as a group to obtain the schematic line candidate primitive.
Because each target schematic line element corresponds to one sub-large sample graph, the target schematic line element is first identified, and the corresponding sub-large sample graph can be identified based on the target schematic line element later.
And a step a2, identifying a node number primitive set and a candidate material primitive set in the pipe network large sample graph according to the second primitive characteristics.
In some embodiments, step a2 may comprise: acquiring the characteristics of each text primitive in the pipe network large sample graph and a third primitive of each text primitive; matching the second primitive feature with the third primitive feature; determining the text primitive corresponding to the successfully matched third primitive feature as a node number primitive to obtain a node number primitive set; and determining the text primitive corresponding to the third primitive feature which fails to match as a candidate material primitive to obtain a candidate material primitive set.
Specifically, a graphic primitive corresponding to graphic primitive information comprising a text graphic primitive type in a pipe network large sample graph to be identified is determined to be a text graphic primitive; and acquiring a third primitive feature of the text primitive from primitive information of each text primitive. Matching the third primitive feature with the second primitive feature of the node numbering sub-primitive for each third primitive feature; if the matching is successful, determining the text primitive corresponding to the third primitive feature which is successfully matched as a node number primitive, and attributing the node number primitive to a node number primitive set; if the matching fails, determining the text primitive corresponding to the third primitive feature which fails to match as the candidate material primitive, and attributing the candidate material primitive to the candidate material primitive set.
Step a3, searching a target node number primitive corresponding to the target schematic primitive from the node number primitive set according to a first search rule;
In some embodiments, step a3 may include: constructing a node number search tree according to the node number primitive set, wherein nodes in the node number search tree correspond to the node number primitives one by one; generating a first search range of each node in the node numbering search tree according to the size of the node numbering text in the node numbering graphic element; and based on the first search range, carrying out search processing in the node number search tree to obtain a target node number primitive corresponding to the target schematic primitive.
In some embodiments, the node number search tree may be a quadtree, and reference may be made to the related art for a specific construction manner of the quadtree, which is not described in detail in the present disclosure. The first search range may be a range corresponding to a minimum bounding box, which may be an axis aligned rectangular bounding box (Axially Aligned Bounding Box, abbreviated as AABB). It should be noted that the node number search tree is not limited to a quad tree, and the first search range is not limited to a range corresponding to the minimum bounding box, and can be set as required in practical applications.
Further, the searching in the node number search tree based on the first search range to obtain the target node number primitive corresponding to the target schematic line primitive may include: determining an initial node number primitive in the node number primitives, wherein the initial node number primitive is a node number primitive which is positioned in a first preset range of the target schematic primitive and is closest to the target schematic primitive; expanding a first search range corresponding to the initial node number primitive to obtain a second search range; determining a target first search range with an intersecting relation with a second search range in the first search range based on the node number search tree; determining node number primitives corresponding to the target first search range as candidate node number primitives; if the number of the candidate node number primitives is equal to 1, determining the candidate node number primitives as target node number primitives corresponding to the target schematic line primitives; if the number of the candidate node number primitives is greater than 1, determining a splicing sequence, and performing splicing processing on the candidate node number primitives according to the splicing sequence to obtain target node number primitives corresponding to the target schematic line primitives.
The first preset range may be above and below the target schematic line element. Specifically, a third distance between the schematic line and the center point of each node number primitive within the first preset range is calculated, and the node number primitive corresponding to the minimum third distance is determined as the initial node number primitive. And expanding the first search range corresponding to the initial node number primitive according to a preset expansion coefficient to obtain a second search range. Determining target first search ranges with an intersecting relation with the second search range in each first search range according to a breadth-first traversal mode; and determining the node number primitive corresponding to the target first search range as the candidate node number primitive. And determining the number of the candidate node number primitives, and if the number of the candidate node number primitives is equal to 1, determining the candidate node number primitives as target node number primitives corresponding to the target schematic line primitives. If the number of the candidate node number primitives is greater than 1, sorting according to the positions of the candidate node number primitives in the node number search tree, namely sorting from high to low according to the positions (namely sorting from high to low according to the y-axis direction), determining a sorting result as a splicing sequence, and performing splicing processing on the candidate node number primitives according to the splicing sequence to obtain target node number primitives corresponding to the target schematic primitive. It should be noted that special symbols, such as spaces, may be added between the spliced candidate node number primitives, and setting may be performed as needed in practical applications.
Wherein the intersection relationship includes a direct intersection and an indirect intersection. For example, the second search range of the initial node number primitive directly intersects the first search range of the node number primitive 1, the first search range of the node number primitive 1 directly intersects the first search range of the node number primitive 2, and then the first search range of the node number primitive 2 indirectly intersects the second search range of the initial node number primitive, i.e., the target first search range includes the first search range of the node number primitive 1 and the first search range of the node number primitive 2. It should be noted that, the first search range of the node number primitive 1 may directly intersect the first search range of the node number primitive 2, or may directly intersect the first search range of the node number primitive 2 after expanding the first search range of the node number primitive 1.
Therefore, the candidate node number graphic elements can be quickly searched by constructing the node number search tree, the identification speed of the candidate node number graphic elements is improved, and the identification speed of the pipe network large-scale pattern is further improved.
And a step a4, searching candidate material primitives corresponding to the target schematic line primitives from the candidate material primitive set according to a second searching rule.
In some embodiments, step a4 may comprise: acquiring a third search range of each candidate material primitive in the candidate material primitive set; determining initial candidate material primitives in the candidate material primitive set, wherein the initial candidate material primitives are candidate material primitives which are located in a second preset range of the target schematic primitive and are closest to the target schematic primitive; expanding a third search range of the initial candidate material primitives to obtain a fourth search range; determining a target third search range with an intersecting relation with a fourth search range in the third search range; and determining the candidate material primitive corresponding to the target third search range as the candidate material primitive corresponding to the target schematic primitive. The second preset range may be above the target schematic line element.
Specifically, the third search range may be a minimum bounding box (box) previously generated in the drawing tool. Correspondingly, after the pipe network large sample graph to be identified is loaded, a third search range of each candidate material primitive can be obtained. Determining a target candidate material primitive positioned above the target schematic primitive in the candidate material primitive set; for each target candidate material primitive, calculating a fourth distance between the target schematic primitive and the center point of the target candidate material primitive, and determining the target candidate material primitive corresponding to the minimum fourth distance as the initial candidate material primitive. And expanding the third search range of the initial candidate material primitive according to a preset expansion coefficient to obtain a fourth search range. And determining a target third search range with an intersection relation with a fourth search range in each third search range, and determining candidate material primitives corresponding to the target third search range as candidate material primitives corresponding to the target schematic line primitives.
Wherein the intersection relationship includes a direct intersection and an indirect intersection. For example, the fourth search range of the initial candidate material primitive directly intersects the third search range of candidate material primitive 1, the third search range of candidate material primitive 1 directly intersects the third search range of candidate material primitive 2, and then the third search range of candidate material primitive 2 indirectly intersects the fourth search range of the initial candidate material primitive, i.e., the target third search range includes the third search range of candidate material primitive 1 and the third search range of candidate material primitive 2. It should be noted that, the third search range of the candidate material primitive 1 may directly intersect the third search range of the candidate material primitive 2, or may directly intersect the third search range of the candidate material primitive 2 after expanding the third search range of the candidate material primitive 1.
And step S2023, determining the target schematic line elements, the target node number graphic elements corresponding to the target schematic line elements and the candidate material graphic elements as a sub-pipe network large sample graph.
Therefore, the target schematic line drawing element in the pipe network large sample drawing and the target node number drawing element and the candidate material drawing element corresponding to the target schematic line drawing element can be automatically identified based on the first primitive feature and the second primitive feature by acquiring the first primitive feature of the schematic line drawing element and the second primitive feature of the node number drawing element, and the pipe network large sample drawing can be rapidly split into a plurality of sub-large sample drawings according to the target schematic line drawing element, so that the identification of material information is conveniently carried out based on each sub-large sample drawing.
In this embodiment, a large-scale pattern recognition method is provided, which may be used in a computer device, such as a mobile phone, a tablet computer, a desktop computer, a portable notebook, a server, etc., and fig. 3 is a flowchart of the large-scale pattern recognition method according to an embodiment of the present invention, and as shown in fig. 3, the flowchart includes the following steps:
Step S301, obtaining a large pipe network sample diagram to be identified and seed picture elements of the large pipe network sample diagram.
Step S302, identifying the sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed sub-primitives.
The specific implementation manner of step S301 and step S302 may refer to the foregoing related description, and the repetition is not repeated here.
Step S303, extracting a target material text in the sub-pipe network large sample graph.
In some embodiments, step S303 may include the following steps S3031 to S3034:
step S3031, identifying a target material primitive from the plurality of candidate material primitives in the sub-pipe network large-scale pattern.
Specifically, text information in the candidate material primitives is acquired for each candidate material primitive; determining whether the preset blacklist comprises the acquired text information; if not, determining that the candidate material primitive is the target material primitive. The preset blacklist is used for identifying texts which do not belong to the material information.
Step S3032, the target material primitives are classified, and primitive categories of the target material primitives are obtained.
In some embodiments, step S3032 may include the following steps b1 to b4:
And b1, determining a first target material primitive to be processed currently, and determining a candidate third search range meeting a first preset condition according to the third search range of the first target material primitive.
In some embodiments, step b1 may comprise: according to the position information of the target material primitives in the sub-pipe network large sample graph, sequencing the target material primitives to obtain sequenced target material primitives; traversing the sequenced target material primitives, and determining a first target material primitive to be processed currently; amplifying a third search range of the first target material primitive to obtain a fifth search range; and determining a third search range intersecting the fifth search range as a candidate third search range satisfying the first preset condition. The third search range intersecting the fifth search range may be a third search range directly intersecting the fifth search range.
Specifically, according to the position information of each target material primitive in the sub-pipe network large sample graph, sequencing each target material primitive according to the sequence from high to low in the vertical direction (namely the y-axis direction of the two-position coordinate system), and obtaining the sequenced target material primitive. Traversing the sequenced target material primitives in the order from high to low, and determining the currently traversed target material primitive as a first target material primitive to be processed (e.g., target material primitive 1); amplifying a third search range of the first target material primitive to obtain a fifth search range; it is determined whether a third search range of a next target material primitive (e.g., target material primitive 2) of the first target material primitive intersects the fifth search range. If the target material primitive (e.g., target material primitive 2) is intersected, determining a third search range of the next target material primitive (e.g., target material primitive 2) as a candidate third search range meeting a first preset condition, and if the next target material primitive (e.g., target material primitive 2) is determined not to be the last target material primitive, determining a target material primitive (e.g., target material primitive 3) adjacent to and behind the next target material primitive (e.g., target material primitive 2) as a first target material primitive to be processed, and performing the aforementioned operation of amplifying the third search range of the first target material primitive to obtain a fifth search range. If the first target material primitive is not intersected, determining the next target material primitive (for example, the target material primitive 2) as a first target material primitive to be processed, and executing the operation of amplifying the third search range of the first target material primitive to obtain a fifth search range. The loop is then repeated until the first target material primitive is the last target material primitive.
And b2, determining whether a second target material primitive which meets a second preset condition exists in target material primitives corresponding to the candidate third search range.
Specifically, determining whether a candidate target material graphic primitive which has the same direction and the same characteristic as the first target material graphic primitive exists in the target material graphic primitive corresponding to the candidate third search range; determining whether a straight line primitive exists between the candidate target material primitive and the first target material primitive in the case that the candidate target material primitive exists; if the straight line primitive exists, determining that a second target material primitive meeting a second preset condition exists; if the straight line primitive does not exist, determining that the second target material primitive meeting the second preset condition does not exist.
As an example, as shown in fig. 4, the first target material primitive is a "butterfly valve" in the dashed box, the target material primitive corresponding to the candidate third search range is a "DN300" in the dashed box, and since the direction of the "DN300" is the same as that of the "butterfly valve" and the feature is the same, and there is a straight line primitive therebetween, it is determined that there is a second target material primitive satisfying the second preset condition, and the second target material primitive is a "DN300".
Step b3, if the second target material primitive exists, determining primitive types of the first target material primitive and the second target material primitive as associated primitives;
If the second target material primitive exists, determining the primitive types of the first target material primitive and the second target material primitive as associated primitives, and determining the first target material primitive and the second target material primitive as associated primitives. That is, the first target material primitive is an associated primitive of the second target material primitive, and the second target material primitive is an associated primitive of the first target material primitive.
Continuing with the above example, the first target material primitive "butterfly valve" and the second target material primitive "DN300" are determined to be associated primitives.
And b4, if the second target material primitive does not exist, determining the primitive category of the first target material primitive as the independent material primitive.
As shown in fig. 4, when the first target material primitive is a "valve well" in the dashed box, it may be determined that the second target material primitive is not present, and thus, the primitive category of the first target material primitive "valve well" is determined to be an independent material primitive.
Step S3033, determining the material quantity corresponding to the target material primitive according to the primitive category;
In some embodiments, step S3033 may include: generating a search line segment of the target material primitive according to the primitive category; determining candidate line primitives intersecting the search line segment; selecting target line primitives meeting a third preset condition from the candidate line primitives; determining a first number of straight-line primitives that intersect a first end of the target line primitive; determining a second number of straight line primitives that intersect a second end point of the target line primitive; and determining the maximum number of the first number and the second number as the material number corresponding to the primitive to be identified.
In some embodiments, the generating the search line segment of the target material primitive according to the primitive category may include: when the primitive category of the target material primitive is the associated primitive, determining a first center point of the target material primitive, determining a second center point of the associated primitive of the target material primitive, and determining a connecting line between the first center point and the second center point as a search line segment of the target material primitive. When the primitive category of the target material primitive is an independent primitive, a first center point of the target material primitive is determined, and a search line segment is generated in a target direction perpendicular to the text direction of the target material primitive by taking the first center point as an origin and the text height of the target material primitive as a length. For example, the text direction of the target material primitive is the horizontal direction, and the target direction is the vertical direction.
In some embodiments, the selecting the target line primitive from the candidate line primitives, where the target line primitive meets the third preset condition, may include: and determining that the candidate display primitive is the target line primitive meeting the third preset condition if the candidate line primitive is determined to be the straight line primitive and the direction of the candidate line primitive is parallel to the text direction of the target material primitive for each candidate line primitive. Wherein the target line primitives may also be referred to as associated leads.
As an example, as shown in fig. 5, the target material primitive is "buttress", the associated primitive of the target material primitive "buttress" is "see 10S505, page 75", the black bolded vertical line is the search line segment, and the target line primitive is within the dashed box. If the first number of straight-line primitives intersecting the first end of the target primitive is 2 (straight-line primitives corresponding to the numbers "1" and "2" in fig. 5) and the second number of straight-line primitives intersecting the second end of the target primitive is 0, then the material number corresponding to the target material primitive is determined to be 2.
And step S3034, generating a target material text of the sub-pipe network large sample graph according to the primitive types and the material quantity.
In some embodiments, when the primitive category is an associated primitive, performing splicing processing on text information in the target material primitive, text information in the associated primitive of the target material primitive and the material quantity corresponding to the target material primitive according to a preset format to obtain a target material text of the sub-pipe network large-scale pattern. When the primitive type is an independent primitive, the text information in the target material primitive and the material quantity corresponding to the target material primitive are spliced according to a preset format, and the target material text of the sub-pipe network large-scale pattern is obtained. The preset format can be set according to the needs in practical application.
In order to connect the above examples, the preset format may be that each data is connected through a space sequence, and then the text information "buttresses" of the target material primitive and the text information "see 10S505, page 75" of the associated primitive are spliced, where the number of materials corresponding to the target material primitive is 2, and the obtained text of the target material is: pier see 10S505, page 75 2.
And step S304, identifying and processing the target material text to obtain the material information of the sub-pipe network large sample graph.
Therefore, by classifying the target material primitives, the associated primitives can be effectively prevented from being split into different target material texts, and the accuracy of the target material texts is ensured. By generating the search line segment and determining the corresponding material quantity based on the search line segment and the primitive category of the target material primitive, the accuracy of the determined material quantity is ensured, the accuracy of the target material text is further ensured, and the guarantee is provided for the accurate identification of the follow-up material information.
In this embodiment, a large-scale pattern recognition method is provided, which may be used in a computer device, such as a mobile phone, a tablet computer, a desktop computer, a server, etc., and fig. 6 is a flowchart of the large-scale pattern recognition method according to an embodiment of the present invention, as shown in fig. 6, where the flowchart includes the following steps:
Step S401, obtaining a large pipe network sample diagram to be identified and seed picture elements of the large pipe network sample diagram.
Step S402, identifying the sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed sub-primitives.
Step S403, extracting the text of the target material in the sub-pipe network large sample graph.
The specific implementation manner of step S401 and step S403 may refer to the foregoing related description, and the repetition is not repeated here.
And step S404, identifying and processing the target material text to obtain the material information of the sub-pipe network large sample graph.
In some embodiments, step S404 may include the following steps S4041 to S4044:
in step S4041, the priority corresponding to the text of the target material is determined.
To ensure the ordering of target material text recognition, in some embodiments, a material text parsing configuration container may be initialized to set corresponding priorities, sub-types, material properties, etc. for each material type. As an example, the priority of the material type "valve" is 5, the corresponding sub-material type includes a sludge discharge gate valve, a vertical butterfly valve, a horizontal butterfly valve, a butterfly valve, an exhaust valve, and the like, and the corresponding material attribute includes a specification model, a link mode, and the like. Accordingly, step S4041 may include: and carrying out matching processing on the target material text and the subtype corresponding to each material type aiming at each target material text, if the matching is successful, acquiring the priority corresponding to the subtype successfully matched, and determining the acquired priority as the priority corresponding to the target material text.
For example, a certain target material text is "butterfly valve DN300 KP type rapid exhaust valve 3" and is subjected to matching processing with the corresponding sub-type of each material type, the sub-type which is successfully matched can be determined to be a butterfly valve, and the priority 5 corresponding to the butterfly valve is determined to be the priority of the target material text "butterfly valve DN300 KP type rapid exhaust valve 3".
Step S4042, performing a first analysis process on the target material text according to the priority, to obtain a material type corresponding to the target material text.
In some embodiments, the current target material text to be identified may be sequentially determined according to the order of the priority from high to low, the matching processing is performed on the current target material text to be identified and the sub-types corresponding to the material types, if the matching is successful, the material type corresponding to the sub-type successfully matched is obtained, and the material type corresponding to the current target material text to be identified is determined.
For example, the text of the target material to be identified is "butterfly valve DN300 KP type rapid exhaust valve 3", the sub-type corresponding to each material type is matched, the sub-type successfully matched can be determined to be a butterfly valve, and the material type corresponding to the butterfly valve is determined to be the material type of the text of the target material "butterfly valve DN300 KP type rapid exhaust valve 3".
And step S4043, performing second analysis processing on the target material text according to the priority to obtain the material attribute corresponding to the target material text.
In some embodiments, the current target material text to be identified may be determined sequentially according to the order of the priority from high to low, and the current target material text to be identified may be parsed to obtain the material attribute corresponding to the target material text.
For example, the text of the target material to be identified currently is "butterfly valve DN300 KP type rapid exhaust valve 3", and the analyzed material properties include: the subtype is butterfly valve, specification model is DN300, the link mode is KP type quick exhaust valve, and the material quantity is 3.
It should be noted that, in some embodiments, the first parsing process may be performed on each target material text according to the determined priority, so as to obtain the material type of each target material text, and then the second parsing process may be performed on each target material text according to the determined priority, so as to obtain the material attribute of each target material text. In other embodiments, the material type of the target material text may be identified for each target material text in turn according to the determined priority, and then the material property of the target material text may be identified. That is, after the material type and the material attribute of the current target material text are identified, the material type and the material attribute of the next target material text with the priority positioned behind the current target material text are identified.
In step S4044, the material type and the material property are determined as the material information of the sub-network large pattern.
Therefore, the priority of each target material text is determined, and the material information is identified according to the priority, so that the identification order is ensured, the risk of missing identification can be reduced, and the accuracy of the obtained material information is ensured.
In this embodiment, a large-scale pattern recognition device is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a large-scale pattern recognition apparatus, as shown in fig. 7, including:
the acquisition module 501 is used for acquiring a pipe network large sample graph to be identified and seed primitives of the pipe network large sample graph;
The first identifying module 502 is configured to identify a sub-pipe network large-scale pattern in the pipe network large-scale pattern according to the primitive feature of the seed primitive;
an extracting module 503, configured to extract a target material text in the sub-pipe network large sample graph;
and the second recognition module 504 is configured to perform recognition processing on the target material text, so as to obtain material information of the sub-pipe network large sample graph.
In some alternative embodiments, the seed sub-elements include schematic line seed sub-elements and node numbering seed sub-elements; accordingly, the first identifying module 502 includes:
the first acquisition unit is used for acquiring the first primitive characteristics of the schematic line seed sub-primitives and the second primitive characteristics of the node numbering seed sub-primitives;
The first determining unit is used for determining a target schematic line primitive, a target node number primitive corresponding to the target schematic line primitive and a candidate material primitive in the pipe network large-scale sample graph according to the first primitive feature and the second primitive feature;
And the second determining unit is used for determining the target schematic line element, the target node number primitive corresponding to the target schematic line element and the candidate material primitive as a sub-pipe network large sample graph.
In some alternative embodiments, the first determining unit includes:
The first identification subunit is used for identifying target schematic line primitives in the pipe network large-scale sample graph according to the first primitive characteristics;
The second identifying subunit is used for identifying a node number primitive set and a candidate material primitive set in the pipe network large sample graph according to the second primitive characteristics;
The first searching subunit searches the target node number primitive corresponding to the target schematic primitive from the node number primitive set according to a first searching rule;
and the second searching subunit is used for searching the candidate material primitive corresponding to the target schematic primitive from the candidate material primitive set according to a second searching rule.
In some alternative embodiments, the schematic line seed sub-element includes two schematic lines; the first primitive feature includes first pattern information of the gesture line and a first distance between the gesture line; the first recognition subunit is specifically configured to:
identifying a plurality of line-type graphic elements in the pipe network large-scale graphic and second style information of the line-type graphic elements;
performing matching processing on the first style information and the second style information, and determining the line-type graphic element corresponding to the successfully matched second style information as a candidate line-type graphic element;
According to the first distance, grouping the candidate line type primitives in pairs to obtain schematic line candidate primitives;
And determining the schematic line seed sub-picture element and the schematic line candidate picture element as target schematic line picture elements in the pipe network large-scale picture.
In some alternative embodiments, the second identifying subunit is specifically configured to:
acquiring each text primitive in the pipe network large sample graph and a third primitive characteristic of each text primitive;
Matching the second primitive feature with the third primitive feature;
Determining a text primitive corresponding to the successfully matched third primitive feature as a node number primitive to obtain the node number primitive set;
And determining the text primitive corresponding to the third primitive feature which fails to match as a candidate material primitive to obtain a candidate material primitive set.
In some alternative embodiments, the first search sub-unit is specifically configured to:
Constructing a node numbering search tree according to the node numbering primitive set; nodes in the node numbering search tree are in one-to-one correspondence with the node numbering graphic elements;
Generating a first search range of each node in the node numbering search tree according to the size of the node numbering text in the node numbering graphic element;
and based on the first search range, carrying out search processing in the node number search tree to obtain a target node number primitive corresponding to the target schematic line primitive.
In some alternative embodiments, the first search sub-unit is further specifically configured to:
Determining an initial node number primitive in the node number primitives; the initial node number primitive is a node number primitive which is positioned in a first preset range of the target schematic primitive and is closest to the target schematic primitive;
expanding a first search range corresponding to the initial node numbering graphic element to obtain a second search range;
determining a target first search range with an intersecting relation with the second search range in the first search range based on the node number search tree;
determining node number primitives corresponding to the target first search range as candidate node number primitives;
If the number of the candidate node number primitives is equal to 1, determining the candidate node number primitives as target node number primitives corresponding to the target schematic line primitives;
if the number of the candidate node number primitives is greater than 1, determining a splicing sequence, and carrying out splicing treatment on the candidate node number primitives according to the splicing sequence to obtain target node number primitives corresponding to the target schematic line primitives.
In some alternative embodiments, the second search sub-unit is specifically configured to:
Acquiring a third search range of each candidate material primitive in the candidate material primitive set;
determining an initial candidate material primitive in the candidate material primitive set; the initial candidate material primitive is a candidate material primitive which is positioned in a second preset range of the target schematic primitive and is closest to the target schematic primitive;
Expanding a third search range of the initial candidate material primitives to obtain a fourth search range;
determining a target third search range with an intersecting relation with the fourth search range in the third search range;
and determining the candidate material primitive corresponding to the target third search range as the candidate material primitive corresponding to the target schematic primitive.
In some alternative embodiments, the sub-network master pattern comprises a plurality of candidate material primitives; the extracting module 503 includes:
The identification unit is used for identifying target material primitives in the candidate material primitives;
the classification unit is used for classifying the target material primitives to obtain primitive categories of the target material primitives;
The third determining unit is used for determining the material quantity corresponding to the target material primitive according to the primitive category;
And the generating unit is used for generating a target material text of the sub-pipe network large-scale pattern according to the primitive category and the material quantity.
In some alternative embodiments, the identification unit is specifically configured to:
acquiring text information in each candidate material primitive according to each candidate material primitive;
determining whether a preset blacklist comprises the text information or not; the preset blacklist is used for identifying texts which do not belong to the material information;
If not, determining that the candidate material primitive is a target material primitive.
In some alternative embodiments, the classification unit comprises:
The first determining subunit is used for determining a first target material primitive to be processed currently, and determining a candidate third search range meeting a first preset condition according to the third search range of the first target material primitive;
a second determining subunit, configured to determine whether a second target material primitive that meets a second preset condition exists in the target material primitives corresponding to the candidate third search range;
a classifying subunit, configured to determine, if the second target material primitive exists, that primitive classes of the first target material primitive and the second target material primitive are associated primitives; and if the second target material primitive does not exist, determining the primitive category of the first target material primitive as an independent material primitive.
In some alternative embodiments, the first determining subunit is specifically configured to:
According to the position information of the target material primitives in the sub-pipe network large sample graph, sequencing the target material primitives to obtain sequenced target material primitives;
traversing the sequenced target material primitives, and determining a first target material primitive to be processed currently;
Amplifying the third search range of the first target material primitive to obtain a fifth search range;
and determining a third search range intersecting with the fifth search range from among the third search ranges of the target material primitives as a candidate third search range meeting the first preset condition.
In some alternative embodiments, the second determining subunit is specifically configured to:
Determining whether a candidate target material graphic primitive which has the same direction and the same characteristic as the first target material graphic primitive exists in the target material graphic primitive corresponding to the candidate third search range;
determining, if a straight line primitive exists between the candidate target material primitive and the first target material primitive, if the candidate target material primitive exists;
If the straight line primitive exists, determining that a second target material primitive meeting a second preset condition exists;
And if the straight line primitive does not exist, determining that a second target material primitive meeting a second preset condition does not exist.
In some optional embodiments, the third determining unit is specifically configured to:
Generating a search line segment of the target material primitive according to the primitive category;
Determining candidate line primitives intersecting the search line segment;
Selecting target line primitives meeting a third preset condition from the candidate line primitives;
Determining a first number of straight-line primitives that intersect a first end of the target line primitive;
determining a second number of straight line primitives that intersect a second end point of the target line primitive;
and determining the maximum number of the first number and the second number as the material number corresponding to the target material primitive.
In some alternative embodiments, the second identification module 504 includes:
A fourth determining unit, configured to determine a priority corresponding to the target material text;
The first analysis unit is used for carrying out first analysis processing on the target material text according to the priority to obtain a material type corresponding to the target material text;
the second analysis unit is used for carrying out second analysis processing on the target material text according to the priority to obtain material properties corresponding to the target material text;
The material information of the sub-network master pattern includes the material type and the material properties.
In the embodiment, the large sample image recognition device obtains a pipe network large sample image to be recognized and seed picture elements of the pipe network large sample image; identifying a sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed primitives; and extracting the target material text in the sub-pipe network large sample graph, and identifying the target material text to obtain the material information of the sub-pipe network large sample graph. Therefore, the automatic identification of the large sample graph is realized, the identification efficiency of the large sample graph is greatly improved, and the identification error caused by human factors can be avoided.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The pattern recognition device 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 a memory executing one or more software or fixed programs, and/or other devices that can provide the above functions.
The embodiment of the invention also provides computer equipment, which is provided with the large pattern recognition device shown in the figure 7.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 8, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 8.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific 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.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods shown in implementing the above embodiments.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device further comprises input means 30 and output means 40. The processor 10, memory 20, input device 30, and output device 40 may be connected by a bus or other means, for example in fig. 8.
The input device 30 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointer stick, one or more mouse buttons, a trackball, a joystick, and the like. The output means 40 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. Such display devices include, but are not limited to, liquid crystal displays, light emitting diodes, displays and plasma displays. In some alternative implementations, the display device may be a touch screen.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Portions of the present invention may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or aspects in accordance with the present invention by way of operation of the computer. Those skilled in the art will appreciate that the form of computer program instructions present in a computer readable medium includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the manner in which the computer program instructions are executed by a 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. Herein, a computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by a computer.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (19)

1. The pipe network large-scale pattern recognition method is characterized by comprising the following steps of:
Obtaining a pipe network large sample diagram to be identified and seed picture elements of the pipe network large sample diagram;
Identifying a sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed primitives;
extracting a target material text in the sub-pipe network large sample graph;
and identifying the target material text to obtain the material information of the sub-pipe network large sample graph.
2. The method of claim 1, wherein the seed sub-primitives include schematic line seed sub-primitives and node numbered seed sub-primitives; identifying the sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed sub-primitives, wherein the sub-pipe network large sample graph comprises:
Acquiring a first primitive feature of the schematic line seed sub-primitive and a second primitive feature of the node numbering seed sub-primitive;
Determining a target schematic line drawing element, a target node number primitive corresponding to the target schematic line drawing element and a candidate material primitive in the pipe network large-scale sample graph according to the first primitive characteristic and the second primitive characteristic;
And determining the target schematic line element, the target node number primitive corresponding to the target schematic line element and the candidate material primitive as a sub-pipe network large sample graph.
3. The method according to claim 2, wherein determining the target schematic line element, the target node number element corresponding to the target schematic line element, and the candidate material element in the pipe network large sample graph according to the first primitive feature and the second primitive feature comprises:
Identifying a target schematic line drawing element in the pipe network large sample graph according to the first primitive characteristics;
According to the second primitive characteristics, identifying a node numbering primitive set and a candidate material primitive set in the pipe network large sample graph;
searching a target node numbering primitive corresponding to the target schematic primitive from the node numbering primitive set according to a first searching rule;
And searching the candidate material primitive corresponding to the target schematic primitive from the candidate material primitive set according to a second searching rule.
4. A method according to claim 3, wherein the schematic line seed picture element comprises two schematic lines; the first primitive feature includes first pattern information of the gesture line and a first distance between the gesture line; and identifying a target schematic line drawing element in the pipe network large sample graph according to the first primitive characteristics, wherein the target schematic line drawing element comprises:
identifying a plurality of line-type graphic elements in the pipe network large-scale graphic and second style information of the line-type graphic elements;
performing matching processing on the first style information and the second style information, and determining the line-type graphic element corresponding to the successfully matched second style information as a candidate line-type graphic element;
According to the first distance, grouping the candidate line type primitives in pairs to obtain schematic line candidate primitives;
And determining the schematic line seed sub-picture element and the schematic line candidate picture element as target schematic line picture elements in the pipe network large-scale picture.
5. A method according to claim 3, wherein said identifying a set of node numbered primitives and a set of candidate material primitives in the pipe network master graph from the second primitive signature comprises:
acquiring each text primitive in the pipe network large sample graph and a third primitive characteristic of each text primitive;
Matching the second primitive feature with the third primitive feature;
Determining a text primitive corresponding to the successfully matched third primitive feature as a node number primitive to obtain the node number primitive set;
And determining the text primitive corresponding to the third primitive feature which fails to match as a candidate material primitive to obtain a candidate material primitive set.
6. A method according to claim 3, wherein searching the target node number primitive corresponding to the target schematic primitive from the node number primitive set according to the first search rule comprises:
Constructing a node numbering search tree according to the node numbering primitive set; nodes in the node numbering search tree are in one-to-one correspondence with the node numbering graphic elements;
Generating a first search range of each node in the node numbering search tree according to the size of the node numbering text in the node numbering graphic element;
and based on the first search range, carrying out search processing in the node number search tree to obtain a target node number primitive corresponding to the target schematic line primitive.
7. The method of claim 6, wherein the performing search processing in the node number search tree based on the first search range to obtain a target node number primitive corresponding to the target schematic line primitive comprises:
Determining an initial node number primitive in the node number primitives; the initial node number primitive is a node number primitive which is positioned in a first preset range of the target schematic primitive and is closest to the target schematic primitive;
expanding a first search range corresponding to the initial node numbering graphic element to obtain a second search range;
determining a target first search range with an intersecting relation with the second search range in the first search range based on the node number search tree;
determining node number primitives corresponding to the target first search range as candidate node number primitives;
If the number of the candidate node number primitives is equal to 1, determining the candidate node number primitives as target node number primitives corresponding to the target schematic line primitives;
if the number of the candidate node number primitives is greater than 1, determining a splicing sequence, and carrying out splicing treatment on the candidate node number primitives according to the splicing sequence to obtain target node number primitives corresponding to the target schematic line primitives.
8. A method according to claim 3, wherein searching candidate material primitives corresponding to the target schematic primitive from the set of candidate material primitives according to a second search rule comprises:
Acquiring a third search range of each candidate material primitive in the candidate material primitive set;
determining an initial candidate material primitive in the candidate material primitive set; the initial candidate material primitive is a candidate material primitive which is positioned in a second preset range of the target schematic primitive and is closest to the target schematic primitive;
Expanding a third search range of the initial candidate material primitives to obtain a fourth search range;
determining a target third search range with an intersecting relation with the fourth search range in the third search range;
and determining the candidate material primitive corresponding to the target third search range as the candidate material primitive corresponding to the target schematic primitive.
9. The method of claim 1, wherein the sub-network master pattern comprises a plurality of candidate material primitives; the extracting the target material text in the sub-pipe network large sample graph comprises the following steps:
Identifying a target material primitive in the candidate material primitives;
Classifying the target material primitives to obtain primitive categories of the target material primitives;
Determining the material quantity corresponding to the target material primitive according to the primitive category;
and generating target material text of the sub-pipe network large sample graph according to the primitive category and the material quantity.
10. The method of claim 9, wherein the identifying a target material primitive of the candidate material primitives comprises:
acquiring text information in each candidate material primitive according to each candidate material primitive;
determining whether a preset blacklist comprises the text information or not; the preset blacklist is used for identifying texts which do not belong to the material information;
If not, determining that the candidate material primitive is a target material primitive.
11. The method of claim 9, wherein classifying the target material primitive to obtain a primitive class of the target material primitive comprises:
determining a first target material primitive to be processed currently, and determining a candidate third search range meeting a first preset condition according to the third search range of the first target material primitive;
Determining whether a second target material primitive meeting a second preset condition exists in target material primitives corresponding to the candidate third search range;
If the second target material primitive exists, determining primitive types of the first target material primitive and the second target material primitive as associated primitives;
and if the second target material primitive does not exist, determining the primitive category of the first target material primitive as an independent material primitive.
12. The method of claim 11, wherein determining a candidate third search range that satisfies the first preset condition among the third search ranges of the target material primitive comprises:
According to the position information of the target material primitives in the sub-pipe network large sample graph, sequencing the target material primitives to obtain sequenced target material primitives;
traversing the sequenced target material primitives, and determining a first target material primitive to be processed currently;
Amplifying the third search range of the first target material primitive to obtain a fifth search range;
and determining a third search range intersecting with the fifth search range from among the third search ranges of the target material primitives as a candidate third search range meeting the first preset condition.
13. The method of claim 11, wherein determining whether a second target material primitive that satisfies a second preset condition exists in the target material primitives corresponding to the candidate third search range includes:
Determining whether a candidate target material graphic primitive which has the same direction and the same characteristic as the first target material graphic primitive exists in the target material graphic primitive corresponding to the candidate third search range;
determining, if a straight line primitive exists between the candidate target material primitive and the first target material primitive, if the candidate target material primitive exists;
If the straight line primitive exists, determining that a second target material primitive meeting a second preset condition exists;
And if the straight line primitive does not exist, determining that a second target material primitive meeting a second preset condition does not exist.
14. The method according to claim 9, wherein determining the amount of material corresponding to the target material primitive according to the primitive category comprises:
Generating a search line segment of the target material primitive according to the primitive category;
Determining candidate line primitives intersecting the search line segment;
Selecting target line primitives meeting a third preset condition from the candidate line primitives;
Determining a first number of straight-line primitives that intersect a first end of the target line primitive;
determining a second number of straight line primitives that intersect a second end point of the target line primitive;
and determining the maximum number of the first number and the second number as the material number corresponding to the target material primitive.
15. The method of any one of claims 1-14, wherein the identifying the target material text to obtain the material information of the sub-network master pattern includes:
determining the priority corresponding to the target material text;
performing first analysis processing on the target material text according to the priority to obtain a material type corresponding to the target material text;
performing second analysis processing on the target material text according to the priority to obtain material properties corresponding to the target material text;
The material information of the sub-network master pattern includes the material type and the material properties.
16. A large pattern recognition apparatus, the apparatus comprising:
The acquisition module is used for acquiring the pipe network large sample graph to be identified and the seed picture elements of the pipe network large sample graph;
the first identification module is used for identifying a sub-pipe network large sample graph in the pipe network large sample graph according to the primitive characteristics of the seed primitives;
The extraction module is used for extracting the target material text in the sub-pipe network large sample graph;
And the second recognition module is used for recognizing the target material text to obtain the material information of the sub-pipe network large sample graph.
17. A computer device, comprising:
A memory and a processor in communication with each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the pattern recognition method of any one of claims 1 to 15.
18. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the large-scale pattern recognition method according to any one of claims 1 to 15.
19. A computer program product comprising computer instructions for causing a computer to perform the large scale pattern recognition method of any one of claims 1 to 15.
CN202410344191.7A 2024-03-25 2024-03-25 Large-scale pattern recognition method, large-scale pattern recognition device, large-scale pattern recognition apparatus, large-scale pattern recognition storage medium, and large-scale pattern recognition program product Pending CN117994592A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410344191.7A CN117994592A (en) 2024-03-25 2024-03-25 Large-scale pattern recognition method, large-scale pattern recognition device, large-scale pattern recognition apparatus, large-scale pattern recognition storage medium, and large-scale pattern recognition program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410344191.7A CN117994592A (en) 2024-03-25 2024-03-25 Large-scale pattern recognition method, large-scale pattern recognition device, large-scale pattern recognition apparatus, large-scale pattern recognition storage medium, and large-scale pattern recognition program product

Publications (1)

Publication Number Publication Date
CN117994592A true CN117994592A (en) 2024-05-07

Family

ID=90889010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410344191.7A Pending CN117994592A (en) 2024-03-25 2024-03-25 Large-scale pattern recognition method, large-scale pattern recognition device, large-scale pattern recognition apparatus, large-scale pattern recognition storage medium, and large-scale pattern recognition program product

Country Status (1)

Country Link
CN (1) CN117994592A (en)

Similar Documents

Publication Publication Date Title
JP2022524642A (en) Automatic extraction of asset data from engineering data sources to generate HMI
US8887135B2 (en) Generating test cases for functional testing of a software application
WO2022057303A1 (en) Image processing method, system and apparatus
CN108255837B (en) SQL parser and method
CN102567565B (en) Cable parameter processing method and system utilizing same
JP2021193606A (en) Operator registration processing method, device and electronic apparatus based on deep learning
EP3822815A1 (en) Method and apparatus for mining entity relationship, electronic device, storage medium, and computer program product
CN114116065B (en) Method and device for acquiring topological graph data object and electronic equipment
US20180025162A1 (en) Application program analysis apparatus and method
CN112445775A (en) Fault analysis method, device, equipment and storage medium of photoetching machine
CN112417899A (en) Character translation method, device, computer equipment and storage medium
CN112015634A (en) Page structure information generation method and device and electronic equipment
CN112015405A (en) Interface layout file generation method, interface generation method, device and equipment
CN112486384B (en) Picture examination processing method and related device
CN111176992B (en) Flow engine testing method and device, computer equipment and storage medium
CN112328246A (en) Page component generation method and device, computer equipment and storage medium
CN117994592A (en) Large-scale pattern recognition method, large-scale pattern recognition device, large-scale pattern recognition apparatus, large-scale pattern recognition storage medium, and large-scale pattern recognition program product
CN111460235A (en) Atlas data processing method, device, equipment and storage medium
CN111078671A (en) Method, device, equipment and medium for modifying data table field
CN115310011A (en) Page display method and system and readable storage medium
CN112685127A (en) Data source operation method and system based on content management system
Song et al. A novel geometric information retrieval tool for images of geometric diagrams
CN113111713B (en) Image detection method and device, electronic equipment and storage medium
CN117033239B (en) Control matching method and device, computer equipment and storage medium
CN114500227B (en) Alarm analysis method, device, equipment and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination