Device for automatically generating inspection data from size marks

By designing a device based on CAD ObjectARX, the dimension labeling information in InterCAD drawings is automatically extracted and marked, and the problems of manual intervention and error extraction in the prior art are solved, and the accuracy of verification and proofreading is improved.

CN119646909APending Publication Date: 2025-03-18TAIYUAN HEAVY IND
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411430587.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the prior art, the automatic extraction technology of the dimension marking information of InterCAD drawings is not yet mature, resulting in a large amount of manual intervention, which is prone to multiple labels, missing labels or incorrect extraction of information, affecting the subsequent verification and verification results.

Method used

A device developed based on CAD ObjectARX is designed. The information acquisition unit receives and processes CAD drawings, uses the preset extraction algorithm of the information extraction unit to extract the annotation information, calculates the enclosure box of the annotation text, and generates the bubble point position for the bubble number to be marked, and finally outputs the inspection data.

Benefits of technology

Automatic extraction of drawing dimension marking information and bubble marking are realized, manual intervention is reduced, error extraction and error marking problems are avoided, and verification and proofreading is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646909A_ABST
    Figure CN119646909A_ABST
Patent Text Reader

Abstract

The invention discloses a device for automatically generating inspection data from size marks, which is developed on the basis of CAD ObjectARX and comprises an information acquisition unit for receiving and processing input CAD drawings through an ObjectARX interface and acquiring various kinds of mark information; the information extraction unit is used for processing various types of obtained annotation information to obtain annotation type information, annotation text content information and annotation text position information; the annotation bounding box calculation unit is used for calculating and generating a bounding box corresponding to the annotation text according to the position information of the annotation text; the bubble labeling unit is used for calculating and generating bubble point positions corresponding to the bounding boxes according to the position information of the bounding boxes and labeling bubble numbers; and the data output unit is used for outputting and displaying the annotation type information, the annotation text content information and the corresponding bubble number annotation. According to the method, automatic extraction and bubble labeling of the drawing size labeling information can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer-aided design, and in particular relates to a device for automatically generating inspection data from dimensioning. Background Art

[0002] In the process of product and component design, a large number of CAD drawings are usually generated. In the process of product process design, a large number of drawing processing tasks are usually involved. In order to facilitate the inspection and proofreading of dimensioning information, it is usually necessary to pre-bubble and extract the dimensioning information such as dimension information, technical requirements, tolerance information, etc. in the drawings.

[0003] However, the automatic extraction technology of dimension annotation information for InterCAD drawings in dwg format is not yet mature. When actually processing dimension annotation information, manual annotation extraction is usually adopted, which requires a lot of manual intervention. Manual operation is prone to other problems such as multiple labeling, missing labels or incorrect extraction of information, which affects the subsequent inspection and proofreading results. Summary of the invention

[0004] In order to solve part or all of the technical problems existing in the above-mentioned prior art, the present invention provides a device for automatically generating inspection data from dimension annotation.

[0005] The technical solution of the present invention is as follows:

[0006] A device for automatically generating inspection data from dimension annotation is provided, the device is developed based on CAD ObjectARX, and includes:

[0007] The information acquisition unit is used to receive and process the input CAD drawings through the ObjectARX interface and obtain various annotation information in the CAD drawings;

[0008] An information extraction unit is used to process various types of annotation information obtained by using a preset extraction algorithm to obtain annotation type information, annotation text content information and annotation text position information;

[0009] A labeling bounding box calculation unit, used to calculate and generate a bounding box corresponding to the labeling text according to the labeling text position information;

[0010] The bubble marking unit is used to calculate and generate the bubble point position corresponding to each bounding box according to the position information of the bounding box corresponding to each marked text, and mark the bubble number on the bubble point position corresponding to each bounding box;

[0011] The data output unit is used to output and display the obtained annotation type information, annotation text content information, and corresponding bubble number annotation.

[0012] In some optional implementations, when the annotation type of the annotation information is a basic type with text as the main body, the information extraction unit processes the annotation information in the following manner:

[0013] Read multiple lines of text contained in the annotation information, parse the read text, remove the CAD font format characters, and obtain the original text value;

[0014] Determine the orientation of each line of text contained in the annotation information, take the orientation of the majority of text in the annotation information as the orientation of the annotation text in the annotation information, and determine the inclination angle of the annotation text, the inclination angle of the annotation text being the angle between the orientation of the annotation text and the X-axis direction preset in the CAD drawing;

[0015] Based on the preset coordinate system in the CAD drawing, the coordinate points of each text contained in the annotation information are determined.

[0016] In some optional implementations, when the annotation type of the annotation information is a technical requirement, the information extraction unit processes the annotation information in the following manner:

[0017] Based on the preset coordinate system in the CAD drawing, calculate and determine the coordinate points of the circumscribed rectangle of the technical requirements, and calculate and determine the length of a line of text in the technical requirements;

[0018] Use the formula "character width = height * aspect ratio" to calculate the character width;

[0019] Use the formula "Technical requirement length = number of characters * (character width + word spacing)" to calculate the technical requirement length;

[0020] Using the formula Calculate the number of rows occupied by technical requirements, Indicates rounding up operation;

[0021] According to the determined number of lines occupied by the technical requirements, each line of text contained in the technical requirements is read, each line of text read is parsed, and the CAD font format symbol is removed to obtain the original text value;

[0022] Determine the orientation of each line of text included in the technical requirements, take the orientation of the majority of text in the technical requirements as the orientation of the annotated text in the technical requirements, and determine the inclination angle of the annotated text, which is the angle between the orientation of the annotated text and the X-axis direction preset in the CAD drawing;

[0023] Among them, the height represents the height of the characters in the technical requirements of CAD annotation, the aspect ratio represents the aspect ratio of the characters in the technical requirements of CAD annotation, the character spacing represents the character spacing of the characters in the technical requirements of CAD annotation, and the number of characters represents the number of characters in the technical requirements of CAD annotation.

[0024] In some optional implementations, when the annotation type of the annotation information is a custom entity type, the information extraction unit processes the annotation information in the following manner:

[0025] Use OpenCV recognition algorithm to identify and detect custom entities in the annotation information to determine the specific type of custom entities;

[0026] Read multiple lines of text contained in the annotation information, parse the read text, remove the CAD font format characters, and obtain the original text value;

[0027] Determine the orientation of each line of text contained in the annotation information, take the orientation of the majority of text in the annotation information as the orientation of the annotation text in the annotation information, and determine the inclination angle of the annotation text, the inclination angle of the annotation text being the angle between the orientation of the annotation text and the X-axis direction preset in the CAD drawing;

[0028] Based on the preset coordinate system in the CAD drawing, the coordinate points of each text contained in the annotation information are determined.

[0029] In some optional implementations, the annotation bounding box calculation unit calculates the bounding box corresponding to the annotation text according to the annotation text position information in the following manner:

[0030] Determine the maximum point of the X axis, the minimum point of the X axis, the maximum point of the Y axis, and the minimum point of the Y axis in the position information of the labeled text;

[0031] According to the inclination angle of the labeled text, and the determined maximum point on the X axis, minimum point on the X axis, maximum point on the Y axis, and minimum point on the Y axis, a bounding box corresponding to the labeled text is determined.

[0032] In some optional implementations, according to the inclination angle of the annotated text, and the determined maximum point on the X axis, minimum point on the X axis, maximum point on the Y axis, and minimum point on the Y axis, the bounding box corresponding to the annotated text is determined in the following manner:

[0033] If the inclination angle of the annotation text is between [0,90), the minimum point on the Y axis is used as the lower left corner of the bounding box, the minimum point on the X axis is used as the upper left corner of the bounding box, and the coordinate point (X max , Y lb +(X max -X lb )*tan(a*π / 180)) as the lower right corner of the bounding box, with the coordinate point (X lt +(Y max -Y lt ) / tan(a*π / 180),Y max ) as the upper right corner of the bounding box;

[0034] If the tilt angle of the labeled text is between [90,180), the minimum point on the Y axis is used as the lower right corner of the bounding box, the maximum point on the X axis is used as the upper right corner of the bounding box, and the coordinate point (X min , Y min +(X rb -X min )*tan((180-a)*π / 180)) as the lower left corner of the bounding box, with the coordinate point (X max -(Y max -Y rt ) / tan((180-a)*π / 180), Y max ) as the upper left corner of the bounding box;

[0035] If the tilt angle of the labeled text is between [180,270), the maximum point on the X axis is used as the lower right corner of the bounding box, the maximum point on the Y axis is used as the upper right corner of the bounding box, and the coordinate point (X max -(Y rb -Y min ) / tan((a-180)*π / 180), Y min) As the lower left corner of the bounding box, take the coordinate point (X min , Y max -(X rt -X min )*tan((a-180)*π / 180)) as the upper left corner of the bounding box;

[0036] If the inclination angle of the labeled text is between [270,360), the minimum point on the X axis is used as the lower left corner of the bounding box, the maximum point on the Y axis is used as the upper left corner of the bounding box, and the coordinate point (X min +(Y lb -Y min ) / tan((360-a)*π / 180), Y min ) as the lower right corner of the bounding box, with coordinate point (X max , Y max -(X max -X lt )*tan((360-a)*π / 180)) as the upper right corner of the bounding box;

[0037] Among them, X max Indicates the X-axis coordinate value of the maximum point on the X-axis, Y lb Indicates the Y-axis coordinate value of the lower left corner, X lb represents the X-axis coordinate value of the lower left corner, a represents the inclination angle of the annotation text, tan represents the tangent trigonometric function operation, X lt Indicates the X-axis coordinate value of the upper left corner, Y maxYlt represents the Y-axis coordinate value of the upper left corner point, X min Indicates the X-axis coordinate value of the minimum point on the X-axis, Y min Indicates the Y-axis coordinate value of the minimum point on the Y-axis, X rb Indicates the X-axis coordinate value of the lower right corner, Y rt Indicates the Y-axis coordinate value of the upper right corner, Y rb Indicates the Y-axis coordinate value of the lower right corner, X rt Indicates the X-axis coordinate value of the upper right corner.

[0038] In some optional implementations, the bubble annotation unit calculates and generates the bubble point position corresponding to the bounding box according to the position coordinate information of the bounding box corresponding to the annotated text in the following manner:

[0039] Determine the tilt angle of the bounding box, and rotate the bounding box clockwise by the tilt angle so that the rotated bounding box is parallel to the X-axis;

[0040] The position point located outside the left midpoint of the rotated bounding box and at a preset distance from the left midpoint in the X-axis direction is used as the left bubble point of the bounding box, the position point located outside the right midpoint of the rotated bounding box and at a preset distance from the right midpoint in the X-axis direction is used as the right bubble point of the bounding box, the position point located outside the upper midpoint of the rotated bounding box and at a preset distance from the upper midpoint in the Y-axis direction is used as the upper bubble point of the bounding box, and the position point located outside the lower midpoint of the rotated bounding box and at a preset distance from the lower midpoint in the Y-axis direction is used as the lower bubble point of the bounding box, and four bubble points of the bounding box are generated.

[0041] The line connecting the left midpoint of the bounding box and the left bubble point is used as the left lead line, the line connecting the right midpoint of the bounding box and the right bubble point is used as the right lead line, the line connecting the upper midpoint of the bounding box and the upper bubble point is used as the upper lead line, and the line connecting the lower midpoint of the bounding box and the lower bubble point is used as the lower lead line to generate four bubble leads of the bounding box;

[0042] Rotate the bounding box and its corresponding four bubble points and four bubble leaders counterclockwise by the tilt angle.

[0043] The main advantages of the technical solution of the present invention are as follows:

[0044] The device for automatically generating inspection data from dimension annotations of the present invention receives and extracts drawing information by utilizing the ObjectARX interface, performs feature extraction with a preset extraction algorithm for each type of annotation feature, generates corresponding bounding boxes and bubble numbers based on the extracted annotation information, and outputs and displays the obtained information and the generated bubble numbers accordingly, thereby realizing automatic extraction and bubble annotation of drawing dimension annotation information, reducing manual intervention, avoiding erroneous extraction and erroneous annotation problems, facilitating subsequent inspection and proofreading, and ensuring inspection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The drawings described herein are used to provide a further understanding of the embodiments of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0046] Figure 1 A schematic diagram of the structure of a device for automatically generating inspection data from dimension annotations provided by an embodiment of the present invention;

[0047] Figure 2 A schematic diagram of the bubble point position calculation principle of a bounding box provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0049] The technical solution provided by the embodiments of the present invention is described in detail below with reference to the accompanying drawings.

[0050] refer to Figure 1 The embodiment of the present invention provides a device for automatically generating inspection data from dimension annotation, the device is developed based on CAD ObjectARX, and includes:

[0051] The information acquisition unit 1 is used to receive and process the input CAD drawings through the ObjectARX interface, and obtain various annotation information in the CAD drawings;

[0052] The information extraction unit 2 is used to process the acquired various annotation information using a preset extraction algorithm to obtain annotation type information, annotation text content information and annotation text position information;

[0053] The annotation bounding box calculation unit 3 is used to calculate and generate a bounding box corresponding to the annotation text according to the annotation text position information;

[0054] The bubble marking unit 4 is used to calculate and generate the bubble point position corresponding to each bounding box according to the position information of the bounding box corresponding to each marked text, and mark the bubble number on the bubble point position corresponding to each bounding box;

[0055] The data output unit 5 is used to output and display the obtained annotation type information, annotation text content information, and corresponding bubble number annotation.

[0056] ObjectARX (Object AutoCAD Runtime eXtension) described in the embodiment of the present invention is a C++ object-oriented API for developing AutoCAD applications. It allows developers to create powerful and efficient AutoCAD plug-ins and extensions. ObjectARX provides direct access and control to AutoCAD core functions, allowing developers to customize AutoCAD's behavior and user interface, add new commands, operate graphics databases, and handle complex geometric calculations and graphics operations.

[0057] In the embodiment of the present invention, the received drawing entity is exploded through the ObjectARX interface, so that various annotation information including line symbols such as points, lines, circles and various text information under the drawing entity can be obtained.

[0058] The device for automatically generating inspection data for dimension annotation provided by the embodiment of the present invention receives and extracts drawing information by utilizing the ObjectARX interface, performs feature extraction for each type of annotation feature using a preset extraction algorithm, generates corresponding bounding boxes and bubble numbers based on the extracted annotation information, and outputs and displays the obtained information and the generated bubble numbers accordingly. This can realize automatic extraction and bubble annotation of drawing dimension annotation information, reduce manual intervention, avoid erroneous extraction and erroneous annotation problems, facilitate subsequent inspection and proofreading, and ensure inspection accuracy.

[0059] Furthermore, it is considered that the CAD drawings include different types of annotation information, such as basic types with text as the main body, annotation types containing custom entities, and technical requirements. Basic types with text as the main body include linear dimensions, angles, diameters, radii, lengths, and other basic types with text as the main body, and custom entities include custom entity symbols such as post-weld processing symbols. In the embodiment of the present invention, for different types of annotation information, different extraction algorithms are set in the information extraction unit 2 to process various types of annotation information, thereby obtaining annotation type information, annotation text content information, and annotation text position information.

[0060] Further, in an optional implementation of the embodiment of the present invention, when the annotation type of the annotation information is a basic type with text as the main body, the information extraction unit 2 processes the annotation information in the following manner:

[0061] Read multiple lines of text contained in the annotation information, parse the read text, remove the CAD font format characters, and obtain the original text value;

[0062] Determine the orientation of each line of text contained in the annotation information, take the orientation of the majority of text in the annotation information as the orientation of the annotation text in the annotation information, and determine the inclination angle of the annotation text, the inclination angle of the annotation text being the angle between the orientation of the annotation text and the X-axis direction preset in the CAD drawing;

[0063] Based on the preset coordinate system in the CAD drawing, the coordinate points of each text contained in the annotation information are determined.

[0064] In the embodiment of the present invention, for a type of annotation with text as the main body, the information extraction unit 2 extracts and processes the annotation information in the above-mentioned setting manner to obtain corresponding annotation type information, annotation text content information and annotation text position information.

[0065] Further, in an optional implementation of the embodiment of the present invention, when the annotation type of the annotation information is a technical requirement, the information extraction unit 2 processes the annotation information in the following manner:

[0066] Based on the preset coordinate system in the CAD drawing, calculate and determine the coordinate points of the circumscribed rectangle of the technical requirements, and calculate and determine the length of a line of text in the technical requirements;

[0067] Use the formula "character width = height * aspect ratio" to calculate the character width;

[0068] Use the formula "Technical requirement length = number of characters * (character width + word spacing)" to calculate the technical requirement length;

[0069] Using the formula Calculate the number of rows occupied by technical requirements, Indicates rounding up operation;

[0070] According to the determined number of lines occupied by the technical requirements, each line of text contained in the technical requirements is read, each line of text read is parsed, and the CAD font format symbol is removed to obtain the original text value;

[0071] Determine the orientation of each line of text included in the technical requirements, take the orientation of the majority of text in the technical requirements as the orientation of the annotated text in the technical requirements, and determine the inclination angle of the annotated text, which is the angle between the orientation of the annotated text and the X-axis direction preset in the CAD drawing;

[0072] Among them, the height represents the height of the characters in the technical requirements of CAD annotation, the aspect ratio represents the aspect ratio of the characters in the technical requirements of CAD annotation, the character spacing represents the character spacing of the characters in the technical requirements of CAD annotation, and the number of characters represents the number of characters in the technical requirements of CAD annotation.

[0073] In the embodiment of the present invention, according to the technical requirements, the information extraction unit 2 extracts and processes the annotation information in the above-mentioned setting manner, and can obtain corresponding annotation type information, annotation text content information and annotation text position information.

[0074] Further, in an optional implementation of the embodiment of the present invention, when the annotation type of the annotation information is a custom entity type, the information extraction unit 2 processes the annotation information in the following manner:

[0075] Use OpenCV recognition algorithm to identify and detect custom entities in the annotation information to determine the specific type of custom entities;

[0076] Read multiple lines of text contained in the annotation information, parse the read text, remove the CAD font format characters, and obtain the original text value;

[0077] Determine the orientation of each line of text contained in the annotation information, take the orientation of the majority of text in the annotation information as the orientation of the annotation text in the annotation information, and determine the inclination angle of the annotation text, the inclination angle of the annotation text being the angle between the orientation of the annotation text and the X-axis direction preset in the CAD drawing;

[0078] Based on the preset coordinate system in the CAD drawing, the coordinate points of each text contained in the annotation information are determined.

[0079] Since the custom entity type cannot be directly obtained through the ObjectARX interface, in the embodiment of the present invention, the recognition algorithm is written using OpenCV to recognize and detect the custom entity type. OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library initiated and supported by Intel. It provides a wealth of image processing and computer vision algorithms, covering a wide range of fields from basic image processing operations to complex machine learning algorithms.

[0080] In the embodiment of the present invention, different OpenCV recognition algorithms are set for different custom entities. For example, for a post-weld processing symbol, a square image is cropped according to the position of the triangle coordinate points, the image is read and converted into a grayscale image, the outline of the triangle is found using Canny edge detection, the inner and outer areas of the triangle are determined using the outline, the color averages of the inner and outer areas are calculated and compared, and if the comparison result is within the threshold range, it is considered to be a post-weld processing symbol.

[0081] In the embodiment of the present invention, for the user-defined entity type, the information extraction unit 2 extracts and processes the annotation information in the above-mentioned setting manner, and can obtain corresponding annotation type information, annotation text content information and annotation text position information.

[0082] Further, in an optional implementation of the embodiment of the present invention, the annotation bounding box calculation unit 3 calculates the bounding box corresponding to the annotation text according to the annotation text position information in the following manner:

[0083] Determine the maximum point of the X axis, the minimum point of the X axis, the maximum point of the Y axis, and the minimum point of the Y axis in the position information of the labeled text;

[0084] According to the inclination angle of the labeled text, and the determined maximum point on the X axis, minimum point on the X axis, maximum point on the Y axis, and minimum point on the Y axis, a bounding box corresponding to the labeled text is determined.

[0085] Further, in the embodiment of the present invention, the annotation bounding box calculation unit 3 determines the bounding box corresponding to the annotation text in the following manner according to the inclination angle of the annotation text and the determined maximum point on the X axis, minimum point on the X axis, maximum point on the Y axis, and minimum point on the Y axis:

[0086] If the inclination angle of the annotation text is between [0,90), the minimum point on the Y axis is used as the lower left corner of the bounding box, the minimum point on the X axis is used as the upper left corner of the bounding box, and the coordinate point (X max , Y lb +(X max -X lb )*tan(a*π / 180)) as the lower right corner of the bounding box, with the coordinate point (X lt +(Y max -Y lt ) / tan(a*π / 180),Y max ) as the upper right corner of the bounding box;

[0087] If the tilt angle of the labeled text is between [90,180), the minimum point on the Y axis is used as the lower right corner of the bounding box, the maximum point on the X axis is used as the upper right corner of the bounding box, and the coordinate point (X min , Y min +(X rb -Xmin )*tan((180-a)*π / 180)) as the lower left corner of the bounding box, with the coordinate point (X max -(Y max -Y rt ) / tan((180-a)*π / 180), Y max ) as the upper left corner of the bounding box;

[0088] If the tilt angle of the labeled text is between [180,270), the maximum point on the X axis is used as the lower right corner of the bounding box, the maximum point on the Y axis is used as the upper right corner of the bounding box, and the coordinate point (X max -(Y rb -Y min) / tan((a-180)*π / 180), Y min ) as the lower left corner of the bounding box, with coordinate point (X min , Y max -(X rt -X min )*tan((a-180)*π / 180)) as the upper left corner of the bounding box;

[0089] If the inclination angle of the labeled text is between [270,360), the minimum point on the X axis is used as the lower left corner of the bounding box, the maximum point on the Y axis is used as the upper left corner of the bounding box, and the coordinate point (X min +(Y lb -Y min ) / tan((360-a)*π / 180), Y min ) as the lower right corner of the bounding box, with coordinate point (X max , Y max -(X max -X lt )*tan((360-a)*π / 180)) as the upper right corner of the bounding box;

[0090] Among them, X max Indicates the X-axis coordinate value of the maximum point on the X-axis, Y lb Indicates the Y-axis coordinate value of the lower left corner, X lb represents the X-axis coordinate value of the lower left corner, a represents the inclination angle of the annotation text, tan represents the tangent trigonometric function operation, X lt Indicates the X-axis coordinate value of the upper left corner, Y max Indicates the Y-axis coordinate value of the maximum point on the Y-axis, Y lt Indicates the Y-axis coordinate value of the upper left corner, X min Indicates the X-axis coordinate value of the minimum point on the X-axis, Y min Indicates the Y-axis coordinate value of the minimum point on the Y-axis, X rb Indicates the X-axis coordinate value of the lower right corner, Yrt Indicates the Y-axis coordinate value of the upper right corner, Y rb Indicates the Y-axis coordinate value of the lower right corner, X rt Indicates the X-axis coordinate value of the upper right corner.

[0091] In the embodiment of the present invention, the above method can be used to construct a bounding box that completely covers the annotation text, which is convenient for subsequent inspection and proofreading of various dimension annotation information.

[0092] refer to Figure 2 Further, in an optional implementation of the embodiment of the present invention, the bubble annotation unit 4 calculates and generates the bubble point position corresponding to the bounding box according to the position coordinate information of the bounding box corresponding to the annotated text in the following manner:

[0093] Determine the tilt angle of the bounding box, and rotate the bounding box clockwise by the tilt angle so that the rotated bounding box is parallel to the X-axis;

[0094] The position point located outside the left midpoint of the rotated bounding box and at a preset distance from the left midpoint in the X-axis direction is used as the left bubble point of the bounding box, the position point located outside the right midpoint of the rotated bounding box and at a preset distance from the right midpoint in the X-axis direction is used as the right bubble point of the bounding box, the position point located outside the upper midpoint of the rotated bounding box and at a preset distance from the upper midpoint in the Y-axis direction is used as the upper bubble point of the bounding box, and the position point located outside the lower midpoint of the rotated bounding box and at a preset distance from the lower midpoint in the Y-axis direction is used as the lower bubble point of the bounding box, and four bubble points of the bounding box are generated.

[0095] The line connecting the left midpoint of the bounding box and the left bubble point is used as the left lead line, the line connecting the right midpoint of the bounding box and the right bubble point is used as the right lead line, the line connecting the upper midpoint of the bounding box and the upper bubble point is used as the upper lead line, and the line connecting the lower midpoint of the bounding box and the lower bubble point is used as the lower lead line to generate four bubble leads of the bounding box;

[0096] Rotate the bounding box and its corresponding four bubble points and four bubble leaders counterclockwise by the tilt angle.

[0097] In the embodiment of the present invention, in order to facilitate processing and implementation, when the bounding box and the bounding box and its corresponding bubble points and bubble leads are rotated, the bounding box, bubble points and bubble leads are processed by using a rotation matrix. Specifically, when the bounding box needs to be rotated clockwise by a tilt angle, all coordinate points constituting the bounding box are multiplied by a first rotation matrix corresponding to the tilt angle, and when the bounding box and its corresponding bubble points and bubble leads need to be rotated counterclockwise by a tilt angle, all coordinate points constituting the bounding box and its corresponding bubble points and bubble leads are multiplied by a second rotation matrix corresponding to the tilt angle.

[0098] Specifically, setting the tilt angle to θ, the first rotation matrix is ​​expressed as: The second rotation matrix is ​​expressed as:

[0099] Furthermore, in an embodiment of the present invention, the data output unit 5 outputs the obtained annotation type information, annotation text content information, and corresponding bubble number annotations line by line to a TXT file, and displays them using an open font to facilitate subsequent inspection and proofreading.

[0100] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In addition, "front", "back", "left", "right", "upper" and "lower" in this article are all referenced to the placement state shown in the accompanying drawings.

[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A device for automatically generating inspection data from dimension annotations, characterized in that: The device is developed based on CADObjectARX and includes: The information acquisition unit is used to receive and process the input CAD drawings through the ObjectARX interface and obtain various annotation information in the CAD drawings; An information extraction unit is used to process various types of annotation information obtained by using a preset extraction algorithm to obtain annotation type information, annotation text content information and annotation text position information; A labeling bounding box calculation unit, used to calculate and generate a bounding box corresponding to the labeling text according to the labeling text position information; The bubble marking unit is used to calculate and generate the bubble point position corresponding to each bounding box according to the position information of the bounding box corresponding to each marked text, and mark the bubble number on the bubble point position corresponding to each bounding box; The data output unit is used to output and display the obtained annotation type information, annotation text content information, and corresponding bubble number annotation.

2. The device for automatically generating inspection data from dimension annotation according to claim 1, characterized in that: When the annotation type of the annotation information is a basic type with text as the main body, the information extraction unit processes the annotation information in the following manner: Read multiple lines of text contained in the annotation information, parse the read text, remove the CAD font format characters, and obtain the original text value; Determine the orientation of each line of text contained in the annotation information, take the orientation of the majority of text in the annotation information as the orientation of the annotation text in the annotation information, and determine the inclination angle of the annotation text, the inclination angle of the annotation text being the angle between the orientation of the annotation text and the X-axis direction preset in the CAD drawing; Based on the preset coordinate system in the CAD drawing, the coordinate points of each text contained in the annotation information are determined.

3. The device for automatically generating inspection data from dimension annotation according to claim 1, characterized in that: When the annotation type of the annotation information is a technical requirement, the information extraction unit processes the annotation information in the following manner: Based on the preset coordinate system in the CAD drawing, calculate and determine the coordinate points of the circumscribed rectangle of the technical requirements, and calculate and determine the length of a line of text in the technical requirements; Use the formula "character width = height * aspect ratio" to calculate the character width; Use the formula "Technical requirement length = number of characters * (character width + word spacing)" to calculate the technical requirement length; Using the formula Calculate the number of rows occupied by technical requirements, Indicates rounding up operation; According to the determined number of lines occupied by the technical requirements, each line of text contained in the technical requirements is read, each line of text read is parsed, and the CAD font format symbol is removed to obtain the original text value; Determine the orientation of each line of text included in the technical requirements, take the orientation of the majority of text in the technical requirements as the orientation of the annotated text in the technical requirements, and determine the inclination angle of the annotated text, which is the angle between the orientation of the annotated text and the X-axis direction preset in the CAD drawing; Among them, the height represents the height of the characters in the technical requirements of CAD annotation, the aspect ratio represents the aspect ratio of the characters in the technical requirements of CAD annotation, the character spacing represents the character spacing of the characters in the technical requirements of CAD annotation, and the number of characters represents the number of characters in the technical requirements of CAD annotation.

4. The device for automatically generating inspection data from dimension annotation according to claim 1, characterized in that: When the annotation type of the annotation information is a custom entity type, the information extraction unit processes the annotation information in the following manner: Use OpenCV recognition algorithm to identify and detect custom entities in the annotation information to determine the specific type of custom entities; Read multiple lines of text contained in the annotation information, parse the read text, remove the CAD font format characters, and obtain the original text value; Determine the orientation of each line of text contained in the annotation information, take the orientation of the majority of text in the annotation information as the orientation of the annotation text in the annotation information, and determine the inclination angle of the annotation text, the inclination angle of the annotation text being the angle between the orientation of the annotation text and the X-axis direction preset in the CAD drawing; Based on the preset coordinate system in the CAD drawing, the coordinate points of each text contained in the annotation information are determined.

5. The device for automatically generating inspection data from dimension annotation according to claim 1, characterized in that: The annotation bounding box calculation unit calculates the bounding box corresponding to the annotation text according to the annotation text position information in the following manner: Determine the maximum point of the X axis, the minimum point of the X axis, the maximum point of the Y axis, and the minimum point of the Y axis in the position information of the labeled text; According to the inclination angle of the labeled text, and the determined maximum point on the X axis, minimum point on the X axis, maximum point on the Y axis, and minimum point on the Y axis, a bounding box corresponding to the labeled text is determined.

6. The device for automatically generating inspection data from dimension annotation according to claim 5, characterized in that: According to the inclination angle of the labeled text, and the determined maximum point on the X axis, minimum point on the X axis, maximum point on the Y axis, and minimum point on the Y axis, the bounding box corresponding to the labeled text is determined in the following way: If the inclination angle of the annotation text is between [0,90), the minimum point on the Y axis is used as the lower left corner of the bounding box, the minimum point on the X axis is used as the upper left corner of the bounding box, and the coordinate point (X max , Y lb +(X max -X lb )*tan(a*π / 180)) as the lower right corner of the bounding box, with the coordinate point (X lt +(Y max -Y lt ) / tan(a*π / 180),Y max ) as the upper right corner of the bounding box; If the tilt angle of the labeled text is between [90,180), the minimum point on the Y axis is used as the lower right corner of the bounding box, the maximum point on the X axis is used as the upper right corner of the bounding box, and the coordinate point (X min , Y min +(X rb -X min )*tan((180-a)*π / 180)) as the lower left corner of the bounding box, with the coordinate point (X max -(Y max -Y rt ) / tan((180-a)*π / 180), Y max ) as the upper left corner of the bounding box; If the tilt angle of the labeled text is between [180,270), the maximum point on the X axis is used as the lower right corner of the bounding box, the maximum point on the Y axis is used as the upper right corner of the bounding box, and the coordinate point (X max -(Y rb -Y min ) / tan((a-180)*π / 180), Y min ) as the lower left corner of the bounding box, with coordinate point (X min , Y max -(X rt -X min )*tan((a-180)*π / 180)) as the upper left corner of the bounding box; If the inclination angle of the labeled text is between [270,360), the minimum point on the X axis is used as the lower left corner of the bounding box, the maximum point on the Y axis is used as the upper left corner of the bounding box, and the coordinate point (X min +(Y lb -Y min ) / tan((360-a)*π / 180), Y min ) as the lower right corner of the bounding box, with coordinate point (X max , Y max -(X max -X lt )*tan((360-a)*π / 180)) as the upper right corner of the bounding box; Among them, X max Indicates the X-axis coordinate value of the maximum point on the X-axis, Y lb Indicates the Y-axis coordinate value of the lower left corner, X lb represents the X-axis coordinate value of the lower left corner, a represents the inclination angle of the annotation text, tan represents the tangent trigonometric function operation, X lt Indicates the X-axis coordinate value of the upper left corner, Y max Indicates the Y-axis coordinate value of the maximum point on the Y-axis, Y lt Indicates the Y-axis coordinate value of the upper left corner, X min Indicates the X-axis coordinate value of the minimum point on the X-axis, Y min Indicates the Y-axis coordinate value of the minimum point on the Y-axis, X rb Indicates the X-axis coordinate value of the lower right corner, Y rt Indicates the Y-axis coordinate value of the upper right corner, Y rb Indicates the Y-axis coordinate value of the lower right corner, X rt Indicates the X-axis coordinate value of the upper right corner.

7. The device for automatically generating inspection data from dimension annotation according to claim 6, characterized in that: The bubble annotation unit calculates and generates the bubble point position corresponding to the bounding box according to the position coordinate information of the bounding box corresponding to the annotated text in the following manner: Determine the tilt angle of the bounding box, and rotate the bounding box clockwise by the tilt angle so that the rotated bounding box is parallel to the X-axis; The position point located outside the left midpoint of the rotated bounding box and at a preset distance from the left midpoint in the X-axis direction is used as the left bubble point of the bounding box, the position point located outside the right midpoint of the rotated bounding box and at a preset distance from the right midpoint in the X-axis direction is used as the right bubble point of the bounding box, the position point located outside the upper midpoint of the rotated bounding box and at a preset distance from the upper midpoint in the Y-axis direction is used as the upper bubble point of the bounding box, and the position point located outside the lower midpoint of the rotated bounding box and at a preset distance from the lower midpoint in the Y-axis direction is used as the lower bubble point of the bounding box, and four bubble points of the bounding box are generated. The line connecting the left midpoint of the bounding box and the left bubble point is used as the left lead line, the line connecting the right midpoint of the bounding box and the right bubble point is used as the right lead line, the line connecting the upper midpoint of the bounding box and the upper bubble point is used as the upper lead line, and the line connecting the lower midpoint of the bounding box and the lower bubble point is used as the lower lead line to generate four bubble leads of the bounding box; Rotate the bounding box and its corresponding four bubble points and four bubble leaders counterclockwise by the tilt angle.