An electronic paper signature area positioning method, system and storage medium

By acquiring and analyzing the line segment features in electronic drawings, especially the vertical and parallel relationships, the drawing label area can be quickly and accurately located, solving the problem of inaccurate positioning in the automated management of drawing information and improving the efficiency and accuracy of drawing information recognition.

CN121637599BActive Publication Date: 2026-05-05TECHNOLOGY (CHENGDU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TECHNOLOGY (CHENGDU) CO LTD
Filing Date
2026-02-04
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In existing technologies, the location of the title block in electronic drawings is not fixed, the drawing orientation changes, and there is a lack of automatic recognition methods, resulting in low efficiency in the automated extraction and management of drawing information.

Method used

By acquiring all line segments in the electronic drawing, the first target line segment and the second target line segment are determined. Based on the vertical and/or parallel relationships of the line segments, the label area is quickly located using geometric logic.

Benefits of technology

It achieves automated and high-precision positioning of the drawing label area, significantly improving the efficiency and accuracy of drawing information recognition and overcoming the dependence on drawing format.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121637599B_ABST
    Figure CN121637599B_ABST
Patent Text Reader

Abstract

This invention provides a method, system, and storage medium for locating the title block area in electronic drawings, relating to the field of engineering drawing data processing technology. The method includes: acquiring all line segments contained in the electronic drawing; determining a first target line segment and a second target line segment among all the line segments; and determining the title block area in the electronic drawing based on the linear characteristics of the first and second target line segments. The title block area is used to write drawing information related to the electronic drawing, and the linear characteristics include perpendicular and / or parallel relationships between line segments. This invention can intelligently and adaptively identify and accurately locate the title block area in various electronic drawings, improving the efficiency and accuracy of automated extraction and management of drawing information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of engineering drawing data processing technology, and in particular to a method, system and storage medium for locating the title area of ​​electronic drawings. Background Technology

[0002] In the field of engineering design, Computer-Aided Design (CAD) electronic drawings (e.g., drawings created using software such as AutoCAD and Tianzheng CAD, simply referred to as drawings) are the core carrier of information transmission. To standardize drawing management, a specific "title area" is set inside the drawing frame when a drawing is produced. This title area is usually located in a corner of the drawing frame (e.g., the right side or bottom) and is used to centrally fill in the drawing's data information, such as drawing name, project name, drawing number, version number, issuing unit, and specialty. This data information is crucial for the archiving, retrieval, version management, and collaborative work of drawings. However, in practical applications, the automatic identification of the title area faces significant technical challenges, including problems such as the inconsistent location of the title area, changes in drawing orientation, and a lack of automatic identification methods.

[0003] Therefore, it is necessary to provide a method, system, and storage medium for locating the title block area in electronic drawings, which can intelligently and adaptively identify and locate the title block area in various electronic drawings, thereby improving the efficiency and accuracy of automated extraction and management of drawing information. Summary of the Invention

[0004] The invention includes a method for locating a title block area in an electronic drawing. The method is executed on a computer device including at least one processor and a storage device communicating with the at least one processor. The storage device stores computer instructions that, when executed by the at least one processor, perform the following operations: acquire all line segments contained in the electronic drawing; determine a first target line segment and a second target line segment among all the line segments; and, based on the linear characteristics of the first target line segment and the second target line segment, determine a title block area in the electronic drawing, the title block area being used to sign drawing information related to the electronic drawing, the linear characteristics including perpendicular and / or parallel relationships between line segments.

[0005] The invention includes a label area positioning system for electronic drawings. The system includes: an acquisition module configured to acquire all line segments contained in the electronic drawing; a line segment determination module configured to determine a first target line segment and a second target line segment among all the line segments; and a label determination module configured to determine a label area in the electronic drawing based on the linear characteristics of the first and second target line segments. The label area is used for drawing information related to the electronic drawing, and the linear characteristics include perpendicular and / or parallel relationships between line segments.

[0006] The invention includes a computer-readable storage medium that stores computer instructions. When a computer reads the computer instructions from the storage medium, the computer executes a method for locating the title area of ​​an electronic drawing as described in any embodiment of this specification.

[0007] The beneficial effects of the above-described invention include, but are not limited to: efficiently acquiring all line segments in electronic drawings, and based on this, accurately determining the first and second target line segments of the drawing frame by analyzing the linear characteristics of the line segments (such as perpendicular and / or parallel relationships), thereby quickly locating the title block area in a geometric logic manner. This overcomes the shortcomings of traditional methods, such as strong dependence on drawing format and low positioning accuracy, achieving automated and high-precision positioning of the title block area, and significantly improving the efficiency and accuracy of drawing information recognition. Attached Figure Description

[0008] This specification will be further described by way of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting; in these embodiments, the same reference numerals denote the same structures, wherein:

[0009] Figure 1 This is an exemplary module diagram of a title area positioning system for an electronic drawing, as shown in some embodiments of this specification;

[0010] Figure 2 This is an exemplary flowchart of a method for locating the title area of ​​an electronic drawing according to some embodiments of this specification;

[0011] Figure 3 This is a schematic diagram showing the positional relationship between the frame and label areas according to some embodiments of this specification;

[0012] Figure 4 This is a schematic diagram showing the positional relationship of the frame and label areas according to other embodiments of this specification;

[0013] Figure 5 This is a schematic diagram showing the positional relationship of the frame and label areas according to other embodiments of this specification;

[0014] Figure 6 This is a schematic diagram showing the positional relationship of the frame and label areas according to other embodiments of this specification; and,

[0015] Figure 7 These are software / hardware schematic diagrams of computer devices illustrated according to some embodiments of this specification. Detailed Implementation

[0016] To more clearly illustrate the technical solutions of the embodiments in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some examples or embodiments of this specification. For those skilled in the art, these drawings can be applied to other similar scenarios without creative effort. Unless obvious from the context or otherwise specified, the same reference numerals in the drawings represent the same structures or operations.

[0017] It should be understood that the terms “system,” “device,” “unit,” and / or “module” used herein are one way to distinguish different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.

[0018] Unless the context clearly indicates an exception, words such as "a," "an," "a kind," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0019] Flowcharts are used in this specification to illustrate the operations performed by the system according to embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0020] Figure 1 This is an exemplary module diagram of a title area positioning system for an electronic drawing, as shown in some embodiments of this specification.

[0021] In some embodiments, such as Figure 1 As shown, the electronic drawing title area positioning system 100 (hereinafter referred to as the system) may include an acquisition module 110, a line segment determination module 120 and a title determination module 130.

[0022] In some embodiments, the acquisition module 110 is configured to acquire all line segments contained in the electronic drawing.

[0023] In some embodiments, the line segment determination module 120 is configured to determine a first target line segment and a second target line segment among all line segments.

[0024] In some embodiments, the label determination module 130 is configured to determine a label area in an electronic drawing based on the linear characteristics of a first target line segment and a second target line segment. The label area is used for drawing information related to the electronic drawing, and the linear characteristics include the vertical and / or parallel relationships between line segments.

[0025] For further explanation of the above content, please see [link / reference]. Figure 2 And related content.

[0026] It should be understood that Figure 1 The system and its modules shown can be implemented in various ways. For example, in some embodiments, Figure 1 The system and its modules shown can be implemented by a processor. The processor can process data and / or information obtained from other devices or system components. Based on this data, information, and / or processing results, the processor can execute program instructions to perform one or more functions described in this specification. In some embodiments, the processor may include one or more sub-processing devices (e.g., a single-core processing device or a multi-core multi-chip processing device). By way of example only, the processor may include a central processing unit (CPU), a controller, a microprocessor, or any combination thereof. In some embodiments, the processor may include multiple modules, each of which can be used to execute different program instructions.

[0027] It should be noted that the above description of the system and its modules is for convenience only and should not be construed as limiting this specification to the scope of the illustrated embodiments. It is understood that those skilled in the art, after understanding the principles of the system, may arbitrarily combine the various modules or construct subsystems connected to other modules without departing from these principles. In some embodiments, Figure 1 The acquisition module 110, line segment determination module 120, and label determination module 130 disclosed herein can be different modules within a single system, or a single module can implement the functions of two or more of the aforementioned modules. For example, the modules can share a single storage module, or each module can have its own separate storage module. Such variations are all within the scope of protection of this specification.

[0028] Figure 2 This is a flowchart illustrating a method for locating the title area of ​​an electronic drawing according to some embodiments of this specification. For example... Figure 2As shown, process 200 includes the following steps. In some embodiments, process 200 may be executed by the title block area positioning system 100 of the electronic drawing or the computer device 700 (e.g., the processor 710).

[0029] Step 210, obtain all line segments included in the electronic drawing. In some embodiments, step 210 may be executed by the processor 710 or the obtaining module 110.

[0030] An electronic drawing refers to a drawing file stored and presented in digital format. For example, an electronic drawing may be a CAD file (e.g., file formats such as DWG, DXF), a PDF file, or an image file (e.g., file formats such as TIFF, JPEG, PNG), etc.

[0031] All line segments refer to the set of all straight and curved line segments depicted in the electronic drawing. All line segments include, but are not limited to, the line segments forming the drawing frame, the line segments forming the title block area, the horizontal and vertical lines within the title block area, and the horizontal and vertical lines outside the title block area. For example, as Figure 4 shown, all line segments, in addition to the 4 line segments of the outer bounding box and the 4 line segments of the inner bounding box, also include any other line segments shown in the figure.

[0032] A drawing frame refers to the edge bounding box in the electronic drawing used to enclose the drawing content, which carries all the elements and information of the drawing (e.g., the drawn content and signature information in the drawing, etc.). For example, a drawing frame is usually composed of double lines or other forms of boundary lines. The drawing frame includes two forms: a single-line frame and a double-line frame. As Figure 3 shown, a single-line frame is a rectangular drawing frame composed of 4 line segments connected end to end, as Figure 4 shown, a double-line frame is a "hui"-shaped drawing frame including an inner circle and an outer circle. The inner circle is the inner bounding box, and the outer circle is the outer bounding box.

[0033] The title block area refers to a specific area in the drawing frame for filling in drawing information. For example, the title block area is usually located in the lower right corner or at the bottom of the drawing for signing drawing information related to the electronic drawing. In some embodiments, the drawing information includes, but is not limited to, information such as drawing name, project name, drawing number, version, drawing issuing unit, specialty, etc.

[0034] In some embodiments, the acquisition module (e.g., acquisition module 110) can parse the content of the electronic drawing to obtain all elements contained in the electronic drawing, referred to as primitives; and filter out text elements in the primitives to obtain all line segment elements contained in the electronic drawing, i.e., all line segments. For example, acquisition module 110 can use a drawing parsing engine (e.g., a CAD parser or a PDF parser) to parse the electronic drawing, identify and extract various primitives (e.g., line segments, arcs, polygons, etc.) and text primitives in the electronic drawing. Subsequently, acquisition module 110 filters all non-line segment primitives (e.g., text, filled areas, points, etc.) by primitive type recognition or attribute filtering, retaining only line segment elements, thereby obtaining all line segments of the electronic drawing.

[0035] In some embodiments, the acquisition module can directly parse electronic drawings to obtain all the line segments contained therein. For example, for electronic drawings in CAD format (e.g., DWG, DXF files), the API interface of the CAD software can be directly called or a dedicated CAD parsing library can be used to extract all line entity objects from the drawing data structure; these line entity objects are the required line segments.

[0036] In some embodiments, the acquisition module can also acquire all line segments contained in the electronic drawing through various other methods. For example, for electronic drawings in bitmap format (e.g., scanned images), image processing techniques, such as edge detection algorithms, can be used to identify lines in the drawing and connect edge pixels into line segments using Hough transform or other line segment fitting algorithms.

[0037] Step 220: Determine the first target line segment and the second target line segment among all line segments. In some embodiments, step 220 may be performed by the processor 710 or the line segment determination module 120.

[0038] The first target line segment refers to the line segment that constitutes the drawing frame of an electronic drawing, used to help determine the title area within the drawing. The first target line segment is usually parallel to the horizontal line. For example, the first target line segment can be the bottom or top edge of the drawing frame.

[0039] The second target line segment refers to the line segment that constitutes the frame of the electronic drawing, and together with the first target line segment, it is used to help determine the title area in the electronic drawing. The first target line segment is usually perpendicular to the horizontal line. For example, the second target line segment can be the right or left line of the frame. In some embodiments, the first and second target line segments intersect and are perpendicular.

[0040] The bottom edge line refers to the line segment at the bottom of the drawing frame and located at the outermost edge. The top edge line refers to the line segment at the top of the drawing frame and located at the outermost edge. The right edge line refers to the line segment on the right side of the drawing frame and located at the outermost edge. The left edge line refers to the line segment on the left side of the drawing frame and located at the outermost edge.

[0041] In some embodiments, the first target line segment and the second target line segment can be any line segment of the bounding box of the drawing frame. In some embodiments, the first target line segment and the second target line segment can be determined based on the approximate position of the title area within the drawing frame. For example, the title determination module 130 can identify the approximate position of the title area (located above, below, to the left, or to the right of the drawing frame), and further determine the first target line segment and the second target line segment based on the approximate position. For example, if the title area is located below the drawing frame, the line segment determination module can determine the bottom edge of the drawing frame as the first target line segment; if the title area is located above the drawing frame, the line segment determination module can determine the top edge of the drawing frame as the first target line segment. As another example, if the title area is located to the right of the drawing frame, the line segment determination module can determine the right edge of the drawing frame as the second target line segment; if the title area is located to the left of the drawing frame, the line segment determination module can determine the left edge of the drawing frame as the second target line segment.

[0042] In some embodiments, the title block determination module (e.g., title block determination module 130) can establish a planar coordinate system based on two mutually perpendicular and intersecting line segments within the bounding box of the title block. In some embodiments, the title block determination module (e.g., title block determination module 130) can establish a planar coordinate system based on the bottom edge and left edge of the title block. In some embodiments, the title block determination module can be configured to establish a planar coordinate system with the bottom edge of the title block as the direction coinciding with the x-axis and the left edge of the title block as the direction coinciding with the y-axis. The origin of this planar coordinate system can be set as the intersection of the bottom edge and left edge of the title block. In some embodiments, the establishment of the planar coordinate system can be achieved through geometric calculations. For example, based on the endpoint coordinates of the bottom edge and left edge of the title block, the direction vectors and intersection points of the bottom edge and left edge are calculated respectively. Based on this, new coordinate axes and origins are defined, and the original global coordinate system of the electronic drawing is translated and rotated to align it with the established planar coordinate system.

[0043] In some embodiments, if the precise boundary lines of the drawing frame have been obtained through parsing (e.g., the coordinates of the four corner points), the label determination module can directly set the lower left corner of the drawing frame as the origin (0,0) of the planar coordinate system, define the direction of the bottom edge as the positive x-axis direction, and define the direction of the left edge as the positive y-axis direction. Based on the planar coordinate system constructed above, the bottom edge of the drawing frame can be regarded as a line segment parallel to the x-axis with a y-value of 0.

[0044] In some embodiments of this specification, a standardized local reference frame is provided by establishing a planar coordinate system based on the bottom and left edges of the drawing frame. This makes it more convenient and efficient to subsequently perform accurate calculations and analyses of the dimensions, positions, and relative relationships of all elements within the electronic drawing (including but not limited to the title block area), effectively avoiding the complexity caused by changes in the drawing's orientation or position, thereby improving the versatility and accuracy of electronic drawing processing.

[0045] In some embodiments, the line segment determination module can identify and determine the outermost drawing frame from all line segments. For example, by analyzing the coordinates and lengths of all line segments, the four line segments constituting the largest outer rectangle are identified. For example, for a double-line frame, the line segment determination module 120 can find a set of mutually perpendicular and intersecting line segments with the largest x or y coordinate range to determine the outer drawing frame. Once the outer drawing frame is determined, the line segment determination module can determine the first target line segment and the second target line segment. For example, the line segment determination module 120 can determine the bottom horizontal line segment of the drawing frame as the first target line segment and the rightmost line segment of the drawing frame that is perpendicular to and intersects the first target line segment as the second target line segment. As another example, the line segment determination module 120 can determine the top horizontal line segment of the drawing frame as the first target line segment and the leftmost line segment of the drawing frame that is perpendicular to and intersects the first target line segment as the second target line segment.

[0046] In some embodiments, the line segment determination module can determine the first target line segment and the second target line segment using statistical or coordinate analysis methods. For example, the line segment determination module 120 can traverse all line segments, identify the line segment with the smallest (lowest) y-coordinate among all horizontal line segments as a potential bottom edge line, and simultaneously identify the line segment with the largest (rightmost) x-coordinate among all vertical line segments as a potential right edge line. Then, by verifying whether these line segments constitute part of the outer boundary of the drawing (e.g., combining the y-axis coordinates of the line segments, parallel and / or perpendicular relationships, etc.), the first target line segment and the second target line segment are determined.

[0047] In some embodiments, the line segment determination module can also utilize a machine learning model to train the machine learning model to directly identify the line segments of the drawing frame in the drawing, thereby determining the first target line segment and the second target line segment.

[0048] Step 230: Based on the linear characteristics of the first target line segment and the second target line segment, determine the label area in the electronic drawing. The label area is used to write drawing information related to the electronic drawing. The linear characteristics include the perpendicular and / or parallel relationships between line segments. In some embodiments, step 230 can be performed by the processor 710 or the label determination module 130.

[0049] Linear characteristics refer to the geometric relationships or properties between line segments. For example, linear characteristics include perpendicular and / or parallel relationships between line segments.

[0050] In some embodiments, the label determination module can determine the label area based on a first target line segment and a second target line segment by searching for other line segments that have specific linear characteristics with the first and second target line segments. For example, when the first target line segment is the bottom edge of the frame and the second target line segment is the right edge of the frame, the label determination module can search for a horizontal line segment that is parallel to and above the first target line segment (e.g., with a y-coordinate greater than the first target line segment), and intersects with or is within the same vertical range as the second target line segment, as the top boundary line of the label area. Simultaneously, it searches for a vertical line segment that is parallel to and to the left of the second target line segment (e.g., with an x-coordinate less than the second target line segment), and intersects with or is within the same horizontal range as the first target line segment, as the left boundary line of the label area. The label determination module can then use the top and left boundary lines of the searched label area, together with the first and second target line segments, to enclose a rectangular area, which is the label area.

[0051] In some embodiments, the label determination module can also utilize a machine learning model to train the machine learning model to directly identify the label area in the electronic drawing.

[0052] In some embodiments of this specification, all line segments in the electronic drawing are efficiently acquired. Based on this, the first and second target line segments of the drawing frame are accurately determined by analyzing the linear characteristics of the line segments (such as perpendicular and / or parallel relationships), thereby quickly locating the title block area in a geometric logic manner. This overcomes the shortcomings of traditional methods, such as strong dependence on drawing format and low positioning accuracy, and realizes automated and high-precision positioning of the title block area, significantly improving the efficiency and accuracy of drawing information recognition.

[0053] In some embodiments, the title block determination module may be further configured to: determine a first vertical line segment group based on the vertical relationship between the first target line segment and other line segments among all line segments, and record the coordinates of each line segment in the first vertical line segment group; determine a first parallel line segment group based on the parallel relationship between the first target line segment and other line segments among all line segments, and record the coordinates of each line segment in the first parallel line segment group; and determine the title block area in the electronic drawing based on the first vertical line segment group and the first parallel line segment group.

[0054] The first vertical segment group refers to the set of all line segments that are perpendicular to the first target line segment (including intersecting and non-intersecting line segments). For example, when the first target line segment is the bottom edge of an electronic drawing, the first vertical segment group can include all line segments in the electronic drawing that are perpendicular to the bottom edge. As another example, when the first target line segment is the top edge of an electronic drawing, the first vertical segment group can include all line segments in the electronic drawing that are perpendicular to the top edge. In some embodiments, being perpendicular can mean that the direction vector of the line segment is approximately orthogonal to the direction vector of the first target line segment, forming an angle between 85 and 95 degrees (preferably 90 degrees).

[0055] In some embodiments, the label determination module can identify line segments that are perpendicular to the first target line segment by traversing all line segments, and determine these line segments as the first vertical line segment group. For example, if the first target line segment is the bottom edge line of the frame (usually a horizontal line), then the first vertical line segment group will include all line segments that are approximately perpendicular to the bottom edge line (i.e., approximately vertical lines).

[0056] In some embodiments, the label determination module may record the (x, y) coordinates (e.g., coordinates in the planar coordinate system described above) of the two endpoints of each line segment in the first vertical line segment group to record the coordinates of each line segment in the first vertical line segment group.

[0057] In some embodiments, the label determination module may also determine the first group of vertical line segments and record their coordinates in other ways. For example, the label determination module may use a line segment intersection detection algorithm to identify line segments perpendicular to the first target line segment and record the coordinates of the line segment (e.g., the coordinates of the starting point of the line segment).

[0058] The first parallel line segment group refers to the set of all line segments that are parallel to the first target line segment. For example, when the first target line segment is the bottom edge of an electronic drawing, the first parallel line segment group may include all line segments in the electronic drawing that are approximately horizontal to the bottom edge. As another example, when the first target line segment is the top edge of an electronic drawing, the first parallel line segment group may include all line segments in the electronic drawing that are approximately horizontal to the top edge. In some embodiments, parallelism may mean that the direction vector of the line segment is approximately parallel to the direction vector of the first target line segment, forming an angle between 0-5 degrees or 175-180 degrees (preferably 0 degrees or 180 degrees).

[0059] In some embodiments, the label determination module can identify line segments that are parallel to the first target line segment by traversing all line segments, and determine these line segments as the first parallel line segment group. For example, if the first target line segment is the bottom edge line of the frame (usually a horizontal line), then the first parallel line segment group will include all line segments that are approximately parallel to the bottom edge line (i.e., approximately horizontal lines).

[0060] In some embodiments, the label determination module may record the (x, y) coordinates (e.g., coordinates in the planar coordinate system described above) of the two endpoints of each line segment in the first parallel line segment group to record the coordinates of each line segment in the first parallel line segment group.

[0061] In some embodiments, the label determination module may also determine the first group of parallel line segments and record their coordinates in other ways. For example, clustering may be performed based on the slope or direction vector of the line segments to identify the group of line segments parallel to the first target line segment and record their coordinates.

[0062] In some embodiments, it is assumed that the title block area is located below and to the right of the frame, the first target line segment is the bottom edge of the frame, and the second target line segment is the right edge of the frame. Taking a single-line frame as an example, the title block determination module can select the vertical line segment located to the left of the second target line segment (right edge) and closest to it from the first vertical line segment group as the left boundary line of the title block area. At the same time, it selects the horizontal line segment located above the first target line segment (bottom edge) and closest to it from the first parallel line segment group as the top boundary line of the title block area. The title block determination module can determine the rectangular area enclosed by the first target line segment (bottom edge), the second target line segment (right edge), the identified left boundary line of the title block area, and the identified top boundary line of the title block area as the title block area.

[0063] Figures 3-6 This is a schematic diagram illustrating the positional relationship between the frame and label areas according to some embodiments of this specification. Figure 3 This indicates the case where the single-line frame and title block area are on the right side of the title block. Figure 4 This indicates the case where the double-lined frame and title tag area are on the right side of the title frame. Figure 5 This indicates the case where the single-line frame and title tag area are below the title frame. Figure 6 This indicates the case where the double-lined frame and the title tag area are below the title tag.

[0064] In some embodiments, taking a single-line frame as an example, such as... Figure 3 and Figure 5 As shown, after determining the bottom edge (first target line segment) and right edge (second target line segment) of the drawing frame, the title block determination module can find the vertical line segment parallel to and closest to the right edge in the first vertical line segment group as the left boundary line of the title block area, and find the horizontal line segment parallel to and closest to the bottom edge in the first parallel line segment group as the top boundary line of the title block area. The title block determination module can determine the area formed by the intersection of these four line segments—bottom edge, right edge, left boundary line, and top boundary line—as the title block area.

[0065] In some embodiments, the label area may be located above, below, to the left, or to the right of the frame. The selection of the first and second target line segments will be adjusted accordingly for different locations. For example, if the label area is located above or to the left, the first target line segment could be the top edge of the frame, and the second target line segment could be the left edge of the frame. The label determination module can determine the right and bottom boundary lines of the label area using similar logic.

[0066] In some embodiments of this specification, by grouping all line segments according to their perpendicular or parallel relationship with the first target line segment and recording their coordinates, key line segments constituting the boundary of the title block area can be quickly located based on the grouping. This method effectively filters out boundary lines directly related to the title block area from a large number of line segments by accurately identifying line segments inside the title block that have a specific geometric relationship (perpendicular or parallel) with the title block boundary line, significantly improving the accuracy and efficiency of title block area positioning. It is particularly suitable for processing electronic drawings containing various title block formats such as single-line frames or double-line frames.

[0067] In some embodiments, the title block determination module may be further configured to: compare a first number of line segments contained in a first vertical line segment group and a second number of line segments contained in a first parallel line segment group with a first threshold to obtain a first comparison result; in response to the first number and the second number being greater than or equal to the first threshold, determine a starting line and a first edge line; and determine the title block area in the electronic drawing based on the starting line and the first edge line.

[0068] The first threshold is a preset value used to determine whether the number of line segment groups meets a specific condition. For example, the first threshold can be 2. When the drawing frame contains a title area, the number of line segments parallel to the bottom edge and the number of line segments perpendicular to the bottom edge are generally greater than 2. Therefore, by comparing with the preset first threshold, a rough screening can be performed, and incomplete drawing frames can be filtered out (for example, if the drawing frame does not contain a bottom edge, the number of line segments in the first parallel line segment group and the first perpendicular line segment group may be less than 2).

[0069] The first comparison result refers to the result obtained by comparing the first number of line segments contained in the first vertical line segment group and the second number of line segments contained in the first parallel line segment group with a first threshold. For example, the first comparison result can indicate whether the number of line segments in each line segment group (e.g., the first number and the second number) meets the requirement of the first threshold.

[0070] In some embodiments, the label determination module can traverse the first vertical line segment group and the first parallel line segment group, count the number of line segments contained in each line segment group, obtain a first quantity and a second quantity, and compare the first quantity and the second quantity with a preset first threshold to obtain a first comparison result. The first comparison result can be a Boolean value (e.g., true or false), indicating whether each line segment group meets the quantity requirement.

[0071] For example, suppose the first threshold is 2. If the first vertical segment group contains 5 segments (i.e., the first quantity is 5) and the first parallel segment group contains 3 segments (i.e., the second quantity is 3), then both 5 and 3 are greater than 2. This first comparison result will be recorded for use in subsequent steps.

[0072] In some embodiments, in order to ensure the integrity of the frame and effectively identify the label area, in response to at least one of the first quantity and the second quantity being less than a first threshold, the label determination module may consider the identified frame to be incomplete or not containing a valid label area, and abandon the subsequent processing of the frame.

[0073] In some embodiments, the title block determination module can further identify the longest line segments among all line segments based on their lengths, and determine whether any of these longest line segments can form a bounding box (e.g., determining whether there are any line segments with overlapping endpoint coordinates) based on the coordinates of their endpoints. If a line segment that can form a bounding box exists, indicating that the current title block is complete, the subsequent title block area determination process can be executed; otherwise, the subsequent processing of the title block can be abandoned.

[0074] A starting line is a line segment that forms the frame of an electronic drawing, serving as a reference boundary line for determining the title area within the drawing. For example, the starting line can be the bottom edge of the frame, used to determine whether the title area is located below or to the right of the frame. Alternatively, the starting line can be the top edge of the frame, used to determine whether the title area is located above or to the left of the frame. In some embodiments, the starting line can also be the left or right edge of the frame.

[0075] The first edge line refers to the line segment that constitutes the frame of the electronic drawing, and together with the starting line, it serves as the reference boundary line for determining the title area in the electronic drawing. In some embodiments, the first edge line is perpendicular to and intersects the starting line. For example, when the starting line is the bottom edge of the frame, the first edge line can be the right edge of the frame; when the starting line is the top edge of the frame, the first edge line can be the left edge of the frame.

[0076] In some embodiments, in response to the first number of line segments contained in the first vertical line segment group and the second number of line segments contained in the first parallel line segment group both being greater than or equal to a first threshold, the label determination module can continue to perform subsequent label area determination operations.

[0077] In some embodiments, the label determination module can determine the starting line and the first edge line based on a preset label area position (e.g., the lower right) or a roughly determined label area position. For example, if the label area is located below and to the right of the frame, the bottom edge of the frame is determined as the starting line, and the right edge of the frame is determined as the first edge line. The bottom edge and the right edge are the line segments that constitute the outermost boundary of the frame, identified from all line segments in the previous steps.

[0078] For example, such as Figures 3-6 As shown, whether it is a single-line frame or a double-line frame, when the label area (shown as a gray dashed frame in the figure) is located on the right or below, the bottom edge (e.g., the line segment with a y value of 0 in the direction coinciding with the x-axis) is determined as the starting line, and the right edge (e.g., the line segment with the largest x value in the direction coinciding with the y-axis) is determined as the first edge line.

[0079] In some embodiments, if the title area is located above or to the left of the frame, the top edge of the frame is defined as the starting line and the left edge of the frame is defined as the first edge.

[0080] In some embodiments, after determining the starting line and the first edge line, the title block determination module can use the starting line and the first edge line as a reference to further search for other line segments corresponding to the boundary of the title block area in the first vertical line segment group and the first parallel line segment group. For example, assuming the starting line is the bottom edge line of the drawing frame and the first edge line is the right edge line of the drawing frame, the title block determination module can find the vertical line segment that is parallel to the first edge line (e.g., the right edge line) and closest to it, located to its left, from the first vertical line segment group. This line segment is determined as the left boundary line of the title block area. At the same time, it finds the horizontal line segment that is parallel to the starting line (bottom edge line) and closest to it, located above it, from the first parallel line segment group. This line segment is determined as the top boundary line of the title block area. Finally, the rectangular area enclosed by the starting line, the first edge line, and the aforementioned determined left and top boundary lines of the title block area is accurately determined as the title block area in the electronic drawing.

[0081] In some embodiments of this specification, preliminary screening is performed by comparing vertical and parallel line segment groups with a first threshold. This effectively eliminates incomplete drawing frames or drawings that do not contain a title block area, avoiding invalid processing. Based on this, by determining the starting line and the first edge line as positioning references, the boundary of the title block area is further precisely determined using the geometric relationships within the line segment groups. This method improves the efficiency and robustness of title block area positioning, especially when processing electronic drawings with multiple drawing frame formats. It can quickly and accurately identify the title block area, laying the foundation for subsequent information extraction.

[0082] In some embodiments, the label determination module may be further configured to: determine the line segments in the first vertical line segment group that intersect with the starting line to obtain a second vertical line segment group; compare the third number of line segments contained in the second vertical line segment group with a second threshold to obtain a second comparison result; determine the target starting line and the first target edge line based on the second comparison result, and determine the label area based on the target starting line and the first target edge line.

[0083] The second vertical line segment group refers to the set of line segments selected from the first vertical line segment group that intersect with the starting line; that is, the set of line segments in the drawing frame that are perpendicular to and intersect with the starting line. For example, taking a single-line frame as an example, when the starting line is the bottom edge of the drawing frame, the second vertical line segment group can include line segments that are perpendicular to the bottom edge and actually intersect with it, such as the left and right edges of the drawing frame.

[0084] In some embodiments, the label determination module can determine the second vertical segment group by performing geometric intersection detection on each segment in the first vertical segment group with the starting line. For example, if the starting line is the bottom edge (horizontal line) of the drawing frame, the label determination module can traverse all segments in the first vertical segment group, checking whether the x-coordinate range of each segment overlaps with the x-coordinate range of the starting line, and whether the y-coordinate of the segment intersects with or is aligned with the y-coordinate (or approximate y-coordinate) of the starting line. Only segments that actually intersect the starting line or whose endpoints are located on the starting line are included in the second vertical segment group. Determining the second vertical segment group helps to exclude vertical segments that are perpendicular to the starting line but do not actually contact it (do not intersect in the drawing), thereby more accurately locating segments related to the main structure of the drawing frame.

[0085] In some embodiments, the label determination module can set a tolerance range to determine whether line segments "intersect". That is, if the endpoints of the line segments are within the tolerance range of the starting line, they are also considered to intersect.

[0086] The second threshold is a preset value used to determine the type of frame (e.g., single-line frame or double-line frame). For example, the second threshold can be selected as 3.

[0087] The second comparison result refers to the result obtained by comparing the third number of segments contained in the second vertical segment group with the second threshold. For example, the second comparison result can indicate whether the third number of segments in the second vertical segment group is greater than or equal to the second threshold, or less than the second threshold.

[0088] In some embodiments, the label determination module can count the number of all segments in the second vertical line segment group to obtain a third number, and compare the third number with a second threshold (e.g., 3).

[0089] For example, such as Figures 3-6 As shown, when the drawing frame is a single-line frame ( Figure 3 and Figure 5 The number of line segments perpendicular to and intersecting the bottom edge is usually greater than or equal to 3 (e.g., Figure 3 There are 5 items, numbered 1-5. Figure 5 There are 8 lines, numbered 1-8. This is because the left and right edges of the drawing frame and the vertical dividing lines within the title block area are also included. However, when the drawing frame is a double-line frame ( Figure 4 and Figure 6 The number of line segments perpendicular to and intersecting the outermost bottom edge is typically 2 (i.e., the left and right edges of the outer ring), less than 3. This is because the vertical lines of the inner ring usually do not directly intersect the bottom edge of the outermost ring. The second comparison result (i.e., whether the number is greater than or equal to or less than the second threshold) can be recorded for subsequent steps.

[0090] The target starting line refers to the horizontal line segment used to define the boundary of the drawing area. For example, the target starting line can be the bottom edge of the drawing frame (for a single-line drawing frame) or the inner bottom edge of the drawing frame (i.e., the bottom edge of the inner circle of a double-line drawing frame). As another example, the target starting line can be the top edge of the drawing frame (for a single-line drawing frame) or the inner top edge of the drawing frame (i.e., the top edge of the inner circle of a double-line drawing frame).

[0091] The first target edge line refers to the vertical line segment used to define the boundary of the title block area. In some embodiments, the first target edge line is perpendicular to and intersects the target starting line. For example, the first target edge line can be the right edge line of the title block (for a single-line frame) or the inner right edge line of the title block (i.e., the right edge line of the inner circle of a double-line frame). As another example, the first target edge line can be the left edge line of the title block (for a single-line frame) or the inner left edge line of the title block (i.e., the left edge line of the inner circle of a double-line frame).

[0092] In some embodiments, based on the second comparison result, the label determination module will distinguish whether the frame is a single-line frame or a double-line frame, and determine the target starting line and the first target edge line for the two cases respectively.

[0093] As in the example above, when the frame is a single-line frame (such as...) Figure 3 and Figure 5 The number of line segments perpendicular to and intersecting the bottom edge is usually greater than or equal to 3; when the frame is a double-line frame (such as...). Figure 4 and Figure 6 The number of line segments perpendicular to and intersecting the outermost bottom edge is typically 2 (i.e., the left and right edges of the outer ring), less than 3. Therefore, the label determination module can determine the frame as a single-line frame when the third number of line segments in the second vertical line segment group is greater than or equal to the second threshold; and determine the frame as a double-line frame when the third number is less than the second threshold.

[0094] In some embodiments, the label determination module may be further configured to: determine the starting line as the target starting line and the first edge line as the first target edge line in response to a third number of line segments contained in the second vertical line segment group being greater than or equal to a second threshold.

[0095] In some embodiments, if the third number of the second vertical line segment group is greater than or equal to the second threshold, it indicates that the frame is a single-line frame. In this case, the bottom and right boundary lines of the title block area can be considered to coincide with the bottom and right edge lines of the frame. The title block determination module can determine the previously determined starting line (e.g., the bottom edge line of the frame) as the target starting line and the previously determined first edge line (e.g., the right edge line of the frame) as the first target edge line. In some embodiments, for cases where the title block area is located above or to the left of the frame, if the third number of the line segments contained in the second vertical line segment group is greater than or equal to the second threshold, the top edge line (starting line) of the frame is determined as the target starting line, and the left edge line (first edge line) of the frame is determined as the first target edge line.

[0096] In some embodiments, the label determination module may, in response to the third number of line segments contained in the second vertical line segment group being less than a second threshold, select line segments from the first parallel line segment group that meet preset conditions (e.g., the line segment with the smallest y-value) as the target starting line; determine the line segments in the first vertical line segment group that intersect with the target starting line (i.e., the line segments that intersect with and are perpendicular to the target starting line) to obtain a third vertical line segment group; and determine the line segment in the third vertical line segment group that is closest to the first edge line as the first target edge line.

[0097] In some embodiments, if the third number of the second vertical line segment group is less than the second threshold, it indicates that the frame is a double-line frame. In this case, the bottom boundary line and right boundary line of the title block area can be considered as the inner bottom edge line and inner right edge line of the frame. The title block determination module can find the line segment with the smallest y-coordinate (i.e., y-value) from the first parallel line segment group (all line segments parallel to the starting line) as the target starting line. Since the y-axis direction coincides with the left edge line of the frame (upward is the positive direction), the line segment with the smallest y-value is the horizontal line segment closest to and above the bottom edge line of the frame, which usually corresponds to the inner bottom edge line of the frame.

[0098] In some embodiments, to improve the accuracy of determining the target starting line, the label determination module can further filter and find the line segment with the smallest y-coordinate and the smallest length difference from the outer bottom edge line (i.e., the right edge line of the outer ring of the double frame). This helps to eliminate short line segments that may exist inside the double frame, parallel to the bottom edge line but with significantly different lengths, ensuring that the selected line segment is indeed the inner bottom edge line of the frame.

[0099] The third vertical line segment group refers to the set of line segments selected from the first vertical line segment group that intersect with the target starting line, that is, line segments that intersect with and are perpendicular to the inner bottom edge of the frame.

[0100] In some embodiments, after determining the target starting line, the label determination module can further filter from the first set of vertical line segments all vertical line segments that intersect with the target starting line (inner bottom edge) as a third set of vertical line segments. Since the inner bottom edge of the double frame is parallel to the outer bottom edge, all line segments perpendicular to the outer bottom edge are also perpendicular to the inner bottom edge. By checking whether these line segments intersect with the inner bottom edge, the vertical line segments constituting the inner vertical boundary or internal dividing line can be effectively identified. For example, for Figure 4 and Figure 6 In the case of a double-line frame, the third vertical line segment group will include the left and right edges of the inner circle of the frame, as well as the vertical dividing line that intersects with the inner bottom edge of the title area.

[0101] In some embodiments, after determining the third set of vertical line segments, the title block determination module selects the line segment from the third set of vertical line segments that is closest to the first edge line (e.g., the right edge line of the outer perimeter of the title block) and identifies it as the first target edge line. For example, for a double-line frame, the right edge line constituting the title block area is usually the right edge line of the inner circle of the title block (i.e., the inner right edge line). The inner right edge line is parallel to the right edge line of the outer circle of the title block and is the one closest to the right edge line of the outer circle among all the vertical lines of the inner circle. By calculating the distance from each line segment in the third set of vertical line segments to the first edge line and selecting the line segment with the smallest distance, the right edge line of the inner circle can be accurately identified as the first target edge line.

[0102] In some embodiments of this specification, the single-line frame or double-line frame structure of an electronic drawing is accurately distinguished by comparing a third quantity of the second vertical line segment group with a second threshold. For different frame types, the embodiments of this specification can flexibly and accurately determine the actual boundary lines (target starting line and first target edge line) of the title block area. Especially when dealing with complex double-line frames, by filtering the parallel line segments with the smallest Y-value and the closest vertical line segments, the problem of misjudging the outer frame boundary as the title block area boundary is avoided, thereby significantly improving the accuracy of title block area positioning.

[0103] In some embodiments, after determining the target starting line and the first target edge line, the title block determination module can determine the title block area based on the target starting line and the first target edge line. For example, a line segment parallel to the first target edge line and located to its left is found from the first vertical line segment group (or the third vertical line segment group) as the left boundary line of the title block area, and a line segment parallel to the target starting line and located above it is found from the first parallel line segment group as the top boundary line of the title block area. Finally, the rectangular area enclosed by the target starting line, the first target edge line, and the aforementioned determined left and top boundary lines of the title block area is accurately determined as the title block area in the electronic drawing.

[0104] In some embodiments, the image label determination module can also use a machine learning model to determine whether the image frame is a single-line frame or a double-line frame, thereby guiding the determination of the target starting line and the first target edge line.

[0105] In some embodiments of this specification, by comparing the third number of line segments contained in the second vertical line segment group with a second threshold, it is possible to effectively determine whether the frame of the electronic drawing is a single-line frame or a double-line frame, and for different types of frames, accurately determine the target starting line and the first target edge line constituting the actual boundary of the title tag area. This refined processing method significantly improves the accuracy of title tag area positioning, especially when processing drawings containing complex double-line frame structures, enabling more accurate identification of the title tag area and providing a reliable foundation for subsequent title tag information extraction.

[0106] In some embodiments, the title block determination module may be further configured to: determine the line segments in the first parallel line segment group that intersect with the first target edge line, thereby obtaining a target parallel line segment group; determine the orientation of the title block area in the electronic drawing based on the target parallel line segment group and the target perpendicular line segment group; determine the second target edge line and the third target edge line based on the orientation; and determine the title block area based on the second target edge line, the third target edge line, the target starting line, and the first target edge line. The target perpendicular line segment group is one of the third perpendicular line segment group and the second perpendicular line segment group described above.

[0107] The target parallel line segment group refers to the set of line segments selected from the first parallel line segment group that intersect with the first target edge line. The target parallel line segment group is used to help determine the top boundary line of the map label area.

[0108] In some embodiments, the label determination module can identify the target parallel segment group by traversing each segment in the first parallel segment group and checking whether it has a geometric intersection with the first target edge line (e.g., the right edge or inner right edge of the frame). This helps to identify key segments that may constitute the top boundary line or internal horizontal dividing line of the label area. For example, the label determination module can use a segment intersection algorithm to determine whether the endpoint coordinates of each segment in the first parallel segment group overlap with the segment range of the first target edge line, or whether two segments have an intersection point.

[0109] In some embodiments, in the case of a single wireframe, the label determination module can select the line segments intersecting with the target first edge line from the first parallel line segment group, and regard them as the second parallel line segment group; in the case of a double wireframe, the label determination module can select the line segments intersecting with the target first edge line from the first parallel line segment group, and regard them as the third parallel line segment group. That is, in the case of a single wireframe, the target parallel line segment group is the second parallel line segment group, and in the case of a double wireframe, the target parallel line segment group is the third parallel line segment group.

[0110] The target vertical line segment group refers to the line segment group used to determine the left boundary line (when the second target line segment is the right side line of the drawing frame) or the right boundary line (when the second target line segment is the left side line of the drawing frame) of the title block area. The target vertical line segment group can be one of the second vertical line segment group or the third vertical line segment group, depending on the drawing frame type (single-line frame or double-line frame).

[0111] In some embodiments, the location of the title area in the electronic drawing includes the left, right, top, or bottom.

[0112] In some embodiments, the label determination module can determine the location of the label area in the electronic drawing by comparing the fourth number of line segments contained in the target parallel line segment group with the fifth number of line segments contained in the target vertical line segment group. If the previous step determines it to be a single-line frame, then the target vertical line segment group is the second vertical line segment group; if it is determined to be a double-line frame, then the target vertical line segment group is the third vertical line segment group. The label determination module can count the fourth number of line segments in the target parallel line segment group and the fifth number of line segments in the target vertical line segment group.

[0113] In some embodiments, the label determination module may be further configured to: determine that the label area is located in a first position of the electronic drawing in response to a fourth number of line segments contained in the target parallel line segment group being greater than a fifth number of line segments contained in the target vertical line segment group; and determine that the label area is located in a second position of the electronic drawing in response to a fourth number being less than or equal to a fifth number.

[0114] The first orientation refers to a specific position of the title block area in the electronic drawing, such as the title block area being located on the right side of the drawing frame (i.e., right-aligned).

[0115] The second orientation refers to a specific location of the title block area in an electronic drawing that differs from the first orientation. For example, the title block area may be located below the drawing frame (i.e., at the bottom). In some embodiments, the first and second orientations are two adjacent orientations. For example, the first orientation may be on the right and the second orientation may be at the bottom. Or, for example, the first orientation may be on the left and the second orientation may be at the top.

[0116] In some embodiments, if the fourth number of line segments contained in the target parallel line segment group is greater than the fifth number of line segments contained in the target vertical line segment group, then the title area is determined to be located in the first position of the frame. For example, in the case of a single frame, the target vertical line segment group is the second vertical line segment group, and the target parallel line segment group is the second parallel line segment group. If the number of line segments contained in the second parallel line segment group is greater than the number of line segments contained in the second vertical line segment group, then the title area is determined to be located on the right side of the frame (i.e., right-aligned). In the case of a double frame, the target vertical line segment group is the third vertical line segment group, and the target parallel line segment group is the third parallel line segment group. If the number of line segments contained in the third parallel line segment group is greater than the number of line segments contained in the third vertical line segment group, then the title area is determined to be located on the right side of the frame (i.e., right-aligned). This is because the title area contains horizontal line segments (such as...) Figures 3-6 The number of horizontal dividing lines in the title block area is greater than the number of vertical lines. This judgment is based on empirical observation: when the title block area is located on the right side of the drawing, in order to present multiple lines of drawing information (such as drawing name, project name, drawing number, etc.), it usually contains more horizontal dividing lines, resulting in a relatively larger number of lines parallel to the bottom edge of the drawing frame (i.e., horizontal lines).

[0117] In some embodiments, if the fourth number of line segments contained in the target parallel line segment group is less than or equal to the fifth number of line segments contained in the target vertical line segment group, then the title area is determined to be located in the second position of the frame. For example, in the case of a single-line frame, if the number of line segments contained in the second parallel line segment group is less than or equal to the number of line segments contained in the second vertical line segment group, or in the case of a double-line frame, if the number of line segments contained in the third parallel line segment group is less than or equal to the number of line segments contained in the third vertical line segment group, then the title area is located below (i.e., at the bottom) of the frame. This is because the title area contains more vertical line segments (such as dividing lines) than horizontal line segments, for the same reason as above.

[0118] In some embodiments of this specification, by comparing the number of line segments in the target parallel line segment group and the target vertical line segment group, it is possible to intelligently determine whether the title tag area is located on the right or bottom of the electronic drawing. This orientation determination method based on internal geometric features effectively solves the problem of diverse title tag area locations, enabling subsequent flexible determination of the precise boundaries of the title tag area for different orientations, thereby improving the accuracy and automation of title tag area positioning.

[0119] In some embodiments, the label determination module can also determine the orientation based on the abscissa values ​​of the line segments in the target parallel line segment group. For example, if the abscissa values ​​of the line segments in the target parallel line segment group are concentrated on the left side of the frame (e.g., less than a preset abscissa threshold), the label area is determined to be on the left; if the abscissa values ​​of the line segments in the target parallel line segment group are concentrated on the right side of the frame, the label area is determined to be on the right; if the ordinate values ​​of the line segments in the target vertical line segment group are concentrated above the frame (e.g., greater than a preset ordinate threshold), the label area is determined to be above; if the ordinate values ​​of the line segments in the target vertical line segment group are concentrated below the frame, the label area is determined to be below.

[0120] The second target boundary line refers to the third boundary line of the map label area, excluding the target starting line and the first target boundary line, after the orientation of the map label area has been determined. For example, the top boundary line or the left boundary line of the map label area.

[0121] The third target boundary line refers to the fourth boundary line used to construct the map label area after its location has been determined. This could be the left or top boundary line of the map label area. The third target boundary line differs from the second target boundary line.

[0122] In some embodiments, the label determination module can select and determine the line segments that constitute the remaining two boundaries of the label area, namely the second target edge line and the third target edge line, from the target parallel line segment group and the target vertical line segment group, respectively, based on the determined label area orientation (e.g., right or bottom).

[0123] For ease of understanding, the following explanation will primarily use the example of the title block being located on the right or bottom of the electronic drawing.

[0124] In some embodiments, the first orientation includes the right side of the electronic drawing, and the second orientation includes the bottom of the electronic drawing. The label determination module is further configured to: in response to the label area being located on the right side of the electronic drawing, determine the line segment with the largest y-value in the target parallel line segment group as the second target edge line, and determine the line segment with the largest x-value in the target vertical line segment group (excluding the target right line) as the third target edge line; in response to the label area being located at the bottom of the electronic drawing, determine the line segment with the smallest y-value in the target parallel line segment group (excluding the target starting line) as the second target edge line, and determine the line segment with the smallest x-value in the target vertical line segment group as the third target edge line.

[0125] In some embodiments, when the orientation is determined to be to the right, the label determination module can traverse the target parallel line segment group (e.g., all horizontal line segments parallel to the target starting line) and select the line segment with the largest Y-coordinate value (i.e., the uppermost one) as the second target edge line (e.g., the top boundary line corresponding to the label area). Simultaneously, the label determination module can traverse the target vertical line segment group and select the line segment with the largest x-coordinate value, provided that this line segment is not the first target edge line (i.e., the rightmost boundary line of the label area, such as the target right side line), and select this line segment as the third target edge line (e.g., the left boundary line corresponding to the label area). For example, as shown... Figure 3 The center line frame is aligned to the right or Figure 4 As shown in the case where the double-line frame is on the right, once the right-side alignment of the title tag area is determined, the title tag determination module will identify the top horizontal line from the horizontal line segments as the top edge line, and identify the rightmost vertical line from the vertical line segments that is not the right edge of the title tag as the left edge line, thus completing the determination of the top edge line and the left edge line of the title tag area.

[0126] In some embodiments, when the orientation is determined to be downward, the label determination module can traverse the target parallel line segment group and select the line segment with the smallest Y-coordinate value. This line segment cannot be the target starting line (i.e., the bottom edge line of the frame, such as the target bottom edge line). This line segment is then determined as the second target edge line (e.g., corresponding to the top edge line of the label area). Simultaneously, the label determination module can traverse the target vertical line segment group and select the line segment with the smallest x-coordinate value (i.e., the leftmost line), determining it as the third target edge line (e.g., corresponding to the left edge line of the label area). For example, as shown... Figure 5 The middle single line frame is at the bottom or Figure 6 As shown in the case where the double-line frame is at the bottom, once the title block area is determined to be at the bottom, the title block determination module will identify the lowest horizontal line from the horizontal line segments, but which is not the bottom edge of the title block, as the top edge line, and identify the leftmost vertical line from the vertical line segments as the left edge line, thus completing the determination of the top edge line and the left edge line of the title block area.

[0127] In some embodiments of this specification, by selectively filtering line segments with the largest or smallest y-values ​​and x-values ​​from target parallel line segment groups and target perpendicular line segment groups based on the specific location of the signature area in the electronic drawing, the second and third target edge lines of the signature area are accurately determined. This refined boundary line determination method can adapt to signature areas with different layouts, accurately obtain the complete geometric boundary of the signature area, and provide a reliable spatial positioning basis for subsequent identification of signature information in the signature area.

[0128] In some embodiments, the title block determination module may be further configured to: in response to the electronic drawing frame being a double-line frame and the title block area being located on the right side of the electronic drawing, determine the line segment with the largest y-value in the third parallel line segment group as the second target edge line, and determine the line segment with the largest x-value in the third vertical line segment group, excluding the target right edge line, as the third target edge line; in response to the electronic drawing frame being a double-line frame and the title block area being located below the electronic drawing, determine the line segment with the smallest y-value in the third parallel line segment group, excluding the target starting line, as the second target edge line, and determine the line segment with the smallest x-value in the third vertical line segment group as the third target edge line.

[0129] In some embodiments, when it is determined that the frame of the electronic drawing is a double-line frame and the title block area is located on the right side of the electronic drawing (i.e., the first position), the title block determination module can search for the y-coordinates of all line segments in the third parallel line segment group, and determine the line segment with the largest y-coordinate value (i.e., the uppermost in the vertical direction) as the second target edge line (e.g., the top boundary line corresponding to the title block area). At the same time, the title block determination module will search for the x-coordinates of all line segments in the third vertical line segment group, and determine the line segment with the largest x-coordinate value that is not equal to the x-coordinate of the first target edge line (e.g., the inner right edge line of the frame) as the third target edge line (e.g., the left boundary line corresponding to the title block area).

[0130] For example, in Figure 4 In the scenario shown with a double-lined frame and the title area on the right, the title determination module 130 identifies all horizontal line segments (i.e., the third group of parallel line segments) that intersect the right edge of the frame. Then, it selects the line segment with the largest y-value from these segments as the top boundary line of the title area. The title determination module 130 also identifies all vertical line segments (i.e., the third group of vertical line segments) that intersect the bottom edge of the frame. From these vertical line segments, it selects the vertical line segment with the largest x-value that is not the right edge of the frame, and determines it as the left boundary line of the title area.

[0131] In some embodiments, when the drawing frame is determined to be a double-lined frame and the title block area is located below the electronic drawing (i.e., in the second position), the title block determination module can search for the y-coordinates of all line segments in the third parallel line segment group, and determine the line segment with the smallest y-coordinate value, and which is not the target starting line (e.g., the inner bottom edge of the drawing frame), as the second target edge line (e.g., corresponding to the top boundary line of the title block area). Simultaneously, the title block determination module searches for the x-coordinates of all line segments in the third vertical line segment group, and determines the line segment with the smallest x-coordinate value (i.e., the leftmost line in the horizontal direction) as the third target edge line (e.g., corresponding to the left boundary line of the title block area).

[0132] For example, in Figure 6In the scenario shown with a double-lined frame and the title area at the bottom, the title determination module identifies all horizontal line segments parallel to the bottom edge of the frame (i.e., the third group of parallel line segments). Then, it selects the horizontal line with the smallest y-value that is not the bottom edge of the frame from these segments as the top edge of the title area. The title determination module then selects the vertical line segment with the smallest x-value from the third group of vertical line segments as the left edge of the title area.

[0133] In some embodiments, the search and determination of line segments can be achieved through geometric analysis algorithms, such as precisely filtering target line segments by traversing a list of line segments, comparing coordinate values, calculating distances, or performing intersection detection. These operations can be combined with tolerance settings to address minor drawing errors that may exist in actual drawings.

[0134] In some embodiments of this specification, by accurately selecting key line segments with the largest / smallest y-values ​​or the largest / smallest x-values ​​from relevant parallel and vertical line segment groups based on the frame type (double-line frame) and the orientation (right or bottom) of the title block area in the electronic drawing, the second and third target edge lines of the title block area are determined. This refined boundary determination strategy, especially when processing double-line frame drawings with complex internal structures, can more accurately identify the actual boundary of the title block area, thus providing a reliable spatial positioning basis for subsequent title block information extraction and improving the accuracy and automation level of electronic drawing processing.

[0135] In some embodiments, the title block determination module may be further configured to: in response to the electronic drawing frame being a single-line frame and the title block area being located on the right side of the electronic drawing, determine the line segment with the largest y-value in the second parallel line segment group as the second target edge line, and determine the line segment with the largest x-value in the second vertical line segment group, excluding the target right edge line, as the third target edge line; in response to the electronic drawing frame being a single-line frame and the title block area being located below the electronic drawing, determine the line segment with the smallest y-value in the second parallel line segment group, excluding the target starting line, as the second target edge line, and determine the line segment with the smallest x-value in the second vertical line segment group as the third target edge line.

[0136] In some embodiments, when the drawing frame is determined to be a single-line frame and the title block area is located on the right side of the electronic drawing (i.e., the first orientation), the title block determination module can traverse all line segments in the second parallel line segment group, extract the y-coordinate of each line segment (e.g., the y-coordinate of its upper endpoint), sort these y-coordinates in descending order, and select the line segment with the largest y-coordinate value (i.e., the uppermost in the vertical direction) as the second target edge line (e.g., the top boundary line corresponding to the title block area). For example, the title block determination module can define a search area within the second parallel line segment group to find the line segment with the largest y-value located within that area.

[0137] In some embodiments, the label determination module can traverse all line segments in the second vertical line segment group, excluding line segments whose x-coordinate values ​​are the same as or extremely close to the x-coordinate value of the target right line. Among the remaining line segments, the label determination module extracts the x-coordinate of each line segment, sorts them in descending order, and selects the line segment with the largest x-coordinate value (i.e., furthest to the left in the horizontal direction, but still close to the right) as the third target edge line (e.g., corresponding to the left boundary line of the label area). For example, after excluding the target right line in the second vertical line segment group, the label determination module can calculate the horizontal distance from the remaining line segments to the target right line and select the line segment with the smallest horizontal distance.

[0138] In some embodiments, when the drawing frame is determined to be a single-line frame and the title block area is located below the electronic drawing (i.e., in the second position), the title block determination module may traverse all line segments in the second parallel line segment group, excluding line segments whose y-coordinate values ​​are the same as or extremely close to the y-coordinate value of the target starting line (i.e., the bottom edge of the drawing frame). Among the remaining line segments, the title block determination module extracts the y-coordinate of each line segment, sorts them in ascending order, and selects the line segment with the smallest y-coordinate value (i.e., the one at the top vertically, but still close to the bottom) as the second target edge line (e.g., corresponding to the top boundary line of the title block area). For example, the title block determination module may, after excluding the target starting line in the second parallel line segment group, calculate the vertical distance from the remaining line segments to the target starting line and select the line segment with the smallest vertical distance.

[0139] In some embodiments, the label determination module can traverse all line segments in the second vertical line segment group, extract the x-coordinate of each line segment, sort them in ascending order, and select the line segment with the smallest x-coordinate value (i.e., the leftmost line in the horizontal direction) as the third target edge line (e.g., the left boundary line corresponding to the label area). For example, the label determination module can directly scan the x-coordinates of all line segments in the second vertical line segment group, find the minimum value, and select the corresponding line segment.

[0140] In some embodiments of this specification, by accurately determining that the frame type of the electronic drawing is a single-line frame, and based on the orientation of the title block area (right side or bottom), key line segments with the largest / smallest y-values ​​or the largest / smallest x-values ​​are selectively filtered from relevant line segment groups to accurately determine the top and left edges of the title block area. This strategy can accurately identify the actual boundaries of the title block area, significantly improve positioning accuracy and automation, and provide a reliable spatial basis for subsequent title block information extraction.

[0141] In some embodiments, the title block determination module can define a rectangular area formed by the four line segments—the target starting line, the first target edge line, the second target edge line, and the third target edge line—as the title block area in the electronic drawing.

[0142] For example, the four vertices of the title block area can be determined by the intersection of these four line segments: the first vertex is obtained by the intersection of the target starting line and the first target edge line (e.g., the lower right corner); the second vertex is obtained by the intersection of the target starting line and the third target edge line (if it is the left edge line of the title block) or the second target edge line (if it is the left edge line of the title block) (e.g., the lower left corner); the third vertex is obtained by the intersection of the first target edge line and the second target edge line (if it is the top edge line of the title block) or the third target edge line (if it is the top edge line of the title block) (e.g., the upper right corner); and the last vertex is obtained by the intersection of the second target edge line and the third target edge line (e.g., the upper left corner). By determining the coordinates of these four vertices, the precise position and size of the title block area in the electronic drawing can be fully defined.

[0143] In some embodiments of this specification, the target parallel line segment group is defined by identifying the line segments in the first parallel line segment group that intersect with the first target edge line. Combined with the target perpendicular line segment group, the location of the title tag area in the electronic drawing can be accurately determined by comparing the number of line segments. Based on this, the second and third target edges are dynamically determined, and the title tag area is ultimately enclosed by these four boundary lines. This step-by-step positioning strategy can adapt to situations where the title tag area is located in different orientations, improving the flexibility and accuracy of title tag area positioning, thereby achieving efficient and automated extraction of title tag information from electronic drawings.

[0144] It should be noted that the above description of process 200 is for illustrative purposes only and does not limit the scope of this specification. Those skilled in the art can make various modifications and changes to process 200 under the guidance of this specification. However, these modifications and changes remain within the scope of this specification.

[0145] Figure 7 These are hardware / software schematic diagrams of exemplary computer devices shown according to some embodiments of this specification.

[0146] like Figure 7As shown, the computer device 700 includes at least one processor 710, a storage device 720, an input / output interface 730 (I / O), and a communication interface 740. The processor 710, storage device 720, and I / O interface 730 are connected via a system bus 750, and the communication interface 740 is connected to the system bus 750 via the I / O interface 730. The processor 710 provides computing and control capabilities. The storage device 720 includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer instructions in the non-volatile storage medium. The database is used for data, etc. The I / O interface 730 is used for exchanging information between the processor 710 and external devices. The communication interface 740 is used for communication with an external terminal (e.g., a user terminal) via a network connection. When the computer instructions are executed by the processor 710, they implement the electronic drawing title area positioning method (e.g., process 200) provided in the embodiments of this specification. The processor 710 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.

[0147] Understandable. Figure 7 The structures shown are merely block diagrams of some structures related to the computer device described in this specification and do not constitute a limitation on the computer device described in this specification. For example, the computer device may include more than Figure 7 The components shown may include more or fewer components (e.g., multiple processors, etc.), or combinations of certain components, or different component arrangements.

[0148] Some embodiments of this specification provide a computer-readable storage medium that stores computer instructions. When a computer reads the computer instructions from the storage medium, the computer executes a method for locating the title area of ​​an electronic drawing as described in any embodiment of this specification.

[0149] The basic concepts have been described above. Obviously, for those skilled in the art, the detailed disclosure above is merely illustrative and does not constitute a limitation of this specification. Although not explicitly stated herein, 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 and therefore remain within the spirit and scope of the exemplary embodiments described herein.

[0150] Furthermore, this specification uses specific terms to describe embodiments thereof, such as "an embodiment". "An Example" The terms "and / or some embodiments" refer to a particular feature, structure, or characteristic associated with at least one embodiment of this specification. Therefore, it should be emphasized and noted that references to "an embodiment," "one embodiment," or "an alternative embodiment" in different locations throughout this specification do not necessarily refer to the same embodiment. Furthermore, certain features, structures, or characteristics of one or more embodiments of this specification can be appropriately combined.

[0151] Furthermore, unless expressly stated in the claims, the order of processing elements and sequences, the use of numbers and letters, or other names described in this specification are not intended to limit the order of the processes and methods described herein. Although various examples have been discussed in the foregoing disclosure of some embodiments of the invention that are currently considered useful, it should be understood that such details are for illustrative purposes only, and the appended claims are not limited to the disclosed embodiments; rather, the claims are intended to cover all modifications and equivalent combinations that conform to the spirit and scope of the embodiments described herein. For example, while the system components described above can be implemented using hardware devices, they can also be implemented solely using software solutions, such as installing the described system on existing servers or mobile devices.

[0152] Similarly, it should be noted that, in order to simplify the description disclosed herein and thus aid in the understanding of one or more embodiments of the invention, the foregoing description of embodiments in this specification may sometimes combine multiple features into a single embodiment, drawing, or description thereof. However, this method of disclosure does not imply that the subject matter of this specification requires more features than those mentioned in the claims. In fact, the embodiments contain fewer features than all the features of a single embodiment disclosed above.

[0153] In some embodiments, numbers describing the quantity of components and attributes are used. It should be understood that such numbers used in the description of embodiments are modified in some examples with the terms "approximately," "approximately," or "generally." Unless otherwise stated, "approximately," "approximately," or "generally" indicates that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may be changed depending on the characteristics required by individual embodiments. In some embodiments, numerical parameters should take into account specified significant digits and employ a general method of digit reservation. Although the numerical ranges and parameters used to confirm their breadth of range in some embodiments of this specification are approximate values, in specific embodiments, such values ​​are set as precisely as feasible.

[0154] For each patent, patent application, patent application publication, and other material such as articles, books, specifications, publications, and documents referenced in this specification, the entire contents of which are incorporated herein by reference. This excludes historical application documents that are inconsistent with or conflict with the content of this specification, as well as documents that limit the broadest scope of the claims in this specification (currently or subsequently appended to this specification). It should be noted that in the event of any inconsistency or conflict between the descriptions, definitions, and / or terminology used in the supplementary materials to this specification and the content of this specification, the descriptions, definitions, and / or terminology used in this specification shall prevail.

[0155] Finally, it should be understood that the embodiments described in this specification are merely illustrative of the principles of the embodiments described herein. Other variations may also fall within the scope of this specification. Therefore, alternative configurations of the embodiments described herein are intended to be illustrative rather than limiting, and should be considered consistent with the teachings of this specification. Accordingly, the embodiments described herein are not limited to those explicitly introduced and described herein.

Claims

1. A method for locating the title block area of ​​an electronic drawing, characterized in that, The method is executed on a computer device, the computer device including at least one processor and a storage device in communication with the at least one processor, the storage device storing computer instructions that, when executed by the at least one processor, perform the following operations: Obtain all line segments contained in the electronic drawing; Determine the first target line segment and the second target line segment among all the line segments; Based on the perpendicular relationship between the first target line segment and other line segments among all the line segments, a first vertical line segment group is determined, and the coordinates of each line segment in the first vertical line segment group are recorded. Based on the parallel relationship between the first target line segment and other line segments among all the line segments, a first group of parallel line segments is determined, and the coordinates of each line segment in the first group of parallel line segments are recorded. The first number of line segments contained in the first vertical line segment group and the second number of line segments contained in the first parallel line segment group are compared with a first threshold to obtain a first comparison result; In response to the fact that both the first quantity and the second quantity are greater than or equal to the first threshold, a starting line and a first edge line are determined; as well as Based on the starting line and the first edge line, a title block area is determined in the electronic drawing, and the title block area is used to sign drawing information related to the electronic drawing.

2. The method according to claim 1, characterized in that, Determining the title area in the electronic drawing based on the starting line and the first edge line includes: Identify the line segments in the first set of vertical line segments that intersect with the starting line to obtain the second set of vertical line segments; The third number of line segments contained in the second vertical line segment group is compared with the second threshold to obtain the second comparison result; The target starting line and the first target edge line are determined based on the second comparison result, and the label area is determined based on the target starting line and the first target edge line.

3. The method according to claim 2, characterized in that, The step of determining the target starting line and the first target edge line based on the second comparison result includes: In response to the third quantity being greater than or equal to the second threshold, the starting line is determined to be the target starting line, and the first edge line is determined to be the first target edge line; and... In response to the third quantity being less than the second threshold, Select line segments that meet the preset conditions from the first group of parallel line segments and determine them as the target starting line; Identify the line segments in the first set of vertical line segments that intersect with the target starting line to obtain the third set of vertical line segments; and, The line segment in the third vertical line segment group that is closest to the first edge line is determined as the first target edge line.

4. The method according to claim 3, characterized in that, Determining the map label area based on the target starting line and the first target edge line includes: Identify the line segments in the first group of parallel line segments that intersect with the first target edge line to obtain the target group of parallel line segments; Based on the target parallel line segment group and the target vertical line segment group, the position of the title block area in the electronic drawing is determined, wherein the target vertical line segment group is one of the third vertical line segment group and the second vertical line segment group; Based on the aforementioned orientation, the edge lines of the second and third targets are determined; The label area is determined based on the second target edge line, the third target edge line, the target starting line, and the first target edge line.

5. The method according to claim 4, characterized in that, Determining the location of the title block area in the electronic drawing based on the target parallel line segment group and the target vertical line segment group includes: In response to the fact that the fourth number of line segments contained in the target parallel line segment group is greater than the fifth number of line segments contained in the target vertical line segment group, it is determined that the label area is located in the first position of the electronic drawing. In response to the fourth quantity being less than or equal to the fifth quantity, it is determined that the label area is located in the second position of the electronic drawing.

6. The method according to claim 5, characterized in that, The first orientation includes the right side of the electronic drawing, the second orientation includes the bottom of the electronic drawing, and the step of determining the second target edge line and the third target edge line based on the orientation includes: In response to the fact that the label area is located on the right side of the electronic drawing, the line segment with the largest y value in the target parallel line segment group is determined as the second target edge line, and the line segment with the largest x value in the target vertical line segment group other than the first target edge line is determined as the third target edge line; In response to the fact that the label area is located below the electronic drawing, the line segment with the smallest y-value in the target parallel line segment group (excluding the target starting line) is determined as the second target edge line, and the line segment with the smallest x-value in the target vertical line segment group is determined as the third target edge line.

7. A label area positioning system for electronic drawings, characterized in that, include: The acquisition module is configured to acquire all line segments contained in the electronic drawing; The line segment determination module is configured to determine a first target line segment and a second target line segment among all the line segments; and The image label confirmation module is configured as follows: Based on the perpendicular relationship between the first target line segment and other line segments among all the line segments, a first vertical line segment group is determined, and the coordinates of each line segment in the first vertical line segment group are recorded. Based on the parallel relationship between the first target line segment and other line segments among all the line segments, a first group of parallel line segments is determined, and the coordinates of each line segment in the first group of parallel line segments are recorded. The first number of line segments contained in the first vertical line segment group and the second number of line segments contained in the first parallel line segment group are compared with a first threshold to obtain a first comparison result; In response to the fact that both the first quantity and the second quantity are greater than or equal to the first threshold, a starting line and a first edge line are determined; as well as Based on the starting line and the first edge line, a title area is determined in the electronic drawing, and the title area is used for drawing information related to the electronic drawing.

8. The system according to claim 7, characterized in that, Determining the title area in the electronic drawing based on the starting line and the first edge line includes: Identify the line segments in the first set of vertical line segments that intersect with the starting line to obtain the second set of vertical line segments; The third number of line segments contained in the second vertical line segment group is compared with the second threshold to obtain the second comparison result; The target starting line and the first target edge line are determined based on the second comparison result, and the label area is determined based on the target starting line and the first target edge line.

9. The system according to claim 8, characterized in that, The step of determining the target starting line and the first target edge line based on the second comparison result includes: In response to the third quantity being greater than or equal to the second threshold, the starting line is determined to be the target starting line, and the first edge line is determined to be the first target edge line; and... In response to the third quantity being less than the second threshold, Select line segments that meet the preset conditions from the first group of parallel line segments and determine them as the target starting line; Identify the line segments in the first set of vertical line segments that intersect with the target starting line to obtain the third set of vertical line segments; and, The line segment in the third vertical line segment group that is closest to the first edge line is determined as the first target edge line.

10. A computer-readable storage medium, characterized in that, The storage medium stores computer instructions, which, when executed by a processor, implement the label area positioning method for electronic drawings as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Picture label information extraction method, apparatus and device, and readable storage medium

    CN116682130A

  • Identification method for drawing block and drawing tag in architectural drawing, storage medium and electronic equipment

    CN120148065A