Communication engineering drawing identification method and device
By using target detection and recognition models to automate the processing of communication engineering drawings, the problems of low efficiency and low accuracy of manual data entry have been solved, achieving efficient and accurate information extraction and entry.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE GRP GUANGDONG CO LTD
- Filing Date
- 2021-11-09
- Publication Date
- 2026-07-10
AI Technical Summary
During the network access phase of wireless base station construction, the efficiency of information entry for communication engineering drawings is low, the labor cost is high, and the accuracy is difficult to guarantee. Existing methods rely on manual interpretation and entry, resulting in low information entry efficiency and high error rate.
A target detection model is used to detect communication engineering drawings, separating table slices, text paragraph slices, and plan slices. The table and text information are identified by a first recognition model and a second recognition model, respectively. Finally, the recognition data is summarized to achieve automated information extraction.
It improved the efficiency of information identification and extraction, reduced labor costs, and ensured the accuracy and consistency of information entry.
Smart Images

Figure CN116110070B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of drawing information acquisition technology, specifically to methods, devices, electronic equipment, and computer program products for recognizing communication engineering drawings. Background Technology
[0002] During the network access phase of wireless base station construction, the telecommunications engineering construction department must enter network equipment information and supporting facility information into the "Integrated Network Resource Management System" according to the design drawings, so that resource scheduling, fault management, and other maintenance activities can be carried out during the maintenance phase. Currently, the method used is for telecommunications engineering data entry personnel to find resource-related fields on the design drawings, fill them into the resource entry form, and then import them into the system.
[0003] However, the design drawings contain a large amount of information. The resource data of one wireless base station has about 160 fields, of which about 55 fields need to be manually entered. Moreover, the drawing templates of different design units are also different. The data entry personnel need to have a clear understanding of different drawing templates. In addition, in addition to the design drawings, the data entry personnel also need to combine relevant data from multiple systems, and after verification and comparison, they can correctly interpret the resource data in the design drawings. As a result, the information entry efficiency is very low, the labor cost is very high, and manual entry is also prone to errors, making it impossible to guarantee the accuracy of information entry. Summary of the Invention
[0004] This application provides a method for recognizing communication engineering drawings, which solves the technical problems of low information entry efficiency, high labor costs, and inability to guarantee the accuracy of information entry caused by manually entering communication engineering drawing information.
[0005] In a first aspect, embodiments of this application provide a method for recognizing communication engineering drawings, including:
[0006] The target detection model is used to detect communication engineering drawings and obtain table slices, text paragraph slices, and plan slices.
[0007] The table slices are identified using the first recognition model to obtain the first slice recognition data;
[0008] The second recognition model is used to identify the text paragraph slices and the planar image slices to obtain the second slice recognition data;
[0009] The first slice identification data and the second slice identification data are combined to obtain the communication engineering drawing identification data.
[0010] In one embodiment, the step of detecting communication engineering drawings using a target detection model to obtain table slices, text paragraph slices, and plan slices includes:
[0011] Based on the feature extraction layer of the target detection model, image features of several communication engineering drawings are obtained.
[0012] Based on the image features of several communication engineering drawings, several candidate region data are obtained using a Region Proposal Network (RPN).
[0013] Based on the mapping layer of the target detection model, several candidate region data are mapped into several candidate region feature vectors;
[0014] Based on the classification layer of the target detection model, the feature vectors of several candidate regions are classified to obtain the table slice, the text paragraph slice, and the planar image slice.
[0015] In one embodiment, the target detection model is trained based on sample data of communication engineering drawings with table labels, text paragraph labels, and floor plan labels.
[0016] In one embodiment, the step of identifying the table slices using a first recognition model to obtain first slice recognition data includes:
[0017] Extract the table frame of the table slice;
[0018] The intersections in the table frame are identified to obtain the actual intersections;
[0019] Based on the type and location of the actual intersection points, the table slices are cropped to obtain cells;
[0020] Based on the first recognition model, the cell is recognized using an optical character recognition algorithm to obtain the first slice recognition information;
[0021] The first slice identification information is encapsulated to obtain the first slice identification data.
[0022] In one embodiment, extracting the table frame of the table slice includes:
[0023] The first table frame of the table slice is extracted using a table frame coarse selection algorithm;
[0024] The table skeleton of the first table frame is extracted using a table skeleton extraction algorithm, wherein the width of the straight lines in the table skeleton is a single pixel.
[0025] Line segment detection is performed on the table skeleton, and the outer frame of the table skeleton is redrawn to obtain the second table frame.
[0026] In one embodiment, determining the intersection points in the table frame to obtain the true intersection points includes:
[0027] Based on the eight-neighborhood matrix of a single pixel, several intersection points in the second table frame are identified, and the types of these intersection points are determined to obtain the real intersection points and interference intersection points.
[0028] The interference intersections are cleaned up.
[0029] In one embodiment, the step of identifying the text paragraph slice and the planar image slice using a second recognition model to obtain second slice recognition data includes:
[0030] Based on the second recognition model, the text paragraph slice and the planar image slice are recognized using an optical character recognition algorithm to obtain the second slice recognition information;
[0031] The second slice identification information is encapsulated to obtain the second slice identification data.
[0032] Secondly, embodiments of this application provide a communication engineering drawing recognition device, comprising:
[0033] The communication engineering drawing inspection module is used to: inspect communication engineering drawings using a target detection model to obtain table slices, text paragraph slices, and plan slices;
[0034] The first slice recognition data acquisition module is used to: identify the table slices through a first recognition model to obtain the first slice recognition data;
[0035] The second slice recognition data acquisition module is used to: identify the text paragraph slice and the planar image slice through the second recognition model to obtain the second slice recognition data;
[0036] The communication engineering drawing identification data acquisition module is used to: summarize the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
[0037] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the program to implement the steps of the communication engineering drawing recognition method described in the first aspect.
[0038] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the communication engineering drawing recognition method described in the first aspect.
[0039] The communication engineering drawing recognition method and apparatus provided in this application embodiment detects communication engineering drawings using a target detection model. First, table slices, text paragraph slices, and planar slices of the communication engineering drawings are obtained. Then, the table slices are recognized using a first recognition model to obtain first slice recognition data. The text paragraph slices and planar slices are recognized using a second recognition model to obtain second slice recognition data. Finally, the first slice recognition data and the second slice recognition data are summarized to obtain communication engineering drawing recognition data.
[0040] The communication engineering drawing recognition method and apparatus provided in this application eliminates the need for manual interpretation and data entry of information on the communication engineering drawings. Instead, it combines a target detection model, a first recognition model, and a second recognition model to identify and extract information from the communication engineering drawings. More specifically, it uses the first and second recognition models to identify and extract information from table slices, text paragraph slices, and planar map slices, which can greatly improve the efficiency and accuracy of information recognition and extraction while reducing labor costs. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart illustrating the communication engineering drawing recognition method provided in an embodiment of this application;
[0043] Figure 2 This shows the labels in the dataset created when training the object detection model, as well as the types of the object regions corresponding to those labels;
[0044] Figure 3 The table shows nine types of intersections;
[0045] Figure 4 The eight-neighborhood matrix of the first type of intersection is shown;
[0046] Figure 5 The eight-neighborhood matrix of the fifth type of intersection is shown;
[0047] Figure 6 The criteria for determining a standard intersection are shown.
[0048] Figure 7 The criteria for determining non-standard intersections are shown.
[0049] Figure 8This demonstrates the process for identifying isolated pixels.
[0050] Figure 9 This is a schematic diagram of the communication engineering drawing recognition device provided in the embodiments of this application;
[0051] Figure 10 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0053] Figure 1 This is a flowchart illustrating a method for recognizing communication engineering drawings provided in an embodiment of this application.
[0054] Reference Figure 1 This application provides a method for recognizing communication engineering drawings, which may include:
[0055] S110. Detect communication engineering drawings using a target detection model to obtain table slices, text paragraph slices, and plan slices;
[0056] S120. Identify the table slices using the first identification model to obtain the first slice identification data;
[0057] S130. The text segment slice and the planar image slice are identified by the second recognition model to obtain the second slice recognition data;
[0058] S140. Summarize the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
[0059] It should be noted that the object detection model, the first recognition model, and the second recognition model can all be pre-trained.
[0060] Taking object detection models as an example, an object detection model can be a Faster R-CNN object detection model, which can be trained based on communication engineering drawing sample data with table labels, text paragraph labels, and floor plan labels.
[0061] Before training the object detection model, a dataset will be created first.
[0062] Specifically, the dataset can be taken from 150 standard communication engineering drawings formulated by a certain communication group, totaling more than 1,000 design scheme images. Then, the open-source software labelImg is used to annotate the data of three types of slices in the design scheme images: table slices, text paragraph slices, and plan slices. For example, the position of the table title in the table slice is marked by labeling, whether there are auxiliary marks in the text slice (which may be auxiliary marks to facilitate reading the text), or whether there are boxes in the plan slice, etc. The corresponding information is then generated and saved in the corresponding XML file. Figure 2 The document shows several types of labels and their corresponding annotation types. More specifically, the open-source software labelImg can be used to label a table slice with the label "table" to indicate the position of the table title in the table slice (e.g., the upper left of the table in the table slice), or the map slice can be labeled with the label "image" to indicate the presence of a frame in the map slice, and so on.
[0063] The object detection model is trained on sample data of communication engineering drawings with table labels, text paragraph labels, and floor plan labels. Compared with open-source table and text datasets, it can more intelligently identify: whether text slices have auxiliary labels, whether floor plan slices have outer frames, whether table titles are located in the upper left corner of the table, etc.
[0064] For the labeled image dataset, use code to generate test.txt (test set), train.txt (training set), val.txt (validation set), and trainval.txt (training and validation set, consisting of train.txt and val.txt) in the dataset directory. Regarding the dataset setup, test.txt (test set) can contain approximately 20% of the entire dataset, and trainval.txt (training and validation set) can contain the remaining 80%; train.txt (training set) can contain approximately 80% of trainval.txt (training and validation set), and val.txt (validation set) can contain the remaining 20%. The proportions of data in each dataset can be modified according to actual needs.
[0065] After completing the dataset, you can configure the GPU core code and train the object detection model on the GPU: Tesla V100 (graphics processor). The basic environment dependencies are PaddlePaddle 2.0 and Python 3.7.
[0066] Before training, object detection models can utilize paddlex.det.transforms (detection and instance segmentation) to preprocess data for object detection / instance segmentation tasks. Specifically, the following four functions can be used for data preprocessing (data augmentation):
[0067] The Normalize function: standardizes an image.
[0068] The RandomHorizontalFlip function flips an image horizontally with a certain probability.
[0069] The ResizeByShort function resizes the image based on its short side.
[0070] The Padding function adjusts the length and width of an image to a fixed multiple using padding.
[0071] The above functions can be combined using the [Compose] class to preprocess data according to actual needs, where the training set and test set need to be defined separately.
[0072] Before training, the object detection model needs to load the dataset. The object detection model can use two datasets: "VOCDetection" format and "COCODetection" format. Since the dataset XML file in this embodiment is in VOC format, "pdx.datasets.VOCDetection" is used to load the dataset.
[0073] During the training of the object detection model, for example, a total of 46 training rounds can be conducted. Every two rounds during the model training process, the model is output and saved to a specified directory. At the same time, relevant indicators are calculated using a validation dataset to verify the training results and select the optimal model.
[0074] After the target detection model has been trained, its loss value and accuracy can be analyzed to ensure the accuracy of the target detection model.
[0075] The loss function value refers to the average loss function value of the training samples participating in the current iteration step. The model's fitting effect can be judged by calculating the loss function value. The lower the loss value, the better the model fits the training set.
[0076] The mean accuracy (bbox_map) represents the average accuracy across the entire validation set in the detection task. The detection performance of the model can be judged by calculating the mean accuracy (bbox_map). The larger the mean accuracy (bbox_map), the better the model's detection performance.
[0077] Then, the trained object detection model can be used to predict the test dataset. A confidence threshold can be set to filter out boxes with a confidence level below the threshold and prevent them from being visualized.
[0078] The target detection model trained in this way has high confidence in its prediction results and accurate image type segmentation. The target detection model can be compressed and optimized for production use.
[0079] It should be noted that the execution subject of the communication engineering drawing recognition method provided in this application embodiment can be a terminal-side device, such as a data processor.
[0080] In step S110, the terminal device will detect the communication engineering drawings through the target detection model to obtain table slices, text paragraph slices, and plan slices.
[0081] Terminal-side devices can use the pre-trained target detection model to detect table slices, text paragraph slices, and planar slices in communication engineering drawings, obtaining preliminary table slices, preliminary text paragraph slices, and preliminary planar slices. Then, based on the table labels, text paragraph labels, and planar labels on the preliminary table slices, preliminary text paragraph slices, and preliminary planar slices, information such as confidence levels can be obtained. Slices with confidence levels greater than a threshold (e.g., 0.9) can then be further segmented to obtain higher-quality table slices, text paragraph slices, and planar slices.
[0082] In step S120, the terminal device identifies the table slices using the first recognition model to obtain the first slice recognition data.
[0083] The first recognition model can be a table feature-based recognition model, such as a table feature-based OCR (Optical Character Recognition) model. Before the terminal device recognizes the table slices through the first recognition model, it can preprocess the table slices, such as coarse selection of the table frame, refinement of the table frame, cleaning of isolated pixels and / or interfering pixels, and cutting of cells, so that the characters in the table slices can be accurately located and recognized in the subsequent process.
[0084] The first slice recognition data obtained by the terminal device through the first recognition model may include table title information, title position information, table row and column information, cell merging information, cell text information, cell position information, confidence level, and other information. Then, these first slice data can be encapsulated to ensure the uniformity of data format.
[0085] In step S130, the terminal device will identify the text paragraph slice and the planar image slice through the second recognition model to obtain the second slice recognition data.
[0086] The second recognition model can be a general OCR (Optical Character Recognition) model. A pre-trained model can be obtained through PaddleHub, and then further developed to obtain the second recognition model.
[0087] The terminal device can use the second recognition model to analyze and recognize text paragraph slices and planar image slices, and then obtain second slice recognition data. The second slice data may include slice type information, text slice location information, text and location information of each line on the slice, text information of the entire text paragraph on the slice, overall confidence level, and other information. Then, these second slice data can be encapsulated to ensure the uniformity of data format.
[0088] The table OCR and text paragraph OCR capabilities encapsulated using the open-source PaddleOCR offer higher text recognition accuracy and lower usage costs compared to open-source OCR algorithms such as EasyOCR and ChineseOCR. Furthermore, they support open-source and personalized training, providing more possibilities for subsequent performance optimization.
[0089] In step S140, the terminal-side device will aggregate the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
[0090] The first slice recognition data is obtained by recognizing table slices using the first recognition model. The second slice recognition data is obtained by recognizing text paragraph slices and planar map slices using the second recognition model. After summarizing the first and second slice recognition data, the data can be standardized separately, for example, by converting them into standardized text or structured JSON data. Then, the standardized first and second slice recognition data can be arranged and integrated according to the original arrangement order on the communication engineering drawing to obtain the final communication engineering drawing recognition data. Alternatively, the standardized first and second slice recognition data can be arranged and integrated according to a pre-set template to ensure the uniformity of the format of the final communication engineering drawing recognition data and facilitate subsequent viewing.
[0091] The communication engineering drawing recognition method provided in this application detects communication engineering drawings using a target detection model. First, it obtains table slices, text paragraph slices, and planar slices of the communication engineering drawings. Then, it identifies the table slices using a first recognition model to obtain first slice recognition data. Next, it identifies the text paragraph slices and planar slices using a second recognition model to obtain second slice recognition data. Finally, it summarizes the first slice recognition data and the second slice recognition data to obtain communication engineering drawing recognition data.
[0092] The communication engineering drawing recognition method provided in this application eliminates the need for manual interpretation and data entry of information on the communication engineering drawings. Instead, it combines a target detection model, a first recognition model, and a second recognition model to identify and extract information from the drawings. More specifically, it uses the first and second recognition models to identify and extract information from table slices, text paragraph slices, and planar drawing slices, which greatly improves the efficiency and accuracy of information recognition and extraction while reducing labor costs.
[0093] In one embodiment, the step of detecting communication engineering drawings using a target detection model to obtain table slices, text paragraph slices, and plan slices includes:
[0094] Based on the feature extraction layer of the target detection model, image features of several communication engineering drawings are obtained.
[0095] Based on the image features of several communication engineering drawings, several candidate region data are obtained using a Region Proposal Network (RPN).
[0096] Based on the mapping layer of the target detection model, several candidate region data are mapped into several candidate region feature vectors;
[0097] Based on the classification layer of the target detection model, the feature vectors of several candidate regions are classified to obtain the table slice, the text paragraph slice, and the planar image slice.
[0098] The object detection model can be a pre-trained Faster R-CNN object detection model, which includes a feature extraction layer, a mapping layer, and a classification layer.
[0099] When the terminal-side device performs detection and analysis on communication engineering drawings using the target detection model, it first extracts image features from several communication engineering drawings based on the feature extraction layer of the target detection model. Image feature extraction can be achieved through the Histogram of Oriented Gradients (HOG) feature extraction algorithm or the Local Binary Pattern (LBP) feature extraction algorithm. Then, based on the image features of several communication engineering drawings, a region generation network is used to obtain several candidate region data. Next, based on the mapping layer of the target detection model, the several candidate region data are mapped into several candidate region feature vectors. The mapping process is equivalent to data dimensionality reduction, which can be achieved through dimensionality reduction methods based on low-dimensional projection, neural networks, data correlation, or fractals. Finally, based on the classification layer of the target detection model, the several candidate region feature vectors are classified. The classification of candidate region feature vectors can be based on the data basis used when the target detection model was pre-trained, so as to obtain the table slices, text paragraph slices, and planar slices expected when training the target detection model.
[0100] The communication engineering drawing recognition method provided in this application embodiment can identify and extract information from communication engineering drawings more quickly and intelligently, and can effectively ensure the quality of information.
[0101] In one embodiment, the step of identifying the table slices using a first recognition model to obtain first slice recognition data includes:
[0102] Extract the table frame of the table slice;
[0103] The intersections in the table frame are identified to obtain the actual intersections;
[0104] Based on the type and location of the actual intersection points, the table slices are cropped to obtain cells;
[0105] Based on the first recognition model, the cell is recognized using an optical character recognition algorithm to obtain the first slice recognition information;
[0106] The first slice identification information is encapsulated to obtain the first slice identification data.
[0107] Before recognizing table slices, they can be preprocessed, such as extracting the table frame of the table slice, identifying the intersections in the table frame to obtain the real intersections, and cropping the table slice based on the position of the real intersections to obtain the cells, etc., to ensure that the content on the table slice is clear and recognizable, so that the table slice can be effectively recognized in the future.
[0108] Then, based on the first recognition model, the cell is recognized using an optical character recognition algorithm to obtain the first slice recognition information. The first slice recognition information is then encapsulated, for example, into structured JSON data, to obtain the first slice recognition data, which ensures the uniformity of the format of the first slice recognition data.
[0109] In one embodiment, extracting the table frame of the table slice includes:
[0110] The first table frame of the table slice is extracted using a table frame coarse selection algorithm;
[0111] The table skeleton of the first table frame is extracted using a table skeleton extraction algorithm, wherein the width of the straight lines in the table skeleton is a single pixel.
[0112] Line segment detection is performed on the table skeleton, and the outer frame of the table skeleton is redrawn to obtain the second table frame.
[0113] Specifically, to extract the first table frame of a table slice using a table frame coarse selection algorithm, the image can first be processed into a binary image using OpenCV, i.e., an image with only black and white colors. Then, the threshold parameters for horizontal and vertical line recognition are adjusted, and then straight line detection is performed using OpenCV. Finally, the detected horizontal and vertical lines are overlapped to coarsely select the first table frame of the table slice. However, the first table frame of the table slice may be irregular, or the horizontal and vertical lines may have different thicknesses.
[0114] At this point, a table skeleton extraction algorithm can be used to extract the table skeleton of the first table frame. The connected regions of the first table frame are refined to a width of one pixel for feature extraction and target topological representation. The width of the lines in the resulting table skeleton is then the width of a single pixel. In this step, the Skeletonize() function provided by the morphology submodule in the sklearn package can be used for table skeleton extraction.
[0115] Then, line segment detection can be performed on the table skeleton, and the four outer frame lines (top, bottom, left, and right) can be selected. The line segments can be extended into straight lines, and the intersections can be used to obtain the four vertices of the table skeleton. Finally, the vertices can be connected to complete the redrawing of the outer frame lines of the table skeleton, resulting in the second table frame.
[0116] This results in a second table frame for the table slices, which ensures accurate recognition of characters on the table slices in subsequent operations.
[0117] In one embodiment, determining the intersection points in the table frame to obtain the true intersection points includes:
[0118] Based on the eight-neighborhood matrix of a single pixel, several intersection points in the second table frame are identified, and the types of these intersection points are determined to obtain the real intersection points and interference intersection points.
[0119] The interference intersections are cleaned up.
[0120] Specifically, in the refined second table frame, each straight line is composed of individual pixels arranged sequentially. Based on this characteristic, the table intersection type can be retrieved. After obtaining the table intersection type, the distance between the intersections is minimized according to the relationship between each intersection, thus enabling the extraction of the smallest cell enclosed by each intersection.
[0121] Research revealed that the intersections in the table mainly include, for example: Figure 3 There are a total of 9 types, 1-9 shown.
[0122] The retrieval of table intersection types can be implemented based on the eight-neighbor matrix of a single pixel. Specifically, for different types of table intersections, all foreground pixels (white pixels) in the second table frame are traversed. That is, with P1=1, the position of the pixel and its eight neighboring pixels are taken, and different types of intersections are retrieved based on the pixel combinations at different positions.
[0123] Taking the first and fifth types of intersections as examples, their eight-neighborhood matrix diagrams are as follows: Figure 4-5 As shown.
[0124] The true intersection point and the interfering intersection point can be determined by using the judgment conditions for standard intersection points and non-standard intersection points. The judgment conditions for standard intersection points and non-standard intersection points are as follows: Figure 6-7 As shown.
[0125] After performing standard intersection detection, the coordinates (y, x) of each standard intersection point can be obtained. Extending the x and y axes of all intersection points yields the coordinates of all line intersections. These coordinate points could potentially be the intersection points of the current table slice's borders. Therefore, non-standard table intersection detection can be performed again on the possible intersection points to obtain the true intersection points and interfering intersection points.
[0126] Among them, interference intersections include isolated pixels and interference pixels. In practical application scenarios, interference lines may overlap with the frame lines, forming isolated pixels that are not on the same axis as other table intersections, leading to slicing errors or incorrect calculation of row and column numbers. Therefore, it is necessary to clean up isolated pixels and interference pixels.
[0127] Specifically, the process for identifying isolated pixels is as follows: Figure 8As shown: First, obtain the coordinates (y, x) of the intersection point. Then, count the total number of other types of intersection points along the x-axis and y-axis respectively. If there are no other types of intersection points along the x-axis and y-axis, then this intersection point is an isolated pixel point and needs to be deleted. If there are other types of intersection points along the x-axis and / or y-axis, then this intersection point is a non-isolated pixel point and needs to be retained.
[0128] After obtaining all the real intersections on the second table frame, the individual cells in the table slice can be extracted based on the type of the real intersections and the relationship between them.
[0129] Specifically, each top-left true intersection point, i.e., the (1,2,4,5) type true intersection point, corresponds to a minimum cell. Therefore, the first step in searching a cell is to find the top-left true intersection point of the cell.
[0130] When the retrieved true intersection point is of the top-left true intersection point type, the right true intersection point is retrieved along the x-axis of that true intersection point. That is, when the true intersection point type is the (2,3,5,6) type true intersection point, the minimum distance between the top-left true intersection point and its right true intersection point is calculated. This value is the width (weight) of the minimum cell corresponding to this top-left true intersection point.
[0131] Similarly, search for the lower true intersection point along the y-axis of the true intersection point. That is, when the true intersection point type is the (4,5,7,8) type true intersection point, find the minimum distance between the upper left true intersection point and the lower true intersection point. This value is the height of the minimum cell corresponding to the upper left true intersection point.
[0132] By following the above process, table slices can be accurately cropped to obtain refined cells, which can provide accurate basic data for subsequent character recognition and has great compatibility with different communication engineering drawings.
[0133] In one embodiment, the step of identifying the text paragraph slice and the planar image slice using a second recognition model to obtain second slice recognition data includes:
[0134] Based on the second recognition model, the text paragraph slice and the planar image slice are recognized using an optical character recognition algorithm to obtain the second slice recognition information;
[0135] The second slice identification information is encapsulated to obtain the second slice identification data.
[0136] It should be noted that Optical Character Recognition (OCR) refers to the process of analyzing and recognizing image files of text materials to obtain text and version information. In other words, it involves recognizing the text in an image and returning the content in text form.
[0137] The second recognition model can be a general-purpose OCR model, which can be obtained by secondary development of the pre-trained OCR text recognition model chinese_ocr_db_crnn_server that is already open sourced by PaddleHub. The second recognition model supports direct recognition, so it can directly recognize text paragraph slices and planar image slices, quickly obtain the second slice recognition data, and then encapsulate the second slice recognition data in a data structure to ensure the uniformity of the data format.
[0138] The communication engineering drawing recognition device provided in the embodiments of this application is described below. The communication engineering drawing recognition device described below can be referred to in correspondence with the communication engineering drawing recognition method described above.
[0139] Figure 9 This application provides a schematic diagram of the structure of a communication engineering drawing recognition device.
[0140] Reference Figure 9 This application provides a communication engineering drawing recognition device, which may include:
[0141] The communication engineering drawing inspection module 910 is used to: inspect communication engineering drawings through a target detection model to obtain table slices, text paragraph slices, and plan slices;
[0142] The first slice recognition data acquisition module 920 is used to: identify the table slices through the first recognition model to obtain the first slice recognition data;
[0143] The second slice recognition data acquisition module 930 is used to: identify the text paragraph slice and the planar image slice through the second recognition model to obtain the second slice recognition data;
[0144] The communication engineering drawing recognition data acquisition module 940 is used to: summarize the first slice recognition data and the second slice recognition data to obtain communication engineering drawing recognition data.
[0145] In one embodiment, the communication engineering drawing detection module 910 includes:
[0146] The image feature acquisition submodule is used to: obtain image features of several communication engineering drawings based on the feature extraction layer of the target detection model;
[0147] The candidate region data acquisition submodule is used to: obtain several candidate region data based on the image features of several of the aforementioned communication engineering drawings and a region generation network;
[0148] The candidate region feature vector acquisition submodule is used to: map several candidate region data into several candidate region feature vectors based on the mapping layer of the target detection model;
[0149] The candidate region feature vector classification submodule is used to classify several candidate region feature vectors based on the classification layer of the target detection model to obtain the table slice, the text paragraph slice, and the planar image slice.
[0150] In one embodiment, the target detection model is trained based on sample data of communication engineering drawings with table labels, text paragraph labels, and floor plan labels.
[0151] In one embodiment, the first slice identification data obtaining module 920 includes:
[0152] The table frame extraction submodule is used to: extract the table frame of the table slice;
[0153] The "Real Intersection Point Acquisition" submodule is used to: identify the intersection points in the table frame and obtain the real intersection points;
[0154] The cell acquisition submodule is used to: crop the table slice according to the type and position of the actual intersection point to obtain the cell;
[0155] The first slice recognition information acquisition submodule is used to: based on the first recognition model, use an optical character recognition algorithm to recognize the cell to obtain the first slice recognition information;
[0156] The first slice recognition data acquisition submodule is used to: encapsulate the first slice recognition information to obtain the first slice recognition data.
[0157] In one embodiment, the table frame extraction submodule includes:
[0158] The first table frame submodule is used to: extract the first table frame of the table slice using a table frame coarse selection algorithm;
[0159] The table skeleton extraction submodule is used to: extract the table skeleton of the first table frame using a table skeleton extraction algorithm, wherein the width of the straight lines in the table skeleton is a single pixel.
[0160] The second table frame submodule is used to: perform line segment detection on the table skeleton and redraw the outer frame of the table skeleton to obtain the second table frame.
[0161] In one embodiment, the submodule for obtaining the true intersection point includes:
[0162] The intersection point classification submodule is used to: identify several intersection points in the second table frame based on the eight-neighbor matrix of a single pixel, and perform type discrimination on the several intersection points to obtain real intersection points and interference intersection points;
[0163] The interference intersection cleaning submodule is used to clean the interference intersections.
[0164] In one embodiment, the second slice identification data obtaining module 930 includes:
[0165] The second slice recognition information acquisition submodule is used to: based on the second recognition model, use an optical character recognition algorithm to recognize the text paragraph slice and the planar image slice to obtain the second slice recognition information;
[0166] The second slice recognition data acquisition submodule is used to: encapsulate the second slice recognition information to obtain the second slice recognition data.
[0167] Figure 10 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 10 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call a computer program in the memory 830 to execute the steps of the communication engineering drawing recognition method, such as including:
[0168] The target detection model is used to detect communication engineering drawings and obtain table slices, text paragraph slices, and plan slices.
[0169] The table slices are identified using the first recognition model to obtain the first slice recognition data;
[0170] The second recognition model is used to identify the text paragraph slices and the planar image slices to obtain the second slice recognition data;
[0171] The first slice identification data and the second slice identification data are combined to obtain the communication engineering drawing identification data.
[0172] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0173] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the communication engineering drawing recognition method provided in the above embodiments, such as including:
[0174] The target detection model is used to detect communication engineering drawings and obtain table slices, text paragraph slices, and plan slices.
[0175] The table slices are identified using the first recognition model to obtain the first slice recognition data;
[0176] The second recognition model is used to identify the text paragraph slices and the planar image slices to obtain the second slice recognition data;
[0177] The first slice identification data and the second slice identification data are combined to obtain the communication engineering drawing identification data.
[0178] On the other hand, embodiments of this application also provide a processor-readable storage medium storing a computer program for causing a processor to execute the steps of the communication engineering drawing recognition method provided in the above embodiments, such as including:
[0179] The target detection model is used to detect communication engineering drawings and obtain table slices, text paragraph slices, and plan slices.
[0180] The table slices are identified using the first recognition model to obtain the first slice recognition data;
[0181] The second recognition model is used to identify the text paragraph slices and the planar image slices to obtain the second slice recognition data;
[0182] The first slice identification data and the second slice identification data are combined to obtain the communication engineering drawing identification data.
[0183] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical memory (e.g., CD, DVD, BD, HVD), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).
[0184] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0185] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0186] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for recognizing communication engineering drawings, characterized in that, include: The target detection model is used to detect communication engineering drawings and obtain table slices, text paragraph slices, and plan slices. The table slices are identified using the first recognition model to obtain the first slice recognition data; The second recognition model is used to identify the text paragraph slices and the planar image slices to obtain the second slice recognition data; By summing the first slice identification data and the second slice identification data, communication engineering drawing identification data is obtained; The step of identifying the table slices using the first recognition model to obtain the first slice recognition data includes: Extract the table frame of the table slice, wherein the straight lines of the table frame are arranged by individual pixels; The intersection points in the table frame are identified to obtain the true intersection points, which are obtained by type identification based on the eight-neighbor matrix of a single pixel. Based on the type and location of the actual intersection points, the table slices are cropped to obtain cells; Based on the first recognition model, the cell is recognized using an optical character recognition algorithm to obtain the first slice recognition information; The first slice identification information is encapsulated to obtain the first slice identification data.
2. The communication engineering drawing recognition method according to claim 1, characterized in that, The method of detecting communication engineering drawings using a target detection model to obtain table slices, text paragraph slices, and plan slices includes: Based on the feature extraction layer of the target detection model, image features of several communication engineering drawings are obtained. Based on the image features of several communication engineering drawings, several candidate region data are obtained using a region generation network. Based on the mapping layer of the target detection model, several candidate region data are mapped into several candidate region feature vectors; Based on the classification layer of the target detection model, the feature vectors of several candidate regions are classified to obtain the table slice, the text paragraph slice, and the planar image slice.
3. The communication engineering drawing recognition method according to claim 1, characterized in that, The target detection model is trained on sample data of communication engineering drawings with table labels, text paragraph labels, and floor plan labels.
4. The communication engineering drawing recognition method according to claim 1, characterized in that, The table frame for extracting the table slices includes: The first table frame of the table slice is extracted using a table frame coarse selection algorithm; The table skeleton of the first table frame is extracted using a table skeleton extraction algorithm, wherein the width of the straight lines in the table skeleton is a single pixel. Line segment detection is performed on the table skeleton, and the outer frame of the table skeleton is redrawn to obtain the second table frame.
5. The communication engineering drawing recognition method according to claim 4, characterized in that, The step of identifying the intersection points in the table frame to obtain the true intersection points includes: Based on the eight-neighborhood matrix of a single pixel, several intersection points in the second table frame are identified, and the types of these intersection points are determined to obtain the real intersection points and interference intersection points. The interference intersections are cleaned up.
6. The communication engineering drawing recognition method according to any one of claims 1-3, characterized in that, The step of identifying the text paragraph slices and the planar image slices using the second recognition model to obtain second slice recognition data includes: Based on the second recognition model, the text paragraph slice and the planar image slice are recognized using an optical character recognition algorithm to obtain the second slice recognition information; The second slice identification information is encapsulated to obtain the second slice identification data.
7. A communication engineering drawing recognition device, characterized in that, include: The communication engineering drawing inspection module is used to: inspect communication engineering drawings using a target detection model to obtain table slices, text paragraph slices, and plan slices; The first slice recognition data acquisition module is used to: identify the table slices through a first recognition model to obtain the first slice recognition data; The second slice recognition data acquisition module is used to: identify the text paragraph slice and the planar image slice through the second recognition model to obtain the second slice recognition data; The module for obtaining communication engineering drawing recognition data is used to: summarize the first slice recognition data and the second slice recognition data to obtain communication engineering drawing recognition data; The module for obtaining the first slice recognition data includes: The table frame extraction submodule is used to: extract the table frame of the table slice, wherein the straight lines of the table frame are arranged by single pixels; The real intersection point acquisition submodule is used to: identify the intersection points in the table frame and obtain the real intersection points, which are obtained by type identification based on the eight-neighbor matrix of a single pixel; The cell acquisition submodule is used to: crop the table slice according to the type and position of the actual intersection point to obtain the cell; The first slice recognition information acquisition submodule is used to: based on the first recognition model, use an optical character recognition algorithm to recognize the cell to obtain the first slice recognition information; The first slice identification data acquisition submodule is used to: encapsulate the first slice identification information to obtain the first slice identification data.
8. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the communication engineering drawing recognition method according to any one of claims 1 to 6.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the communication engineering drawing recognition method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Picture processing method and device, storage medium and electronic equipment
CN111444922A
Table identification method and device
CN113269153A