A method, system and device for identifying drawing labels
By establishing a drawing label database and parsing the text information of the target drawing, the problem of differences in the format and location of drawing label information in drawing management is solved, efficient identification and management of drawings is achieved, and the efficiency of drawing review and search is improved.
Patent Information
- Application Number
- CN202410855328.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In the existing technology, there are differences in the format and location of drawing label information in drawings, and there is a lack of unified standards, resulting in low efficiency in drawing management, which requires manual viewing and management, making it difficult to efficiently review and search drawings.
Establish a drawing label database, parse the target drawing to obtain text information, determine the query field and target drawing label information from the database based on the text information, extract the drawing label information through image recognition technology, and construct key field names and coordinate ranges to achieve automatic identification and manage.
It improves the efficiency and accuracy of drawing management, reduces the dependence on manual reference, realizes efficient drawing reference and search, and adapts to the drawing formats of different drawing units.
Smart Images

Figure CN118410196B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of drawing recognition, and in particular to a method, system and device for identifying a drawing label. Background Art
[0002] At present, drawings are mainly drawn by drawing software (such as CAD software). Different drawing units usually indicate the drawing name, project name, drawing number, version, drawing unit and other drawing label information of the drawing frame in the drawing label area when drawing drawings. However, there is a lack of unified standards among different drawing units, and the format and location of the drawing label information are also different. In general, it is necessary to manually check the drawings and obtain the drawing label information before using the drawings. In addition, when managing drawings, they are only managed in the form of folders. If you need to find related drawings, you usually browse them according to the folder and file name, which is inefficient and relies on memory and experience, and cannot meet the needs of efficient viewing and searching of drawings.
[0003] Therefore, it is necessary to provide a drawing label recognition method, system and device to achieve efficient drawing management and review. Summary of the invention
[0004] One or more embodiments of the present specification provide a method for identifying drawing labels, the method comprising: establishing a drawing label database, the drawing label database including key field names and key field values of different drawings; parsing a target drawing to obtain text information in the target drawing; determining a query field from the drawing label database based on the text information; and determining target drawing label information based on the query field and the text information.
[0005] One or more embodiments of the present specification also provide a drawing label recognition system, the system comprising: a database construction module, configured to establish a drawing label database, the drawing label database including drawing label information of different drawings; a parsing module, configured to parse a target drawing and obtain text information in the target drawing, the text information including text content and text coordinates; a first determination module, configured to determine a query field from the drawing label information in the drawing label database based on the text information; and a second determination module, configured to determine the target drawing label information based on the query field and the text information.
[0006] One or more embodiments of the present specification also provide a device for identifying drawing labels, the device comprising at least one storage medium and at least one processor; the at least one storage medium is used to store computer instructions; the at least one processor is used to execute the computer instructions to implement the method for identifying drawing labels as described in the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:
[0008] Figure 1 is a schematic diagram of an application scenario of a drawing label recognition system according to some embodiments of this specification;
[0009] Figure 2 is an exemplary flow chart of a method for identifying a drawing label according to some embodiments of this specification;
[0010] Figure 3 is an exemplary flow chart of a method for identifying a drawing label according to other embodiments of this specification;
[0011] Figure 4 is an exemplary flow chart of a method for identifying a drawing label according to some embodiments of the present specification;
[0012] Figure 5 is an exemplary flow chart of updating a graphic label database according to some embodiments of this specification;
[0013] Figure 6 It is an exemplary module diagram of a system for identifying a drawing label according to some embodiments of the present specification. DETAILED DESCRIPTION
[0014] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0015] It should be understood that the "system", "device", "unit" and / or "module" used herein are a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
[0016] As shown in this specification and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0017] Flowcharts are used in this specification to illustrate the operations performed by the system according to the embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed precisely in order. Instead, the steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.
[0018] Figure 1 It is a schematic diagram of an application scenario of a drawing label recognition system according to some embodiments of this specification.
[0019] In some embodiments, Figure 1 As shown, the application scenario 100 of the drawing label recognition system includes a drawing 110, a network 120, a terminal 130, a processor 140, and a storage device 150.
[0020] Drawing 110 refers to a schematic diagram that needs to be identified by a drawing label. For example, drawing 110 may be a building schematic diagram, a decoration schematic diagram, a mechanical manufacturing schematic diagram, a clothing design schematic diagram, etc. that needs to be identified by a drawing label. The types of drawings 110 listed above are only examples and do not constitute a limitation. Drawing 110 may also be any drawing that needs to be identified by a drawing label.
[0021] In some embodiments, the drawing 110 may be a paper drawing. In other embodiments, the drawing 110 may also be an electronic drawing.
[0022] A drawing label is a label used to identify drawing information in a drawing. It should be noted that drawings are generally divided into a drawing area and a drawing label area. The drawing area is used to draw specific design drawings, and the drawing label area is used to place drawing labels.
[0023] The drawing label may include various information related to the drawing, and for example, the drawing label may include the drawing name, project name, drawing number, version, drawing unit, etc. In some embodiments of the present specification, the drawing label may also be referred to as drawing label information.
[0024] The network 120 may connect various components in the application scenario 100 of the system for identifying the image label of drawings and / or other components outside the application scenario 100 of the system for identifying the image label of drawings. In some embodiments, one or more components of the application scenario 100 of the system for identifying the image label of drawings (e.g., the terminal 130, the processor 140, and the storage device 150, etc.) of the system for identifying the image label of drawings may be connected and / or communicate with each other through the network 120. For example, the terminal 130 may send the image label of the drawing 110 to the processor 140, etc., through the network 120.
[0025] The terminal 130 can provide functional components related to user interaction and can implement user interaction functions (such as providing or displaying information and data to users). The user can refer to the manager of the drawing 110, or the person who searches or uses the drawing 110. As an example only, the terminal 130 can be a mobile device, a tablet computer, a laptop computer, a desktop computer, or other devices with input and / or output functions, or any combination thereof.
[0026] In some embodiments, the user may obtain the drawings 110 through the terminal 130 . For example, the user may search for and read the drawings stored in the storage device 150 through the terminal 130 .
[0027] In some embodiments, the user may also send the drawing 110 to the processor 140 via the terminal 130 , and have the processor 140 perform label recognition on the drawing 110 .
[0028] The processor 140 is capable of processing information and / or data related to the drawing label recognition system to perform one or more functions described in this specification. In some embodiments, the processor 140 can establish a label database, wherein the label database includes label information of different drawings; parse the target drawing to obtain text information in the target drawing; determine the query field from the label information in the label database based on the text information; and determine the target label information based on the query field and the text information. Detailed description of the relevant content can be found later (such as Figure 2 , Figure 3 etc.) related description.
[0029] In some embodiments, the processor 140 may include a central processing unit (CPU), a digital signal processor (DSP), a microcontroller unit (MCU), a computer, a user console, etc., or any combination thereof. In some embodiments, the processor 140 may include a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 140 may be local or remote. In some embodiments, the processor 140 may be implemented on a cloud platform. By way of example only, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-layer cloud, etc., or any combination thereof.
[0030] The storage device 150 is capable of storing data, instructions, and / or any other information. In some embodiments, the storage device 150 may store data obtained from the terminal 130, the processor 140, etc., such as drawings 110, a database of drawing labels, etc. In some embodiments, the storage device 150 may include a large-capacity memory, a removable memory, a volatile read-write memory, a read-only memory (ROM), etc., or any combination thereof. In some embodiments, the storage device 150 may be executed on a cloud platform. In some embodiments, the storage device 150 may be connected to the network 120 to communicate with one or more other components of the application scenario 100 of the drawing label recognition system (e.g., the terminal 130, the processor 140, etc.). In some embodiments, the storage device 150 may be part of the processor 140.
[0031] It is worth noting that the application scenario 100 of the drawing label recognition system is provided for illustrative purposes only and is not intended to limit the scope of this specification. For those of ordinary skill in the art, various changes and modifications can be made according to the description of this specification. For example, the application scenario 100 of the drawing label recognition system can also include a database, an information source, etc. For another example, the application scenario 100 of the drawing label recognition system can be implemented on other devices to achieve similar or different functions. However, these changes and modifications will not deviate from the scope of this specification.
[0032] Figure 2 200 is an exemplary flow chart of a method for identifying a drawing label according to some embodiments of this specification. In some embodiments, process 200 may be executed by a processing device (eg, processor 140). Figure 2 As shown, process 200 includes the following steps.
[0033] Step 210, establishing a label database.
[0034] The drawing label database refers to a database system for storing, managing and retrieving the drawing label information of drawings. In some embodiments, the drawing label database includes the drawing label information of different drawings. In some embodiments, the drawing label database includes the key field names and key field values of different drawings.
[0035] In some embodiments, the processor may construct a drawing label database based on existing drawings of multiple different drawing units.
[0036] For example, a large number of drawings drawn by different drawing units can be obtained in advance, and the drawing labels on the drawings can be annotated with annotation tools. Then, information such as the drawing name, project name, drawing number, version, and drawing unit in the drawing labels can be extracted through image recognition (for example, optical character recognition, OCR) and other technologies.
[0037] In some embodiments, further, after extracting drawing label information such as drawing name, project name, drawing number, version, and drawing unit, the processor can construct key field names, key field values corresponding to the key field names, and coordinate ranges of the key field values.
[0038] The key field name is a character string used to mark the drawing label information in the drawing label database. Exemplarily, the key field name may include "drawing name", "drawing number", "drawing unit", "sub-item", "version", "project name", etc. Among them, a key field name may correspond to a content of the drawing label information. For example, the key field name "drawing name" may correspond to the drawing name of the drawing label information. When you need to query the drawing name of a certain drawing, you can query it through the key field name "drawing name".
[0039] The key field value refers to the specific text content of the drawing label information corresponding to the key field name. For example, the key field value corresponding to the key field "drawing name" can include the names of all drawings in the drawing label database; the key field value corresponding to the key field "drawing number" can include the numbers of all drawings in the drawing label database; the key field value corresponding to the key field "project name" can include the project names of all drawings in the drawing label database, etc.
[0040] In some embodiments, the coordinate range of the key field value refers to the coordinate range of the specific text content (i.e., the key field value) corresponding to the image tag information on the drawing. For example, a rectangular box can be used to mark the text content corresponding to the image tag information on the drawing. When the rectangular box happens to completely cover the text content, the coordinates corresponding to the four vertices of the rectangular box can be used as the coordinate range of the text content corresponding to the image tag information (i.e., the coordinate range of the key field value). For example only, a coordinate system can be constructed with the lower left corner vertex of the drawing as the origin, the horizontal direction to the right as the x-axis square, and the vertical and horizontal direction upward as the positive direction of the y-axis.
[0041] Taking the query of the name of a certain building drawing as an example, the key field name during the query is "Drawing Name", and the corresponding key field value includes the text content of the drawing label corresponding to the drawing name "XX Building Design Drawing", and the coordinate range of the key field value "XX Building Design Drawing" on the drawing ((x1, y1), (x2, y2), (x3, y3), (x4, y4)). The above description of the coordinate range is only an example, and those skilled in the art can also construct other coordinate systems as needed, such as constructing a polar coordinate system and / or using any other suitable graphics (such as a circle, trapezoid, etc.) to determine the coordinate range of the text content corresponding to the drawing label information by box selection.
[0042] In some embodiments, a key field name may include multiple key field values. For example, the key field value corresponding to the key field name "drawing name" may include the text content corresponding to the drawing name of all drawings in the drawing label database and the coordinate range corresponding to the text content.
[0043] Step 220, parse the target drawing and obtain text information in the target drawing.
[0044] The target drawing is the drawing that needs to be identified by the drawing label. The target drawing can be an electronic drawing or a physical drawing (such as a paper drawing).
[0045] In some embodiments, taking the target drawing as an electronic version of the drawing as an example, the processor can parse the target drawing based on image processing software and mapping software. Exemplarily, the processor extracts the text content corresponding to the label through image recognition technology (such as OCR technology, etc.). Furthermore, the processor can also combine the positioning method (such as frame positioning technology) to create a relative coordinate system in the frame where the label is located in a preset coordinate system (such as the built-in coordinate system of the mapping software), and through the automatically generated coordinate conversion matrix, the coordinate range of the text content corresponding to the label in the relative coordinate system in the frame is converted to the coordinate range in the preset coordinate system to obtain the text coordinates.
[0046] In some embodiments, when the target drawing is a physical drawing, the physical drawing can be converted into an electronic drawing by photographing, scanning, etc. and then analyzed.
[0047] In some embodiments, the target drawing may include multiple drawings, and each target drawing may also include multiple drawing labels. When parsing the target drawing, it is necessary to obtain text information of multiple drawing labels of each of the multiple target drawings.
[0048] In some embodiments, the drawing content may also include text information, but the text information does not belong to the drawing label. When extracting the text information in the drawing label, it is necessary to avoid extracting the text information in the drawing content.
[0049] In some embodiments, the processor may further indent the frame of the target drawing by a preset distance to obtain a reference frame; and obtain text information between the frame of the target drawing and the reference frame.
[0050] The drawing frame is the boundary line that marks the edge of the drawing. Generally, the specific drawing content is placed in the middle of the drawing frame, and the drawing label is placed in the inner corner of the drawing frame.
[0051] The reference frame is an indented boundary line used to identify specific drawing content. That is, the reference frame is a smaller area in the drawing frame, which only includes specific drawing content but not the label information. The label information is located in the area between the reference frame and the drawing frame.
[0052] Exemplarily, the processor may indent the frame by a preset distance (e.g., 10 mm) to obtain a reference frame, and extract text information of the area between the reference frame and the frame. The preset distance of the indented frame may be related to the label information, for example, the preset distance of the indented frame may be such that the text information of the label is just outside the reference frame.
[0053] In some embodiments of the present specification, the drawing frame is indented by a preset distance to obtain a reference drawing frame, and text information of the area between the reference drawing frame and the drawing frame is obtained as the text information of the drawing label of the target drawing. This can avoid interference from text information in the drawing content and improve the accuracy of the text information of the drawing label of the target drawing.
[0054] In some embodiments, before parsing the target drawing, the processor may further pre-process the target drawing.
[0055] Exemplarily, the preprocessing operation may include removing special characters in the text content of the label (e.g., removing punctuation marks in the label) and / or converting the text content of the label into a predetermined format (e.g., converting letters in the text content into lowercase). The above operations on drawing preprocessing are only examples, and the preprocessing operation may also include other operations, such as noise removal, word segmentation, stem extraction, etc., which are not limited here.
[0056] In some embodiments of the present specification, by pre-processing the target drawing and then parsing it, the accuracy of the text information of the acquired target drawing can be improved, thereby improving the accuracy of the target drawing label information determined subsequently.
[0057] Step 230, determining a query field from the image tag database based on the text information.
[0058] The query field is the key field value for querying the drawing label information related to the target drawing in the drawing label database. For example, if the target drawing is a drawing of "XX Design Institute", the query field includes all key field values related to "XX Design Institute" in the drawing label database (for example, all drawing names, drawing numbers, project names, etc. related to "XX Design Institute" in the drawing label database).
[0059] In some embodiments, the processor may determine the image tag classification information based on the text information; and determine the query field from the image tag database based on the image tag classification information.
[0060] Label classification information refers to a set of information or data used to describe, classify or mark label in the target drawing.
[0061] In some embodiments, the processor may determine the drawing unit information of the target drawing based on the text information; and determine the drawing label classification information based on the drawing unit information.
[0062] Exemplarily, the processor can identify the drawing unit information such as the drawing unit name in the text information, and determine the drawing label classification information based on the identified drawing unit information. For example, if the processor recognizes that the text information of the drawing label of the target drawing includes the drawing unit name information such as "XX Design Institute", then "XX Design Institute" can be matched with the predefined first drawing label classification system, and the drawing label classification information corresponding to the drawing unit information of the target drawing can be determined based on the matching result. The predefined first drawing label classification system can be a pre-set classification tree, label set, or other form of data structure, which contains the correspondence between different drawing units and drawing label classification information.
[0063] In some embodiments, the processor may determine the project information of the target drawing based on the text information; and determine the drawing label classification information based on the project.
[0064] Exemplarily, the processor can identify the project information in the text information, and determine the label classification information based on the identified project information. For example, if the processor recognizes that the text information of the label of the target drawing includes project information such as "XX project", the "XX project" can be matched with the predefined second label classification system, and the label classification information corresponding to the project information of the target drawing can be determined based on the matching result. The predefined second label classification system can be a pre-set classification tree, label set, or other form of data structure, which contains the correspondence between different project information and label classification information.
[0065] In some embodiments, the processor can determine the drawing unit information and project information of the target drawing based on the text information; determine the first sub-classification information of the drawing label based on the drawing unit information, determine the second sub-classification information of the drawing label based on the project information, and determine the drawing label classification information by merging the first sub-classification information of the drawing label and the second sub-classification information of the drawing label.
[0066] Exemplarily, similar to the above, the processor can simultaneously identify the drawing unit information and project information in the text information, and determine the first sub-classification information through the drawing unit information and the first drawing label classification system, determine the second sub-classification information through the project information and the second drawing label classification system, and finally merge the first sub-classification information and the second sub-classification information as the drawing label classification information corresponding to the target drawing. That is, the classification information of the target drawing is related to both the drawing unit information and the project information.
[0067] In some embodiments of the present specification, the classification information of the target drawing is determined in a variety of different ways, which can meet the drawing classification needs in different situations, accurately determine the classification of the drawing labels, and facilitate subsequent drawing retrieval and management.
[0068] In some embodiments, the image label classification information may also correspond to the key field names in the image label database. For example, one image label classification information may correspond to one or more key field names in the image label database. Taking the image label classification information determined based on the drawing unit information (such as "XX Design Institute") as an example, the target key field names in the image label database may include all key fields related to "XX Design Institute".
[0069] In some embodiments, the processor may determine a target key field name related to the text information in the image tag database based on the image tag classification information.
[0070] For example, the processor may traverse all key field names in the drawing label database, and determine the key field name corresponding to the drawing label classification information of the target drawing as the target key field.
[0071] In some embodiments, the processor may determine all key field values corresponding to the target key field name as query fields. Continuing with the example of determining the classification information of the drawing label based on the drawing unit information (such as "XX Design Institute"), the processor may determine all key field values related to "XX Design Institute" in the drawing label database (such as specific values of the drawing name, drawing number, version, etc. related to "XX Design Institute") as query fields.
[0072] In some embodiments, different query fields may have different importance to the target drawing. Therefore, the importance of the query field can be evaluated according to actual needs, and different weight values can be preset. In the embodiments of this specification, different weight values are preset for the query fields, and the processor can perform intelligent sorting and screening according to the weight values of the query fields when performing the target drawing label recognition, thereby improving the recognition efficiency and accuracy of the label.
[0073] Step 240, determining target label information based on the query field and text information.
[0074] The target drawing label information refers to the drawing label information in the target drawing.
[0075] In some embodiments, the processor may directly determine the text information as the target image label information, or may further process the text information and use the processed information as the target image label information.
[0076] In some embodiments, to improve the recognition efficiency and accuracy of the target label information, the processor can determine the first coordinate range corresponding to each query field in the label database; determine the second coordinate range corresponding to the first coordinate range in the target drawing; and determine the target label information based on the second coordinate range and the text information.
[0077] The first coordinate range refers to the coordinate range of the key field value corresponding to the query field in the label data.
[0078] In some embodiments, the first coordinate range can be obtained through a drawing label database. For example, the processor can traverse the drawing label database and determine the coordinate range of the key field value corresponding to the query field as the first coordinate range. In some embodiments, each query field may correspond to multiple first coordinate ranges. In order to improve the accuracy of the drawing label recognition of the target drawing, it is necessary to obtain multiple first coordinate ranges corresponding to each query field.
[0079] The second coordinate range refers to the coordinate range corresponding to the query field on the target drawing.
[0080] In some embodiments, the second coordinate range can be obtained by converting the first coordinate range from the coordinate system of the label data to the coordinate system of the target drawing. For example, the first coordinate range can be converted to the second coordinate range by means of a coordinate conversion matrix.
[0081] In some embodiments, similar to the above, when a query field corresponds to multiple first coordinate ranges, in order to improve the accuracy of label recognition of the target drawing, it is necessary to convert the multiple first coordinate ranges corresponding to the query field into second coordinate ranges.
[0082] In some embodiments, the processor may determine the target image label information based on the second coordinate range and the text information. For example, the processor may determine the text information within the second coordinate range as the target image label information.
[0083] In some embodiments of the present specification, by determining the target label information through the second coordinate range and text information, the processor can more quickly and accurately determine the area related to the query field in the target drawing, narrowing the label search range and improving the efficiency of label information extraction.
[0084] In some embodiments, the processor may further filter out all text information within the second coordinate range; sort all text information according to the number of text statistics, and determine the target image label information based on preset rules.
[0085] For example, the processor can perform text recognition on one or more second coordinate ranges corresponding to each query field, and filter out all text information within all second coordinate ranges, and then sort all text information according to the text statistics. The text statistics refer to grouping the filtered text information according to different query fields, counting the number of occurrences of each unique text fragment (for example, a keyword, a phrase, or a whole sentence) in the text information group corresponding to each query field, and sorting the statistical number of occurrences based on a sorting method (such as bubble sort, quick sort, etc.). The more times a text fragment appears, the more likely it is to be the correct text content, the higher its priority, and the higher its ranking.
[0086] In some embodiments, the preset rules may include: setting a threshold for the number of times a text fragment appears, and for each text fragment that appears within the second coordinate range corresponding to the query field, the text fragment that appears the most times and exceeds the threshold for the number of times the text fragment appears will be used as the target image label information corresponding to the query field.
[0087] In some embodiments, when there are multiple text segments with the largest number of occurrences and exceeding the threshold of the number of text segment occurrences, the preset rules may also include: determining whether to merge texts, and in response to merging texts, determining target label information based on the merged texts.
[0088] Merging texts means merging multiple text segments that are close or adjacent to each other in the second coordinate range into one text.
[0089] In some embodiments, after merging the text, the processor can treat the merged text as a whole as a text segment, re-count the number of occurrences and sort them, and then use the text segment with the largest number of occurrences that exceeds the threshold of the number of text segment occurrences as the target image label information corresponding to the query field.
[0090] In some embodiments, when merging text, the processor may also determine the distance between different text segments in the y-axis direction, and determine the merging order of different text segments based on the distance, wherein the distance between different text segments in the y-axis direction may be the difference in the y-coordinates of the text.
[0091] In some embodiments, the processor can determine the coordinate difference between two adjacent text segments on the y-axis among multiple different text segments. If the coordinate difference is between 1.3 and 2 times the character height, it means that the text information may be divided into multiple lines on the target drawing. In this case, the two adjacent text segments are merged, and the text segment with a larger y-coordinate is placed in front. In some preferred embodiments, if the coordinate difference between two adjacent text segments on the y-axis is between 1.5 and 1.8 times the character height, the two adjacent text segments are merged, and the text segment with a larger y-coordinate is placed in front. Among them, the character height refers to the font height in the text of the target drawing.
[0092] In some embodiments, if the coordinate difference between two adjacent text segments on the y-axis is between 0 and 0.25 times the character height, the two adjacent text segments need to be merged, and the text segment with the smaller x-coordinate is placed in front. In some preferred embodiments, if the coordinate difference between two adjacent text segments on the y-axis is between 0.1 and 0.2 times the character height, the two adjacent text segments are merged, and the text segment with the larger x-coordinate is placed in front.
[0093] The relationship between the aforementioned coordinate difference and the character height of the text is only an example, and other suitable relationships may be designed as needed.
[0094] In some embodiments, if the text merging rule is not met, the text is not merged, and the first text segment is obtained as the text information.
[0095] In some embodiments, after the text segments are merged, the coordinates of the merged text need to be updated. Exemplarily, the processor may update the coordinates of the merged text in a similar manner to step 210 .
[0096] In some embodiments of the present specification, when the text information is long, the text information may be divided into multiple lines or multiple paragraphs in the target drawing. The text information divided into multiple lines or multiple paragraphs is not different text information, but is actually the same text information. Therefore, merging them can improve the accuracy of label information recognition.
[0097] In some embodiments, when all text information within the second coordinate range is filtered out, rule matching may be performed based on the second preset rule for some query fields to exclude text that does not meet the second preset rule.
[0098] Among them, some query fields that are matched by the second preset rule may be query fields with relatively fixed content formats. For example, the text content corresponding to query field A involves a ratio, and its fixed format is "1:XX", then the text fragments corresponding to query field A that are not in the format of "1:XX" can be excluded. The above description is only an example, and other matching rules can also be set according to other fixed formats (such as tables), which is not limited here.
[0099] In the embodiments of the present specification, rule matching is performed on some query fields, which can reduce the amount of text to be sorted and improve the efficiency of image label recognition.
[0100] In some embodiments, since the second coordinate range may be relatively vague and a query field may correspond to multiple different second coordinate ranges, it may affect the recognition efficiency and accuracy of the target image label information. In some embodiments of the present specification, by sorting all text information within the entire second coordinate range according to the number of text statistics and further determining the target image label information, the accuracy of target image label information recognition can be further improved.
[0101] In some embodiments, the processor may also determine the estimated range of the label based on the query field and the text information; obtain a first image corresponding to the estimated range of the label in the target drawing; and determine the target label information based on the first image. Figure 3 and related instructions.
[0102] Figure 3 is an exemplary flow chart of a method for identifying a drawing label according to other embodiments of this specification. In some embodiments, process 300 may be executed by a processing device (eg, processor 140). Figure 3 As shown, process 300 includes the following steps.
[0103] Step 310, determining the image label inference range based on the query field and text information.
[0104] The estimated range of the drawing label refers to the area in the target drawing where the drawing label is estimated to exist.
[0105] In some embodiments, the processor may determine the inference range of the image tag based on a third preset rule. For example, the processor may determine the inference range of the image tag based on data / information such as keywords, location information, and timestamps in the query field and text information, using context information and prior knowledge.
[0106] Step 320: Acquire a first image in the target drawing corresponding to the estimated range of the drawing label.
[0107] In some embodiments, the processor may locate the image signature inference range from the target drawing based on the determined image signature inference range based on the image positioning method, and acquire the first image from the image signature inference range.
[0108] In some embodiments, the inferred range of the image signature may be too large or contain information irrelevant to the image signature. When acquiring the first image, the processor may also perform image capture on the inferred range of the image signature and retain only a portion of the image related to the image signature.
[0109] In some embodiments, after acquiring the first image, the processor may further check the quality of the first image, and reacquire the first image when the clarity and resolution of the first image are too low.
[0110] Step 330: Determine target label information based on the first image.
[0111] In some embodiments, the processor may determine the target image label information based on the first image. For example, the processor may process the first image using image recognition technology (such as OCR technology) and determine the extracted text information as the target image label information.
[0112] It should be noted that the above description of processes 200 and 300 is only for illustration and description, and does not limit the scope of application of this specification. For those skilled in the art, various modifications and changes can be made to processes 200 and 300 under the guidance of this specification. However, these modifications and changes are still within the scope of this specification.
[0113] In some embodiments of the present specification, another method for determining target image label information is also provided.
[0114] Figure 4 is an exemplary flow chart of a method for identifying a drawing label according to some embodiments of the present specification. In some embodiments, process 400 may be executed by a processing device (eg, processor 140). Figure 4 As shown, process 400 includes the following steps.
[0115] Step 410, determining the initial coordinate range of the query field.
[0116] The initial coordinate range refers to the coordinate range of the query field before the corresponding text content is processed.
[0117] In some embodiments, the processor may determine the initial coordinate range of the query field based on the image tag database. For example, the processor may determine the first coordinate range corresponding to the query field in the image tag database as the initial coordinate range. For more information about the query field, the image tag database, and the first coordinate range, see Figure 2 and its related parts.
[0118] Step 420 , performing at least one expansion operation on the initial coordinate range, and obtaining a second image corresponding to the coordinate range after each expansion.
[0119] The expansion operation refers to the action performed when the initial coordinate range is expanded outward.
[0120] In some embodiments, the expansion operation includes expanding the initial coordinate range outward by a certain step length or ratio. For example, an expansion operation may include expanding the initial coordinate range by 10 pixels or 10% in the positive and negative directions of the x-axis and the positive and negative directions of the y-axis, respectively.
[0121] In some embodiments, after each expansion operation, the processor may obtain a second image within the expanded coordinate range. After each expansion, the processor may intercept an image of the target drawing within the expanded coordinate range and use it as the second image.
[0122] In some embodiments, to avoid excessive or even infinite expansion times, a maximum number of expansion times or a maximum area of the second image may be preset in advance. When the number of expansion times reaches the maximum number of expansion times or the area of the second image reaches the maximum area of the second image, the expansion operation is stopped.
[0123] Step 430: extract text information from the second image, compare the text information with the text information in the image tag database, and determine the target image tag range.
[0124] The target label range refers to the area where the label exists in the target drawing.
[0125] In some embodiments, each time after acquiring the second image, the processor may process the second image based on image recognition technology (such as OCR technology) to extract text information from the second image.
[0126] In some embodiments, after extracting the text information in the second image, the processor may also compare the text information in the second image with the text information of the image tag stored in the image tag database to determine whether the text information in the second image is the image tag information. Exemplary comparison methods include fuzzy matching, keyword matching, and the like.
[0127] In some embodiments, after the expansion operation, if it is determined that the text information in the second image is the image label information, the next expansion is continued until the text information extracted after multiple expansions (such as three consecutive times) is not the image label information, then the expansion is stopped, and the coordinate range corresponding to the expansion operation in which the text information extracted last time is the image label information is determined as the target image label range.
[0128] Step 440: determine the text information within the target image label range as the target image label information.
[0129] In some embodiments, the processor may extract text information within the target range, and determine the extracted text information as the target image label information.
[0130] In some embodiments of the present specification, multiple expansion operations are performed to determine the target image tag range and further determine the target image tag information, thereby avoiding omissions when identifying image tag information and improving the accuracy of image tag recognition.
[0131] In some embodiments of this specification, the processor may also determine a target coordinate range of the target image label information on the target drawing; and update the first coordinate range in the image label database based on the target coordinate range. Figure 5 and its related description.
[0132] Figure 5 is an exemplary flow chart of updating the image tag database according to some embodiments of this specification. In some embodiments, process 500 may be executed by a processing device (eg, processor 140). Figure 5 As shown, process 500 includes the following steps.
[0133] Step 510, determining the target coordinate range of the target drawing label information on the target drawing.
[0134] The target coordinate range refers to the coordinate interval of the area where the target drawing label information is located on the target drawing.
[0135] In some embodiments, the processor may determine the area where the target image label information is located on the target drawing by a text positioning method. After determining the area where the target image label information is located on the target drawing, the processor may determine the target coordinate range of the target image label information according to the position of the text content contained in the target image label information on the target drawing.
[0136] Step 520: Update the target first coordinate range in the image tag database based on the target coordinate range.
[0137] The target first coordinate range refers to the first coordinate range that needs to be updated in the image label database.
[0138] The processor can establish a connection with the image label database and obtain permission to update the image label database.
[0139] In some embodiments, the processor can query the first coordinate range corresponding to the query field that needs to be updated and corresponds to the target image tag information in the image tag database based on the unique identifier of the target image tag information (such as ID, serial number, etc.), and determine the queried first coordinate range that needs to be updated as the target first coordinate range.
[0140] In some embodiments, the processor may directly replace the target first coordinate range that needs to be updated with the target coordinate range of the target image tag information.
[0141] In some embodiments, the processor may further determine the covering relationship between the target coordinate range and the target first coordinate range; in response to the target coordinate range being completely covered by the target first coordinate range, update the target first coordinate range with the target coordinate range.
[0142] The coverage relationship refers to the degree to which the target coordinate range is covered by the target first coordinate range in the same coordinate system (such as the coordinate system of the target drawing or the coordinate system of the drawing label database).
[0143] The coverage relationship includes complete coverage and incomplete coverage. When all vertices of the target coordinate range are within the target first coordinate range, the target coordinate range is completely covered by the target first coordinate range, otherwise it is incomplete coverage. Exemplarily, the minimum and maximum values of the x-coordinate and y-coordinate of the target coordinate range and the target first coordinate range can be compared. When the minimum value of the x-coordinate and the minimum value of the y-coordinate of the target coordinate range are greater than the minimum value of the x-coordinate and the minimum value of the y-coordinate of the target first coordinate range, and the maximum value of the x-coordinate and the maximum value of the y-coordinate of the target coordinate range are less than the maximum value of the x-coordinate and the maximum value of the y-coordinate of the target first coordinate range, the target coordinate range completely falls within the target first coordinate range, and the target coordinate range is completely covered by the target first coordinate range, otherwise it is incomplete coverage.
[0144] In some embodiments, when the target coordinate range is completely covered by the target first coordinate range, the processor may update the value of the first coordinate range to the value of the target coordinate range. If the target coordinate range is not completely covered by the target first coordinate range, it may be selected not to update the target first coordinate range or perform other processing (such as merging coordinates, marking coordinate conflicts, etc.) according to actual needs.
[0145] In some embodiments of the present specification, when the target coordinate range is completely covered by the existing coordinate range in the tag database, updating the tag database with the target coordinate range can ensure that the coordinate information stored in the tag database is up-to-date and accurate, thereby improving the query and recognition efficiency of the tag information.
[0146] In some embodiments, the processor may also preset a weight for the first coordinate range; after determining the target tag information each time: determine the degree of overlap between the target coordinate range and the target first coordinate range; in response to the degree of overlap being greater than a first threshold, increase the weight of the target first coordinate range; after increasing the weight, determine whether the weight of the target first coordinate range exceeds a second threshold, and in response to the weight of the target first coordinate range exceeding the second threshold, perform weight sorting on all first coordinate ranges in the tag database, and eliminate first coordinate ranges whose weights are lower than a third threshold.
[0147] In some embodiments, the processor may preset the weights of all first coordinate ranges in the image tag database to be initial values (eg, 0).
[0148] After determining the target label information each time, the processor can determine the target coordinate range of the target label information on the target drawing, and determine the degree of overlap between the target coordinate range and the target first coordinate range in the same coordinate system (such as the coordinate system where the target drawing is located or the coordinate system where the label database is located).
[0149] The overlap degree can be determined by comparing the ratio of the area of the overlapped region between the target coordinate range and the target first coordinate range to the total area of the target coordinate range and the target first coordinate range. For example, if the area of the overlapped region between the target coordinate range and the target first coordinate range is m, and the total area of the target coordinate range and the target first coordinate range is n, then the overlap degree between the target coordinate range and the target first coordinate range is m / n.
[0150] In some embodiments, when the overlap degree is greater than a first threshold (eg, 80%), the processor may increase the weight of the target first coordinate range, and the increased weight value may be preset, for example, the weight may be increased by 1.
[0151] In some embodiments, the target coordinate range may completely fall within the target first coordinate range (ie, the target coordinate range is completely covered by the target first coordinate range), and the overlap between the target coordinate range and the target first coordinate range may be considered to be 100%.
[0152] In some embodiments, after increasing the weight of the target first coordinate range, the processor may also determine whether the weight of the target first coordinate range exceeds a second threshold value (such as 10, etc.). When the weight of the target first coordinate range exceeds the second threshold value, the processor may sort the weights of all first coordinate ranges in the image tag database and eliminate the first coordinate ranges whose weights are lower than a third threshold value (such as 3). The second threshold value and the third threshold value may be preset in advance and are related to the weight value of each increase in the weight of the first coordinate range, that is, the larger the increased weight value, the larger the second threshold value and the third threshold value.
[0153] In some embodiments of the present specification, eliminating the first coordinate range with too low weight in the image tag database can reduce the impact of edge data, streamline the data volume, and improve the efficiency of image tag recognition and query.
[0154] In some embodiments, the processor may further determine a degree of overlap between the target coordinate range and the target first coordinate range; in response to the degree of overlap being less than a fourth threshold, the target coordinate range is added to the image tag database as a new coordinate range.
[0155] The method for determining the degree of overlap between the target coordinate range and the target first coordinate range is the same as that described above. For details, please refer to the relevant part of the above text.
[0156] In some embodiments, when the overlap degree is less than a fourth threshold, the processor may use the target coordinate range as a new first coordinate range, and add it to the image tag database after associating it with the target image tag information.
[0157] In some embodiments of the present specification, a target coordinate range whose overlap with the target first coordinate range is less than a certain threshold is added to the image tag database, which can ensure the integrity of the image tag database, incorporate image tag areas that have not been collected before into the image tag database management, and improve the accuracy of subsequent image tag information recognition. In addition, updating and maintaining the image tag database based on the target image tag information and the target coordinate range corresponding thereto can improve the maintainability and scalability of the system. When it is necessary to add new fields or modify existing fields, the coordinate range information in the image tag database can be easily updated to meet new needs.
[0158] Figure 6 is an exemplary module diagram of a drawing label recognition system according to some embodiments of this specification. Figure 6 As shown, the drawing label recognition system 600 includes a database construction module 610 , a parsing module 620 , a first determination module 630 and a second determination module 640 .
[0159] The database construction module 610 is configured to establish a drawing label database, which includes key field names and key field values of different drawings.
[0160] The parsing module 620 is configured to parse the target drawing and obtain text information in the target drawing.
[0161] In some embodiments, the parsing module 620 is further configured to indent the frame of the target drawing by a preset distance to obtain a reference frame; and obtain text information between the frame of the target drawing and the reference frame.
[0162] The first determination module 630 is configured to determine a query field from the image tag information in the image tag database based on the text information.
[0163] In some embodiments, the first determination module 630 is further configured to determine the image tag classification information based on the text information; and determine the query field from the image tag database based on the image tag classification information.
[0164] In some embodiments, the first determination module 630 is further configured to determine the drawing unit information of the target drawing based on the text information; determine the drawing label classification information based on the drawing label classification information; and determine the target key field name related to the text information in the drawing label database based on the drawing label classification information; and determine all key field values of the target key field name as query fields.
[0165] The second determination module 640 is configured to determine target label information based on the query field and text information.
[0166] In some embodiments, the second determination module 640 is further configured to determine a first coordinate range corresponding to each query field in the drawing label database; determine a second coordinate range corresponding to the first coordinate range in the target drawing; and determine the target drawing label information based on the second coordinate range and text information.
[0167] In some embodiments, the second determination module 640 is further configured to filter out all text information within the second coordinate range; sort all text information according to the number of text statistics, and determine the target image label information based on preset rules.
[0168] In some embodiments, the second determination module 640 is further configured to determine the inferred range of the label based on the query field and text information; obtain a first image corresponding to the inferred range of the label in the target drawing; and determine the target label information based on the first image.
[0169] In some embodiments, the second determination module 640 is further configured to determine the initial coordinate range of the query field; perform at least one expansion operation on the initial coordinate range to obtain a second image corresponding to the coordinate range after each expansion; extract text information in the second image, compare the text information with the text information in the image tag database to determine the target image tag range; and determine the text information within the target image tag range as the target image tag information.
[0170] In some embodiments, the drawing label recognition system 600 further includes an update module 650 .
[0171] The updating module 650 is configured to determine a target coordinate range of the target drawing label information on the drawing; and update a target first coordinate range in the drawing label database based on the target coordinate range.
[0172] In some embodiments, the updating module 650 is further configured to determine the covering relationship between the target coordinate range and the target first coordinate range; in response to the target coordinate range being completely covered by the target first coordinate range, update the first coordinate range with the target coordinate range.
[0173] In some embodiments, the update module 650 is further configured to: preset the weight of the first coordinate range; after determining the target image tag information each time: determine the overlap between the target coordinate range and the target first coordinate range; in response to the overlap being greater than a first threshold, increase the weight of the target first coordinate range; after increasing the weight, determine whether the weight of the target first coordinate range exceeds a second threshold, and in response to the weight of the target first coordinate range exceeding the second threshold, weight sort all first coordinate ranges in the image tag database, and eliminate first coordinate ranges whose weights are lower than a third threshold.
[0174] In some embodiments, the update module 650 is further configured to determine the degree of overlap between the target coordinate range and the target first coordinate range; in response to the degree of overlap being less than a fourth threshold, the target coordinate range is added to the image signature database as a new coordinate range.
[0175] For a detailed description of the functions involved in each module of the drawing label recognition system 600 shown above, reference may be made to the relevant parts of the previous text of this specification, for example, Figure 2~Figure 5 and related instructions.
[0176] It should be noted that the above description of the drawing label recognition system 600 and its modules is only for the convenience of description and cannot limit the present specification to the scope of the embodiments. Figure 6 The database construction module 610, the parsing module 620, the first determination module 630, the second determination module 640 and the update module 650 disclosed in the specification can be different modules in a system, or a module can realize the functions of two or more modules mentioned above. For example, each module can share a storage module, or each module can have its own storage module. Such variations are all within the protection scope of this specification.
[0177] The drawing label recognition method and system described in some embodiments of the present specification can achieve at least the following effects by establishing a label database and querying the label database based on the text information in the target drawing: (1) effectively reducing the search range when querying drawings and improving the accuracy of recognition; (2) the label database contains different label templates and has strong adaptability, thereby greatly improving the recognition efficiency of label information; (3) extracting the label information in the drawing to facilitate subsequent drawing search.
[0178] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are suggested in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.
[0179] At the same time, this specification uses specific words to describe the embodiments of this specification. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures or characteristics in one or more embodiments of this specification can be appropriately combined.
[0180] It should be noted that in order to simplify the description disclosed in this specification and thus help understand one or more embodiments, in the above description of the embodiments of this specification, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the subject of this specification are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.
Claims
1. A method for identifying a drawing label, characterized in that: The method comprises: Establishing a drawing label database, wherein the drawing label database includes key field names and key field values of different drawings; Parsing the target drawing to obtain text information in the target drawing; Determine a query field from the drawing label database based on the text information; the query field is the key field value for querying the drawing label information related to the target drawing in the drawing label database; Determine a first coordinate range corresponding to the query field in the image tag database; Determine a second coordinate range in the target drawing corresponding to the first coordinate range; The target label information is determined based on the second coordinate range and the text information.
2. The method according to claim 1, characterized in that The step of determining a query field from the image tag information in the image tag database based on the text information includes: Determine the label classification information based on the text information; The query field is determined from the image tag database based on the image tag classification information.
3. The method according to claim 2, characterized in that The determining of the image label classification information based on the text information includes: Determine the drawing unit information of the target drawing based on the text information; Determine the image label classification information based on the mapping unit information; And, determining the query field from the image tag database based on the image tag classification information includes: Determining a target key field name related to the text information in the image tag database based on the image tag classification information; and All the key field values of the target key field name are determined as the query fields.
4. The method according to claim 1, characterized in that The determining the target image label information based on the second coordinate range and the text information includes: Filter out all the text information within the second coordinate range; All the text information is sorted according to the text statistics times, and the target image label information is determined based on preset rules.
5. The method according to claim 1, characterized in that The step of parsing the target drawing and obtaining text information in the target drawing includes: Indent the frame of the target drawing by a preset distance to obtain a reference frame; The text information between the frame of the target drawing and the reference frame is obtained.
6. The method according to claim 1, characterized in that The method further comprises: Determine the image label inference range based on the query field and the text information; Acquire a first image in the target drawing corresponding to the estimated range of the drawing label; The target label information is determined based on the first image.
7. The method according to claim 1, characterized in that The method further comprises: Determining an initial coordinate range of the query field; Perform at least one expansion operation on the initial coordinate range to obtain a second image corresponding to the coordinate range after each expansion; Extracting the text information in the second image, comparing the text information with the text information in the image tag database, and determining a target image tag range; The text information within the target image label range is determined as the target image label information.
8. The method according to claim 1, characterized in that The method further comprises: Determine the target coordinate range of the target drawing label information on the target drawing; The target first coordinate range in the image tag database is updated based on the target coordinate range.
9. The method according to claim 8, characterized in that The updating of the image label database based on the target coordinate range includes: Determining the overlapping relationship between the target coordinate range and the target first coordinate range; In response to the target coordinate range being completely covered by the target first coordinate range, the target first coordinate range is updated with the target coordinate range.
10. The method according to claim 8, characterized in that The updating of the image label database based on the target coordinate range includes: Presetting the weight of the first coordinate range; and after determining the target image tag information each time: Determining the degree of overlap between the target coordinate range and the first coordinate range; In response to the overlap being greater than a first threshold, increasing the weight of the target first coordinate range; After adding the weight, it is determined whether the weight of the target first coordinate range exceeds a second threshold value, In response to the weight of the target first coordinate range exceeding a second threshold, all the first coordinate ranges in the tag database are weight-sorted, and the first coordinate ranges whose weights are lower than a third threshold are eliminated.
11. The method according to claim 8, characterized in that The updating of the image label database based on the target coordinate range includes: Determining the degree of overlap between the target coordinate range and the target first coordinate range; In response to the degree of overlap being less than a fourth threshold, the target coordinate range is added to the image tag database as a new coordinate range.
12. A drawing label recognition system, characterized in that: The system comprises: A database construction module is configured to establish a drawing label database, wherein the drawing label database includes drawing label information of different drawings; A parsing module is configured to parse a target drawing and obtain text information in the target drawing; A first determining module is configured to determine a query field from the image tag information in the image tag database based on the text information; the query field is a key field value for querying the image tag information related to the target drawing in the image tag database; The second determination module is configured to Determine a first coordinate range corresponding to the query field in the image tag database; Determine a second coordinate range in the target drawing corresponding to the first coordinate range; The target label information is determined based on the second coordinate range and the text information.
13. A drawing label recognition device, characterized in that: The device includes at least one storage medium and at least one processor; The at least one storage medium is used to store computer instructions; The at least one processor is used to execute the computer instructions to implement the method according to any one of claims 1 to 11.
Citation Information
Cited By
DWG drawing text information query method and system based on multi-modal large model
CN122086945A
