A method for text detection and recognition of large-scale complex PDF engineering drawings

By using high-resolution image cutting, two-time text detection and PaddleOCR recognition scheme in the text detection and recognition method of large-size complex PDF engineering drawings, the problem of inefficient text detection and recognition of large-size complex PDF engineering drawings in the prior art is solved, and efficient and accurate text recognition is achieved.

CN115035541BActive Publication Date: 2025-03-14CNNC NUCLEAR POWER OPERATION MANAGEMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210735421.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2025-03-14
Estimated Expiration
2042-06-27

AI Technical Summary

Technical Problem

The prior art has high cost, low efficiency and complex drawing content in the text detection and recognition of large-size complex PDF engineering drawings, making it difficult to achieve efficient and automated text extraction.

Method used

A large-size complex PDF engineering drawing text detection and recognition method is adopted, including pre-processing to generate high-resolution images, cutting into low-resolution sub-graphs, and performing two text detection and recognition. Using AdvancedEAST and PaddleOCR schemes, duplicate data is removed through sliding window chunking processing and coordinate mapping to improve the accuracy of text recognition.

Benefits of technology

It realizes accurate detection and recognition of effective text areas in large-size complex PDF engineering drawings, improves the accuracy and efficiency of text recognition, and reduces labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115035541B_ABST
    Figure CN115035541B_ABST
Patent Text Reader

Abstract

The present invention provides a method for detecting and recognizing text in a large-scale complex PDF engineering drawing, comprising the following steps: step S1: pre-processing the PDF engineering drawing to generate a corresponding high-resolution image; step S2: cutting the high-resolution image into a plurality of low-resolution sub-images, and recording the corresponding order of the sub-images according to the positions; step S3: performing a first sub-image text detection, preliminarily locating the text area range in the sub-image, and outputting the position coordinates corresponding to the range; step S4: mapping the text area position coordinates in the sub-image to the original large image, removing duplicate data therein, and obtaining the corresponding text area image according to the position coordinates after deduplication; step S5: performing a second text detection, accurately locating the text in the text area, and cutting the corresponding text block; step S6: performing text recognition on the text block, extracting the text content in the text block, and the corresponding coordinate position. The method provided by the present invention improves the text recognition accuracy of complex drawings.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of nuclear power plant text drawing management, and in particular to a method for detecting and identifying text in large-size complex PDF engineering drawings. Background Art

[0002] In the engineering field, it is often necessary to establish a relationship between drawings and their text content in order to quickly query information such as material codes and component numbers in drawings and their corresponding drawings. In the past, such work was mostly done manually, which was inefficient and the cost of human resources was extremely high when processing text data of a large number of drawings. Therefore, a method for automatically identifying the text content of drawings is needed to replace manual work and complete the text extraction of large quantities of PDF drawings, thereby reducing labor costs and improving the efficiency of text extraction of engineering drawings.

[0003] Currently, text recognition for drawings generally requires two steps: text detection and text recognition. The purpose of text detection is to detect the text area in the drawing, locate the text in the image, and output the position coordinate information of the corresponding text area; the purpose of text recognition is to output the corresponding text for the text area in the drawing.

[0004] It can be seen that the existing drawing text extraction methods have problems such as high cost, low efficiency and complex drawing content. Summary of the invention

[0005] The purpose of the present invention is to overcome the defects described in the prior art, thereby providing a low-cost and high-efficiency method for detecting and recognizing text in large-size complex PDF engineering drawings.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] A method for detecting and recognizing text in large-scale complex PDF engineering drawings, comprising the following steps:

[0008] Step S1: pre-process the pdf engineering drawing to generate the corresponding high-resolution image;

[0009] Step S2: cutting the high-resolution image into a number of low-resolution sub-images, and recording the corresponding order of the sub-images according to their positions;

[0010] Step S3: Perform the first sub-image text detection, preliminarily locate the text area range in the sub-image, and output the position coordinates corresponding to the range;

[0011] Step S4: Mapping the text area position coordinates in the sub-image to the original large image, removing duplicate data therein, and obtaining the corresponding text area image according to the position coordinates after deduplication;

[0012] Step S5: performing a second text detection, accurately locating the text in the text area, and cropping the corresponding text block;

[0013] Step S6: Perform text recognition on the text block to extract the text content in the text block and the corresponding coordinate position.

[0014] In step S2, the high-resolution image is cut into several low-resolution sub-images by using sliding window cropping.

[0015] In step S3, the AdvancedEAST method is used to complete the text detection of the sub-image, and the rough position information of the text area in the sub-image is preliminarily obtained.

[0016] Step S4 includes:

[0017] Step S41: Mapping the coordinate position in step S3 to the original high-resolution large image;

[0018] Step S42: removing duplicate data in the coordinate information;

[0019] Step S43: Crop the corresponding text area image according to the position coordinates after deduplication.

[0020] In step S5, a second text detection is performed on the text area image obtained in step S4, the text is accurately located, and the corresponding text image is cropped.

[0021] In step S6, the PaddleOCR text recognition solution is used to complete the text recognition of the text image obtained in step S5, and finally the text content and the corresponding image area coordinates are output.

[0022] Compared with the prior art, the large-scale complex PDF engineering drawing text detection and recognition method provided by the present invention has the following beneficial effects:

[0023] The method provided by the present invention can accurately detect the valid text area in large-scale complex PDF engineering drawings, including horizontal text area coordinate information and vertical text area coordinate information, and accurately identify the text content in the valid text area.

[0024] Furthermore, the present invention effectively avoids the adverse effects of interferences such as lines and patterns on recognition by performing two consecutive text detections, thereby improving the accuracy of text recognition of complex drawings.

[0025] Furthermore, the present invention realizes the application of the text detection and recognition method on large-size drawings through a sliding window block processing method, while avoiding the risk of continuous text being truncated. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1 The present invention provides a flowchart of a method for detecting and recognizing text in a large-scale complex PDF engineering drawing. DETAILED DESCRIPTION

[0028] The following is further explained in detail through specific implementation methods.

[0029] The present invention provides a method for detecting and recognizing text in large-scale complex PDF engineering drawings. The method can be generally divided into four parts: First, process the PDF drawings, convert them into high-resolution images, and orderly split them into sub-images of fixed sizes. Second, perform two text detections to accurately locate the text area. The first detection is for the sub-image to find the rough area range of the text in the sub-image; the second detection is for the area detected in the first time, eliminates the interference in the area, and accurately locates the text position. Third, text coordinate processing, maps the coordinates in the sub-image to a high-resolution large image, and screens out duplicate data in the coordinates; Fourth, text recognition, based on the text detection results, identifies the text content of the corresponding area, and outputs the text content and its corresponding coordinate position.

[0030] like Figure 1 As shown, the method for detecting and recognizing text in large-size complex PDF engineering drawings provided by the present invention comprises the following steps:

[0031] Step S1: pre-process the pdf engineering drawing to generate a corresponding high-resolution image, such as a 3680x2944 image of 10 million pixels;

[0032] Step S2: Use the sliding window cropping method to cut the high-resolution image into several sub-images of smaller sizes, and record the corresponding sequence numbers of the sub-images according to the horizontal and vertical sliding times i and j of the cropping window. The specific method is as follows: for a large image of 3680x2944, each sub-image I i,j The width w and height h of the image are both 736, and the horizontal and vertical sliding steps Δx and Δy are both 368, and finally 63 sub-images are obtained;

[0033] Step S3: Use the AdvancedEAST method to complete the text detection of the sub-graph and preliminarily obtain the rough position information of the text area in the sub-graph, which is specifically represented by the four vertices of the rectangular text area, corresponding to 8 coordinate values ​​(x 0 ,y 0 )…(x3 ,y 3 );

[0034] Step S4: Mapping the text area position coordinates in the sub-image to the original large image, removing duplicate data therein, and obtaining the corresponding text area image according to the position coordinates after deduplication;

[0035] Step S41: Map the coordinate position in step S3 to the original high-resolution large image. The coordinate mapping formula is as follows:

[0036] X m =i*Δx+x m , m = 0, 1, 2, 3;

[0037] Y n =j*Δy+y n , n = 0, 1, 2, 3;

[0038] Step S42: Remove duplicate data from the coordinate information. Since the sub-image is obtained by sliding window cropping in step S2, the same text area must be detected multiple times during detection, thereby obtaining multiple sets of coordinate information pointing to the same area in the original image. These duplicate data need to be merged into one set of coordinate data. The duplicate data merging determination formula is as follows:

[0039]

[0040] Among them, S i Represents the text area. If the text detection area is contained, the text area coordinates are merged and the smaller area coordinates are discarded.

[0041] Step S43: Crop the corresponding text area image according to the position coordinates after deduplication.

[0042] Step S5: Perform a second text detection on the text area image of the first text detection, accurately locate the text, and crop the corresponding text image. The second detection can effectively remove the interference of lines or patterns other than the text content in the text area of ​​the first detection, achieve more accurate text positioning, and ensure the accuracy of subsequent recognition.

[0043] Step S6: Use the PaddleOCR text recognition solution to perform text recognition on the precise text area obtained by text detection. Finally, output the text content and the corresponding image area coordinate position.

[0044] The text detection of the present invention adopts AdvancedEAST open source text detection solution, uses VGG16 network structure as the backbone network to extract pixel features in drawings, uses upsampling, convolution and other methods to achieve multi-channel feature fusion, and predicts text areas based on fused features. The text recognition part uses PaddleOCR open source text recognition solution, based on CRNN model, using CTC Loss as loss function.

[0045] The present invention provides an application-oriented basic technology, which solves the text detection and recognition problems in PDF engineering drawings with large size (note: the entire PDF drawing cannot be directly used as an input source) and complex content (note: there are horizontal text, vertical text, and interfering lines or patterns similar to text). It can provide technical support for related applications targeting specific texts in large-size and complex PDF engineering drawings, such as: code recognition of equipment codes or material codes, code error correction recommendations, code location queries, code file associations, etc.

[0046] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for detecting and recognizing text in large-scale complex PDF engineering drawings, characterized in that: The following steps are involved: Step S1: pre-process the pdf engineering drawing to generate the corresponding high-resolution image; Step S2: Cut the high-resolution image into several low-resolution sub-images by using sliding window cropping, and record the corresponding order of the sub-images according to their positions; Step S3: Perform the first sub-image text detection, preliminarily locate the text area range in the sub-image, and output the position coordinates corresponding to the range; wherein, the AdvancedEAST method is used to complete the sub-image text detection, and preliminarily obtain the rough position information of the text area in the sub-image; Step S4: Mapping the text area position coordinates in the sub-image to the original large image, removing duplicate data therein, and obtaining the corresponding text area image according to the position coordinates after deduplication; Step S5: performing a second text detection, accurately locating the text in the text area, and cropping the corresponding text block; Step S6: Perform text recognition on the text block, extract the text content in the text block, and the corresponding coordinate position; wherein, use the PaddleOCR text recognition solution to complete the text recognition of the text image obtained in step S5, and finally output the text content and the corresponding image area coordinates.

Citation Information

Patent Citations

  • Data synthesis and text recognition method for paper bill pictures

    CN111414906A

  • Weak supervision electric power drawing OCR identification method based on deep learning

    CN111860348A