CN116110070A - Communication engineering drawing recognition method and device - Google Patents

Communication engineering drawing recognition method and device Download PDF

Info

Publication number
CN116110070A
CN116110070A CN202111320690.5A CN202111320690A CN116110070A CN 116110070 A CN116110070 A CN 116110070A CN 202111320690 A CN202111320690 A CN 202111320690A CN 116110070 A CN116110070 A CN 116110070A
Authority
CN
China
Prior art keywords
slice
communication engineering
engineering drawing
identification data
identification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111320690.5A
Other languages
Chinese (zh)
Inventor
苏泽橙
裴金栋
王冬梅
易正元
林广禄
陈卓
赵业祯
郑宝鑫
张兵战
黄建威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Group Guangdong Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Guangdong Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Group Guangdong Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202111320690.5A priority Critical patent/CN116110070A/en
Publication of CN116110070A publication Critical patent/CN116110070A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application provides a communication engineering drawing identification method and device, and relates to the technical field of drawing information acquisition. The method comprises the following steps: detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice; identifying the table slice through the first identification model to obtain first slice identification data; identifying text paragraph slices and plan view slices through a second identification model to obtain second slice identification data; and summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data. According to the communication engineering drawing identification method, the information on the communication engineering drawing is not required to be manually read, the information is not required to be manually input, and the information on the communication engineering drawing is identified and extracted by combining the target detection model, the first identification model and the second identification model, so that the efficiency and the accuracy of identifying the information and extracting the information can be greatly improved, and meanwhile, the labor cost is reduced.

Description

Communication engineering drawing recognition method and device
Technical Field
The application relates to the technical field of drawing information acquisition, in particular to a communication engineering drawing identification method, a device, electronic equipment and a computer program product.
Background
In the network access stage of the wireless base station construction, the communication engineering construction department must enter network equipment information and supporting facility information into a comprehensive network resource management system according to a design drawing so as to develop maintenance activities such as resource scheduling, fault management and the like in the maintenance stage. The method adopted at present is that communication engineering entry personnel searches relevant fields of resources on a design drawing, and fills the fields into a resource entry form and then imports the system.
However, the information quantity contained in the design drawing is larger, about 160 fields of the resource data of one wireless base station need to be manually recorded, about 55 fields exist, the drawing templates of different design units are different, the recording personnel need to clearly know the different drawing templates, besides the design drawing, the recording personnel also need to combine the related data of a plurality of systems, and the resource data in the design drawing can be correctly read through approval and comparison, so that the information recording efficiency is very low, the labor cost is very high, the manual recording is easy to make mistakes, and the information recording accuracy cannot be guaranteed.
Disclosure of Invention
The embodiment of the application provides a communication engineering drawing identification method, which is used for solving the technical problems that the information input efficiency is very low, the labor cost is very high and the information input accuracy cannot be ensured due to the mode of manually inputting communication engineering drawing information.
In a first aspect, an embodiment of the present application provides a method for identifying a communication engineering drawing, including:
detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice;
identifying the table slice through a first identification model to obtain first slice identification data;
identifying the text paragraph slice and the plane graph slice through a second identification model to obtain second slice identification data;
and summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
In one embodiment, the detecting the communication engineering drawing through the object detection model to obtain a form slice, a text paragraph slice, and a plan view slice includes:
based on the feature extraction layer of the target detection model, obtaining image features of a plurality of communication engineering drawings;
according to the image characteristics of a plurality of communication engineering drawings, obtaining a plurality of candidate area data based on an area generation network (RPN network, region Proposal Network);
mapping the candidate region data into candidate region feature vectors based on a mapping layer of the target detection model;
And classifying the candidate region feature vectors based on a classification layer of the target detection model to obtain the table slice, the text paragraph slice and the plan view slice.
In one embodiment, the object detection model is trained based on communication engineering drawing sample data with form tags, text paragraph tags, and planogram tags.
In one embodiment, the identifying the table slice by the first identification model to obtain first slice identification data includes:
extracting a table frame of the table slice;
judging the crossing points in the table frame to obtain real crossing points;
cutting the table slice according to the type and the position of the real intersection point to obtain a cell;
based on the first recognition model, recognizing the unit cell by utilizing an optical character recognition algorithm to obtain first slice recognition information;
and packaging the first slice identification information to obtain the first slice identification data.
In one embodiment, the extracting the table frame of the table slice includes:
extracting a first table frame of the table slice by using a table frame roughing algorithm;
Extracting a table skeleton of the first table frame by using a table skeleton extraction algorithm, wherein the width of a straight line in the table skeleton is single pixel width;
and carrying out line segment detection on the table skeleton, and redrawing the outer frame line of the table skeleton to obtain a second table skeleton.
In one embodiment, the determining the intersection in the table frame to obtain the real intersection includes:
based on an eight-neighborhood matrix of single pixel points, identifying a plurality of crossing points in the second table frame, and judging the types of the crossing points to obtain a real crossing point and an interference crossing point;
and cleaning the interference crossing points.
In one embodiment, the identifying the text paragraph slice and the plan view slice by the second identification model, to obtain second slice identification data, includes:
based on the second recognition model, recognizing the text paragraph slice and the plane graph slice by using an optical character recognition algorithm to obtain second slice recognition information;
and packaging the second slice identification information to obtain the second slice identification data.
In a second aspect, an embodiment of the present application provides a communication engineering drawing recognition device, including:
Communication engineering drawing detection module for: detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice;
the first slice identification data obtaining module is used for: identifying the table slice through a first identification model to obtain first slice identification data;
a second slice identification data obtaining module for: identifying the text paragraph slice and the plane graph slice through a second identification model to obtain second slice identification data;
the communication engineering drawing identification data obtaining module is used for: and summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory storing a computer program, where the processor implements the steps of the communication engineering drawing identification method according to the first aspect when executing the program.
In a fourth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements the steps of the communication engineering drawing identification method of the first aspect.
According to the communication engineering drawing identification method and device, the target detection model is used for detecting the communication engineering drawing, a form slice, a text paragraph slice and a plane view slice of the communication engineering drawing are obtained first, then the form slice is identified through the first identification model, first slice identification data are obtained, the text paragraph slice and the plane view slice are identified through the second identification model, second slice identification data are obtained, and finally the first slice identification data and the second slice identification data are summarized, so that the communication engineering drawing identification data are obtained.
According to the communication engineering drawing identification method and device, information contained in the communication engineering drawing is not required to be manually read, information is not required to be manually input, the information contained in the communication engineering drawing is identified and extracted by combining the target detection model, the first identification model and the second identification model, more particularly, the table slice, the text paragraph slice and the plane graph slice are respectively identified and extracted through the first identification model and the second identification model, so that the efficiency and the accuracy of identifying information and extracting information can be greatly improved, and meanwhile, the labor cost is reduced.
Drawings
For a clearer description of the present application or of the prior art, the drawings that are used in the description of the embodiments or of the prior art will be briefly described, it being apparent that the drawings in the description below are some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a communication engineering drawing recognition method provided in an embodiment of the present application;
FIG. 2 shows labels in a dataset made while training a target detection model and the types of target areas to which the labels correspond;
FIG. 3 shows nine types of intersections in a table;
FIG. 4 shows an eight neighborhood matrix for class 1 intersection points;
FIG. 5 shows an eight neighborhood matrix for class 5 intersection points;
fig. 6 shows judgment conditions of standard intersections;
fig. 7 shows a judgment condition of a non-standard intersection;
fig. 8 shows a judgment process of judging isolated pixel points;
fig. 9 is a schematic structural diagram of a communication engineering drawing recognition device provided in an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Fig. 1 is a schematic flow chart of a communication engineering drawing recognition method according to an embodiment of the present application.
Referring to fig. 1, an embodiment of the present application provides a communication engineering drawing identification method, which may include:
s110, detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice;
s120, identifying the table slice through a first identification model to obtain first slice identification data;
s130, identifying the text paragraph slice and the plane graph slice through a second identification model to obtain second slice identification data;
and S140, summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
It should be noted that the target detection model, the first recognition model, and the second recognition model may be all obtained by training in advance.
Taking the target detection model as an example, the target detection model can be a Faster R-CNN target detection model, and the target detection model can be trained based on communication engineering drawing sample data with form labels, text paragraph labels and planogram labels.
The data set is created prior to training the object detection model.
Specifically, the data set can be obtained from 150 parts of standard communication engineering drawings established by a certain communication group, and total more than 1000 design scheme images, then three kinds of slices, namely a table slice, a text paragraph slice and a plane view slice in the design scheme images are marked by using open source software labelImg, for example, the position of a table title in the table slice is marked by a marking mode, whether an auxiliary identifier (possibly an auxiliary identifier for facilitating text reading) is marked in the text slice, whether a frame is marked in the plane view slice or not is marked, and the like, and corresponding information is regenerated and stored in a corresponding xml file. Fig. 2 shows several labels and label types corresponding to the labels, more specifically, the position of a table title in a table slice (for example, the upper left side of a table in the table slice) can be marked by marking a label "table" on the table slice by using open source software labeimg, or a box in a plan view slice can be marked by marking a label "image" on the plan view slice, or the like.
The target detection model is obtained based on communication engineering drawing sample data training with form labels, text paragraph labels and planogram labels, and compared with an open-source form and text data set, the target detection model can be more intelligently identified: whether the text slice has an auxiliary identifier, whether the plan view slice has an outline, whether the form title is positioned at the upper left of the form, etc.
For annotated image datasets, code is used to generate test. Txt (test set), train. Txt (training set), val. Txt (validation set), train. Txt (training validation set, composed of train. Txt and val. Txt) under the dataset catalog. Regarding the set up of the data set, test. Txt (test set) may be approximately 20% of the entire data set, and tranval. Txt (training verification set) may be the remaining 80% of the entire data set; the train. Txt (training set) may be approximately 80% of the train. Txt (training verification set), and val. Txt (verification set) may be the remaining 20% of the train. Txt (training verification set). The proportion of data included in each data set can be modified according to actual requirements.
After the data set is manufactured, the GPU may: GPU core code is configured on Tesla V100 (graphics processor) and a target detection model is trained, and the adopted basic environment is dependent on Paddlepaddle 2.0 and python 3.7.
The target detection model may pre-process data of the target detection/instance segmentation task using paddlex.
Normal (normalization) function: normalizing the image;
random horizontal flip function: randomly and horizontally overturning the image with a certain probability;
ressizebyshort (short side resizing) function: adjusting the size of the image according to the short side of the image;
padding function: adjusting the length and width of the image to a fixed multiple;
the above functions can be combined according to actual requirements by using the [ compound ] class to preprocess the data, wherein the training set and the test set need to be defined respectively.
The target detection model needs to load the data set before training, and the target detection model can use two data sets of a VOCDetection format and a COCOdetection format, and because the xml file of the data set in the embodiment of the application is in the VOC format, the data set is loaded by adopting a pdx.datases.VOCDetection.
The training process of the target detection model can be for example totaling 46 training rounds, the model training process can output and store the model to a designated catalog once every 2 rounds, and meanwhile, the verification data set is used for calculating related indexes, verifying the training result and screening out the optimal model.
After the target detection model is trained, the loss value and the accuracy of the target detection model can be analyzed, and the accuracy of the target detection model is ensured.
The loss function value loss refers to the average loss function value loss of training samples participating in the current iteration step number, the fitting effect of the model can be judged by calculating the loss function value loss, and the lower the loss value is, the better the fitting effect of the model on the training set is indicated.
The average accuracy average value bbox_map represents the average accuracy average value of the whole verification set in the detection task, the detection performance of the model can be judged by calculating the average accuracy average value bbox_map, and the larger the average accuracy average value bbox_map is, the better the detection performance of the model is indicated.
The test dataset may then be predicted using a trained target detection model, where a confidence threshold may be set, and boxes with Box confidence below the threshold are filtered from visualization.
The prediction result of the target detection model obtained through training is high in confidence coefficient and accurate in image type segmentation, and the target detection model can be compressed and optimized and put into production for use.
It should be noted that, the execution body of the communication engineering drawing identification method provided in the embodiment of the present application may be a terminal side device, such as a data processor.
In step S110, the terminal device detects the communication engineering drawing through the object detection model, and obtains a form slice, a text paragraph slice, and a planogram slice.
The terminal side equipment can detect the form slice, the text paragraph slice and the plan view slice of the communication engineering drawing through the pre-trained target detection model to obtain a preliminary form slice, a preliminary text paragraph slice and a preliminary plan view slice, obtain information such as confidence level according to the form slice, the preliminary text paragraph slice and the form label, the text paragraph label and the plan view label on the preliminary plan view slice, and then perform secondary segmentation on the slice with the opposite confidence level being greater than a threshold (for example, 0.9) so as to obtain the form slice, the text paragraph slice and the plan view slice with better quality.
In step S120, the terminal device identifies the table slice through the first identification model, and obtains first slice identification data.
The first recognition model may be a recognition model based on table features, for example, an OCR (Optical Character Recognition ) model based on table features, and before the terminal side device recognizes the table slice through the first recognition model, the table slice may be preprocessed, for example, the table frame roughing, the table frame thinning, the cleaning of isolated pixels and/or interference pixels, the cell cutting, and the like, so that characters in the table slice can be accurately located and recognized later.
The first slice identification data obtained by the terminal side equipment identifying the table slice through the first identification model may comprise table title information of the table, position information of the title, row and column information of the table, merging information of the cells, text information of the cells, position information of the cells, confidence and other information, and then the first slice data can be packaged to ensure the unification of data formats.
In step S130, the terminal device identifies the text paragraph slice and the plan view slice through the second identification model, and obtains second slice identification data.
The second recognition model may be a generic OCR (Optical Character Recognition ) model, which may be obtained by PaddleHub, which may be pre-trained, and then developed a second time to obtain the second recognition model.
The terminal side equipment can analyze and identify the text paragraph slice and the plan view slice by using the second identification model, then acquire second slice identification data, wherein the second slice data may include information such as slice type information, text slice position information, text and position information of each line on the slice, text information of the whole text paragraph on the slice, overall confidence and the like, and then package the second slice data to ensure the unification of data formats.
Compared with an open source OCR algorithm such as EasyOCR, chineseOCR, the method has the advantages that the text recognition accuracy is high, the use cost is low, the open source and personalized training is supported, and more possibility is provided for the later performance optimization.
In step S140, the terminal device may aggregate the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
The first slice identification data is data obtained by identifying a table slice through a first identification model, the second slice identification data is data obtained by identifying a text paragraph slice and a plan view slice through a second identification model, after the first slice identification data and the second slice identification data are summarized, the first slice identification data and the second slice identification data can be respectively processed into standardized text or structured JSON data, and then the first slice identification data and the second slice identification data which are processed in a standardized manner are arranged and integrated according to the arrangement sequence on the original communication engineering drawing to obtain final communication engineering drawing identification data, or the first slice identification data and the second slice identification data which are processed in a standardized manner are arranged and integrated according to a preset template to ensure the format uniformity of the finally obtained communication engineering drawing identification data, so that the follow-up check is convenient.
According to the communication engineering drawing identification method, a target detection model is used for detecting a communication engineering drawing, a form slice, a text paragraph slice and a planogram slice of the communication engineering drawing are obtained first, then the form slice is identified through a first identification model, first slice identification data are obtained, the text paragraph slice and the planogram slice are identified through a second identification model, second slice identification data are obtained, and finally the first slice identification data and the second slice identification data are summarized, so that the communication engineering drawing identification data are obtained.
According to the communication engineering drawing identification method provided by the embodiment of the application, the information contained in the communication engineering drawing is not required to be manually read, the information is not required to be manually input, the information contained in the communication engineering drawing is identified and extracted by combining the target detection model, the first identification model and the second identification model, more particularly, the table slice, the text paragraph slice and the plane graph slice are respectively identified and extracted through the first identification model and the second identification model, so that the efficiency and the accuracy of identifying information and extracting information can be greatly improved, and meanwhile, the labor cost is reduced.
In one embodiment, the detecting the communication engineering drawing through the object detection model to obtain a form slice, a text paragraph slice, and a plan view slice includes:
based on the feature extraction layer of the target detection model, obtaining image features of a plurality of communication engineering drawings;
according to the image characteristics of a plurality of communication engineering drawings, obtaining a plurality of candidate area data based on an area generation network (RPN network, region Proposal Network);
mapping the candidate region data into candidate region feature vectors based on a mapping layer of the target detection model;
and classifying the candidate region feature vectors based on a classification layer of the target detection model to obtain the table slice, the text paragraph slice and the plan view slice.
The target detection model may be a pre-trained Faster R-CNN target detection model that includes a feature extraction layer, a mapping layer, and a classification layer.
When the terminal side equipment carries out detection analysis processing on communication engineering drawings through a target detection model, firstly extracting image features from a plurality of communication engineering drawings based on a feature extraction layer of the target detection model, wherein the image features can be realized through a direction gradient Histogram (HOG) feature extraction algorithm or a Local Binary Pattern (LBP) feature extraction algorithm, and then generating a network based on regions according to the image features of the plurality of communication engineering drawings to obtain a plurality of candidate region data; then, based on a mapping layer of a target detection model, mapping a plurality of candidate region data into a plurality of candidate region feature vectors, wherein the mapping process is equivalent to data dimension reduction, and the mapping of the plurality of candidate region data into the plurality of candidate region feature vectors can be realized through a dimension reduction method based on low-dimension projection, a dimension reduction method based on a neural network, a dimension reduction method based on correlation between data or a dimension reduction method based on fractal; and finally classifying the candidate region feature vectors based on a classification layer of the target detection model, and classifying the candidate region feature vectors according to a data base used when the target detection model is trained in advance to obtain a table slice, a text paragraph slice and a planogram slice which are expected to be obtained when the target detection model is trained.
By the communication engineering drawing identification method, the information of the communication engineering drawing can be identified and extracted more quickly and intelligently, and the quality of the information can be effectively guaranteed.
In one embodiment, the identifying the table slice by the first identification model to obtain first slice identification data includes:
extracting a table frame of the table slice;
judging the crossing points in the table frame to obtain real crossing points;
cutting the table slice according to the type and the position of the real intersection point to obtain a cell;
based on the first recognition model, recognizing the unit cell by utilizing an optical character recognition algorithm to obtain first slice recognition information;
and packaging the first slice identification information to obtain the first slice identification data.
Before the table slice is identified, the table frame of the table slice can be firstly preprocessed, for example, the table frame of the table slice is extracted, the intersection points in the table frame are judged, the real intersection points are obtained, the table slice is cut according to the positions of the real intersection points, the cells are obtained, and the like, so that the content on the table slice is ensured to be clearly identifiable, and the table slice can be effectively identified subsequently.
And then based on the first recognition model, recognizing the cell by utilizing an optical character recognition algorithm to obtain first slice recognition information, and packaging the first slice recognition information, for example, into structured JSON data, so as to obtain first slice recognition data, and ensuring the format uniformity of the first slice recognition data.
In one embodiment, the extracting the table frame of the table slice includes:
extracting a first table frame of the table slice by using a table frame roughing algorithm;
extracting a table skeleton of the first table frame by using a table skeleton extraction algorithm, wherein the width of a straight line in the table skeleton is single pixel width;
and carrying out line segment detection on the table skeleton, and redrawing the outer frame line of the table skeleton to obtain a second table skeleton.
Specifically, the first table frame of the table slice is extracted by using a table frame roughing algorithm, the image can be processed into a binary image through OpenCV, namely, only images with black and white colors are processed, then the threshold parameters for identifying the horizontal line and the vertical line are adjusted, then the OpenCV is used for carrying out straight line detection, and finally the detected horizontal line and the vertical line are overlapped, so that the first table frame of the table slice can be roughed, but the first table frame of the table slice may have the conditions of irregularity, different thicknesses of the horizontal line and the vertical line, and the like.
At this time, the table skeleton of the first table frame can be extracted by using a table skeleton extraction algorithm, and the connected region of the first table frame is thinned into a pixel width for feature extraction and target topology representation, so that the width of a straight line in the obtained table skeleton is the single pixel width. In this step, the table skeleton extraction may be performed using the Skeletonize () function provided by the morphy submodule in the skeleton extension package.
And then, line segment detection can be carried out on the table skeleton, 4 outer frame lines are screened out, the line segments are extended into straight lines, 4 vertexes of the table skeleton are obtained through crossing, and finally, the outer frame lines of the redrawn table skeleton can be completed by connecting the vertexes, so that a second table skeleton is obtained.
Thus, the second table frame of the table slice is obtained, and the accurate identification of the characters on the table slice can be ensured.
In one embodiment, the determining the intersection in the table frame to obtain the real intersection includes:
based on an eight-neighborhood matrix of single pixel points, identifying a plurality of crossing points in the second table frame, and judging the types of the crossing points to obtain a real crossing point and an interference crossing point;
And cleaning the interference crossing points.
Specifically, in the refined second table frame, each straight line is formed by sequentially arranging single pixels, based on the characteristic, the type of the table intersection point can be searched, and after the type of the table intersection point is obtained, the minimum distance between the intersection points is defined to be minimum according to the relation between the intersection points, namely, the minimum unit cell surrounded by the intersection points can be extracted.
It was found that the intersections in the table mainly comprise 9 types in total of 1-9 as shown in fig. 3.
With respect to the retrieval of the table cross-point type, this may be accomplished based on an eight-neighborhood matrix of single pixel points. Specifically, for different types of table intersection points, all foreground pixel points (white pixel points) in the second table frame are traversed, namely, on the premise of p1=1, the positions of the pixel point and eight adjacent pixel points are taken, and different types of intersection points are searched according to pixel combinations of different positions.
Taking the first class and the fifth class of crossing points as examples, eight neighborhood matrix diagrams are shown in fig. 4-5.
The real cross point and the interference cross point can be obtained by judging the judging condition of the standard cross point and the judging condition of the non-standard cross point, and the judging condition of the standard cross point and the judging condition of the non-standard cross point are shown in fig. 6-7.
After the standard crossing point detection is performed, the coordinates (y, x) of each standard crossing point can be obtained, the x and y axes of all crossing points are extended, and the position coordinates of all straight line crossing points are obtained, wherein all coordinate points are possible to be the frame line crossing points of the current table slice. Thus, table intersection detection in a non-standard format can be performed again on the positions where table intersections may occur, and then the real intersections and the disturbing intersections are obtained.
The interference intersection point includes an isolated pixel point and an interference pixel point, and because in an actual application scene, the interference line segment overlaps with the frame line to form an isolated pixel point which is not in the same axial direction with other table intersection points, so that a graph cutting error or a row and column number error is caused, the isolated pixel point and the interference pixel point need to be cleaned.
Specifically, the process of determining the isolated pixel point is as shown in fig. 8: the coordinates (y, x) of the cross points are obtained first, then, the total number of other types of cross points in the x-axis direction and the y-axis direction is counted, if the cross points in the x-axis direction and the y-axis direction are not provided with other types of cross points, the cross points are isolated pixel points and need to be deleted, and if the cross points in the x-axis direction and/or the y-axis direction are provided with other types of cross points, the cross points are non-isolated pixel points and need to be reserved.
After all the real intersections on the second table frame are obtained, each cell in the table slice can be extracted according to the type of the real intersection and the relation between the real intersections.
Specifically, each upper left corner real intersection, i.e., (1, 2,4, 5) class real intersection, corresponds to a minimum cell, so the first step in finding a cell is to find the upper left corner real intersection of the cell.
When the retrieved real intersection point type is the upper left corner real intersection point, the right side real intersection point is retrieved along the axial direction of the real intersection point x, namely, when the real intersection point type is the (2, 3,5, 6) type real intersection point, the minimum value is obtained for the distance between the upper left corner real intersection point and the right side real intersection point, namely, the width (weight) of the minimum cell corresponding to the upper left corner real intersection point.
Similarly, the lower real intersection is retrieved along the axis of the real intersection y, that is, when the real intersection type is the (4, 5,7, 8) th class real intersection, the minimum value is found for the distance between the upper left corner real intersection and the lower real intersection, that is, the height (height) of the minimum cell corresponding to the upper left corner real intersection.
The table slice can be accurately cut according to the process, so that the refined unit cells are obtained, accurate basic data can be provided for subsequent character recognition, and the method has great compatibility to different communication engineering drawings.
In one embodiment, the identifying the text paragraph slice and the plan view slice by the second identification model, to obtain second slice identification data, includes:
based on the second recognition model, recognizing the text paragraph slice and the plane graph slice by using an optical character recognition algorithm to obtain second slice recognition information;
and packaging the second slice identification information to obtain the second slice identification data.
Optical character recognition (Optical Character Recognition, OCR) refers to a process of analyzing and recognizing an image file of a text material to obtain text and version information. That is, the text in the image is identified and the text form of the content is returned.
The second recognition model can be a universal OCR model, can be obtained by adopting a pre-training model of Chinese_ OCR _db_crnn_server for the Paddlehub existing open source OCR character recognition to carry out secondary development, and supports direct recognition, so that a text paragraph slice and a plan view slice can be directly recognized, second slice recognition data can be quickly obtained, and then the second slice recognition data is subjected to data structured packaging, so that the format uniformity of the data can be ensured.
The communication engineering drawing recognition device provided in the embodiment of the present application is described below, and the communication engineering drawing recognition device described below and the communication engineering drawing recognition method described above may be referred to correspondingly.
Fig. 9 is a schematic structural diagram of a communication engineering drawing recognition device according to an embodiment of the present application.
Referring to fig. 9, an embodiment of the present application provides a communication engineering drawing identification device, which may include:
the communication engineering drawing detection module 910 is configured to: detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice;
the first slice identification data obtaining module 920 is configured to: identifying the table slice through a first identification model to obtain first slice identification data;
the second slice identification data obtaining module 930 is configured to: identifying the text paragraph slice and the plane graph slice through a second identification model to obtain second slice identification data;
a communication engineering drawing identification data obtaining module 940, configured to: and summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
In one embodiment, the communication engineering drawing detection module 910 includes:
The image feature obtaining sub-module is used for: based on the feature extraction layer of the target detection model, obtaining image features of a plurality of communication engineering drawings;
the candidate region data obtaining sub-module is used for: generating a network based on the region according to the image characteristics of a plurality of communication engineering drawings to obtain a plurality of candidate region data;
the candidate region feature vector obtaining sub-module is used for: mapping the candidate region data into candidate region feature vectors based on a mapping layer of the target detection model;
a candidate region feature vector classification sub-module for: and classifying the candidate region feature vectors based on a classification layer of the target detection model to obtain the table slice, the text paragraph slice and the plan view slice.
In one embodiment, the object detection model is trained based on communication engineering drawing sample data with form tags, text paragraph tags, and planogram tags.
In one embodiment, the first slice identification data obtaining module 920 includes:
the form framework extraction submodule is used for: extracting a table frame of the table slice;
The true intersection gets a sub-module for: judging the crossing points in the table frame to obtain real crossing points;
the unit cell is provided with a sub-module for: cutting the table slice according to the type and the position of the real intersection point to obtain a cell;
the first slice identification information obtaining sub-module is used for: based on the first recognition model, recognizing the unit cell by utilizing an optical character recognition algorithm to obtain first slice recognition information;
the first slice identification data is obtained as a sub-module for: and packaging the first slice identification information to obtain the first slice identification data.
In one embodiment, the table frame extraction submodule includes:
the first table framework obtains sub-modules for: extracting a first table frame of the table slice by using a table frame roughing algorithm;
the form skeleton obtains sub-modules for: extracting a table skeleton of the first table frame by using a table skeleton extraction algorithm, wherein the width of a straight line in the table skeleton is single pixel width;
the second table framework obtains sub-modules for: and carrying out line segment detection on the table skeleton, and redrawing the outer frame line of the table skeleton to obtain a second table skeleton.
In one embodiment, the real intersection obtaining submodule includes:
a cross point classification sub-module for: based on an eight-neighborhood matrix of single pixel points, identifying a plurality of crossing points in the second table frame, and judging the types of the crossing points to obtain a real crossing point and an interference crossing point;
an interfering cross-point cleaning sub-module for: and cleaning the interference crossing points.
In one embodiment, the second slice identification data obtaining module 930 includes:
the second slice identification information obtaining sub-module is used for: based on the second recognition model, recognizing the text paragraph slice and the plane graph slice by using an optical character recognition algorithm to obtain second slice recognition information;
the second slice identification data is obtained as a sub-module for: and packaging the second slice identification information to obtain the second slice identification data.
Fig. 10 illustrates a physical structure diagram of an electronic device, as shown in fig. 10, which may include: processor 810, communication interface (Communication Interface) 820, memory 830, and communication bus 840, wherein processor 810, communication interface 820, memory 830 accomplish communication with each other through communication bus 840. The processor 810 may call a computer program in the memory 830 to perform the steps of the communication engineering drawing identification method, including, for example:
Detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice;
identifying the table slice through a first identification model to obtain first slice identification data;
identifying the text paragraph slice and the plane graph slice through a second identification model to obtain second slice identification data;
and summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
Further, the logic instructions in the memory 830 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present application further provide a computer program product, where the computer program product includes a computer program, where the computer program may be stored on a non-transitory computer readable storage medium, where the computer program when executed by a processor is capable of executing the steps of the communication engineering drawing recognition method provided in the foregoing embodiments, for example, including:
detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice;
identifying the table slice through a first identification model to obtain first slice identification data;
identifying the text paragraph slice and the plane graph slice through a second identification model to obtain second slice identification data;
and summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
In another aspect, embodiments of the present application further provide a processor readable storage medium storing a computer program, where the computer program is configured to cause a processor to execute the steps of the communication engineering drawing identification method provided in the foregoing embodiments, for example, including:
Detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice;
identifying the table slice through a first identification model to obtain first slice identification data;
identifying the text paragraph slice and the plane graph slice through a second identification model to obtain second slice identification data;
and summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
The processor-readable storage medium may be any available medium or data storage device that can be accessed by a processor, including, but not limited to, magnetic storage (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical storage (e.g., CD, DVD, BD, HVD, etc.), semiconductor storage (e.g., ROM, EPROM, EEPROM, nonvolatile storage (NAND FLASH), solid State Disk (SSD)), and the like.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (10)

1. The communication engineering drawing identification method is characterized by comprising the following steps of:
detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice;
identifying the table slice through a first identification model to obtain first slice identification data;
identifying the text paragraph slice and the plane graph slice through a second identification model to obtain second slice identification data;
and summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
2. The method for identifying a communication engineering drawing according to claim 1, wherein the detecting the communication engineering drawing by the object detection model to obtain a form slice, a text paragraph slice, and a plan view slice comprises:
based on the feature extraction layer of the target detection model, obtaining image features of a plurality of communication engineering drawings;
generating a network based on the region according to the image characteristics of a plurality of communication engineering drawings to obtain a plurality of candidate region data;
mapping the candidate region data into candidate region feature vectors based on a mapping layer of the target detection model;
And classifying the candidate region feature vectors based on a classification layer of the target detection model to obtain the table slice, the text paragraph slice and the plan view slice.
3. The communication engineering drawing recognition method according to claim 1, wherein the object detection model is trained based on communication engineering drawing sample data with a form tag, a text paragraph tag, and a planogram tag.
4. A method for identifying a communication engineering drawing according to any one of claims 1 to 3, wherein the identifying the form slice by the first identification model to obtain first slice identification data includes:
extracting a table frame of the table slice;
judging the crossing points in the table frame to obtain real crossing points;
cutting the table slice according to the type and the position of the real intersection point to obtain a cell;
based on the first recognition model, recognizing the unit cell by utilizing an optical character recognition algorithm to obtain first slice recognition information;
and packaging the first slice identification information to obtain the first slice identification data.
5. The communication engineering drawing identification method according to claim 4, wherein the extracting the form frame of the form slice includes:
extracting a first table frame of the table slice by using a table frame roughing algorithm;
extracting a table skeleton of the first table frame by using a table skeleton extraction algorithm, wherein the width of a straight line in the table skeleton is single pixel width;
and carrying out line segment detection on the table skeleton, and redrawing the outer frame line of the table skeleton to obtain a second table skeleton.
6. The communication engineering drawing identification method according to claim 5, wherein the distinguishing the intersection in the table frame to obtain the real intersection comprises:
based on an eight-neighborhood matrix of single pixel points, identifying a plurality of crossing points in the second table frame, and judging the types of the crossing points to obtain a real crossing point and an interference crossing point;
and cleaning the interference crossing points.
7. A method of identifying a communication engineering drawing according to any one of claims 1 to 3, wherein identifying the text paragraph slice and the plan view slice by the second identification model to obtain second slice identification data includes:
Based on the second recognition model, recognizing the text paragraph slice and the plane graph slice by using an optical character recognition algorithm to obtain second slice recognition information;
and packaging the second slice identification information to obtain the second slice identification data.
8. A communication engineering drawing recognition device, characterized by comprising:
communication engineering drawing detection module for: detecting a communication engineering drawing through a target detection model to obtain a table slice, a text paragraph slice and a plan view slice;
the first slice identification data obtaining module is used for: identifying the table slice through a first identification model to obtain first slice identification data;
a second slice identification data obtaining module for: identifying the text paragraph slice and the plane graph slice through a second identification model to obtain second slice identification data;
the communication engineering drawing identification data obtaining module is used for: and summarizing the first slice identification data and the second slice identification data to obtain communication engineering drawing identification data.
9. An electronic device comprising a processor and a memory storing a computer program, characterized in that the processor implements the steps of the communication engineering drawing identification method of any one of claims 1 to 7 when executing the computer program.
10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the communication engineering drawing identification method of any one of claims 1 to 7.
CN202111320690.5A 2021-11-09 2021-11-09 Communication engineering drawing recognition method and device Pending CN116110070A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111320690.5A CN116110070A (en) 2021-11-09 2021-11-09 Communication engineering drawing recognition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111320690.5A CN116110070A (en) 2021-11-09 2021-11-09 Communication engineering drawing recognition method and device

Publications (1)

Publication Number Publication Date
CN116110070A true CN116110070A (en) 2023-05-12

Family

ID=86262489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111320690.5A Pending CN116110070A (en) 2021-11-09 2021-11-09 Communication engineering drawing recognition method and device

Country Status (1)

Country Link
CN (1) CN116110070A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116978052A (en) * 2023-07-21 2023-10-31 安徽省交通规划设计研究总院股份有限公司 Subgraph layout recognition method of bridge design diagram based on improved YOLOv5

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116978052A (en) * 2023-07-21 2023-10-31 安徽省交通规划设计研究总院股份有限公司 Subgraph layout recognition method of bridge design diagram based on improved YOLOv5
CN116978052B (en) * 2023-07-21 2024-04-09 安徽省交通规划设计研究总院股份有限公司 Subgraph layout recognition method of bridge design diagram based on improved YOLOv5

Similar Documents

Publication Publication Date Title
CN110569701B (en) Computer-implemented vehicle damage assessment method and device
US20190266394A1 (en) Method and device for parsing table in document image
US6996295B2 (en) Automatic document reading system for technical drawings
CN111460927B (en) Method for extracting structured information of house property evidence image
CN110503054B (en) Text image processing method and device
US20230029045A1 (en) Automatic image classification and processing method based on continuous processing structure of multiple artificial intelligence model, and computer program stored in computer-readable recording medium to execute the same
CN113962274B (en) Abnormity identification method and device, electronic equipment and storage medium
CN113963147B (en) Key information extraction method and system based on semantic segmentation
CN111652208A (en) User interface component identification method and device, electronic equipment and storage medium
US20230215125A1 (en) Data identification method and apparatus
CN114972880A (en) Label identification method and device, electronic equipment and storage medium
CN116110070A (en) Communication engineering drawing recognition method and device
CA3035387C (en) Digitization of industrial inspection sheets by inferring visual relations
CN117437647B (en) Oracle character detection method based on deep learning and computer vision
CN111461133A (en) Express delivery surface single item name identification method, device, equipment and storage medium
CN113393442A (en) Method and system for detecting abnormality of train parts, electronic device and storage medium
CN110287970B (en) Weak supervision object positioning method based on CAM and covering
CN112200789A (en) Image identification method and device, electronic equipment and storage medium
CN114927236A (en) Detection method and system for multiple target images
CN114120057A (en) Confusion matrix generation method based on Paddledetection
CN114821617A (en) Door and window hole identification method, device, equipment and readable storage medium
CN114332915A (en) Human body attribute detection method and device, computer equipment and storage medium
CN114387600A (en) Text feature recognition method and device, computer equipment and storage medium
CN113468977A (en) Text line language identification method and device and electronic equipment
CN112199984A (en) Target rapid detection method of large-scale remote sensing image

Legal Events

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