Method, device and electronic equipment for recognizing layout text

By converting the general description drawings into element vector information and using text spacing and title attributes to identify text regions, the problem of recognition rate depending on image clarity in existing technologies is solved, achieving efficient and accurate text recognition.

CN116229497BActive Publication Date: 2026-03-27GLODON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies for text recognition in architectural general specification drawings have low recognition rates due to the reliance on image clarity, and are particularly ineffective for data with indistinct features.

Method used

By converting the target general description drawing into element vector information, using text spacing to determine dividing lines for column division, identifying text areas, determining paragraph positions based on title attributes, and finally splicing each line of text together to improve recognition accuracy and efficiency.

Benefits of technology

It enables efficient and accurate identification of text areas in general specification drawings in the construction industry, avoiding the processing of non-text areas and improving recognition efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116229497B_ABST
    Figure CN116229497B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of layout recognition, and particularly relates to a layout text recognition method, device and electronic equipment, the recognition method comprising: obtaining a target general description drawing; converting the target general description drawing into element vector information, and determining a title attribute in the target general description drawing; determining a text region in the element vector information according to the characteristics of each region type; determining position information of a paragraph corresponding to each title in the text region based on the title attribute; and determining text under each paragraph based on the position information of each paragraph. By converting the target general description drawing into element vector information and performing text recognition based on the element vector information, the accuracy of recognition can be ensured; and only the text in the text region is recognized, without the need for semantic analysis based on the text, but the coordinate information of each paragraph obtained through paragraph division processing is utilized, thereby improving the accuracy and efficiency of recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of layout recognition technology, specifically to methods, devices, and electronic equipment for recognizing layout text. Background Technology

[0002] Page layout analysis is currently primarily used to convert the content of paper documents into electronic information, enabling further digitization of the layout through layout understanding. A common approach is computer vision (CV) combined with optical character recognition (OCR). Specifically, the paper document is first converted into raw image data. Then, a model is trained based on collected raw image dataset samples to homogenize the complex layout into homogeneous single regions. For text regions, OCR technology is used to standardize them into text-formatted character sequences. Finally, character extraction and recognition are used to achieve document layout understanding and reconstruction.

[0003] However, when applying the above solution to general specification drawings in the architectural industry, the conversion of these drawings into images results in different resolutions depending on the size of the drawing, making the recognition rate dependent on the image clarity. Furthermore, computer vision (CV) relies on a training set, has a long implementation cycle, and suffers from low accuracy for data with indistinct features, such as drawings with table backgrounds in the architectural industry, where the performance is very poor. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method, apparatus and electronic device for recognizing layout text, in order to solve the problem of low efficiency and accuracy of layout text recognition.

[0005] According to a first aspect, embodiments of the present invention provide a method for recognizing layout text, comprising:

[0006] Obtain the target general specification drawing;

[0007] Convert the target general description drawing into element vector information and determine the title attribute in the target general description drawing;

[0008] The text region is determined from the element vector information based on the characteristics of each region type;

[0009] Based on the title attributes, the position information of the paragraphs corresponding to each title is determined in the text area;

[0010] The text under each paragraph is determined based on the position information of each paragraph.

[0011] The method for recognizing layout text provided by the embodiment of the present application can convert a target general description drawing into element vector information, and recognize text based on the element vector information, so as to ensure the accuracy of recognition; and only the text in the text area is recognized, without semantic analysis based on the text, but the coordinate information of each paragraph obtained by paragraph division processing is utilized, so as to improve the accuracy and efficiency of recognition.

[0012] With reference to the first aspect, in a first implementation manner of the first aspect, the text area is determined according to the features of each region type in the element vector information, including:

[0013] The interval between each text in the element vector information is obtained, and a division line is determined;

[0014] The element vector information is columned by using the division line, and at least one region is determined;

[0015] The text area is determined based on the features of the at least one region.

[0016] The method for recognizing layout text provided by the embodiment of the present application can determine a division line according to the interval between texts, and then column and divide regions by using the division line, since the size of the interval is the simplest way to distinguish regions and the gap between texts, the division line is determined based on this way, so that the processing flow is simplified and the recognition efficiency is improved.

[0017] With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, the interval between each text in the element vector information is obtained, and a division line is determined, including:

[0018] The coordinates of each text are obtained;

[0019] Whether the coordinate difference between adjacent texts exceeds a threshold value is determined based on the coordinates of each text;

[0020] When the coordinate difference between adjacent texts exceeds the threshold value, it is determined that the division line is located between the adjacent texts.

[0021] The method for recognizing layout text provided by the embodiment of the present application compares the coordinate difference with the threshold value, so that the division line can be accurately determined.

[0022] With reference to the first implementation manner of the first aspect, in a third implementation manner of the first aspect, the text area is determined based on the features of the at least one region, including:

[0023] The position rule of a figure signature and the key word of the figure signature are obtained;

[0024] Based on the picture signature position rule and the picture signature keyword, a picture signature region in the at least one region is identified;

[0025] Based on the intersecting line segment in the at least one region, a table region in the at least one region is identified;

[0026] Excluding the picture signature region and the table region in the at least one region, the text region is determined.

[0027] The method for identifying layout text provided by the embodiment of the application can accurately identify the picture signature region and the table region, and on this basis, can accurately determine the text region in the at least one region, thereby ensuring the accuracy of text region identification.

[0028] With reference to the first aspect, in a fourth implementation manner of the first aspect, the title attribute includes a title level and a title style, and the determining, based on the title attribute, of position information of a corresponding paragraph of each title in the text region includes:

[0029] Obtaining a design basis of the target general description drawing to determine the title attribute, the title attribute including a title level and a title style;

[0030] Matching based on the title attribute in the text region to determine the each title;

[0031] Determining the position information of the corresponding paragraph based on the each title.

[0032] The method for identifying layout text provided by the embodiment of the application determines the title in the text region, and after the title is determined, the position information of each paragraph can be determined, thereby ensuring the reliability of the determined position information.

[0033] With reference to the first aspect, in a fifth implementation manner of the first aspect, the determining, based on the position information of each paragraph, of text under each paragraph includes:

[0034] Determining each line of text under each paragraph by using the position information of each paragraph;

[0035] Splicing each line of text to determine each line of text under each title.

[0036] The method for identifying layout text provided by the embodiment of the application can reduce the cost of subsequent text processing by splicing each line of text, because each line of text can be composed of multiple picture elements.

[0037] With reference to the fifth implementation manner of the first aspect, in a sixth implementation manner of the first aspect, the splicing each line of text to determine each line of text under each title includes:

[0038] According to a preset order, each line of text is clustered and spliced to determine each line of text under each title.

[0039] The method for recognizing layout text provided by the embodiment of the present application can ensure the accuracy of the downstream processing, because the text in the entire text region is very large and may span paragraphs, and if all the texts are spliced together, the data features of the previous texts will be blurred, which is not conducive to the processing of the downstream link.

[0040] According to a second aspect, the embodiment of the present application further provides a layout text recognition device, comprising:

[0041] An acquisition module is configured to acquire a target general description drawing.

[0042] A conversion module is configured to convert the target general description drawing into element vector information and determine the title attribute in the target general description drawing.

[0043] A region determination module is configured to determine a text region in the element vector information according to the characteristics of each region type.

[0044] A paragraph determination module is configured to determine the position information of a paragraph corresponding to each title in the text region based on the title attribute.

[0045] A text determination module is configured to determine the text under each paragraph based on the position information of each paragraph.

[0046] The layout text recognition device provided by the embodiment of the present application can convert the target general description drawing into element vector information and perform text recognition based on the element vector information, so as to ensure the accuracy of the recognition; and only the text in the text region is recognized, without the need for semantic analysis based on the text, but the coordinate information of each paragraph obtained through paragraph division processing is utilized, so as to improve the accuracy and efficiency of the recognition.

[0047] According to a third aspect, the embodiment of the present application provides an electronic device, comprising a memory and a processor, which are in communication connection with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the layout text recognition method in the first aspect or any one of the embodiments of the first aspect.

[0048] According to a fourth aspect, the embodiment of the present application provides a computer readable storage medium, which stores computer instructions for causing the computer to perform the layout text recognition method in the first aspect or any one of the embodiments of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the specific embodiments or the prior art of the present application, the drawings required to be used in the specific embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0050] Figure 1 is a flow chart of a layout text recognition method according to an embodiment of the present application;

[0051] Figure 2 is a flow chart of a layout text recognition method according to an embodiment of the present application;

[0052] Figure 3 is a flow chart of a layout text recognition method according to an embodiment of the present application;

[0053] Figure 4 is a flow chart of a layout text recognition method according to an embodiment of the present application;

[0054] Figure 5 is a structural block diagram of a layout text recognition device according to an embodiment of the present application;

[0055] Figure 6 is a hardware structure schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.

[0057] The layout text recognition method provided by the embodiments of the present application is used for layout analysis and layout understanding of a total description drawing in the construction industry, so as to recognize the text in the layout text area. The layout analysis is to divide the whole layout into different areas and label the types (text, table, figure signature) of all areas; the layout understanding is to obtain the logical structure of the document, including the logical attributes of each area, the hierarchical relationship of the drawing, etc.

[0058] The general specification drawing includes a text area, a figure caption area, and a table area, and further includes design basis for title attributes such as title level and title style. No limitation is made herein, as long as the corresponding design basis is provided in the general specification drawing.

[0059] The method for recognizing the layout text provided in the embodiment of the present application first converts the drawing into element vector information to determine the text area, avoiding processing of non-text areas; second, only the text area is subjected to layout analysis, without semantic analysis based on the text, but using the coordinate information of each paragraph obtained through paragraph division to perform layout screening in units of paragraphs, thereby realizing the layout analysis and layout understanding method of the general specification drawing. The method for recognizing the layout text is to recognize the data of each line of the text area, and finally gives the text of each line and the title to which the text belongs.

[0060] Further, with the result of the layout analysis, the text analysis of the general specification drawing and the analysis of the table in the general specification can be more accurately and efficiently performed. According to the result of the layout analysis, the text analysis can not only realize analysis of a certain paragraph, but also can not analyze the figure caption and table area according to the result of the layout analysis, thereby greatly improving the efficiency of text recognition. No limitation is made herein on the subsequent processing based on the result of the layout analysis, and the specific setting can be made according to actual needs.

[0061] According to the embodiment of the present application, a method for recognizing layout text is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0062] In the embodiment, a method for recognizing layout text is provided, which can be used in electronic devices such as computers, tablet computers, etc. Figure 1 The flowchart of the method for recognizing layout text according to the embodiment of the present application is shown in FIG. 1, which includes the following steps: Figure 1

[0063] S11, obtaining a target general specification drawing.

[0064] The target general specification drawing includes a text area, and can also include a table area or a figure caption area, etc. For a text area, it can include multiple paragraphs, and each paragraph corresponds to a corresponding title. For example, one paragraph corresponds to one title, or multiple paragraphs correspond to one title, etc. For a paragraph, it can include one line of text or multiple lines of text. ​

[0065] S12, convert the target general description drawing into element vector information and determine the title attributes in the target general description drawing.

[0066] For DWG format drawings, electronic devices can use specific parsing tools (Teigha) to extract and convert the vector information of each element contained in the DWG drawing. For general instruction drawings in other formats, other corresponding parsing tools can be used to convert the vector information, or the image can be first converted to DWG format and then converted to element vector information. Compared to bitmaps, images require OCR technology for text recognition. The accuracy of text recognition is not as high as that of vector information; the accuracy of text recognition using vector information is 100%.

[0067] The title attributes are extracted from the design basis of the target general specification drawing. These attributes include, but are not limited to, the hierarchical relationship of the titles, the style of the titles, and the numbering of the titles. These attributes are used to subsequently determine the position of paragraphs. That is, the electronic device first locates the titles, then identifies the paragraphs under each title, and then determines the text in each paragraph. After determining the text in each paragraph, the title corresponding to each line of text can be determined by using the correspondence between paragraphs and titles.

[0068] S13, determine the text region in the element vector information based on the characteristics of each region type.

[0069] Electronic devices can analyze element vector information to divide it into at least one region. For example, cluster analysis of element vector information can be performed to obtain at least one region. Alternatively, the target general description drawing can be divided into columns based on element vector information to obtain at least one region. The column division is determined by the spacing between text.

[0070] After dividing the data into at least one region, the electronic device performs feature recognition on each region based on the characteristics of each region type, such as label regions, table regions, and text regions, to determine the text region. For example, a classification model is obtained, whose input is the element vector information of each region, and whose output is the type of that region.

[0071] Alternatively, electronic devices can extract features from each region separately, then calculate the similarity between the features of each region and the features of each region type, and determine the region type of the similarity pair as the type of that region.

[0072] The specifics of this step will be described in detail below.

[0073] S14, determine the position information of the paragraph corresponding to each title in the text area based on the title attribute.

[0074] As described above, the title attribute includes, but is not limited to, the hierarchical relationship of the title, the title style, the serial number of the title, and the like. The electronic device matches the title in each text region by using the title attribute, and determines the title position in each text region. When the title position is determined, the title corresponding paragraph is also determined, and then the position information of the paragraph corresponding to each title can be determined.

[0075] The step will be described in detail below.

[0076] S15, determining the text under each paragraph based on the position information of each paragraph.

[0077] After the position information of each paragraph is determined, the text under each paragraph is determined in sequence according to the corresponding order. The text under each paragraph can be one line, two lines or more lines, and accordingly, the title corresponding to each paragraph can be determined, so that the title to which the text under each paragraph belongs can be determined.

[0078] The step will be described in detail below.

[0079] The method for recognizing layout text provided in the embodiment can convert the target general description drawing into element vector information, and recognize the text based on the element vector information, so that the accuracy of recognition can be ensured. The text in the text region is recognized only, without semantic analysis based on the text, and the coordinate information of each paragraph obtained by paragraph division processing is used, so that the accuracy and efficiency of recognition are improved.

[0080] In the embodiment, a method for recognizing layout text is provided, which can be used in electronic devices such as computers, tablet computers, and the like. Figure 2 The method for recognizing layout text according to the embodiment of the present application is shown in a flowchart as shown in Figure 2 The flowchart includes the following steps:

[0081] S21, obtaining a target general description drawing.

[0082] For details, please refer to S11 of the embodiment shown in Figure 1 which will not be described here again.

[0083] S22, converting the target general description drawing into element vector information, and determining the title attribute in the target general description drawing.

[0084] For details, please refer to S12 of the embodiment shown in Figure 2 which will not be described here again.

[0085] S23, determining the text region in the element vector information according to the characteristics of each region type.

[0086] Specifically, the above S23 includes:

[0087] S231, obtain the interval between each text in the element vector information, and determine the division line.

[0088] The electronic device processes the element vector information, and finds the division line gap according to the layout of the entire page. The division line is a vertical division line, and the layout of the page is divided by determining the vertical gap. The corresponding processing includes separating the text graph element and the line segment graph element, removing noise graph elements (such as diagonal lines, such as elements without coordinate information), and obtaining the average interval of the lines.

[0089] In the above steps, the target total specification drawing is converted into element vector information, and the element vector information is subjected to cluster analysis to determine the interval between each text. By setting an interval threshold, the interval between each text is compared with the interval threshold, and the division line can be determined.

[0090] In some optional embodiments of the present embodiment, the above S231 can include:

[0091] (1) Obtain the coordinates of each text.

[0092] (2) Based on the coordinates of each text, determine whether the coordinate difference between adjacent texts exceeds a threshold.

[0093] (3) When the coordinate difference between adjacent texts exceeds the threshold, determine that the division line is located between the adjacent texts.

[0094] As described above, by performing cluster analysis on the element vector information, each text is determined, and the coordinates of each text are determined. By comparing the horizontal coordinates of adjacent texts respectively, the vertical division line is determined; and by comparing the vertical coordinates between adjacent texts, the horizontal division line is determined.

[0095] As described above, the division line is a vertical division line, and the electronic device is provided with a threshold corresponding to the horizontal coordinate. The difference between the horizontal coordinates of adjacent texts is calculated, and the difference is compared with the threshold. When the difference is greater than the threshold, it indicates that there is a vertical division line between the adjacent texts. After the electronic device determines the vertical division line between each adjacent text, the vertical division line is connected, and the layout of the page is divided. By comparing the coordinate difference with the threshold, the division line can be accurately determined.

[0096] For example, the texts are sorted according to the horizontal axis coordinates from small to large. If the horizontal coordinate difference between two adjacent texts is abnormal (such as very large), the division line is located at this position. Example:

[0097] Text 1 Text 2 Text 3 Text 4

[0098] Through the analysis of the abscissa, the interval between text 3 and text 4 is abnormal, and the dividing line is between text 3 and text 4.

[0099] In S232, the element vector information is divided by the dividing line to determine at least one region.

[0100] The electronic device divides the element vector information based on the determined dividing line, and at least one region is determined. Each region is represented by element vector information.

[0101] In S233, the text region is determined based on the characteristics of the at least one region.

[0102] As described above, the electronic device can first extract the characteristics of each region, and then perform similarity calculation on the extracted characteristics and the characteristics of each region type to determine the text region; or, in combination with the classification model, the type to which each region belongs is classified.

[0103] In some optional embodiments of the present embodiment, S233 described above can include:

[0104] (1) Obtain the drawing signature position rule and the drawing signature keyword.

[0105] (2) Based on the drawing signature position rule and the drawing signature keyword, a drawing signature region in the at least one region is identified.

[0106] (3) Based on the intersecting line segment in the at least one region, a table region in the at least one region is identified.

[0107] (4) In the at least one region, the drawing signature region and the table region are excluded, and the text region is determined.

[0108] Specifically, the electronic device is pre-provided with the drawing signature position rule and the drawing signature keyword, which can be obtained by experience or by other means. The electronic device identifies the drawing signature region according to the drawing signature position rule and the drawing signature keyword information; identifies the table region according to the intersection of vertical lines and horizontal lines, the title position, and the drawing vertical dividing line. That is, through the fusion algorithm of "CV+design basis", the drawing signature and the table are identified, and the regions outside the table and the drawing signature are excluded as the text region. Based on this, the accuracy of the table is improved, and the precision of the text region is also improved.

[0109] By accurately identifying the drawing signature region and the table region, the text region can be accurately determined from the at least one region, ensuring the accuracy of the text region identification.

[0110] In S24, the position information of the paragraph corresponding to each title in the text region is determined based on the title attribute.

[0111] Please refer to Figure 1 S14 of the embodiment shown, which will not be repeated here.

[0112] S25, determining the text under each paragraph based on the position information of each paragraph.

[0113] Please refer to Figure 1 S15 of the embodiment shown, which will not be repeated here.

[0114] The layout text recognition method provided in the embodiment determines the division line through the spacing between texts, and then divides the regions by using the division line. Since the size of the spacing is the simplest way to distinguish regions and the gap between texts, the division line is determined based on this way, thereby simplifying the processing procedure and improving the recognition efficiency.

[0115] In the embodiment, a layout text recognition method is provided, which can be used in electronic devices such as computers, tablet computers, etc. Figure 3 is a flowchart of the layout text recognition method according to the embodiment of the present application, as shown in Figure 3 The flowchart includes the following steps:

[0116] S31, obtaining a target general description drawing.

[0117] The title attribute includes a title level and a title style.

[0118] Please refer to Figure 2 S21 of the embodiment shown, which will not be repeated here.

[0119] S32, converting the target general description drawing into element vector information, and determining the title attribute in the target general description drawing.

[0120] Please refer to Figure 2 S22 of the embodiment shown, which will not be repeated here.

[0121] S33, determining the text region in the element vector information according to the characteristics of each region type.

[0122] Please refer to Figure 2 S23 of the embodiment shown, which will not be repeated here.

[0123] S34, determining the position information of each paragraph corresponding to the title in the text region based on the title attribute.

[0124] Specifically, the above S34 includes:

[0125] S341, matching in the text region based on the title attribute, and determining each title.

[0126] According to the title level and the title number pattern, matching is performed in the text area to find more same-level titles. After finding the title where the design basis is located, according to the arrangement rule of the serial number, the same-level title is found. For example, the title level includes first-level titles and second-level titles. After the title is determined, according to the corresponding relationship between the serial number of each title and the serial number of the title level, it is determined which is the first-level title and which is the second-level title.

[0127] S342, determining the position information of the corresponding paragraph based on each title.

[0128] After the electronic device locates each title, the position information of the paragraph corresponding to each title can be determined.

[0129] S35, determining the text under each paragraph based on the position information of each paragraph.

[0130] Specifically, the above S35 includes:

[0131] S351, determining the text under each paragraph based on the position information of each paragraph.

[0132] S352, splicing each line of text to determine each line of text under each title.

[0133] In the DWG drawing, a line is composed of multiple texts. Splicing the text of each line obtains each line of text under each title. The splicing adopts a clustering splicing manner, that is, the text in the line range is spliced, which means that the text in the same line is found according to the position of the text and spliced into a line.

[0134] According to the preset order, the clustering splicing of each line of text is performed to determine each line of text under each title. Because the text in the entire text area is very large and may cross paragraphs, if all the texts are spliced together, the data features of the previous data will be blurred, which is not conducive to the processing of the downstream link. Therefore, the clustering splicing is performed in the unit of line to ensure the accuracy of the processing of the downstream link.

[0135] The recognition method of the layout text provided in the embodiment determines the title in the text area, and after the title is determined, the position information of each paragraph can be determined, which can ensure the reliability of the determined position information. Because there is a gap between each line of text, the gap can be removed by splicing each line of text, which reduces the data amount of subsequent text analysis.

[0136] In one specific application example of the embodiment, the total explanation drawing is taken as a drawing in DWG format. As shown in Figure 4 The recognition method of the layout text includes:

[0137] S51, inputting a DWG general description drawing;

[0138] S52, analyzing the DWG drawing to determine element vector information and design rules;

[0139] S53, determining vertical gaps for layout segmentation;

[0140] S54, region segmentation, determining text region, table region and figure caption region, and coordinate positions of each region;

[0141] S55, first-level title recognition based on the text region;

[0142] S56, text splicing and determination of title paragraph position;

[0143] S57, determining paragraph information to which a line belongs.

[0144] The layout text recognition method provided in the embodiment is a gap segmentation layout segmentation method based on finding vertical gaps in the entire layout. According to data characteristics of different layout regions, a classification method of different layout regions is proposed, such as classification and recognition of figure captions according to keyword rules and figure caption position rules. According to left-to-right sequential traversal of vertical lines, a table formed by the vertical lines is searched to classify and recognize the table. In the recognition process, first-level title recognition is performed. According to the title position and the layout segmentation result, the position of each paragraph under the title is determined, so that the text analysis of the general description drawing is more accurate and efficient. According to the layout analysis result, the text analysis can not only realize analysis of a certain paragraph, but also can not analyze the figure caption and table region in the layout analysis result, thereby greatly improving the text recognition efficiency.

[0145] In the embodiment, a layout text recognition device is also provided. The device is used to implement the above-described embodiments and preferred embodiments, and details are not repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and is contemplated.

[0146] The embodiment provides a layout text recognition device, as shown in Figure 5 The device includes:

[0147] The acquisition module 41 is configured to acquire a target general description drawing.

[0148] The conversion module 42 is configured to convert the target general description drawing into element vector information and determine title attributes in the target general description drawing.

[0149] The region determining module 43 is configured to determine a text region from the element vector information according to features of various region types.

[0150] The paragraph determining module 44 is configured to determine position information of a paragraph corresponding to each title in the text region based on the title attribute.

[0151] The text determining module 45 is configured to determine text under each paragraph based on the position information of the paragraphs.

[0152] The layout text recognition device provided by the embodiment can convert a target general description drawing into element vector information, and perform text recognition based on the element vector information, so that the accuracy of recognition can be ensured. The text recognition device only recognizes text in a text region, does not need to perform semantic analysis based on the text, but uses coordinate information of each paragraph obtained through paragraph division processing, so that the accuracy and efficiency of recognition are improved.

[0153] The layout text recognition device in the embodiment is presented in the form of a functional unit. The unit refers to an ASIC circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0154] Further function descriptions of the above modules are the same as those of the above corresponding embodiments, and will not be described here.

[0155] The embodiment of the application further provides an electronic device having the above layout text recognition device. Figure 5 The layout text recognition device is shown in the figure.

[0156] Please refer to Figure 6 , Figure 6 is a structural schematic diagram of an electronic device provided by an optional embodiment of the application, as shown in the figure, the electronic device can include: at least one processor 601, such as a CPU (Central Processing Unit, central processing unit), at least one communication interface 603, a memory 604, at least one communication bus 602. Among them, the communication bus 602 is used to realize the connection communication between these components. Among them, the communication interface 603 can include a display screen (Display), a keyboard (Keyboard), and an optional communication interface 603, which can also include a standard wired interface, a wireless interface. The memory 604 can be a high-speed RAM memory (Random Access Memory, volatile random access memory), and can also be a non-volatile memory, such as at least one disk memory. The memory 604 can also be at least one storage device located away from the aforementioned processor 601. Among them, the processor 601 can be combined with the communication interface 603 to form a communication processor, and the communication processor can be used to implement functions such as data encryption and decryption, and error detection. Figure 6 The memory 604 can be a high-speed RAM memory (Random Access Memory, volatile random access memory), and can also be a non-volatile memory, such as at least one disk memory. The memory 604 can also be at least one storage device located away from the aforementioned processor 601. Among them, the processor 601 can be combined with the communication interface 603 to form a communication processor, and the communication processor can be used to implement functions such as data encryption and decryption, and error detection.Figure 5 The described apparatus, the memory 604 stores an application program, and the processor 601 invokes the program code stored in the memory 604 for executing any of the above method steps.

[0157] The communication bus 602 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 602 can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 6 Only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0158] The memory 604 can include a volatile memory (e.g., a random-access memory, RAM), a non-volatile memory (e.g., a flash memory, a hard disk drive, or a solid-state drive), or a combination of the above types of memories.

[0159] The processor 601 can be a central processing unit (CPU), a network processor (NP), or a combination thereof.

[0160] The processor 601 can further include a hardware chip. The hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0161] Optionally, the memory 604 is further configured to store program instructions. The processor 601 can invoke the program instructions to implement the method for recognizing the text in layout as shown in any embodiment of the present application.

[0162] The embodiment of the present application further provides a non-transitory computer storage medium, which stores computer executable instructions. The computer executable instructions can execute the method for recognizing the text in layout in any method embodiment described above. The storage medium can be a disc, an optical disc, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc. The storage medium can also include a combination of the above-mentioned types of memories.

[0163] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes are intended to fall within the scope of the appended claims.

Claims

1. A method for recognizing text on a page, characterized in that, include: Obtain the target general specification drawing; Convert the target general description drawing into element vector information and determine the title attribute in the target general description drawing; The text region is determined from the element vector information based on the characteristics of each region type; Based on the title attributes, the position information of each paragraph corresponding to each title is determined in the text area; The text under each paragraph is determined based on the position information of each paragraph.

2. The method according to claim 1, characterized in that, The process of determining the text region from the element vector information based on the characteristics of each region type includes: Obtain the spacing between each text element in the element vector information to determine the dividing line; The element vector information is divided into columns using the dividing lines to determine at least one region; The text region is determined based on the features of the at least one region.

3. The method according to claim 2, characterized in that, The step of obtaining the spacing between each text element in the element vector information and determining the dividing line includes: Obtain the coordinates of each text element; Based on the coordinates of each text, determine whether the coordinate difference between adjacent texts exceeds a threshold. When the coordinate difference between adjacent texts exceeds the threshold, it is determined that the dividing line is located between adjacent texts.

4. The method according to claim 2, characterized in that, Determining the text region based on the features of the at least one region includes: Identify the patterns in the positions of the image tags and their keywords; Based on the positional patterns of the title tags and the keywords of the title tags, the title tag regions in the at least one region are identified; Based on the intersecting line segments in the at least one region, identify the table region in the at least one region; The text area is determined by excluding the label area and the table area from the at least one area.

5. The method according to claim 1, characterized in that, The heading attributes include heading level and heading style. Determining the position information of the paragraphs corresponding to each heading in the text area based on the heading attributes includes: The titles are determined by matching the title attributes within the text area. The position information of the corresponding paragraphs is determined based on the various headings.

6. The method according to claim 1, characterized in that, The step of determining the text under each paragraph based on the position information of each paragraph includes: Using the positional information of each paragraph, determine the lines of text within each paragraph; Concatenate each line of text to determine the text under each of the aforementioned headings.

7. The method according to claim 6, characterized in that, The step of concatenating each line of text to determine each line of text under each of the aforementioned headings includes: Each line of text is clustered and concatenated according to a preset order to determine each line of text under each title.

8. A device for recognizing text on a page, characterized in that, include: The acquisition module is used to acquire the target general specification drawings; A conversion module is used to convert the target general description drawing into element vector information in order to determine the title attributes in the target general description drawing; The region determination module is used to determine the text region in the element vector information based on the characteristics of each region type; The paragraph determination module is used to determine the position information of each paragraph corresponding to each title in the text area based on the title attributes. The text determination module is used to determine the text under each paragraph based on the position information of each paragraph.

9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the layout text recognition method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method for recognizing layout text as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Text information identification method and device for architectural drawing

    CN112257629A

  • Text recombination method of CAD drawing and computer readable storage medium

    CN113177995A