A drawing annotation analysis method, system and storage medium
By identifying and segmenting the annotation units in the drawing, standard analysis and position optimization are carried out, the problem of unreasonable distribution of the annotation position of the drawing is solved, the uniform distribution of the annotation information and the eye-catchingness of manual annotation are achieved, and the readability and labeling efficiency of the drawing are improved.
Patent Information
- Application Number
- CN202411718100.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In the prior art, the distribution of drawing label locations is unreasonable, manual labeling and automatic labeling are mixed, and automatic labeling cannot fully consider the manual labeling position and its influence, resulting in uneven overall labeling layout.
By identifying and dividing the annotation units in the drawing, performing annotation standard analysis, dividing manual and automatic annotation units, and optimizing the annotation position in the annotation space to improve uniformity and the eye-catchingness of manual annotation.
The reasonable distribution of labeling information is achieved, the problem of excessive concentration or dispersion of information is reduced, the overall readability of the drawings and the eye-catchingness of manual labeling is improved, and the labeling efficiency and the accuracy of results are ensured.
Smart Images

Figure CN119206764B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of drawing processing, and in particular to a drawing annotation and parsing method, system and storage medium. Background Art
[0002] In modern engineering design and manufacturing, drawing annotation is one of the indispensable links, which usually involves the annotation of key dimensions, technical requirements and symbols in the design drawings. These annotation information plays a vital role in product manufacturing, quality control, and subsequent assembly and inspection. However, the existing drawing annotation methods mainly rely on manual operation. Although automated tools have been developed, there are still many problems. First, manual annotation is inefficient and error-prone. In complex engineering drawings, there is a lot of annotation information, manual annotation takes a lot of time, and it is easy to omit or make mistakes. Especially in large-scale production or complex product design, the limitations of manual annotation become more obvious. Secondly, automatic annotation technology has the problem of uneven layout. Although the existing automatic annotation methods can realize the automation of some annotations, their layout is usually not reasonable enough, resulting in dense or sparse annotation information, affecting the overall readability of the drawings. In addition, the automatic annotation system often cannot adjust the annotation position according to the actual situation in the drawing, which makes some manual annotations and automatic annotations have coordination problems, resulting in manual annotations not being eye-catching and easy to be ignored. Finally, there is a lack of means to optimize the annotation position. In the existing technology, there are few global optimization mechanisms for the layout of drawing annotations, which cannot effectively improve the uniformity of annotation positions and the eye-catchingness of manual annotations. This not only affects the rapid understanding of drawings by engineers, but may also lead to misunderstandings and operational errors in subsequent manufacturing and assembly. Summary of the invention
[0003] The present application provides a drawing annotation parsing method, system and storage medium, aiming to solve the technical problem that manual annotations are mixed with other annotations due to unreasonable distribution of annotation positions, and automatic annotations cannot fully consider the positions of manual annotations and their influence, resulting in uneven overall annotation layout.
[0004] The first aspect disclosed in the present application provides a drawing annotation analysis method, the method comprising: receiving a drawing to be annotated and analyzed, identifying and segmenting the annotation units of the drawing to obtain a plurality of annotation units; performing an annotation standardization analysis on the plurality of annotation units to obtain a plurality of annotation standard coefficients, and dividing the plurality of annotation units according to the plurality of annotation standard coefficients to obtain a plurality of manual annotation units and a plurality of automatic annotation units; obtaining an annotation space of the drawing, and optimizing the annotation positions of the plurality of manual annotation units and the plurality of automatic annotation units within the annotation space for the purpose of improving the uniformity of all annotation positions and the conspicuousness of the manual annotation positions to obtain a plurality of optimal manual annotation positions and a plurality of optimal automatic annotation positions; displaying the plurality of optimal manual annotation positions, receiving a plurality of manual annotation information input by a user according to the plurality of optimal manual annotation positions, and automatically annotating according to the plurality of optimal automatic annotation positions to obtain a plurality of automatic annotation information, and obtaining a drawing annotation analysis result.
[0005] The second aspect disclosed in the present application provides a drawing annotation analysis system, which is used for the above-mentioned drawing annotation analysis method, and the system includes: an annotation unit identification and segmentation module: the annotation unit identification and segmentation module is used to receive drawings to be annotated and analyzed, identify and segment the annotation units of the drawings, and obtain multiple annotation units; an annotation standardization analysis module: the annotation standardization analysis module is used to perform annotation standardization analysis on the multiple annotation units, obtain multiple annotation standard coefficients, and obtain multiple manual annotation units and multiple automatic annotation units according to the multiple annotation standard coefficients; an annotation position optimization module: the annotation position optimization module is used to obtain the annotation space of the drawing, and in the annotation space, with the purpose of improving the uniformity of all annotation positions and the conspicuousness of the manual annotation positions, the annotation positions of the multiple manual annotation units and the multiple automatic annotation units are optimized to obtain multiple optimal manual annotation positions and multiple optimal automatic annotation positions; an annotation analysis result acquisition module: the annotation analysis result acquisition module is used to display the multiple optimal manual annotation positions, receive multiple manual annotation information input by the user according to the multiple optimal manual annotation positions, and automatically annotate according to the multiple optimal automatic annotation positions to obtain multiple automatic annotation information, and obtain the drawing annotation analysis result.
[0006] According to a third aspect disclosed in the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any step of the first aspect disclosed in the present application is implemented.
[0007] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0008] First, the drawings that need to be annotated and parsed are received. By identifying and segmenting the annotated units in the drawings, multiple independent annotated units are generated. These annotated units are then analyzed to determine the annotation standard of each unit, and the corresponding annotation standard coefficients are calculated and obtained. Based on these coefficients, the annotation units are divided into manual annotation units and automatic annotation units. In the annotation optimization stage, the annotation space of the drawings is obtained, and the annotation positions of the manual and automatic annotation units are optimized with the goal of improving the uniformity of the annotation positions and enhancing the conspicuousness of the manual annotation positions, thereby generating multiple optimal manual annotation and automatic annotation positions. This process makes the distribution of annotation information more reasonable through effective annotation position planning, reduces the phenomenon of excessive concentration or dispersion of information, and improves the overall readability of the drawings. After the optimization is completed, the optimal manual annotation position is displayed, and the user is allowed to enter the corresponding manual annotation information. At the same time, the corresponding annotation information will be automatically generated at the optimal automatic annotation position. The whole process not only ensures the accuracy of the annotation, but also significantly improves the annotation efficiency and the rationality of the annotation layout, and finally generates an optimized drawing annotation parsing result. Through this process, the drawing annotation information can be more eye-catching and easy to identify, and the coordination between manual and automatic annotation is improved, avoiding the confusion and unevenness existing in traditional annotation methods.
[0009] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 A schematic diagram of a drawing annotation analysis method provided in an embodiment of the present application;
[0011] Figure 2 A schematic diagram of the structure of a drawing annotation and parsing system provided in an embodiment of the present application.
[0012] Explanation of the reference numerals: labeling unit recognition and segmentation module 1, labeling standardization analysis module 2, labeling position optimization module 3, labeling analysis result acquisition module 4. DETAILED DESCRIPTION
[0013] The embodiments of the present application provide a drawing annotation parsing method, system and storage medium to solve the technical problem that manual annotations are mixed with other annotations due to unreasonable distribution of annotation positions, and automatic annotations cannot fully consider the positions of manual annotations and their influence, resulting in uneven overall annotation layout.
[0014] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application will be specifically introduced below in conjunction with the accompanying drawings of the specification. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0015] Embodiment 1, as Figure 1 As shown, an embodiment of the present application provides a drawing annotation parsing method, the method comprising:
[0016] A drawing to be annotated and parsed is received, and annotated units are identified and segmented on the drawing to obtain a plurality of annotated units.
[0017] In one embodiment, the system terminal receives a drawing file that needs to be annotated and parsed, which is input by a user. The drawings can be various types of engineering drawings, such as architectural design drawings, interior design drawings, etc. These drawings usually contain multiple parts that need to be annotated, such as areas for area annotation, wall length annotation, etc. After receiving the drawings, the system terminal inputs the drawings into a pre-trained drawing annotation unit segmenter for processing, thereby generating multiple annotation units. For example, in an interior design drawing, the drawing annotation unit segmenter will automatically identify and segment the area units used to annotate the room area, or the wall units used to annotate the wall length. For areas with different annotation requirements, the segmenter will identify them as independent annotation units. Through the pre-trained annotation unit segmenter, the annotation unit recognition and segmentation in the drawings can be completed efficiently and accurately, thereby providing a basis for subsequent annotation operations.
[0018] Further, receiving a drawing to be annotated and parsed, identifying and segmenting the annotation units of the drawing to obtain a plurality of annotation units, the method includes:
[0019] Receive a drawing to be annotated and parsed input by a user; input the drawing into a pre-trained and verified drawing annotation unit segmentor, perform annotation unit recognition and segmentation, and obtain an annotation unit segmentation result, wherein the annotation unit segmentation result includes multiple annotation units.
[0020] Preferably, the system terminal receives the drawing file uploaded by the user that needs to be annotated and parsed, and inputs the drawing into a drawing annotation unit segmentor that has been pre-trained and verified. This drawing annotation unit segmentor is built based on machine learning technologies such as convolutional neural networks (CNNs). It has been learned through a large amount of historical annotation data and has the ability to identify and segment different annotation units in the drawings. After the drawing is input into the drawing annotation unit segmentor, it will automatically process the drawing, identify the various annotation areas in the drawing, and divide it into multiple independent annotation units, which will provide the basis for subsequent annotation operations.
[0021] Furthermore, the training and verification process of the drawing annotation unit segmenter includes:
[0022] According to the historical annotation data of similar drawings, a set of sample drawings is collected, and the sample annotation units in each sample drawing are segmented and marked to obtain a set of sample annotation unit segmentation results; a convolutional neural network is used to construct the network structure of a drawing annotation unit segmentor; the sample drawing set and the sample annotation unit segmentation result set are used as supervised training data and verification data to perform supervised training and verification on the drawing annotation unit segmentor until the verification convergence requirements are met to obtain a drawing annotation unit segmentor.
[0023] Optionally, the system terminal collects a large number of representative drawings from the historical annotation data of similar drawings. These drawings cover different design types and annotation methods, such as architectural design drawings, interior design drawings, etc. These drawings will constitute the sample drawing set required for training the model. In the sample drawing set, the system terminal manually or semi-automatically segments and marks the annotation units of each drawing, and clearly divides the different annotation areas in the drawings through manual or auxiliary tools, such as room area, wall length, etc. Each annotation unit will be accurately segmented and annotated to form a set of sample annotation unit segmentation results, which represent the clear annotation unit boundaries and classifications in each sample drawing.
[0024] When constructing the drawing annotation unit segmenter, a convolutional neural network (CNN) is used as the core algorithm model. CNN has powerful image feature extraction capabilities and can handle complex annotation information in drawings. The system terminal first adjusts the input drawing image to a uniform size (e.g., 512x512 pixels) to adapt to the input format of CNN. The convolution layer uses multiple convolution kernels (usually 3x3 or 5x5 in size) to extract different features, such as edges, lines, and shapes in the drawing, and uses the Max-Pooling layer to reduce the size of the feature map, reduce computational complexity, and retain important features. After the convolution and pooling layers, a fully connected layer is added to convert the extracted features into a fixed-length feature vector for the classification and segmentation of the annotation unit. The output layer uses the Softmax function for multi-category classification to determine which annotation unit category each pixel belongs to. To ensure the nonlinear expression ability of the model, the ReLU activation function is used in the network structure, combined with BatchNormalization and Dropout techniques to prevent overfitting.
[0025] During the training process, the system terminal uses the sample drawing set and the segmentation results of the labeled unit as input data and labels. The first step of training is to initialize the weights and bias parameters of the convolution kernel and the fully connected layer, and use the Xavier or He initialization method to ensure that the initial state of the model is good. Subsequently, the sample drawings are input into the model. After passing through the convolution layer, the pooling layer, and the fully connected layer, the model outputs the category probability of each pixel. This output result is compared with the actual segmentation result of the labeled unit (label data) to calculate the error. Since this is a multi-category classification problem, the system terminal selects the cross-entropy loss function to measure the gap between the model prediction result and the true label, and calculates the loss value between the prediction result and the true label. After that, the gradient of the loss value to each layer parameter is calculated through the back-propagation algorithm, and the Adam optimizer is used for gradient update to optimize the weight and bias parameters so that the loss function value gradually decreases. After each training cycle (epoch), the model is evaluated using the validation data set. The cross-entropy loss on the validation data set data is used to measure the performance of the model on unseen data to ensure that the model does not overfit the training data set. If the loss value on the validation dataset continues to decrease, it means that the model performs well in generalization ability; if the loss value on the validation dataset increases, it indicates that the model needs to adjust the structure or training parameters. The entire training process continues until the loss function of the model converges on both the training dataset and the validation dataset. If the loss on the validation dataset does not decrease further within several cycles (for example, 5 epochs), the system terminal will trigger the early stopping mechanism (Early Stopping) to stop training in advance to avoid overfitting of the model. In addition, the learning rate decay strategy will be used to accelerate convergence. A larger learning rate (such as 0.001) is used at the beginning of training, and the learning rate is gradually reduced as the training progresses (such as to 0.0001) to ensure that the model can converge more stably when approaching the global optimal solution. After each training cycle, the system terminal will record the performance of the model on the validation dataset and save the model with the lowest loss in the validation dataset as the final drawing annotation unit segmentor. Through this training process, the final drawing annotation unit segmentor can efficiently and accurately identify the annotation units in the drawings.
[0026] A labeling standardity analysis is performed on the multiple labeling units to obtain multiple labeling standard coefficients, and multiple manual labeling units and multiple automatic labeling units are obtained by dividing the multiple labeling standard coefficients.
[0027] In one embodiment, the system terminal retrieves the historical annotation units related to the current drawing from the historical annotation data. Each annotation unit will be analyzed for similarity with the historical annotation units. By traversing and analyzing the image of each annotation unit in the current drawing, it is compared with the image set of the historical annotation units, the similarity is calculated, and the calculated similarity is used as the annotation standard coefficient of the annotation unit. For those annotation units with large similarity, it means that these units have a large number of similar or identical standard annotation units in the historical data. Therefore, such units can be automatically annotated by the system terminal. This is because similar annotation units appear many times in the historical data, and annotation information can be automatically generated according to the existing annotation rules, thereby ensuring the accuracy and consistency of the annotation. On the contrary, the annotation units with small similarity indicate that there are not enough similar annotation units in the historical annotation data, or these annotation units are relatively rare, complex, and have low standardization. Therefore, such annotation units need to be processed by manual annotation. Manual annotation ensures that these complex or special units can be accurately annotated to ensure the overall quality and accuracy of the drawing annotation. Finally, the system terminal divides the annotation units into manual annotation units and automatic annotation units according to the calculated annotation standard coefficient. Automatically marked units have high similarity and strong standardization, and are automatically marked by the system; manually marked units have low similarity, are more complex or uncommon, and are manually marked by the user, ensuring the accuracy of drawing marking.
[0028] Further, the method includes performing a labeling standardization analysis on the plurality of labeling units to obtain a plurality of labeling standard coefficients, and dividing the plurality of labeling standard coefficients to obtain a plurality of manual labeling units and a plurality of automatic labeling units.
[0029] Retrieve the drawing annotation data within a preset time range in the past, and extract a historical annotation unit set; input a first annotation unit among the multiple annotation units into the historical annotation unit set for traversal similarity analysis to obtain a first annotation unit similarity set, calculate the mean to obtain the first annotation unit similarity as a first annotation standard coefficient; continue to input the historical annotation unit set for annotation standardity analysis and calculation to obtain multiple annotation standard coefficients; divide and select the annotation units corresponding to the smallest M annotation standard coefficients among the multiple annotation standard coefficients as multiple manual annotation units, where M is an integer greater than 1; and use the other multiple annotation units as multiple automatic annotation units.
[0030] Preferably, the system terminal retrieves the drawing annotation data within the preset time range in the past, which covers the annotation drawing information within a specific time period, and extracts a historical annotation unit set from these historical annotation data, which contains all the annotated units within the preset time range. These historical annotation units provide a reference for the subsequent similarity analysis. Subsequently, a random annotation unit is selected from the annotation units in the current drawing as the first annotation unit, and it is input into the extracted historical annotation unit set for similarity analysis. During the similarity analysis process, the system terminal combines the geometric features of the first annotation unit such as area, perimeter, aspect ratio, corner point feature, center of gravity position, direction, etc. to form a first multidimensional vector, such as [area, perimeter, aspect ratio, center of gravity, main direction, corner point]. Then the historical annotation unit set is traversed, and in each traversal, the current historical annotation unit is converted into a historical multidimensional vector, and combined with the first multidimensional vector, and the similarity between the first multidimensional vector and the historical multidimensional vector is calculated by the cosine similarity formula. Repeating this process, the system terminal will calculate a first annotation unit similarity set. This set contains the similarity values between the first annotation unit and all historical annotation units. After that, the similarity values in this similarity set are averaged to obtain the similarity mean of the first annotation unit, and the mean is used as the first annotation standard coefficient. This process is repeated for each annotation unit in the current drawing. For each annotation unit, the system terminal inputs it into the historical annotation unit set, performs similarity analysis and calculates its corresponding similarity mean. In this way, the similarity mean of all annotation units can be obtained, and then multiple annotation standard coefficients are formed, and each annotation unit corresponds to a standard coefficient. After obtaining these standard coefficients, the system terminal sorts and screens these coefficients. The smallest M coefficients of multiple annotation standard coefficients, that is, the M coefficients that are less than the critical value of the standard coefficient, will be selected, and the annotation units corresponding to these smallest coefficients will be classified as manual annotation units. This is because the annotation units with lower similarity represent that they appear less frequently in the historical annotation data, or are more complex and irregular, so they need to be processed manually. M is an integer greater than 1, indicating the number of units selected to be manually annotated. For the remaining annotation units, the system terminal will classify them as automatic annotation units. The similarity of these annotation units is high, indicating that they have a large number of similar standard annotation units in the historical data. The system terminal can automatically generate annotation information according to previous annotation rules to ensure the efficiency and consistency of annotation.
[0031] A marking space of the drawing is obtained, and within the marking space, the marking positions of the multiple manual marking units and the multiple automatic marking units are optimized for the purpose of improving the uniformity of all marking positions and the conspicuity of the manual marking positions, so as to obtain multiple optimal manual marking positions and multiple optimal automatic marking positions.
[0032] In one embodiment, the system terminal obtains the annotation space of the drawing, that is, the area on the drawing that can be used for annotation. The annotation space is a two-dimensional plane, and the system terminal will identify which areas are suitable for placing annotation information according to the layout of the drawing and the actual requirements of annotation. The annotation space will avoid key design areas and overly dense parts to ensure that the annotation information does not cover or interfere with the main content of the drawing. Subsequently, the annotation positions of the manual annotation units and automatic annotation units in the drawing are optimized. The main goal of the optimization is to improve the uniformity of the annotation position and the eye-catching degree of the manual annotation position. To achieve this goal, the system terminal first assigns an initial position to each annotation unit. The initial positions of the automatic annotation unit and the manual annotation unit are randomly selected. In order to improve the uniformity of the annotation position, the system terminal will detect the distribution of the annotation position. If it is found that the annotations in some areas are too dense, which may affect the readability of the drawing, the annotation position will be readjusted so that the annotations are more evenly distributed in the drawing space. The annotation information of the manual annotation unit usually requires special attention from the user, so it needs to be more eye-catching. In order to achieve this goal, the system terminal will adjust the position of the manual annotation unit, and the specific optimization is to reduce the distance between the manual annotation position and the center of the drawing. The closer to the center of the drawing, the easier it is for the manual annotation to attract the user's attention, thus achieving a striking effect. The optimization of the annotation position is not completed in one go. The system terminal gradually adjusts the annotation position in an iterative manner until the uniformity of the annotation position and the eye-catching degree of the manual annotation reach the ideal effect. In each iteration, the current annotation distribution is evaluated, the uniformity of the annotation position and the center distance of the manual annotation are calculated, and they are gradually optimized. When the annotation position optimization reaches convergence, that is, the uniformity of the annotation position and the eye-catching degree of the manual annotation position do not change significantly in several consecutive iterations, the system terminal will output the optimal manual annotation position and the optimal automatic annotation position. Through the above process, the uniformity of all annotation positions is ensured, and the local density of annotation information is avoided, thereby improving the readability of the drawing. At the same time, the manual annotation position is optimized to be more eye-catching. By moving the manual annotation position as close to the center of the drawing as possible, it is easier to attract the user's attention, thereby improving the display effect of the manual annotation information.
[0033] Further, obtaining the annotation space of the drawing, optimizing the annotation positions of the plurality of manual annotation units and the plurality of automatic annotation units in the annotation space for the purpose of improving the uniformity of all annotation positions and the conspicuity of the manual annotation positions, the method comprising:
[0034] Acquire the annotation space of the drawing; in the annotation space, randomly select a plurality of first manual annotation positions and a plurality of first automatic annotation positions of the plurality of manual annotation units and the plurality of automatic annotation units according to a preset annotation area size, wherein the plurality of first manual annotation positions and the plurality of first automatic annotation positions do not overlap; analyze and calculate the first annotation uniformity information of the plurality of first manual annotation positions and the plurality of first automatic annotation positions; acquire the center position of the drawing, and the plurality of manual unit positions and the plurality of automatic unit positions of the plurality of manual annotation units and the plurality of automatic annotation units, and calculate the first annotation position fitness of the plurality of first manual annotation positions and the plurality of first automatic annotation positions in combination with the first annotation uniformity information; continue to optimize the annotation positions of the plurality of manual annotation units and the plurality of automatic annotation units in the annotation space until the optimization converges, and output a plurality of optimal manual annotation positions and a plurality of optimal automatic annotation positions with the largest annotation position fitness.
[0035] Preferably, the system terminal first identifies and obtains the area in the drawing that can be used for annotation as the annotation space. The annotation space is a blank area on the drawing, which is suitable for placing annotation information without interfering with the main design content of the drawing. By detecting the design structure, layout density and other information of the drawing, the design area and the part with more complex content are automatically excluded to ensure that the annotation space is left for the annotation unit. After determining the annotation space, according to the preset annotation area size, the initial annotation position is selected for the manual annotation unit and the automatic annotation unit respectively. The system terminal randomly selects the first manual annotation position of each manual annotation unit and the first automatic annotation position of each automatic annotation unit in the annotation space. During the selection process, it is ensured that these initial annotation positions do not overlap to avoid stacking and mutual occlusion of annotation information. Subsequently, the distance between each annotation position is calculated, including the distance between the manual annotation position and the automatic annotation position. In order to measure whether the distribution of these annotation positions is uniform, the system terminal calculates the variance of these distances to obtain the first annotation uniformity information. The larger the variance value, the larger the distance difference between the annotation units, and the uneven distribution of the annotation; the smaller the variance value, the closer the distance between the annotation units, and the more uniform the distribution. After that, the center position of the drawing is determined as an important reference point for optimizing the eye-catching degree of the manual annotation position. The system terminal compares the initial position of the manual annotation unit and the automatic annotation unit with the center of the drawing, calculates the distance between each annotation unit and the center of the drawing, and then combines the annotation uniformity information with the position of each annotation unit to calculate the annotation position fitness. Then, according to the calculated fitness, the position of the annotation unit is optimized. The goal of optimization is to maximize the annotation position fitness and make the manual annotation unit as close to the center of the drawing as possible, while the automatic annotation unit remains evenly distributed. The system terminal adjusts the position of the annotation unit in each round of optimization and recalculates the fitness after each adjustment. By adjusting the position of the manual annotation unit to make it closer to the center of the drawing, its eye-catching degree is improved. By adjusting the position of the automatic annotation unit to make it more evenly distributed, the problem of excessive concentration of annotation information is reduced. The optimization iteration of the annotation position is continuously performed until the fitness of the annotation position is no longer significantly improved in consecutive rounds of optimization, indicating that the optimization process has converged. At this point, the position of the annotation unit has reached the optimal state, and the uniformity and eye-catchingness have been optimally balanced. When the optimization process converges, the system terminal outputs the manual and automatic annotation positions with the greatest fitness as the optimal manual and automatic annotation positions. These positions are optimized to ensure not only the uniform distribution of annotations, but also the eye-catching degree of manual annotation units is significantly improved, ensuring the readability and clarity of the drawing annotations.
[0036] Furthermore, the method for analyzing and calculating the first annotation uniformity information of the plurality of first manually-annotated positions and the plurality of first automatically-annotated positions includes:
[0037] According to the multiple first manual marking positions and the multiple first automatic marking positions, the distance between each group of two adjacent marking positions is measured to obtain multiple marking position spacings; and the inverse of the variance of the spacings between the multiple marking positions is calculated as the first marking uniformity information.
[0038] Optionally, the system terminal uses the coordinate system of the drawing to determine the specific coordinate value of the annotation position, and arranges the annotation positions of all annotation units (including manual and automatic annotation units) in order of distance from small to large, and then selects the two points with the smallest distance from these annotation positions as adjacent annotation positions in turn, ensuring that the spacing between each group of adjacent annotations is as small as possible and logical. Once the combination of adjacent annotation positions is determined, the system terminal calculates the distance between each group of adjacent annotation positions by the Euclidean distance formula. The distance is calculated by the coordinate system in the drawing, and the unit is usually millimeter (for example, 5mm). In this way, the annotation position spacing between all adjacent annotation positions can be obtained, and these spacings reflect the actual distribution of the annotation information in the drawing. Subsequently, the variance of these spacings is calculated, and the inverse thereof is taken as information to measure the uniformity of the annotation, that is, the first annotation uniformity information. The smaller the variance, the more uniform the distribution of the annotation position, and the larger the inverse of the variance, the better the uniformity. By calculating the variance, the reasonable layout and clear readability of the annotation information can be ensured.
[0039] Further, taking the center position of the drawing, and the multiple manual unit positions and the multiple automatic unit positions of the multiple manual marking units and the multiple automatic marking units, and combining the first marking uniformity information, calculating and obtaining the first marking position fitness of the multiple first manual marking positions and the multiple first automatic marking positions, the method includes:
[0040] According to the drawing coordinate system of the drawing, the center position of the drawing, and the multiple manual unit positions and the multiple automatic unit positions of the multiple manual annotation units and the multiple automatic annotation units are obtained; multiple first manual annotation center distances between the multiple first manual annotation positions and the center position are calculated, and multiple first manual annotation distances between the multiple first manual annotation positions and the multiple manual unit positions, and multiple first automatic annotation distances between the multiple first automatic annotation positions and the multiple automatic unit positions are calculated; according to the multiple first manual annotation center distances, the multiple first manual annotation distances, the multiple first automatic annotation distances and the first annotation uniformity information, the first annotation position fitness of the multiple first manual annotation positions and the multiple first automatic annotation positions is calculated, as shown in the following formula: .
[0041] Optionally, the system terminal determines the center position of the drawing based on the coordinate system of the drawing. The calculation of the center position is usually based on the geometric center point obtained according to the boundary and size of the drawing. Then obtain the actual annotation positions of multiple manual annotation units and multiple automatic annotation units, that is, the position coordinates of these annotation units on the drawing. Subsequently, according to the positions of the acquired manual annotation units and automatic annotation units, the distance calculation is performed in sequence. The distance between each first manual annotation position and the center position of the drawing is calculated by the Euclidean distance formula as the first manual annotation center spacing. This indicates the distance between each first manual annotation position and the center position. The smaller the distance, the higher the eye-catchingness of the manual annotation. The distance between each first manual annotation position and the corresponding manual unit position is calculated by the Euclidean distance formula as the first manual annotation spacing. This indicates the relative distance of the manual unit corresponding to each manual annotation. The smaller the distance, the closer the annotation is to the manual unit, and the more it meets the actual annotation requirements. Similarly, the distance between each first automatic annotation position and the corresponding automatic unit position is also calculated as the first automatic annotation spacing. This also reflects the fit between the annotation and the automatic unit. Afterwards, the calculated multiple distances and uniformity information are input into the annotation position fitness formula to calculate the first annotation position fitness of the current layout. The annotation position fitness formula is as follows: ; Among them, DAA is the annotation position adaptability, which reflects the degree of optimization of the current annotation layout. , and is the weight, which is used to adjust the influence of different parts on fitness, for example, , and They can be 0.4, 0.3, and 0.3 respectively. M is the number of manual annotation units, and N is the number of automatic annotation units. For example, if there are 12 annotation units on the drawing, 4 of which are manual annotation units and the remaining 8 are annotation units, then M = 4 and N = 8. Y is the annotation uniformity information, which is used to describe the distribution of annotation units on the entire drawing. is the manual annotation center distance between the ith manual annotation position and the center position. is the manual annotation distance between the manual annotation position of the i-th manual annotation unit and the manual unit position. The automatic annotation position of the jth automatic annotation unit and the automatic unit position automatic annotation spacing. M and N are integers greater than 1, and M is less than N. Through this formula, the positions of manual annotation and automatic annotation can be optimized to improve the readability of the drawing, the clarity of information, and the accuracy of the annotation information.
[0042] The multiple optimal manual marking positions are displayed, multiple manual marking information input by the user according to the multiple optimal manual marking positions are received, and automatic marking is performed according to the multiple optimal automatic marking positions to obtain multiple automatic marking information, and obtain drawing marking analysis results.
[0043] In one embodiment, after the optimization is completed, the system terminal will display multiple optimal manual annotation positions on the user side. These positions are obtained by the system after a series of calculations and optimizations, ensuring that the distribution of each manual annotation unit on the drawing is both reasonable and eye-catching. The user can clearly see the positions corresponding to these manual annotation units and perform manual operations according to these positions. Subsequently, the system terminal receives the manual annotation information input by the user. This information is the specific annotation content that the user will enter based on the provided optimal positions. These manual annotation information can be content related to the drawing design, such as size, explanatory text, etc. After the user completes the manual annotation input, the system terminal will continue to process the automatic annotation unit. According to the optimized optimal automatic annotation position, the annotation operation is automatically performed to generate multiple automatic annotation information. These automatic annotation information can be the size, description or symbol automatically generated according to the design in the drawing, which avoids the trouble of manual input by the user and improves the annotation efficiency. When all manual annotation and automatic annotation operations are completed, these annotation information are summarized to generate the annotation analysis result of the drawing. This analysis result is a collection of complete annotation information of the drawing, which contains the manual annotation content entered by the user and the automatic annotation information generated automatically. The final result ensures the reasonable layout, clarity and accuracy of all annotation information on the drawing, providing users with an optimized and complete annotated drawing.
[0044] In summary, the drawing annotation parsing method provided by the embodiment of the present application has the following technical effects:
[0045] The drawing annotation parsing method involves the identification, classification and optimization of annotation positions of the drawings through automation and optimization technology. First, multiple annotation units in the drawings are received and identified, and then the standardization analysis is performed based on the historical annotation data to divide the annotation units into manual annotation and automatic annotation units. Subsequently, the annotation space of the drawing is obtained, and the positions of the manual and automatic annotation units are optimized according to the goal of improving the uniformity of the annotation position and the eye-catchingness of the manual annotation, and their fitness is calculated to ensure that the annotations are evenly distributed and the manual annotations are close to the center of the drawing. After the optimization is completed, the user can input the manual annotation information according to the displayed optimal manual annotation position, and the automatic annotation information is automatically generated at the same time, and finally a complete drawing annotation parsing result is obtained, thereby solving the technical problem that the overall annotation layout is uneven due to the unreasonable distribution of the annotation position, the manual annotation will be mixed with other annotations, and the automatic annotation cannot fully consider the position and influence of the manual annotation, and achieves the technical effect of optimizing the annotation position layout, improving the uniformity of the annotation and the eye-catchingness of the manual annotation, and ensuring the accuracy of the annotation efficiency and the annotation results.
[0046] Embodiment 2, based on the same inventive concept as a drawing annotation analysis method in the above embodiment, Figure 2 As shown, an embodiment of the present application provides a drawing annotation parsing system, the system comprising:
[0047] Annotation unit identification and segmentation module 1: The annotation unit identification and segmentation module 1 is used to receive drawings to be annotated and analyzed, identify and segment the annotation units of the drawings, and obtain multiple annotation units; Annotation standardization analysis module 2: The annotation standardization analysis module 2 is used to perform annotation standardization analysis on the multiple annotation units, obtain multiple annotation standard coefficients, and obtain multiple manual annotation units and multiple automatic annotation units according to the multiple annotation standard coefficients; Annotation position optimization module 3: The annotation position optimization module 3 is used to obtain the annotation space of the drawing, and within the annotation space, the annotation positions of the multiple manual annotation units and the multiple automatic annotation units are optimized for the purpose of improving the uniformity of all annotation positions and the conspicuousness of the manual annotation positions, and multiple optimal manual annotation positions and multiple optimal automatic annotation positions are obtained; Annotation analysis result acquisition module 4: The annotation analysis result acquisition module 4 is used to display the multiple optimal manual annotation positions, receive multiple manual annotation information input by the user according to the multiple optimal manual annotation positions, and automatically annotate according to the multiple optimal automatic annotation positions to obtain multiple automatic annotation information, and obtain the drawing annotation analysis result.
[0048] Furthermore, the system further comprises a labeling unit identification and segmentation module 1 to perform the following operation steps:
[0049] Receive a drawing to be annotated and parsed input by a user; input the drawing into a pre-trained and verified drawing annotation unit segmentor, perform annotation unit recognition and segmentation, and obtain an annotation unit segmentation result, wherein the annotation unit segmentation result includes multiple annotation units.
[0050] Furthermore, the system further comprises a labeling unit identification and segmentation module 1 to perform the following operation steps:
[0051] According to the historical annotation data of similar drawings, a set of sample drawings is collected, and the sample annotation units in each sample drawing are segmented and marked to obtain a set of sample annotation unit segmentation results; a convolutional neural network is used to construct the network structure of a drawing annotation unit segmentor; the sample drawing set and the sample annotation unit segmentation result set are used as supervised training data and verification data to perform supervised training and verification on the drawing annotation unit segmentor until the verification convergence requirements are met to obtain a drawing annotation unit segmentor.
[0052] Furthermore, the system further comprises a labeling standardization analysis module 2 to perform the following operation steps:
[0053] Retrieve the drawing annotation data within a preset time range in the past, and extract a historical annotation unit set; input a first annotation unit among the multiple annotation units into the historical annotation unit set for traversal similarity analysis to obtain a first annotation unit similarity set, calculate the mean to obtain the first annotation unit similarity as a first annotation standard coefficient; continue to input the historical annotation unit set for annotation standardity analysis and calculation to obtain multiple annotation standard coefficients; divide and select the annotation units corresponding to the smallest M annotation standard coefficients among the multiple annotation standard coefficients as multiple manual annotation units, where M is an integer greater than 1; and use the other multiple annotation units as multiple automatic annotation units.
[0054] Furthermore, the system further includes a marking position optimization module 3 to perform the following operation steps:
[0055] Acquire the annotation space of the drawing; in the annotation space, randomly select a plurality of first manual annotation positions and a plurality of first automatic annotation positions of the plurality of manual annotation units and the plurality of automatic annotation units according to a preset annotation area size, wherein the plurality of first manual annotation positions and the plurality of first automatic annotation positions do not overlap; analyze and calculate the first annotation uniformity information of the plurality of first manual annotation positions and the plurality of first automatic annotation positions; acquire the center position of the drawing, and the plurality of manual unit positions and the plurality of automatic unit positions of the plurality of manual annotation units and the plurality of automatic annotation units, and calculate the first annotation position fitness of the plurality of first manual annotation positions and the plurality of first automatic annotation positions in combination with the first annotation uniformity information; continue to optimize the annotation positions of the plurality of manual annotation units and the plurality of automatic annotation units in the annotation space until the optimization converges, and output a plurality of optimal manual annotation positions and a plurality of optimal automatic annotation positions with the largest annotation position fitness.
[0056] Furthermore, the system further includes a marking position optimization module 3 to perform the following operation steps:
[0057] According to the multiple first manual marking positions and the multiple first automatic marking positions, the distance between each group of two adjacent marking positions is measured to obtain multiple marking position spacings; and the inverse of the variance of the spacings between the multiple marking positions is calculated as the first marking uniformity information.
[0058] Furthermore, the system further includes a marking position optimization module 3 to perform the following operation steps:
[0059] According to the drawing coordinate system of the drawing, the center position of the drawing, and the multiple manual unit positions and the multiple automatic unit positions of the multiple manual annotation units and the multiple automatic annotation units are obtained; multiple first manual annotation center distances between the multiple first manual annotation positions and the center position are calculated, and multiple first manual annotation distances between the multiple first manual annotation positions and the multiple manual unit positions, and multiple first automatic annotation distances between the multiple first automatic annotation positions and the multiple automatic unit positions are calculated; according to the multiple first manual annotation center distances, the multiple first manual annotation distances, the multiple first automatic annotation distances and the first annotation uniformity information, the first annotation position fitness of the multiple first manual annotation positions and the multiple first automatic annotation positions is calculated, as shown in the following formula: ; Among them, DAA is the annotation position adaptation, , and is the weight, M is the number of multiple manually labeled units, N is the number of multiple automatically labeled units, and Y is the labeling uniformity information. is the manual annotation center distance between the ith manual annotation position and the center position, is the manual annotation distance between the manual annotation position of the i-th manual annotation unit and the manual unit position, The automatic annotation position of the jth automatic annotation unit and the automatic unit position automatic annotation spacing, M and N are integers greater than 1, and M is less than N.
[0060] Through the above detailed description of a drawing annotation analysis method in this specification, those skilled in the art can clearly understand a drawing annotation analysis system in this embodiment. Since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0061] Embodiment three, based on the same inventive concept as a drawing annotation analysis method in the aforementioned embodiment, the present application also provides a storage medium, on which a computer program is stored, and when the computer program is executed, the steps of any one of the methods described in the aforementioned embodiment one are implemented.
[0062] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A drawing annotation analysis method, characterized in that: The method comprises: Receiving a drawing to be annotated and parsed, identifying and segmenting the annotated units of the drawing, and obtaining a plurality of annotated units; Performing a labeling standard analysis on the multiple labeling units to obtain a plurality of labeling standard coefficients, and dividing the multiple labeling standard coefficients to obtain a plurality of manual labeling units and a plurality of automatic labeling units; Acquire a marking space of the drawing, and within the marking space, optimize the marking positions of the plurality of manual marking units and the plurality of automatic marking units to obtain a plurality of optimal manual marking positions and a plurality of optimal automatic marking positions with the purpose of improving the uniformity of all marking positions and the conspicuity of the manual marking positions; Displaying the multiple optimal manual annotation positions, receiving multiple manual annotation information input by the user according to the multiple optimal manual annotation positions, and automatically annotating according to the multiple optimal automatic annotation positions to obtain multiple automatic annotation information, and obtaining a drawing annotation analysis result; Performing a labeling standardization analysis on the plurality of labeling units to obtain a plurality of labeling standard coefficients, and dividing the plurality of labeling standard coefficients to obtain a plurality of manual labeling units and a plurality of automatic labeling units, including: Retrieve the drawing annotation data within a preset time range in the past, and extract the historical annotation unit set; Inputting a first annotation unit among the multiple annotation units into the historical annotation unit set to perform traversal similarity analysis to obtain a first annotation unit similarity set, and calculating the mean to obtain the first annotation unit similarity as a first annotation standard coefficient; Continue to input other multiple annotation units into the historical annotation unit set to perform annotation standardization analysis and calculation to obtain multiple annotation standard coefficients; Divide and select the marking units corresponding to the smallest M marking standard coefficients among the multiple marking standard coefficients as multiple manual marking units, where M is an integer greater than 1; The other multiple annotation units are regarded as multiple automatic annotation units.
2. The drawing annotation and analysis method according to claim 1, characterized in that: Receiving a drawing to be annotated and parsed, identifying and segmenting the annotated units of the drawing, and obtaining a plurality of annotated units, including: Receive drawings to be annotated and parsed input by users; The drawing is input into a drawing annotation unit segmentor that has been pre-trained and verified, and the annotation units are identified and segmented to obtain an annotation unit segmentation result, wherein the annotation unit segmentation result includes a plurality of annotation units.
3. The drawing annotation and analysis method according to claim 2, characterized in that: The training and verification process of the drawing annotation unit segmenter includes: According to the historical annotation data of similar drawings, a set of sample drawings is collected, and the sample annotation units in each sample drawing are segmented and marked to obtain a set of sample annotation unit segmentation results; Use convolutional neural network to build the network structure of drawing annotation unit segmentor; The sample drawing set and the sample annotation unit segmentation result set are used as supervised training data and verification data, and the drawing annotation unit segmentor is supervised trained and verified until the verification convergence requirement is met, thereby obtaining the drawing annotation unit segmentor.
4. The drawing annotation and analysis method according to claim 1, characterized in that: Obtaining the annotation space of the drawing, and optimizing the annotation positions of the plurality of manual annotation units and the plurality of automatic annotation units in the annotation space for the purpose of improving the uniformity of all annotation positions and the conspicuity of the manual annotation positions, including: Obtaining the annotation space of the drawing; In the annotation space, according to a preset annotation area size, randomly selecting a plurality of first manual annotation positions and a plurality of first automatic annotation positions of the plurality of manual annotation units and the plurality of automatic annotation units, wherein the plurality of first manual annotation positions and the plurality of first automatic annotation positions do not overlap with each other; Analyzing and calculating first annotation uniformity information of the plurality of first manually-annotated positions and the plurality of first automatically-annotated positions; Acquire the center position of the drawing, and multiple manual unit positions and multiple automatic unit positions of the multiple manual annotation units and the multiple automatic annotation units, and calculate and obtain the first annotation position fitness of the multiple first manual annotation positions and the multiple first automatic annotation positions in combination with the first annotation uniformity information; Continue to optimize the annotation positions of the multiple manual annotation units and the multiple automatic annotation units in the annotation space until the optimization converges, and output multiple optimal manual annotation positions and multiple optimal automatic annotation positions with the maximum annotation position fitness.
5. The drawing annotation and analysis method according to claim 4, characterized in that: Analyzing and calculating first annotation uniformity information of the plurality of first manually-annotated positions and the plurality of first automatically-annotated positions, including: According to the plurality of first manual marking positions and the plurality of first automatic marking positions, measuring and acquiring the distance between each group of two adjacent marking positions to obtain a plurality of marking position spacings; The inverse of the variance of the spacings between the multiple annotation positions is calculated as the first annotation uniformity information.
6. The drawing annotation and analysis method according to claim 4, characterized in that: Acquiring the center position of the drawing, and multiple manual unit positions and multiple automatic unit positions of the multiple manual annotation units and the multiple automatic annotation units, and calculating and obtaining the first annotation position fitness of the multiple first manual annotation positions and the multiple first automatic annotation positions in combination with the first annotation uniformity information, including: According to a drawing coordinate system of the drawing, acquiring a center position of the drawing, and a plurality of manual unit positions and a plurality of automatic unit positions of the plurality of manual marking units and the plurality of automatic marking units; Calculating and acquiring a plurality of first manually-annotated center distances between the plurality of first manually-annotated positions and the center position, and calculating a plurality of first manually-annotated distances between the plurality of first manually-annotated positions and the plurality of manual unit positions, and a plurality of first automatically-annotated distances between the plurality of first automatically-annotated positions and the plurality of automatic unit positions; According to the plurality of first manual annotation center spacings, the plurality of first manual annotation spacings, the plurality of first automatic annotation spacings and the first annotation uniformity information, the first annotation position fitness of the plurality of first manual annotation positions and the plurality of first automatic annotation positions is calculated and obtained as follows: ; Among them, DAA is the annotation position adaptation, , and is the weight, M is the number of multiple manually labeled units, N is the number of multiple automatically labeled units, and Y is the labeling uniformity information. is the manual annotation center distance between the ith manual annotation position and the center position, is the manual annotation distance between the manual annotation position of the i-th manual annotation unit and the manual unit position, The automatic annotation position of the jth automatic annotation unit and the automatic unit position automatic annotation spacing, M and N are integers greater than 1, and M is less than N.
7. A drawing annotation and parsing system, characterized in that: A system for implementing a drawing annotation parsing method according to any one of claims 1 to 6, comprising: Annotation unit identification and segmentation module: receiving drawings to be annotated and analyzed, identifying and segmenting the annotation units of the drawings, and obtaining a plurality of annotation units; A labeling standardization analysis module: performs labeling standardization analysis on the plurality of labeling units to obtain a plurality of labeling standard coefficients, and divides the plurality of labeling standard coefficients to obtain a plurality of manual labeling units and a plurality of automatic labeling units; A marking position optimization module: obtaining a marking space of the drawing, optimizing the marking positions of the plurality of manual marking units and the plurality of automatic marking units in the marking space for the purpose of improving the uniformity of all marking positions and the eye-catching degree of the manual marking positions, and obtaining a plurality of optimal manual marking positions and a plurality of optimal automatic marking positions; The annotation analysis result acquisition module displays the multiple optimal manual annotation positions, receives multiple manual annotation information input by the user according to the multiple optimal manual annotation positions, and performs automatic annotation according to the multiple optimal automatic annotation positions to obtain multiple automatic annotation information, thereby obtaining the drawing annotation analysis result; The labeling standardization analysis module performs the following steps: Retrieve the drawing annotation data within a preset time range in the past, and extract a historical annotation unit set; input a first annotation unit among the multiple annotation units into the historical annotation unit set for traversal similarity analysis to obtain a first annotation unit similarity set, calculate the mean to obtain the first annotation unit similarity as a first annotation standard coefficient; continue to input the historical annotation unit set for annotation standardity analysis and calculation to obtain multiple annotation standard coefficients; divide and select the annotation units corresponding to the smallest M annotation standard coefficients among the multiple annotation standard coefficients as multiple manual annotation units, where M is an integer greater than 1; and use the other multiple annotation units as multiple automatic annotation units.
8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a drawing annotation parsing method described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Analysis method for automatically annotating graph size
CN104008192A
Automatic loop labeling method for CAD (Computer Aided Design) electrical system diagram
CN113065175A