CN114399784A - Automatic identification method and device based on CAD drawing - Google Patents

Automatic identification method and device based on CAD drawing Download PDF

Info

Publication number
CN114399784A
CN114399784A CN202210067566.0A CN202210067566A CN114399784A CN 114399784 A CN114399784 A CN 114399784A CN 202210067566 A CN202210067566 A CN 202210067566A CN 114399784 A CN114399784 A CN 114399784A
Authority
CN
China
Prior art keywords
processing
result
cad drawing
rendering
cad
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
CN202210067566.0A
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.)
Guangdong Bozhilin Software Technology Co ltd
Original Assignee
Guangdong Bozhilin Robot 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 Guangdong Bozhilin Robot Co Ltd filed Critical Guangdong Bozhilin Robot Co Ltd
Priority to CN202210067566.0A priority Critical patent/CN114399784A/en
Publication of CN114399784A publication Critical patent/CN114399784A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/02Affine transformations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides an automatic identification method and device based on a CAD drawing, and the automatic identification method comprises the following steps: judging whether the CAD drawing meets the preset drawing requirements or not; when the CAD drawing meets the drawing requirement, rendering the CAD drawing to obtain a drawing rendering result; performing at least one of information screening processing, shaft network identification processing and area division processing on the drawing rendering result to obtain at least one processing result; and carrying out image recognition according to a preset image recognition algorithm and at least one processing result to obtain an image recognition result. Therefore, by implementing the implementation mode, the automatic identification method of the CAD drawing can be provided, and the CAD drawing is automatically subjected to auxiliary identification according to the preset conditions, so that the difficulty in realizing the identification algorithm is reduced, and the identification efficiency of the CAD drawing and the automatic import efficiency of the CAD drawing are improved.

Description

Automatic identification method and device based on CAD drawing
Technical Field
The application relates to the field of image processing, in particular to an automatic identification method and device based on a CAD drawing.
Background
At present, more and more design models in the building field start to allow automatic import of CAD drawings, so that workers can quickly and accurately design buildings using the design models. However, in practice, it is found that no matter the traditional image algorithm or the deep learning image algorithm is used in the import algorithm, when the CAD drawing with a huge size and complicated information is faced, the performance of the import algorithm is greatly restricted, so that the identification efficiency of the CAD drawing is influenced, and further the automatic import efficiency of the CAD drawing is influenced.
Disclosure of Invention
The embodiment of the application aims to provide an automatic identification method and device based on a CAD drawing, which can provide the automatic identification method of the CAD drawing, and can automatically perform auxiliary identification on the CAD drawing according to preset conditions, so that the difficulty in realizing an identification algorithm is reduced, and the identification efficiency of the CAD drawing and the automatic import efficiency of the CAD drawing are improved.
The first aspect of the embodiments of the present application provides an automatic identification method based on a CAD drawing, including:
judging whether the CAD drawing meets the preset drawing requirements or not;
when the CAD drawing meets the drawing requirement, rendering the CAD drawing to obtain a drawing rendering result;
performing at least one of information screening processing, shaft network identification processing and area division processing on the drawing rendering result to obtain at least one processing result;
and carrying out image recognition according to a preset image recognition algorithm and the at least one processing result to obtain an image recognition result.
In the implementation process, the method can preferentially judge whether the CAD drawing meets the preset drawing requirements, so that the judgment effect on the legality of the CAD drawing is realized, the subsequent automatic identification processing is carried out when the CAD drawing meets all the requirements, and the CAD drawing which does not meet the requirements is prevented from being identified; then, the method can be used for rendering the CAD drawing meeting the drawing requirement to obtain a drawing rendering result, the process can be used for calculating according to the construction rule of the CAD drawing and the preset rendering logic to obtain vector information included in the CAD drawing, so that the drawing rendering result obtained by rendering is a vector result and can be randomly adjusted according to the required resolution, and the requirement of an algorithm on the resolution is effectively supported; then, the method performs at least one of information screening processing, axis network identification processing and area division processing on the drawing rendering result to obtain at least one processing result, so that the method can perform processing of various forms on the drawing rendering result to obtain a corresponding processing result file, and further the processing result file can be identified by using an auxiliary CAD drawing to improve the identification effect of the CAD drawing; finally, the method can perform image recognition according to a preset image recognition algorithm and the at least one processing result to obtain an image recognition result. Therefore, by the implementation of the implementation mode, the automatic drawing recognition effect of the building CAD drawing can be achieved, so that the difficulty in realizing the recognition algorithm is reduced, and the recognition efficiency of the CAD drawing and the automatic importing efficiency of the CAD drawing are improved.
Further, the step of rendering the CAD drawing to obtain a drawing rendering result includes:
extracting data information in the CAD drawing;
extracting a root node block in the data information;
recursively instantiating all node blocks in the data information into a block tree by taking the root node block as a starting point;
and carrying out affine transformation on the primitive coordinates of the node block according to the block tree to obtain a drawing rendering result.
Further, the step of performing affine transformation on the primitive coordinates of the node block according to the block tree to obtain a drawing rendering result includes:
carrying out affine transformation on the primitive coordinates of the node block according to the block tree to obtain transformation coordinates;
filling the transformed coordinates into a preset key value storage database to obtain a drawing rendering result; and the key in the key value storage database is used for representing the type of the primitive, and the value in the key value storage database is used for representing the transformation coordinates of all primitives corresponding to the type of the primitive.
Further, the step of performing at least one of information screening processing, axis network identification processing, and area division processing on the drawing rendering result to obtain at least one processing result includes:
when an information screening processing requirement is detected, performing information screening processing on the drawing rendering result to obtain a first processing result;
when the requirement for the axle network identification processing is detected, carrying out axle network identification processing on the drawing rendering result to obtain a second processing result;
and when the requirement for area division processing is detected, area division processing is carried out on the drawing rendering result to obtain a third processing result.
Further, the step of performing information screening processing on the drawing rendering result to obtain a first processing result includes:
extracting a primitive criterion of each primitive from the drawing rendering result;
extracting at least one effective criterion from preset screening conditions;
screening at least one primitive with a primitive criterion as the effective criterion in the drawing rendering result;
and performing intersection set fusion processing or union set fusion processing on the at least one primitive to obtain a first processing result.
Further, the step of performing axis network identification processing on the drawing rendering result to obtain a second processing result includes:
obtaining an axis number characteristic point, an axis number text and an axis characteristic point from the drawing rendering result;
matching the shaft number characteristic points with the shaft number text to obtain a first matching result;
matching the first matching result with the axis characteristic point to obtain a second matching result;
and generating a second processing result according to the second matching result.
Further, the step of performing area division processing on the drawing rendering result to obtain a third processing result includes:
inputting the drawing rendering result into a preset target detection model so that the target detection model outputs the picture frame category and the picture frame coordinates of the picture frame in the drawing rendering result;
carrying out coordinate conversion on the picture frame coordinate to obtain a conversion coordinate;
and generating a third processing result according to the drawing frame type and the conversion coordinate.
A second aspect of the embodiments of the present application provides an automatic identification device based on a CAD drawing, where the automatic identification device includes:
the judging unit is used for judging whether the CAD drawing meets the preset drawing requirements or not;
the rendering unit is used for rendering the CAD drawing to obtain a drawing rendering result when the CAD drawing meets the drawing requirement;
the processing unit is used for performing at least one of information screening processing, axis network identification processing and area division processing on the drawing rendering result to obtain at least one processing result;
and the identification unit is used for carrying out image identification according to a preset image identification algorithm and the at least one processing result to obtain an image identification result.
In the implementation process, the automatic identification device can automatically judge the legality of the input CAD drawing, and render and perform auxiliary identification processing on the CAD drawing when the CAD drawing is legal, so that effective and efficient image identification can be performed according to the auxiliary identification processing result. Therefore, the implementation of the implementation mode can independently perform auxiliary identification on the CAD drawing according to the preset conditions, so that the difficulty in realizing the identification algorithm is reduced, and the identification efficiency of the CAD drawing and the automatic importing efficiency of the CAD drawing are improved.
A third aspect of the embodiments of the present application provides an electronic device, including a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the automatic identification method based on a CAD drawing according to any one of the first aspect of the embodiments of the present application.
A fourth aspect of the present embodiment provides a computer-readable storage medium, which stores computer program instructions, where the computer program instructions, when read and executed by a processor, perform the method for automatic identification based on CAD drawings according to any one of the first aspect of the present embodiment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flow chart of an automatic identification method based on a CAD drawing according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of an automatic identification device based on a CAD drawing according to an embodiment of the present application;
fig. 3 is an exemplary diagram of block contents provided in an embodiment of the present application;
fig. 4 is a schematic diagram of a block structure provided in an embodiment of the present application;
FIG. 5 is a redrawn form of a drawing in which only the number layer and the axis layer are opened according to an embodiment of the present disclosure;
fig. 6 is a prediction sample of a region partitioning module according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
Referring to fig. 1, fig. 1 is a schematic flow chart of an automatic identification method based on a CAD drawing according to an embodiment of the present application. The automatic identification method based on the CAD drawing comprises the following steps:
s101, judging whether the CAD drawing meets the preset drawing requirement, and if so, executing the steps S102-S110; if not, the flow is ended.
In this embodiment, the method first checks the CAD drawing, and determines whether the CAD drawing is legal.
In this embodiment, the drawing requirements may include a drawing size requirement, a complexity requirement, or an integrity requirement, etc.
In this embodiment, the method may also allow the CAD drawing to pass, perform validity check on the data information when the data information is to be acquired, and then perform construction rendering on the data information if the data information is valid.
And S102, extracting data information in the CAD drawing.
In this embodiment, the data information constitutes a data file.
In the embodiment, the data file describes the definition of each primitive in the graph and the correlation between the primitives; it cannot be directly used by the algorithm because the data in the algorithm needs to be subjected to a series of calculations such as construction and rendering to become the coordinates in the graph.
And S103, extracting a root node block in the data information.
In this embodiment, for a piece of CAD drawing, the data information in the piece of CAD drawing may be extracted and then output in the form of a data file. The data file understands the internal data of the CAD drawing as a tree structure in which the basic unit is a block.
In this embodiment, each block in the data file has some attributes, most of which are primitive attributes, where the primitive attributes include lines, polylines, circles, arcs, ellipsoses, texts, mtexts, attributes, dimensions, and the like, and for these primitive attributes, the coordinates thereof are extracted and output. In addition, each block has a special attribute, block references, which stores all blocks referenced by the current block, and the corresponding reference scheme.
Referring to fig. 3, fig. 3 is a diagram illustrating an example of block contents, from which the attribute inclusion relationship can be seen.
Meanwhile, referring to fig. 4, fig. 4 shows a block structure diagram. As can be seen from FIG. 4, the block includes references and reference schemes that are critical in the construction of the tree. The two concepts link the basic unit block to form a tree-shaped drawing information database; each reference is necessarily accompanied by a referencing scheme that indicates the transformation rules for the primitives of the referenced block.
In the present embodiment, the above-mentioned reference scheme is essentially some rendering coefficients, which include but are not limited to scaling coefficients, rotation coefficients, and displacement coefficients. In the present invention these coefficients are expressed as corresponding matrices, i.e. scaling, rotation, displacement matrices.
In this embodiment, a block may refer to other blocks, and may also be referred to by other blocks. The primitive that a block should draw, broadly speaking, has two sources: the self graphic element attribute; primitive attributes of the block referenced in its own block references attributes.
In this embodiment, if the primitive belongs to the first source, it is called a block custom primitive (visible in FIG. 4); and the block extracts the coordinates of the primitive and directly outputs the coordinates.
In this embodiment, if the primitive belongs to the second source, it is called a block reference primitive; the current block needs to obtain the coordinates of the user-defined primitive of the block referred by the current block, then obtains a scaling matrix, a rotation matrix and a displacement matrix through the corresponding reference scheme in the corresponding block references attributes to transform the coordinates, and finally outputs the coordinates.
In this embodiment, each block may refer to any other block, and each block may also be referred to by any other block; and the referred block can also refer to other blocks, and the recursion is carried out, so that a drawing basic database-block tree with a tree structure is finally formed. The generated data in the block tree is the object of the subsequent rendering step.
And S104, recursively instantiating all the node blocks in the data information into a block tree by taking the root node block as a starting point.
In the embodiment, the method constructs the block tree through the reference relationship among the blocks.
And S105, carrying out affine transformation on the primitive coordinates of the node block according to the block tree to obtain transformation coordinates.
S106, filling the transformed coordinates into a preset key value storage database to obtain a drawing rendering result; keys in the key value storage database are used for representing primitive types, and values in the key value storage database are used for representing transformation coordinates of all primitives corresponding to the primitive types.
In this embodiment, the Key Value storage database is a Key-Value storage database.
In this embodiment, the drawing rendering result is essentially a key-value store database.
In this embodiment, a data object generated after the data information is constructed and rendered is referred to as a drawing rendering result, data in the drawing rendering result is already coordinates in a graph, and the coordinates can be directly used by an algorithm.
In this embodiment, the method first performs an initialization configuration on the processing system, so as to define and record a data file path, an image resolution, a saving path, a color, and the like. Then, starting again with the root node block, recursively instantiates all blocks as block trees. When the method is used, only the members of the block tree need to be called, so that the pixel coordinates of all blocks can be subjected to affine transformation, and the calculated coordinates are filled into a preset key value storage database to obtain a new key value storage database. The key value storage database becomes the drawing rendering result.
By implementing the embodiment, the problems of low image resolution and large loss of reality in the traditional methods (screen shot method and pdf file identification method) can be solved based on vector graphics capable of generating any resolution. Specifically, the method is based on an analyzed drawing basic database, vector information of the CAD drawing is obtained through calculation of a construction rule of the CAD drawing and a preset rendering logic, and the vector information is stored in a Key-Value storage database. When the identification algorithm calls the key value storage database, an image with a specific resolution can be generated according to the configuration file in the key value storage database, so that the requirement of the algorithm on the resolution is effectively supported.
And S107, when the information screening processing requirement is detected, performing information screening processing on the drawing rendering result to obtain a first processing result.
In this embodiment, the first processing result is a rendering data object output file. The rendering data object output file only contains files of data meeting the screening condition; at the same time, the rendering data object output file may be provided directly to the algorithm for use. Wherein the rendered data object output file contains only information of interest to the algorithm, while other interference information has been filtered out.
As an optional implementation manner, the step of performing information screening processing on the drawing rendering result to obtain a first processing result includes:
extracting a primitive criterion of each primitive from a drawing rendering result;
extracting at least one effective criterion from preset screening conditions;
screening at least one primitive with a primitive criterion as an effective criterion in a drawing rendering result;
and performing intersection set fusion processing or union set fusion processing on at least one primitive to obtain a first processing result.
By implementing the embodiment, the method can return the graphic information meeting the screening condition to the algorithm when the information screening function is called. Through information screening, the identification algorithm can acquire interested CAD graphs and images in a customized manner, so that the problem situation of the algorithm is simplified, and the difficulty of algorithm implementation is reduced.
In this embodiment, the key-value storage database may generate a criterion for each primitive, where the criterion is a basis for determining whether a corresponding primitive is retained. The method establishes functions one by one according to screening conditions, and screens data in a drawing rendering result one by one to generate a corresponding rendering data object (namely the at least one primitive). Finally, according to the configuration requirement, the method takes intersection or union of the rendering data objects to form a final rendering data object output file (namely a first processing result). Wherein the first processing result only contains information of interest to the algorithm.
In addition, the information screening module also has a white list function and a black list function, has the highest priority and is used for certain retention or certain deletion of certain information in the rendering data object.
And S108, when the requirement for the axle network identification processing is detected, carrying out axle network identification processing on the drawing rendering result to obtain a second processing result.
In this embodiment, the second processing result is an axis network identification output file. The shaft network identifies the output file as a file containing every two shaft coordinates, shaft serial numbers and pairing information of the two shaft coordinates and the shaft serial numbers.
In this embodiment, the axis network is a series of coordinate axes in the architectural drawing, a plurality of sets of horizontal and vertical position information are integrated, and a plurality of objects such as rooms, structures, members and the like are drawn by the axis network.
In this embodiment, in general, red arrows are used to indicate a pair of axis numbers, the axis numbers are english letters or numbers, the axis numbers usually appear in pairs, and there is also a separate axis number, and all the axis numbers have a circle to surround them. Referring to fig. 5, fig. 5 is a drawing redrawing proof sheet with only the axle number layer and the axle line layer opened. It can be seen that after the other layers are closed, each pair (or each) of the axis numbers corresponds to one axis. The axis standardizes the coordinates of the whole drawing, and is convenient for the positioning of the graphic primitives in the drawing. And the shaft number is used as the mark of the shaft line and indicates the name and the position of the shaft line. It can also be seen from the figure that two separate axis numbers B and E, which do not appear in pairs each, but which each correspond to an axis.
In this embodiment, the shaft network has the following rules:
1. the number of the axis is English letters or numbers;
2. all the axis numbers are surrounded by circles;
3. all the axis numbers have leads (connected with the circles) to guide the directions indicated by the axis numbers;
4. the axis numbers usually appear in pairs, and there are also individual axis numbers;
5. a pair (or one) of the axis numbers may correspond to multiple axes;
6. an axis may correspond to multiple pairs (or multiple) of axis numbers;
the working principle of shaft network identification in the method is based on the above rules.
As an optional implementation manner, the step of performing the axis network identification processing on the drawing rendering result to obtain the second processing result includes:
obtaining an axis number characteristic point, an axis number text and an axis characteristic point from a drawing rendering result;
matching the shaft number characteristic points and the shaft number text to obtain a first matching result;
matching the first matching result with the axis characteristic points to obtain a second matching result;
and generating a second processing result according to the second matching result.
By implementing the embodiment, when the shaft network identification function is called by the algorithm, the shaft network characteristics with good compatibility can be determined through the key value storage database. Specifically, when the coordinates and the axis numbers of each axis of the axis network are found, the method can return the coordinates and the axis numbers to the algorithm, so that the algorithm combines with the axis network information to find objects such as rooms, structures, components and the like at a lower cost, and the efficiency of the algorithm is improved.
For example, the method can preferentially determine the module for identifying the axle network in the system and carry out initialization configuration on the module. Then, the module acquires the shaft number characteristic points, the shaft number text and the shaft line characteristic points in the drawing rendering result. The axis number characteristic points are end points of the lead line of the axis number circle and the circle center of the circle, the axis number texts are texts in the axis number circle ('A', 'B', 'C', '1', '2',) and the axis characteristic points are two end points of each axis. Next, the axle network identification module matches the axle number feature points with the axle number text pairwise to know what the axle number text in each axle number circle is. Then, according to the principle of three-point collinearity, the axle network identification module matches the axle number characteristic points and the axle line characteristic points pairwise, so that the names (axle numbers) of the axles are obtained. Finally, an axis network identification output file (i.e., the second processing result) is generated and provided to the algorithm.
And S109, when the requirement for the area division processing is detected, performing area division processing on the drawing rendering result to obtain a third processing result.
In this embodiment, the third processing result is an area division output file. The area division output file is a file containing coordinates of a specific position range.
In this embodiment, the area is a specific range in which a specific function module is drawn in the construction drawing, and based on the specific range, the specific function module can be conveniently found by the algorithm. According to the algorithm requirement, the region dividing module divides the drawing into a plurality of functional module regions, each region expresses respective unique information, and the unique information is equivalent to a process for pre-classifying problems for a series of algorithms later, so that the difficulty in realizing the algorithms can be reduced.
In this embodiment, the bottom layer implementation of the region partitioning module is a deep learning target detection model. According to the label category and the understanding of the drawing by human knowledge, the areas in the drawing are generally divided into 12 types: "figure", "countersign bar", "picture name", "thumbnail", "table", "comment", "picture frame", "fire zone", "local enlargement", "big appearance", "description", "system", corresponding english: "Graph", "Countersign", "GraphName", "Thumbnail", "Table", "Comment", "Frame", "FireZone", "LocalZoom", "Detail", "exposure", "System". As shown in fig. 6, it can be seen from the output samples of the region division, the model can accurately predict the category and the frame position of each region, and the coordinates are relatively accurate.
As an optional implementation manner, the step of performing area division processing on the drawing rendering result to obtain a third processing result includes:
inputting the drawing rendering result into a preset target detection model so that the target detection model outputs the picture frame category and the picture frame coordinates of the picture frame in the drawing rendering result;
carrying out coordinate conversion on the frame coordinate to obtain a conversion coordinate;
and generating a third processing result according to the frame type and the converted coordinates.
By implementing the implementation mode, when the algorithm calls the region division function, the method can generate an image through the specific configuration file in the key value storage database, then perform target detection on the image and return the result to the algorithm. Therefore, when the identification algorithm can be combined with the region information, the range of the specific function module can be obtained, and a foundation is laid for further implementation of the algorithm.
For example, the drawing rendering result may generate an image with a certain resolution as an input of the target detection model. The object detection model then predicts the class and coordinates of the frame. The coordinates of this frame are referenced to the coordinate system of the image, but the coordinates in the rendered data object are referenced to the coordinate system of the CAD drawing. Therefore, the coordinates of the frame need to be transformed from the coordinate system of the image to the coordinate system of the CAD through a specific coordinate transformation. And finally, generating an area division output file according to the frame type and the transformed frame coordinate, and outputting the area division output file to an algorithm.
In this embodiment, the target detection model may be replaced by SSD, Retina, or the like, and especially a multi-stage model such as FastRCNN may be used, so that a higher accuracy may be obtained under a condition that the requirement on the speed is not high.
And S110, carrying out image recognition according to a preset image recognition algorithm and at least one processing result to obtain an image recognition result.
In the embodiment of the present application, the execution subject of the method may be a computing device such as a computer and a server, and is not limited in this embodiment.
In this embodiment, an execution subject of the method may also be an intelligent device such as a smart phone and a tablet computer, which is not limited in this embodiment.
Therefore, the automatic identification method based on the CAD drawing described in the embodiment can realize the automatic drawing identification effect of the building CAD drawing, thereby reducing the difficulty of realizing the identification algorithm and further improving the identification efficiency of the CAD drawing and the automatic import efficiency of the CAD drawing.
Example 2
Referring to fig. 2, fig. 2 is a schematic structural diagram of an automatic identification device based on a CAD drawing according to an embodiment of the present application. As shown in fig. 2, the automatic identification apparatus based on CAD drawings includes:
the judging unit 210 is configured to judge whether the CAD drawing meets a preset drawing requirement;
the rendering unit 220 is configured to render the CAD drawing to obtain a drawing rendering result when the CAD drawing meets the drawing requirement;
the processing unit 230 is configured to perform at least one of information screening processing, axis network identification processing, and area division processing on the drawing rendering result to obtain at least one processing result;
and the identifying unit 240 is configured to perform image identification according to a preset image identification algorithm and at least one processing result to obtain an image identification result.
As an alternative embodiment, the rendering unit 220 includes:
an extraction subunit 221, configured to extract data information in the CAD drawing;
an extracting subunit 221, configured to extract a root node block in the data information;
a recursion subunit 222, configured to recursively instantiate all node blocks in the data information into a block tree with the root node block as a starting point;
and the rendering subunit 223 is configured to perform affine transformation on the primitive coordinates of the node block according to the block tree to obtain a drawing rendering result.
As an alternative embodiment, the rendering subunit 223 includes:
the rendering module is used for carrying out affine transformation on the pixel coordinates of the node block according to the block tree to obtain transformation coordinates;
the storage module is used for filling the transformed coordinates into a preset key value storage database to obtain a drawing rendering result; keys in the key value storage database are used for representing primitive types, and values in the key value storage database are used for representing transformation coordinates of all primitives corresponding to the primitive types.
As an alternative embodiment, the processing unit 230 includes:
the screening and identifying subunit 231 is configured to, when an information screening processing requirement is detected, perform information screening processing on the drawing rendering result to obtain a first processing result;
the axle network identification subunit 232 is configured to perform axle network identification processing on the drawing rendering result when the axle network identification processing requirement is detected, so as to obtain a second processing result;
and a dividing processing subunit 233, configured to, when the area dividing processing requirement is detected, perform area dividing processing on the drawing rendering result to obtain a third processing result.
As an alternative embodiment, the screening identifier unit 231 includes:
the extraction module is used for extracting the primitive criterion of each primitive from the drawing rendering result;
the extraction module is used for extracting at least one effective criterion from preset screening conditions;
the screening module is used for screening at least one primitive with the primitive criterion as the effective criterion in the drawing rendering result;
and the fusion module is used for performing intersection fusion processing or union fusion processing on at least one primitive to obtain a first processing result.
As an alternative embodiment, the axle network identification subunit 232 includes:
the obtaining module is used for obtaining the shaft number characteristic points, the shaft number text and the shaft line characteristic points in the drawing rendering result;
the matching module is used for matching the axle number feature points with the axle number text to obtain a first matching result;
the matching module is used for matching the first matching result with the axis characteristic points to obtain a second matching result;
and the generating module is used for generating a second processing result according to the second matching result.
As an alternative embodiment, the division processing subunit 233 includes:
the input module is used for inputting the drawing rendering result to a preset target detection model so that the target detection model outputs the picture frame category and the picture frame coordinates of a picture frame in the drawing rendering result;
the conversion module is used for carrying out coordinate conversion on the picture frame coordinate to obtain a conversion coordinate;
and the generating module is used for generating a third processing result according to the picture frame type and the conversion coordinate.
In the embodiment of the present application, for explanation of an automatic identification apparatus based on a CAD drawing, reference may be made to the description in embodiment 1, and details are not repeated in this embodiment.
It can be seen that, by implementing the automatic identification device based on the CAD drawing described in this embodiment, the validity of the input CAD drawing can be automatically determined, and the CAD drawing is rendered and subjected to the auxiliary identification processing when the CAD drawing is legal, so that the CAD drawing can perform effective and efficient image identification according to the auxiliary identification processing result. Therefore, the implementation of the implementation mode can independently perform auxiliary identification on the CAD drawing according to the preset conditions, so that the difficulty in realizing the identification algorithm is reduced, and the identification efficiency of the CAD drawing and the automatic importing efficiency of the CAD drawing are improved.
The embodiment of the application provides electronic equipment, which comprises a memory and a processor, wherein the memory is used for storing a computer program, and the processor runs the computer program to enable the electronic equipment to execute the automatic identification method based on the CAD drawing in the embodiment 1 of the application.
The embodiment of the present application provides a computer-readable storage medium, which stores computer program instructions, and when the computer program instructions are read and executed by a processor, the method for automatically identifying based on a CAD drawing in embodiment 1 of the present application is executed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. An automatic identification method based on CAD drawings is characterized by comprising the following steps:
judging whether the CAD drawing meets the preset drawing requirements or not;
when the CAD drawing meets the drawing requirement, rendering the CAD drawing to obtain a drawing rendering result;
performing at least one of information screening processing, shaft network identification processing and area division processing on the drawing rendering result to obtain at least one processing result;
and carrying out image recognition according to a preset image recognition algorithm and the at least one processing result to obtain an image recognition result.
2. The automatic identification method based on the CAD drawing as recited in claim 1, wherein said step of rendering the CAD drawing to obtain a drawing rendering result comprises:
extracting data information in the CAD drawing;
extracting a root node block in the data information;
recursively instantiating all node blocks in the data information into a block tree by taking the root node block as a starting point;
and carrying out affine transformation on the primitive coordinates of the node block according to the block tree to obtain a drawing rendering result.
3. The CAD drawing-based automatic identification method according to claim 2, wherein the step of performing affine transformation on the primitive coordinates of the node block according to the block tree to obtain a drawing rendering result comprises:
carrying out affine transformation on the primitive coordinates of the node block according to the block tree to obtain transformation coordinates;
filling the transformed coordinates into a preset key value storage database to obtain a drawing rendering result; and the key in the key value storage database is used for representing the type of the primitive, and the value in the key value storage database is used for representing the transformation coordinates of all primitives corresponding to the type of the primitive.
4. The automatic identification method based on the CAD drawing as recited in claim 1, wherein said step of performing at least one of information filtering, axis network identification and area division on the drawing rendering result to obtain at least one processing result comprises:
when an information screening processing requirement is detected, performing information screening processing on the drawing rendering result to obtain a first processing result;
when the requirement for the axle network identification processing is detected, carrying out axle network identification processing on the drawing rendering result to obtain a second processing result;
and when the requirement for area division processing is detected, area division processing is carried out on the drawing rendering result to obtain a third processing result.
5. The automatic identification method based on the CAD drawing as recited in claim 4, wherein the step of performing information screening processing on the drawing rendering result to obtain a first processing result comprises:
extracting a primitive criterion of each primitive from the drawing rendering result;
extracting at least one effective criterion from preset screening conditions;
screening at least one primitive with a primitive criterion as the effective criterion in the drawing rendering result;
and performing intersection set fusion processing or union set fusion processing on the at least one primitive to obtain a first processing result.
6. The CAD drawing-based automatic identification method according to claim 4, wherein said step of performing axis network identification processing on the drawing rendering result to obtain a second processing result comprises:
obtaining an axis number characteristic point, an axis number text and an axis characteristic point from the drawing rendering result;
matching the shaft number characteristic points with the shaft number text to obtain a first matching result;
matching the first matching result with the axis characteristic point to obtain a second matching result;
and generating a second processing result according to the second matching result.
7. The automatic identification method based on the CAD drawing as recited in claim 4, wherein said step of performing area division processing on the drawing rendering result to obtain a third processing result comprises:
inputting the drawing rendering result into a preset target detection model so that the target detection model outputs the picture frame category and the picture frame coordinates of the picture frame in the drawing rendering result;
carrying out coordinate conversion on the picture frame coordinate to obtain a conversion coordinate;
and generating a third processing result according to the drawing frame type and the conversion coordinate.
8. An automatic identification device based on CAD drawing, characterized in that, the automatic identification device includes:
the judging unit is used for judging whether the CAD drawing meets the preset drawing requirements or not;
the rendering unit is used for rendering the CAD drawing to obtain a drawing rendering result when the CAD drawing meets the drawing requirement;
the processing unit is used for performing at least one of information screening processing, axis network identification processing and area division processing on the drawing rendering result to obtain at least one processing result;
and the identification unit is used for carrying out image identification according to a preset image identification algorithm and the at least one processing result to obtain an image identification result.
9. An electronic device, comprising a memory for storing a computer program and a processor for executing the computer program to cause the electronic device to execute the CAD drawing-based automatic identification method according to any one of claims 1 to 7.
10. A readable storage medium, wherein computer program instructions are stored in the readable storage medium, and when the computer program instructions are read and executed by a processor, the computer program instructions execute the CAD drawing-based automatic identification method according to any one of claims 1 to 7.
CN202210067566.0A 2022-01-20 2022-01-20 Automatic identification method and device based on CAD drawing Pending CN114399784A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210067566.0A CN114399784A (en) 2022-01-20 2022-01-20 Automatic identification method and device based on CAD drawing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210067566.0A CN114399784A (en) 2022-01-20 2022-01-20 Automatic identification method and device based on CAD drawing

Publications (1)

Publication Number Publication Date
CN114399784A true CN114399784A (en) 2022-04-26

Family

ID=81233669

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210067566.0A Pending CN114399784A (en) 2022-01-20 2022-01-20 Automatic identification method and device based on CAD drawing

Country Status (1)

Country Link
CN (1) CN114399784A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116595602A (en) * 2023-07-17 2023-08-15 中国核工业二三建设有限公司 CAD block cleaning method and device, electronic equipment and storage medium
CN116704204A (en) * 2023-04-20 2023-09-05 华联世纪工程咨询股份有限公司 Shaft network identification method based on graph combination
CN117831063A (en) * 2024-01-31 2024-04-05 北京鸿鹄云图科技股份有限公司 Double-drawing same-screen control method and system for drawing measurement

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116704204A (en) * 2023-04-20 2023-09-05 华联世纪工程咨询股份有限公司 Shaft network identification method based on graph combination
CN116704204B (en) * 2023-04-20 2024-01-05 华联世纪工程咨询股份有限公司 Shaft network identification method based on graph combination
CN116595602A (en) * 2023-07-17 2023-08-15 中国核工业二三建设有限公司 CAD block cleaning method and device, electronic equipment and storage medium
CN116595602B (en) * 2023-07-17 2023-09-22 中国核工业二三建设有限公司 CAD block cleaning method and device, electronic equipment and storage medium
CN117831063A (en) * 2024-01-31 2024-04-05 北京鸿鹄云图科技股份有限公司 Double-drawing same-screen control method and system for drawing measurement

Similar Documents

Publication Publication Date Title
JP7335907B2 (en) Character structuring extraction method and device, electronic device, storage medium, and computer program
CN114399784A (en) Automatic identification method and device based on CAD drawing
CN110059697B (en) Automatic lung nodule segmentation method based on deep learning
CN110163208B (en) Scene character detection method and system based on deep learning
US20210166058A1 (en) Image generation method and computing device
EP4172803A1 (en) Computerized information extraction from tables
CN112016546A (en) Text region positioning method and device
CN111428503B (en) Identification processing method and processing device for homonymous characters
JP2023501820A (en) Face parsing methods and related devices
CN112700529A (en) Method and system for generating three-dimensional model according to standard document
CN114066718A (en) Image style migration method and device, storage medium and terminal
US20170132484A1 (en) Two Step Mathematical Expression Search
CN111241326B (en) Image visual relationship indication positioning method based on attention pyramid graph network
CN114547077A (en) Intelligent processing system and method for basic government affair form data
CN113343981A (en) Visual feature enhanced character recognition method, device and equipment
CN113936287A (en) Table detection method and device based on artificial intelligence, electronic equipment and medium
CN115393872A (en) Method, device and equipment for training text classification model and storage medium
Slade et al. Automatic semantic and geometric enrichment of CityGML building models using HOG-based template matching
CN116704542A (en) Layer classification method, device, equipment and storage medium
CN116610304B (en) Page code generation method, device, equipment and storage medium
CN112819510A (en) Fashion trend prediction method, system and equipment based on clothing multi-attribute recognition
US20230023636A1 (en) Methods and systems for preparing unstructured data for statistical analysis using electronic characters
JP2024518695A (en) User input based distraction removal in media items - Patents.com
WO2022180705A1 (en) Information acquisition device, information acquisition method, and information acquisition program
CN112395834B (en) Brain graph generation method, device and equipment based on picture input and 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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230710

Address after: A4-04, Floor 4, Building A1, No. 1, Panpu Road, Country Garden Community, Beijiao Town, Shunde District, Foshan City, Guangdong Province, 528000 (residence declaration is only for office purposes)

Applicant after: Guangdong Bozhilin Software Technology Co.,Ltd.

Address before: 528000 a2-05, 2nd floor, building A1, 1 Panpu Road, Biguiyuan community, Beijiao Town, Shunde District, Foshan City, Guangdong Province (for office use only) (residence declaration)

Applicant before: GUANGDONG BOZHILIN ROBOT Co.,Ltd.