Rebar quantification method, device and program product
Patent Information
- Application Number
- CN202611086113.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]有鉴于此,本申请提供了一种钢筋核量方法、装置及程序产品,以解决核量效率较低的问题
[0020]本申请实施例提供的钢筋核量方法,通过自动检测设计图纸图像中的钢筋表格区域与钢筋图形区域,并分别提取表格文字和基于图形要素指引框引导矢量化所获得的图形边线段及文字标注,形成两组钢筋规格信息进行自动比对,从而实现了钢筋核量全过程的自动化处理。因此,本申请有效取代了传统人工逐条抄录、比对图纸信息的方式,大幅减少重复性劳动,显著提升核量效率和准确性;同时,利用要素指引框定位图形区域并驱动矢量化提取,使得图形边线段与文字标注的组合更为精准可靠,能够系统性地核对表格与图形数据的一致性,确保输出核量结果的客观性与可靠性。
Smart Images

Figure CN122906712A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, specifically to methods, devices, and programs for measuring steel reinforcement. Background Technology
[0002] In the bidding and construction preparation stages of building engineering projects, accurate verification of steel reinforcement quantities in design drawings is a crucial step in cost control and material planning. Design drawings typically include tables recording steel reinforcement specifications and graphics depicting their shapes. Traditionally, obtaining and verifying this information relies heavily on manual labor. This involves quantity surveyors manually copying the required information from the tables and graphics and then comparing it item by item. This process is not only cumbersome, labor-intensive, and inefficient, but the manual copying and comparison process is also highly susceptible to errors due to visual fatigue or negligence, making it difficult to consistently guarantee the accuracy of quantity verification.
[0003] In recent years, with the development of artificial intelligence visual recognition technology, technical solutions have emerged that attempt to automatically analyze drawings using image recognition algorithms. However, when applied to rebar measurement tasks, these solutions still suffer from insufficient accuracy and recall in their automatic processing results. Their ability to recognize and process different components of drawings, such as tables and graphics, is limited, often resulting in incomplete or inaccurate information extraction. Therefore, a significant amount of manual review and correction is still required based on the output results, failing to fundamentally solve the high dependence of the measurement process on human intervention. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus and program for measuring steel reinforcement to solve the problem of low measurement efficiency.
[0005] In a first aspect, this application provides a method for measuring rebar quantity, comprising: acquiring a design drawing image to be measured; detecting the design drawing image to determine a rebar table area and a rebar graphic area in the design drawing image; identifying text content within the rebar table area to obtain first rebar specification information; identifying element guide boxes within the rebar graphic area, and vectorizing the rebar graphic area based on the element guide boxes to obtain graphic edge segments; identifying text annotations within the rebar graphic area, and combining the text annotations with the graphic edge segments to obtain second rebar specification information; and comparing the second rebar specification information with the first rebar specification information to obtain the target measurement result corresponding to the design drawing image.
[0006] In some optional implementations, identifying the text content within the rebar table area to obtain the first rebar specification information includes: dividing the rebar table area into cell areas by table lines; obtaining the first text position corresponding to the text content; and backfilling the text content into the corresponding cell area based on the degree of overlap between the first text position and the cell area; classifying the text content backfilled into the corresponding cell area to obtain the text content category; and parsing the text content backfilled into the corresponding cell area based on the positional relationship of the cell area within the rebar table area and the text content category to obtain the first rebar specification information.
[0007] In some optional implementations, the rebar graphic region is vectorized based on the feature guide frame to obtain graphic edge segments, including: obtaining the main rebar line region associated with the feature guide frame; segmenting the rebar graphic region into endpoints to obtain an initial endpoint set; filtering the endpoints located within the main rebar line region from the initial endpoint set to obtain a target endpoint set; for any target endpoint in the target endpoint set, determining other endpoints connected to the target endpoint within the main rebar line region; and selecting the endpoint with the shortest path length connected to the target endpoint from the other endpoints for pairing to generate graphic edge segments.
[0008] In some optional implementations, obtaining the main rebar line region associated with the feature guide frame includes: performing binarization processing on the design drawing image to determine the foreground pixels in the design drawing image and the connected regions formed by the foreground pixels; determining the connected regions that overlap with the feature guide frame as candidate connected regions; and determining the candidate connected region with the largest overlap area with the feature guide frame as the main rebar line region.
[0009] In some optional implementations, combining text annotations with graphic edge segments to obtain second rebar specification information includes: obtaining the position of the second text corresponding to the text annotation; determining the edge length annotation text corresponding to the graphic edge segment from the text annotation based on the positional relationship between the second text position and the graphic edge segment; locating the number annotation sub-frame, specification annotation sub-frame, and single length annotation sub-frame respectively within the element guide box; determining the number text in the number annotation sub-frame, the specification text in the specification annotation sub-frame, and the single length text in the single length annotation sub-frame by utilizing the positional overlap relationship between the text content and the number annotation sub-frame, specification annotation sub-frame, and single length annotation sub-frame; and combining the number text, specification text, single length text, edge length annotation text, and graphic edge segment to obtain the second rebar specification information.
[0010] In some optional implementations, based on the positional relationship between the second text position and the graphic edge segment, the side length annotation text corresponding to the graphic edge segment is determined from the text content, including: for any graphic edge segment, determining the vertical distance between each second text position corresponding to the identified text content and the graphic edge segment; determining the text content corresponding to the second text position with a vertical distance less than a preset spacing threshold as candidate text; determining the target distance from the second text position of each candidate text to the midpoint of the graphic edge segment; and determining the candidate text with the smallest target distance as the side length annotation text corresponding to the graphic edge segment.
[0011] In some optional implementations, the second rebar specification information is obtained by combining the number text, specification text, single-length text, side length annotation text, and graphic edge segment, including: extracting quantity information, grade information, and diameter information from the specification text according to preset specification parsing rules; combining the number text, quantity information, grade information, diameter information, and single-length text to obtain key element information; and determining the second rebar specification information based on the graphic edge segment, the side length annotation text corresponding to the graphic edge, and the key element information.
[0012] In some optional implementations, comparing the second rebar specification information with the first rebar specification information to obtain the target verification result corresponding to the design drawing image includes: comparing the grade information, diameter information and quantity information in the second rebar specification information and the first rebar specification information respectively to obtain a first comparison result; wherein, the target verification result includes the first comparison result.
[0013] In some optional implementations, a second comparison result is obtained by comparing the single length text in the second rebar specification information with the single length information in the first rebar specification information; wherein, the target verification result includes the second comparison result.
[0014] In some optional implementations, a third comparison result is obtained by comparing the value represented by the single-length text in the second rebar specification information with the sum of the values represented by the text representing all side lengths in the second rebar specification information; wherein, the target verification result includes the third comparison result.
[0015] In some optional implementations, the total weight calculated on the drawing is determined based on the grade information, diameter information, quantity information, and numerical values represented by single-length text in the second rebar specification information; the total weight calculated on the drawing is compared with the total weight information in the table of the first rebar specification information to obtain a fourth comparison result; wherein, the target verification result includes the fourth comparison result.
[0016] Secondly, this application provides a rebar measurement device, comprising: an acquisition module for acquiring an image of a design drawing to be measured; a detection module for detecting the design drawing image and determining a rebar table area and a rebar graphic area in the design drawing image; a first recognition module for recognizing text content in the rebar table area to obtain first rebar specification information; a second recognition module for recognizing element guide boxes in the rebar graphic area and vectorizing the rebar graphic area based on the element guide boxes to obtain graphic edge segments; a third recognition module for recognizing text annotations in the rebar graphic area and combining the text annotations with the graphic edge segments to obtain second rebar specification information; and a comparison module for comparing the second rebar specification information with the first rebar specification information to obtain the target measurement result corresponding to the design drawing image.
[0017] Thirdly, this application provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the rebar measurement method of the first aspect or any corresponding embodiment described above.
[0018] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to execute the reinforcement measurement method of the first aspect or any corresponding embodiment described above.
[0019] Fifthly, this application provides a computer program product, including computer instructions for causing a computer to execute the steel reinforcement measurement method of the first aspect or any corresponding embodiment described above.
[0020] The rebar measurement method provided in this application automatically detects the rebar table area and rebar graphic area in the design drawing image, and extracts the table text and graphic edge segments and text annotations obtained by vectorization guided by the graphic element guide box, forming two sets of rebar specification information for automatic comparison, thereby realizing the automation of the entire rebar measurement process. Therefore, this application effectively replaces the traditional method of manually copying and comparing drawing information line by line, greatly reducing repetitive labor and significantly improving the efficiency and accuracy of measurement; at the same time, by using the element guide box to locate the graphic area and drive vectorization extraction, the combination of graphic edge segments and text annotations is more accurate and reliable, and can systematically verify the consistency of table and graphic data, ensuring the objectivity and reliability of the output measurement results. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the specific embodiments or related technologies of this application, the drawings used in the description of the specific embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 This is a schematic flowchart of the first method for verifying the amount of reinforcing steel according to an embodiment of this application; Figure 2 This is a schematic diagram of the second process of the steel reinforcement verification method according to the embodiments of this application; Figure 3 This is a schematic diagram of the process for extracting the first steel bar specification information according to an embodiment of this application; Figure 4 This is a schematic diagram illustrating the effect of element guide box positioning and steel bar main line area extraction according to an embodiment of this application; Figure 5 This is a schematic diagram illustrating the effect of vectorized endpoint segmentation of the reinforcing bar graphic according to an embodiment of this application; Figure 6 This is a schematic diagram of the operational effect of an embodiment of this application on an actual engineering drawing; Figure 7 This is a schematic diagram of the software interface displaying the steel reinforcement quantity verification results according to an embodiment of this application. Figure 8 This is a structural block diagram of the rebar measuring device according to an embodiment of this application; Figure 9 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0025] In the bidding and construction preparation stages of building engineering projects, accurate verification of steel reinforcement quantities in design drawings is a crucial step in cost control and material planning. Traditional verification methods rely on personnel manually copying data from the steel reinforcement detail drawings, extracting core elements such as steel reinforcement number, grade, quantity, diameter, single length, and side lengths, and then comparing them line by line with the data in the steel reinforcement detail table. This process is not only cumbersome and inefficient, but manual copying and comparison are also prone to errors, making it difficult to meet the project's requirements for accuracy and timeliness in verification.
[0026] In recent years, artificial intelligence visual recognition technology has provided a feasible path for automating rebar measurement. Image recognition algorithms can extract rebar table information and some graphic elements from drawings. However, in processing the graphic area of rebar, related automatic measurement methods often fail to fully utilize the element guide boxes in the graphic area to vectorize the rebar graphics. This results in the inaccurate combination of the edge segments representing each side length in the graphic with the surrounding text annotations, making it difficult to automatically generate complete rebar specification information. Ultimately, manual intervention is still required to complete the collection of specifications from the graphic side and the comparison with the specifications from the table side. The degree of automation and accuracy of measurement remains limited.
[0027] The rebar measurement method provided in this application acquires design drawing images and detects the rebar table area and rebar graphic area. On the one hand, it automatically identifies the text content in the table area to obtain the first rebar specification information. On the other hand, it identifies the element guide box in the graphic area and vectorizes the graphic area based on the element guide box, accurately extracting the graphic edge segments representing each side length. Then, it combines the identified text annotations in the graphic area with these graphic edge segments to automatically generate complete second rebar specification information. Finally, it compares the two sets of rebar specification information to obtain the measurement result. Thus, it completely eliminates the tedious process of manually copying graphic elements one by one and manually comparing table data, avoiding human error and greatly improving the accuracy and efficiency of measurement. Furthermore, by actively using the element guide box to guide the graphic vectorization, the edge segments and surrounding text annotations can be accurately associated and combined, overcoming the problem that related automatic measurement methods cannot automatically generate complete specifications on the graphic side due to insufficient use of the element guide box, and still require manual intervention for collection and comparison. It truly achieves full-process automation and high-accuracy measurement.
[0028] According to an embodiment of this application, a method for measuring the quantity of reinforcing bars is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0029] This embodiment provides a method for measuring rebar quantity, which can be used in electronic devices such as desktop computers and laptops. Figure 1 This is a flowchart of the steel reinforcement measurement method according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the design drawing image to be verified.
[0030] Design drawing images refer to electronic images or scanned copies of architectural structural construction drawings that contain reinforcement design information. Specifically, electronic drawings containing reinforcement design information can be received or read through the data acquisition interface of electronic devices. These electronic drawings can be scanned or digital images directly exported from design software, serving as the starting point and data foundation for the entire automated measurement process, and their source is not limited to a specific file format or acquisition path.
[0031] Step S102: Detect the design drawing image to determine the rebar table area and rebar graphic area in the design drawing image.
[0032] The rebar table area refers to the region in the design drawing image that specifically records detailed information about the rebar in tabular form; it is often called the rebar table or detail table. The rebar graphic area refers to the detail drawing area in the design drawing image that uses lines and graphics to depict the specific shape, size, and annotations of individual rebars. Specifically, image object detection technology can be used to perform a holistic analysis of the input design drawing image to identify and locate these two types of areas with different functional attributes. One type is the rebar table area, which systematically records rebar attribute data in a row and column structure; the other type is the rebar graphic area, which uses geometric lines to form specific shapes. This process automatically completes the division and spatial positioning of the drawing content through a pre-trained area detection model.
[0033] Step S103: Identify the text content in the rebar table area to obtain the first rebar specification information.
[0034] The text content within the rebar table area refers to all specific character information identified within the located rebar table area, such as N1, C, 25, 46, 740.1, etc. The first rebar specification information refers to the benchmark data extracted from and structured from the rebar table area, used for comparison with the graphic information. Specifically, optical character recognition (OCR) technology can be used to extract all text characters within the rebar table area, and combined with the layout and structural information of the table area, semantic analysis and structuring processing are performed on the identified text content. This process converts the unstructured table image text into a standardized data structure containing attributes such as rebar number, grade, diameter, quantity, and length, thus forming the first rebar specification information that can serve as a comparison benchmark.
[0035] Step S104: Identify the feature guide box within the rebar graphic area, and vectorize the rebar graphic area based on the feature guide box to obtain the graphic edge line segment.
[0036] The element guide box refers to the key graphic element box used to identify and index each individual rebar within the rebar graphic area. This element guide box, also called the key element graphic box, typically contains core annotation information such as rebar number, specifications, and single-strand length. Graphic edge segments refer to the precise line segments parsed from the rebar graphic area through graphic vectorization. Each graphic edge segment contains start, end, and side length information. Specifically, a pre-trained object detection model can be used to locate the key graphic element boxes used to identify individual rebars, i.e., the element guide boxes. Based on the guidance of these element guide boxes, the rebar graphic area is graphic vectorized. This process involves geometrically parsing the rebar graphic within the range indicated by the element guide box, extracting the key geometric features that constitute the rebar shape, and transforming the original pixel-based rebar outline into vectorized graphic data composed of multiple line segments. These line segments that precisely describe the rebar geometry are the obtained graphic edge segments.
[0037] Step S105: Identify the text annotations in the rebar graphic area, and combine the text annotations with the graphic edge segments to obtain the second rebar specification information.
[0038] Text annotations refer to the explanatory text identified within the rebar graphic area, especially near the feature guide frame or around the graphic edge segments. When recognizing text annotations, these extracted texts are associated with matching graphic edge segments to determine the dimensional value of each edge. Secondary rebar specification information refers to the complete structured information of a single rebar extracted from the rebar graphic area through vectorization analysis and the fusion of graphics and text. Specifically, text recognition technology can be used to extract text annotations distributed within the rebar graphic area. Text annotations include dimensional explanatory text scattered around the graphic edge segments, used to indicate the length values of each graphic edge segment, and specification explanatory text located within the feature guide frame, used to describe the rebar's number, grade, diameter, quantity, single-strand length, and other attributes. Combining text annotations with graphic edge segments involves associating and integrating the specification explanatory text within the feature guide frame with the set of graphic edge segments indexed by that feature guide frame. This allows each graphic edge segment to obtain its corresponding dimensional description, and the entire set of graphic edge segments to obtain its corresponding specification attributes, thus forming a structured secondary rebar specification information that encompasses specification attributes and a complete geometric dimension chain.
[0039] Step S106: Compare the specification information of the second rebar with the specification information of the first rebar to obtain the target verification result corresponding to the design drawing image.
[0040] The target verification result refers to the final output, which is the judgment conclusion and difference result after comparing the second rebar specification information with the first rebar specification information item by item. Specifically, the complete information extracted from the rebar graphic area can be checked and verified item by item with the benchmark information extracted from the rebar table area. This comparison process checks whether the two are consistent in various attributes (such as grade, diameter, quantity, length, and related indicators determined by physical characteristics) of the corresponding rebar entities. Based on the consistency or difference of the comparison, a conclusive information is output, which is the target verification result corresponding to the design drawing image. This result is used to reflect whether the drawing information is accurate.
[0041] The rebar measurement method provided in this application automatically detects the rebar table area and rebar graphic area in the design drawing image, and extracts the table text and graphic edge segments and text annotations obtained by vectorization guided by the graphic element guide box, forming two sets of rebar specification information for automatic comparison, thereby realizing the automation of the entire rebar measurement process. Therefore, this application effectively replaces the traditional method of manually copying and comparing drawing information line by line, greatly reducing repetitive labor and significantly improving the efficiency and accuracy of measurement; at the same time, by using the element guide box to locate the graphic area and drive vectorization extraction, the combination of graphic edge segments and text annotations is more accurate and reliable, and can systematically verify the consistency of table and graphic data, ensuring the objectivity and reliability of the output measurement results.
[0042] This embodiment provides a method for measuring rebar quantity, which can be used in electronic devices such as desktop computers and laptops. Figure 2 This is a flowchart of the steel reinforcement measurement method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain the design drawing image to be verified. For details, please refer to [link to relevant documentation]. Figure 1 Step S101 of the illustrated embodiment will not be described again here.
[0043] Step S202 involves inspecting the design drawing image to identify the rebar table area and rebar graphic area within the image. For details, please refer to [link to relevant documentation]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.
[0044] Optionally, a pre-trained YOLOv5 object detection model can be used to detect and locate the table region and the rebar graphic region in the input design drawing image, thereby obtaining the rebar table region and the rebar graphic region respectively.
[0045] Step S203: Identify the text content in the rebar table area to obtain the first rebar specification information.
[0046] Specifically, step S203 includes: Step S2031: Divide the rebar table area into table lines to obtain a cell area.
[0047] A cell region refers to the individual grid regions divided by the grid lines after segmenting the rebar table region. Specifically, the extracted rebar table region image can first undergo image erosion preprocessing (such as 3x3 image erosion preprocessing) to enhance line features and prevent lines from being weakened or lost when the image is scaled to the model input size (such as 512x512). Then, a pre-trained image segmentation model, such as the Unet model based on MobileNetV3 as the backbone network, is used to detect and extract the horizontal and vertical grid lines in the preprocessed rebar table region. Based on the distribution and intersection relationships of the extracted grid lines, the rebar table region is divided into several independent grids, each of which is a cell region.
[0048] Step S2032: Obtain the first text position corresponding to the text content, and fill the text content back into the corresponding cell area based on the degree of overlap between the first text position and the cell area.
[0049] The first text position refers to the spatial coordinate range of each character within the rebar table area when the text content is recognized. Specifically, text recognition technology (such as OCR technology based on DB+CRNN) can simultaneously obtain the spatial coordinate range of each character within the rebar table area, i.e., the first text position, when recognizing the text characters within the rebar table area. Backfilling the text content to the corresponding cell area involves matching the first text position of each character with the spatial positions of each cell area, calculating the degree of overlap (IOU), and backfilling the text content to the cell area with the highest degree of overlap.
[0050] Step S2033: Classify the text content backfilled to the corresponding cell range to obtain the category of the text content.
[0051] The category of text content refers to the type of rebar attribute to which each piece of text belongs after being categorized into the text content filled into the cell area. Specifically, a pre-trained classification model can be used. This model integrates the text content within each cell area with the row and column position information of that cell area in the table to perform semantic analysis and category determination on the text content filled into each cell area, classifying it into a predefined rebar attribute category. The predefined rebar attribute categories include No., Grade, Number, Diameter, Length, and Weight, thereby obtaining the category of the text content in each cell area.
[0052] For example, the pre-trained classification model can be a pre-trained customized lightweight BERT model. The specific configuration parameters of this BERT model include: attention_probs_dropout_prob = 0.1, directionality = bidirectional BIDI, hidden_act = GELU, hidden_dropout_prob = 0.1, hidden_size = 64, initializer_range = 0.02, intermediate_size = 128, layer_norm_eps = 1e-12, max_position_embeddings = 96, model_type = BERT, attention_heads = 2, hidden_layers = 2, pad_token_id = 0, and pooler_fc_size = 0. The model has 128 pooling layers (pooler_num_fc_layers), 1 pooling type (pooler_type), 1 type vocabulary size (type_vocab_size), and a total vocabulary size (vocab_size) of 3600. This lightweight model with few parameters is suitable for short text classification scenarios, balancing classification accuracy and inference efficiency.
[0053] Step S2034: Based on the positional relationship of the cell range in the rebar table area and the category of the text content, parse the text content that is filled back into the corresponding cell range to obtain the first rebar specification information.
[0054] The positional relationship of cell ranges within the rebar table area refers to the row and column position of each cell range within the rebar table area. Specifically, by utilizing the relative position of each cell range within the table's row and column structure, combined with the already determined category labels for each cell range, the text content of cell ranges belonging to the same row or the same rebar entity is associated and integrated. This extracts structured data with clear attribute meanings from the unstructured table text, forming the first rebar specification information. This first rebar specification information is the rebar entity information extracted from the table, denoted as Entity_Steel. For example, the data structure of Entity_Steel can be as follows: Entity_Steel={“No”:”Nx”,“Grade”:”C”,“Number”:”46”,“Diameter”:”25”,“Length”:”740.1”,”Weight”:”1310.78”}.
[0055] For example, such as Figure 3 As shown, the classification process for extracting structured rebar entity information from the table area is divided into three parts: input, model processing, and output. The input side consists of multiple parallel cell processing units. Each unit is composed of cell text content and corresponding cell position information. The text content comes from the rebar construction engineering table of pier No. 2 on the left. This table contains columns such as rebar number, diameter, length, number of bars, total length, total weight, and total weight, covering 8 rebar records from N1 to N8. Exemplary data includes: N1 rebar diameter 25mm, single bar length 740.1cm, number of bars 46, total length 340.5m, total weight 1310.78kg; N2 rebar diameter 25mm, single bar length 2990.6cm, number of bars 46, total length 1375.7m, total weight 5296.41kg; N7 The steel bars are 10mm in diameter, 74566.1cm long per bar, 745.7m in total length, and weigh 460.07kg. The table also includes engineering parameters such as column diameter (160cm), pile diameter (180cm), and concrete strength grade (C35 / C30). The model processing section inputs the text content and location information of each cell into the BERT classification model, outputting the corresponding... <cls1>to <clsn>The category labels are used to identify the rebar attribute category of each cell.
[0056] The rebar measurement method provided in this application first divides the rebar table area into table lines to restore the cell structure, and then accurately backfills the identified text content into the corresponding cells by utilizing the overlap between the text position and the cell area. This method effectively avoids the problem of confusion in the classification of text within the table due to misalignment or crossing cells, ensuring that each piece of text data can be associated with the correct table position. On this basis, the backfilled text content is classified, and the analysis is performed in combination with the positional relationship of the cells in the table and the classification results. This can transform the originally isolated and scattered table text into first rebar specification information with clear categories and logical relationships, significantly improving the accuracy and structure of table content extraction, and providing a more reliable data foundation for subsequent automated measurement and comparison.
[0057] Step S204: Identify the feature guide box within the rebar graphic area, and vectorize the rebar graphic area based on the feature guide box to obtain the graphic edge line segment.
[0058] Optionally, an independently trained YOLOv5 object detection model can be used to locate the key element bounding box corresponding to each rebar within the rebar graphic area. This key element bounding box is the element guide box, which is used to index the subsequent main rebar lines.
[0059] For example, the effect of locating the above-mentioned element guide box and extracting the main line area of the reinforcing steel is as follows: Figure 4 As shown in the figure, all the foreground steel bar lines extracted by binarization are displayed in multi-colored solid polylines. Each steel bar corresponds to an independent color. The main steel bar area obtained by connecting component analysis and the maximum overlap principle is matched one by one with the feature guide box of the corresponding color, which completely covers the outline range of a single steel bar. The upper left corner of the feature guide box is marked with two types of labels: LineRe and GuardR, which correspond to linear main bar details and stirrup block rectangular details, respectively. The image uses green rectangles to mark the text areas corresponding to the side lengths of each rebar, closely following the distribution of each rebar line. Examples of values include 310, 185, 135, 120, 113.6, 177.5, 215 / 2, 471.3, 111.2, 129.6, 465 / 2, 610 / 2, 205.2, 94.6, and 62.1. The image also uses red rectangles to mark the key element labeling areas for each rebar, containing three types of information: rebar number (circled number), rebar specification, and rebar length. This visually presents the complete processing effect of element positioning, subject matching, and label association.
[0060] Specifically, the rebar graphic area is vectorized based on the feature guide box to obtain graphic edge segments, including: Step a1: Obtain the main line area of the reinforcing bars associated with the feature guide box.
[0061] The main line area of the reinforcing steel bar refers to the pixel area containing the main graphic lines that constitute the geometry of a single reinforcing steel bar, determined from the design drawing image based on the element guide frame. Specifically, using the identified element guide frame as an index, the graphic lines in the design drawing image are analyzed to determine the graphic line area that has the highest spatial correlation with the element guide frame. This area is taken as the main line range corresponding to the single reinforcing steel bar identified by the element guide frame, and this range is the main line area of the reinforcing steel bar.
[0062] In some alternative implementations, step a1 above includes: Step a11: Binarize the design drawing image to determine the foreground pixels in the design drawing image and the connected regions formed by the foreground pixels.
[0063] Foreground pixels refer to the pixels identified as representing graphic lines after binarization of the design drawing image. A connected region refers to a spatially connected pixel area composed of adjacent foreground pixels. Specifically, the design drawing image is converted into an image containing only two pixel values according to a preset pixel threshold. Pixels with values higher than the threshold are identified as foreground pixels representing graphic lines, and the rest are background pixels. The connected regions formed by foreground pixels are created by performing connectivity analysis on the foreground pixels, grouping spatially adjacent foreground pixels into the same region, thus forming several spatially connected pixel regions, i.e., connected regions.
[0064] For example, a global fixed threshold of 180 can be used to convert a design drawing image into an image containing only two types of pixel values. Pixels with values higher than the threshold of 180 are identified as foreground pixels representing graphic lines, while the rest are background pixels. Then, 8-connectivity analysis is used to perform connectivity analysis on the foreground pixels, grouping spatially adjacent foreground pixels into the same region.
[0065] Step a12: Connected regions that overlap with the feature guide box are identified as candidate connected regions.
[0066] Candidate connected regions refer to several connected regions that overlap with the feature guide frame. Specifically, the spatial positions of each identified connected region are compared with the spatial positions of the feature guide frame, and connected regions that overlap or coincide in spatial range are selected as a preliminary candidate set.
[0067] Step a13: The candidate connected region with the largest overlap area with the feature guide box is identified as the main reinforcement line region.
[0068] In the selected candidate connected regions, calculate the spatial overlap area between each candidate connected region and the feature guide frame, and select the candidate connected region with the largest overlap area as the main graphic line range directly corresponding to the steel reinforcement body identified by the feature guide frame.
[0069] In the above implementation, when acquiring the main rebar line area, foreground pixels in the image are first extracted through binarization and connected regions are constructed. This organizes discrete pixels into spatially continuous graphic objects, laying the foundation for subsequent region selection. Based on this, using the feature guide frame as a spatial reference, candidate connected regions that overlap with it are selected, effectively filtering out a large number of irrelevant lines or annotation areas in the drawing, preventing them from contaminating the main body recognition. Finally, the candidate region with the largest overlapping area is selected as the main rebar line area. Using objective area measurement as the selection criterion, the system can automatically and accurately lock the complete rebar line range that best matches the current feature guide frame, avoiding the uncertainty caused by manual threshold setting or subjective judgment, and improving the accuracy and robustness of the main body area acquisition.
[0070] Step a2: Divide the reinforcement graphic region into endpoints to obtain an initial endpoint set.
[0071] The initial endpoint set refers to the set of all endpoint positions obtained for the first time after endpoint segmentation processing of the rebar graphic region. Specifically, using a pre-trained image segmentation model (such as the Unet segmentation model based on MobileNetV3 with the same structure as in step S2031), endpoint detection and localization are performed on the lines of the rebar graphic primitives in the rebar graphic region, the positions of each endpoint of the lines are identified, and all identified endpoints are collected to form the initial endpoint set.
[0072] Step a3: Select the endpoints located within the main line area of the reinforcing steel from the initial endpoint set to obtain the target endpoint set.
[0073] The target endpoint set refers to the set of endpoints formed after filtering out endpoints located within the main reinforcement line area from the initial endpoint set. Specifically, it is determined whether the spatial position of each endpoint in the initial endpoint set falls within the defined main reinforcement line area. Endpoints falling within the area are retained, while endpoints outside the area are removed, thus obtaining the target endpoint set.
[0074] Step a4: For any target endpoint in the target endpoint set, determine other endpoints connected to the target endpoint within the main steel reinforcement line area.
[0075] The target endpoint refers to any single endpoint in the set of target endpoints. Other endpoints refer to all endpoints within the main reinforcement line area that are connected to the target endpoint, excluding the target endpoint itself. Specifically, starting from the target endpoint, a connectivity path search is performed along the foreground pixels within the main reinforcement line area to find all other endpoints within the main reinforcement line area that have continuous foreground pixel connections to the target endpoint.
[0076] Step a5: Select the endpoint with the shortest path length to the target endpoint from the other endpoints and pair them to generate graphic edge segments.
[0077] For the target endpoint, calculate the path length between it and each other connected endpoint along the foreground pixel. Select the other endpoint with the shortest path length and pair it with the target endpoint. The line segment formed by the pairing connection is a graphic edge segment.
[0078] For example, the processing effect of the above endpoint segmentation and graphics vectorization is as follows: Figure 5 As shown, this diagram is a detailed schematic of a single retaining block's reinforcing steel reinforcement, fully demonstrating the algorithm's visualization results in locating the endpoints and inflection points of the reinforcing steel lines and converting them into vector data. The diagram includes two sets of independent reinforcing steel components: the left side shows the rectangular main reinforcement (number ①), and the right side shows the diamond-shaped stirrups (number ②). All inflection points and endpoints of the reinforcing steel lines are precisely marked with red dots. Each segment of the reinforcing steel in the diagram is labeled with complete dimensions. Exemplary data includes a vertical segment length of 100, a diagonal segment dimension of 23 / cosα, a total length of 200+23 / cosα for reinforcement ①, a horizontal segment dimension of 115 / cosα for reinforcement ②, a total length of 24+276 / cosα for reinforcement ②, and a short segment dimension of 12. Each group of reinforcing steel is marked with circled component numbers ① and ② in the upper right corner, with leader lines indicating the corresponding steel specifications: 9Φ22 and 6Φ10, respectively. The algorithm generates independent graphic edge segments based on connecting all the red-marked endpoints along the reinforcing steel outline, completing the conversion of pixel raster format reinforcing steel drawings into vector line segment data.
[0079] The rebar measurement method provided in this application first uses a feature guide box to lock the associated main rebar line area during the vectorization process. Based on this area, the endpoint segmentation results are filtered to selectively eliminate interfering endpoints outside the main body area, thereby effectively avoiding misleading graphic vectorization caused by other irrelevant lines or annotations in the drawing. Furthermore, by finding connected endpoints within the main body area and prioritizing the shortest connected path for pairing, graphic edge segments are generated. This more accurately restores the actual edge relationships in the rebar graphic, preventing redundant or incorrect line segments due to mismatched endpoints, and significantly improving the geometric accuracy and topological correctness of graphic edge segment extraction.
[0080] Step S205: Identify the text annotations in the rebar graphic area, and combine the text annotations with the graphic edge segments to obtain the second rebar specification information.
[0081] Specifically, the text annotations are combined with the graphic edge segments to obtain the second reinforcement specification information, including: Step b1: Obtain the position of the second text corresponding to the text annotation.
[0082] The second text position refers to the spatial coordinate range of each text annotation within the rebar graphic area when the text annotation is recognized. Specifically, when recognizing text annotations within the rebar graphic area using text recognition technology (such as the DB+CRNN-based OCR technology consistent with step S2032), the spatial coordinate range of each text annotation within the rebar graphic area is simultaneously obtained, and this spatial coordinate range is the second text position.
[0083] Step b2: Based on the positional relationship between the second text position and the graphic edge segment, determine the edge length annotation text corresponding to the graphic edge segment from the text annotation.
[0084] The positional relationship between the second text position and the graphic edge segment refers to the geometric relationship between the spatial coordinates of the second text position and the graphic edge segment. The edge length annotation text refers to the text content in the text annotation that is determined to match a certain graphic edge segment and is used to annotate the length value of that graphic edge segment. Specifically, by analyzing the spatial geometric relationship between each second text position and each graphic edge segment, and based on a preset association criterion, the text annotation that is closest to and most relevant to the graphic edge segment is determined to be the dimension description text corresponding to that graphic edge segment, i.e., the edge length annotation text.
[0085] In some alternative implementations, step b2 above includes: Step b21: For any graphic edge segment, determine the vertical distance between the position of each second character corresponding to the identified text content and the graphic edge segment.
[0086] The vertical distance refers to the length of the perpendicular line from the second text position to the line containing the edge segment of the graphic. Specifically, the vertical distance of each text label relative to the edge segment of the graphic is obtained by calculating the length of the perpendicular line from the second text position of each identified text label to the line containing the edge segment of the graphic.
[0087] Step b22: The text content corresponding to the second text position with a vertical distance less than the preset spacing threshold is determined as candidate text.
[0088] Candidate text refers to text content that is initially judged to be potentially associated with the edge segment of the graphic if its vertical distance is less than a preset spacing threshold. Specifically, a distance threshold (e.g., 45 pixels) is preset to determine the relationship between text and line segment. Text labels whose vertical distance falls within the range of this preset spacing threshold are initially filtered out as a set of candidate texts that may be associated with the edge segment of the graphic.
[0089] Step b23: Determine the target distance from the second text position of each candidate text to the midpoint of the graphic edge segment.
[0090] The target distance refers to the straight-line distance between the second text position of each candidate character and the midpoint of the edge segment of the graphic. Specifically, the straight-line distance between the spatial coordinates of the second text position of each candidate character and the spatial coordinates of the midpoint of the edge segment of the graphic is calculated, and this distance is the target distance.
[0091] Step b24: The candidate text with the smallest target distance is determined as the side length label text corresponding to the edge segment of the graphic.
[0092] From all candidate texts, the candidate text with the shortest target distance from its second text position to the midpoint of the graphic's edge segment is selected. This candidate text is then identified as the dimension description text most closely related to the graphic's edge segment, i.e., the edge length label text corresponding to the graphic's edge segment. Thus, each graphic edge segment and its corresponding edge length label text combine to form edge length entity information, denoted as Entity_Edge. Its data structure includes the start point egs, the end point ege, and the edge length value eglength. For example, the data structure of Entity_Edge can be as follows: Entity_Edge={"egs":[x0,y0],"ege":[x1,y1],"eglength":"24.2"}.
[0093] In the above implementation, when determining the text for edge length annotation, the initial screening criterion is the vertical distance between the text position and the edge segment of the graphic. Only texts with a distance less than a preset spacing threshold are retained as candidates, effectively eliminating interfering annotations in the drawing that are too far from the current edge segment and clearly do not belong to that edge length. Based on this, the distance from the candidate text to the midpoint of the edge segment is calculated, and the text with the smallest distance is selected as the edge length annotation text for that edge segment. Using the midpoint distance as a refined attribution criterion allows for more accurate handling of complex situations where multiple annotation texts exist near an edge segment, ensuring that each graphic edge segment can be matched with the edge length value that best fits its position, thereby significantly improving the accuracy and anti-interference capability of edge length information extraction.
[0094] Step b3: Within the feature guide box, locate the number label sub-box, specification label sub-box, and single length label sub-box respectively.
[0095] The numbering sub-frame refers to the sub-region within the feature guide frame used to label the rebar number. The specification sub-frame refers to the sub-region within the feature guide frame used to label the rebar specification information. The single-length sub-frame refers to the sub-region within the feature guide frame used to label the single length of the rebar. Specifically, using a pre-trained object detection model (such as an independently trained YOLOv5 object detection model), sub-feature detection is performed on the area inside the feature guide frame to identify and locate the three sub-regions used to label the rebar number, rebar specification, and single-length of the rebar, respectively: the numbering sub-frame, the specification sub-frame, and the single-length sub-frame.
[0096] Step b4: Using the positional overlap between the text content and the numbered label sub-frame, specification label sub-frame, and single-length label sub-frame, determine the numbered text in the numbered label sub-frame, the specification text in the specification label sub-frame, and the single-length text in the single-length label sub-frame.
[0097] The "numbered text" refers to the text identified within the numbered label sub-frame that indicates the rebar number. The "specification text" refers to the text identified within the specification label sub-frame that includes quantity, grade, and diameter information. The "single length text" refers to the text identified within the single length label sub-frame that indicates the length of a single rebar. Specifically, by calculating the overlap between the second text position of the identified text labels and the spatial positions of the numbered label sub-frame, specification label sub-frame, and single length label sub-frame, the text with the highest overlap with the corresponding sub-frame is determined as the text within that sub-frame, thus obtaining the numbered text, specification text, and single length text, respectively.
[0098] Step b5: Combine the number text, specification text, single length text, side length annotation text, and graphic edge segment to obtain the second rebar specification information.
[0099] The steel reinforcement attribute information represented by the number text, specification text, and single length text extracted from the element guide box is associated and integrated with the geometric dimension information represented by each graphic edge segment and its corresponding edge length label text to form a structured data that simultaneously covers specification attributes and a complete geometric dimension chain. This structured data is the second steel reinforcement specification information.
[0100] The rebar measurement method provided in this application, during the process of generating the second rebar specification information, firstly determines the corresponding side length annotation text for each side line from numerous annotations by using the positional relationship between text annotations and graphic edge segments. This achieves accurate association between graphic geometric elements and surrounding text annotations, avoiding side length mismatches caused by interference from multiple annotation segments in the drawing. Based on this, sub-frames are further located and divided within the element guide frame. The text content such as number, specification, and unit length is extracted separately using the positional overlap relationship between text and each sub-frame. This refines and categorizes the originally mixed text information, ensuring that each key attribute can be captured independently and accurately. The graphic edge segments and these categorized and extracted texts are then integrated to form complete and structured rebar specification information at the graphic end, achieving deep fusion from geometric graphics to attribute data, improving the completeness of graphic information extraction and the logical organization of data.
[0101] In some alternative implementations, step b5 above includes: Step b51: Extract quantity information, grade information, and diameter information from the specification text according to the preset specification parsing rules.
[0102] Predefined specification parsing rules refer to pre-defined parsing rules used to extract quantity, grade, and diameter information from specification text. Quantity information refers to the number of rebars extracted from the specification text. Grade information refers to the rebar strength grade code extracted from the specification text. Diameter information refers to the rebar diameter value extracted from the specification text. Specifically, according to predefined specification parsing rules, the character content in the specification text can be split and parsed to extract the quantity information representing the number of rebars, the grade information representing the rebar strength grade, and the diameter information representing the rebar diameter. For example, the specification parsing rules can be based on regular expressions, using the regular expression '^([a-zA-Z0-9]+)([ABC])(\d+)$'.
[0103] Step b52: Combine the number text, quantity information, grade information, diameter information, and single-length text to obtain the key element information.
[0104] Key element information refers to structured information describing the core attributes of steel bars, composed of a combination of numbered text, quantity information, grade information, diameter information, and single length text. Specifically, the attribute information extracted and parsed from the element guide box, namely number, quantity, grade, diameter, and single length, is integrated according to a preset data structure to form a structured information unit containing the above five core elements. This information unit is the key element information. This key element information can be denoted as Entity_Key. In addition to the above five items, its data structure also includes an edge list, Edgelist, which stores the edge length entity information Entity_Edge belonging to this steel bar. For example, the data structure of Entity_Key can be as follows: Entity_Key={"No":"Nx","Grade":"C","Number":"12","Diameter":"10","Length":"7600","Edgelist":[Eitem]}, where the data type of Eitem is Entity_Edge.
[0105] Step b53: Based on the graphic edge segments, the side length annotation text corresponding to the graphic edge lines, and key element information, determine the specification information of the second rebar.
[0106] The rebar attribute data contained in the key element information is integrated with the geometric vector data of the graphic edge segments and the dimensional values represented by their corresponding edge length annotations. Specifically, the entity information Entity_Edge formed by combining each graphic edge segment and its corresponding edge length annotation is filled into the edge list of the key element information Entity_Key. This ensures that the dimension annotations of each graphic edge segment and the overall specification attributes of the rebar belong to the same rebar entity, ultimately forming a second rebar specification information that fully describes the rebar.
[0107] In the above implementation, when generating the second rebar specification information, the specification text is first automatically decomposed using preset specification parsing rules. This separates the originally mixed specification expressions into independent quantity, grade, and diameter information, achieving fine-grained extraction of key attributes and avoiding confusion or omission of information within the specification fields. Subsequently, the decomposed information is integrated with the number and single-length text into structured key element information, making the identification attributes and length parameters of each rebar form clear and complete data units. This key element information is then associated and combined with specific graphic edge segments and their corresponding edge length annotations, establishing a clear correspondence between geometric shapes and attribute data, and between overall parameters and local edge lengths. The resulting information includes both a quantitative expression of the graphic shape and a complete multi-dimensional specification description, significantly improving the completeness and rigor of the second rebar specification information.
[0108] Step S206: Compare the specification information of the second rebar with the specification information of the first rebar to obtain the target verification result corresponding to the design drawing image.
[0109] In some optional implementations, step S206 includes: comparing the grade information, diameter information and quantity information in the second steel bar specification information with the first steel bar specification information to obtain a first comparison result; wherein, the target verification result includes the first comparison result.
[0110] The grade, diameter, and quantity information of the second rebar specification information extracted from the rebar graphic area are compared item by item with the grade, diameter, and quantity information of the corresponding rebar entity in the first rebar specification information extracted from the rebar table area. The results are used to determine whether the two are consistent in each attribute, and the comparison results are summarized to form the first comparison result.
[0111] In the above implementation, the three core attributes—grade, diameter, and quantity—are independently compared from the second and first rebar specification information during the comparison phase. This generates a first comparison result, which serves as a component of the target verification result. This transforms the verification process from a general, fuzzy assessment to a precise, item-by-item verification of key indicators. This approach clearly distinguishes and locates the matching status of each specification attribute, avoiding the oversight of inconsistencies in local attributes due to only performing a general comparison. This significantly improves the precision and reliability of the verification results, providing clear direction for subsequent discrepancy investigation and correction.
[0112] In some optional implementations, step S206 further includes: comparing the single length text in the second rebar specification information with the single length information in the first rebar specification information to obtain a second comparison result; wherein the target verification result includes the second comparison result.
[0113] The single-strand length information in the first rebar specification information refers to the single-strand length data of each rebar extracted from the rebar table area and recorded in the first rebar specification information. Specifically, the value represented by the single-strand length text identified from the element guide box in the rebar graphic area is compared with the value represented by the single-strand length information of the corresponding rebar entity in the first rebar specification information extracted from the rebar table area to determine whether the two are consistent in the single-strand length indicator. This comparison result is the second comparison result.
[0114] In the above implementation, in addition to comparing grade, diameter, and quantity, the single-length text in the second rebar specification information is further independently compared with the single-length information in the first rebar specification information to form a second comparison result, which is then incorporated into the target verification result. This supplementary comparison step extends the verification coverage from specification attributes to length information, allowing for dedicated verification of the consistency of rebar size parameters between the graphical and tabular versions. By generating independent comparison results for specification attribute comparison and length comparison, the verification output is more detailed, facilitating accurate identification of inconsistencies in length data and further enhancing the comprehensiveness and reliability of the verification results.
[0115] In some optional implementations, step S206 above further includes: comparing the value represented by the single-length text in the second rebar specification information with the sum of the values represented by all the side length annotation texts in the second rebar specification information to obtain a third comparison result; wherein, the target verification result includes the third comparison result.
[0116] The numerical value represented by the single-length text in the second rebar specification information refers to the numerical value corresponding to the single-length text identified from the single-length annotation sub-box within the element guide box in the second rebar specification information.
[0117] The sum of the values represented by all the side length annotations in the second rebar specification information refers to the sum obtained by adding the values of the side length annotations corresponding to each of the graphic line segments of a rebar in the second rebar specification information.
[0118] Specifically, the value corresponding to the single-length text identified from the element guide box is compared with the sum of the values corresponding to the side length annotation texts associated with each of the graphic side line segments of the rebar. The result of this comparison is the third comparison result, which is used to verify the consistency between the annotation value of the single length and the sum of the annotation values of each segment side length.
[0119] In the above implementation, during the comparison process, the numerical value represented by the single-length text in the second rebar specification information is compared with the sum of the numerical values represented by all the side length annotations. A third comparison result is generated and incorporated into the target verification result, thereby introducing a key self-consistency verification mechanism within the graphic end. This verification can automatically identify whether there is a contradiction between the total single-length dimension and the cumulative value of each segment side length dimension in the graphic annotation, effectively discovering annotation errors or identification deviations in the drawing itself. This ensures that the verification result not only reflects the differences between the graphic end and the table end, but also reveals logical inconsistencies within the graphic end, significantly enhancing the completeness and quality control capabilities of the verification output.
[0120] In some optional implementations, step S206 above further includes: Step c1: Based on the grade information, diameter information, quantity information, and numerical values represented by the single-length text in the second reinforcement specification information, determine the total weight calculated in the drawing.
[0121] The total weight calculated from the drawings refers to the total weight of the reinforcing bar, theoretically calculated based on the grade, diameter, quantity, and unit length text values in the second reinforcing bar specification information. Specifically, using the grade, diameter, and unit length text values extracted from the reinforcing bar graphic area, combined with the formula for calculating the theoretical weight of the reinforcing bar, the theoretical weight per unit length of the reinforcing bar of that grade and diameter is first determined. Then, a multiplication operation is performed based on the quantity and unit length text values to obtain the theoretical total weight of the reinforcing bar calculated from the graphic area. This theoretical total weight is the total weight calculated from the drawings.
[0122] Step c2: Compare the calculated total weight on the drawing with the total weight information in the table of the first steel reinforcement specification information to obtain the fourth comparison result.
[0123] The target kernel results include the fourth alignment result.
[0124] The total weight information in the first rebar specification information table refers to the total weight data of the rebar recorded in the first rebar specification information and directly read from the rebar table area. Specifically, the total weight calculated from the drawing obtained from the rebar graphic area is compared with the total weight information in the first rebar specification information table directly read from the rebar table area to determine whether the two values are consistent. The conclusion of whether they are consistent is the fourth comparison result, used to verify the difference between the total weight calculated from the graphic area and the total weight recorded in the table area.
[0125] In the above implementation, during the verification process, the total weight calculated from the drawings is actively calculated based on information such as grade, diameter, quantity, and single-length text identified by the graphical interface. The calculated result is then independently compared with the total weight information in the first rebar specification information in the table, generating a fourth comparison result which is incorporated into the target verification result. This method of cross-validation through secondary calculation elevates the verification process from a simple comparison of field values to a deep verification of the inherent logical consistency of the data. It effectively identifies weight mismatches caused by input errors in the table data or attribute recognition deviations in the graphical interface, compensating for the shortcomings of directly comparing attribute fields, which may still miss hidden data contradictions. This significantly enhances the accuracy and reliability of the verification results.
[0126] Furthermore, by integrating the first, second, third, and fourth comparison results, a target verification result is formed for six verification indicators: coverage level, diameter, quantity, single root length, whether the single root length is equal to the sum of the side lengths, and total weight. For each indicator, a conclusion on whether they are consistent is output, and indicators with discrepancies are marked and prompted, thereby completing the automatic verification.
[0127] For example, a multi-dimensional automatic verification process can take the table list of steel reinforcement entities (Entity_Steel_List) and the graphic list of key element entities (Entity_Key_List) as inputs, and complete the number matching and multi-dimensional verification through a double-loop logic. The outer loop iterates through each steel reinforcement entity (steel_item) in the table and initializes the matching flag (is_hit) to 0; the inner loop iterates through each key element entity (key_item) on the graphic side, and when the steel reinforcement number (No) of the two is the same, the match is considered successful, and is_hit is set to 1. After a successful match, three dimensions of verification are performed sequentially: First, the four attributes—Grade, Number, Diameter, and Length—are compared item by item, and inconsistent attributes are recorded in the no_match_list. Second, the entire edge list of the rebar is traversed, and the length values of all edges are concatenated and summed to obtain the total edge length, which is then compared with the Length of the single rebar to verify consistency. Third, the theoretical specific gravity table (Kg_m) is queried using Grade and Diameter as keys, and the theoretical total weight is calculated according to the formula "Total Weight = Rebar Specific Gravity × Rebar Quantity × Rebar Length," and compared with the total weight recorded in the table to verify consistency. After verification, if there are inconsistencies in attributes, a single-item inconsistency warning is triggered; if the edge length is inconsistent, a length warning is triggered; and if the total weight is inconsistent, a weight warning is triggered. Finally, the complete verification result and discrepancy prompts are output.
[0128] Furthermore, the above-mentioned method for verifying the amount of reinforcing steel was applied to actual bridge engineering drawings for validation. The intermediate identification results during the algorithm's operation are as follows: Figure 6 As shown, this example drawing is a design drawing of a bridge pier cap beam. The main body of the drawing includes a half-elevation and half-planar structural drawing of the cap beam, as well as detailed steel reinforcement details for skeletons A and B. A material quantity table for the bridge pier cap beam is displayed in the upper right corner, and the lower right corner shows annotations on the construction and design of the retaining block reinforcement. The left side of the drawing simultaneously displays magnified images of multiple sets of steel reinforcement details. The entire drawing is overlaid with color-coded annotation boxes generated by the algorithm, covering the main steel reinforcement area, element guidance area, and side length annotation area, intuitively presenting the algorithm's positioning and recognition effects on real engineering drawings.
[0129] The output interface of the verification system software accompanying this application is as follows: Figure 7 As shown, the interface adopts a row-based table layout. Each row corresponds to the verification information of a single rebar, which includes 11 items in sequence: rebar number, diameter, grade, graphic preview, calculation expression, single length, number of bars, total length, specific gravity, total weight, and quantity difference. The graphic column intuitively displays the detailed shape of the corresponding rebar, the calculation expression column indicates the segmented calculation logic of the single length, and the quantity difference column presents the verification difference results, which is convenient for operators to view, review, and correct one by one.
[0130] This embodiment also provides a rebar measuring device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0131] This embodiment provides a rebar measurement device, such as... Figure 8 As shown, it includes: Module 801 is used to acquire images of the design drawings to be verified. The detection module 802 is used to detect the design drawing image and determine the rebar table area and rebar graphic area in the design drawing image; The first recognition module 803 is used to recognize the text content within the rebar table area to obtain the first rebar specification information; The second identification module 804 is used to identify the feature guide box in the rebar graphic area, and to perform graphic vectorization on the rebar graphic area based on the feature guide box to obtain graphic edge segments. The third recognition module 805 is used to recognize the text annotations in the rebar graphic area, and combine the text annotations with the graphic edge segments to obtain the second rebar specification information. The comparison module 806 is used to compare the specification information of the second rebar with that of the first rebar to obtain the target verification result corresponding to the design drawing image.
[0132] In some alternative implementations, the first identification module 803 includes: The segmentation submodule is used to divide the rebar table area using table lines to obtain a cell area; The backfill submodule is used to obtain the first text position corresponding to the text content, and backfill the text content to the corresponding cell area based on the degree of overlap between the first text position and the cell area. The classification submodule is used to classify the text content that has been filled into the corresponding cell range to obtain the category of the text content; The parsing submodule is used to parse the text content that is filled back into the corresponding cell area based on the positional relationship of the cell area in the rebar table area and the category of the text content, so as to obtain the first rebar specification information.
[0133] In some alternative implementations, the second identification module 804 includes: The Get submodule is used to retrieve the main steel bar line area associated with the feature guide box; The segmentation submodule is used to segment the rebar graphic region at its endpoints to obtain an initial set of endpoints. The filtering submodule is used to filter out endpoints located within the main reinforcement line area from the initial endpoint set to obtain the target endpoint set; The first determination submodule is used to determine, for any target endpoint in the set of target endpoints, other endpoints connected to the target endpoint within the main steel bar line area; The generation submodule is used to select the endpoint with the shortest path length to the target endpoint from other endpoints and pair them to generate graphic edge segments.
[0134] In some optional implementations, the acquisition submodule includes: The processing unit is used to perform binarization processing on the design drawing image, determine the foreground pixels in the design drawing image, and the connected regions formed by the foreground pixels; The first determining unit is used to determine the connected regions that overlap with the feature guide box as candidate connected regions; The second determining unit is used to determine the candidate connected region with the largest overlap area with the feature guide box as the main line region of the reinforcing steel.
[0135] In some alternative implementations, the third identification module 805 includes: The `get` submodule is used to obtain the position of the second text corresponding to the text annotation; The second determination submodule is used to determine the side length annotation text corresponding to the graphic edge segment from the text annotation based on the positional relationship between the second text position and the graphic edge segment; The positioning submodule is used to locate the number label subframe, specification label subframe, and single-length label subframe respectively within the feature guide box; The third determination submodule is used to determine the number text in the number label subframe, the specification text in the specification label subframe, and the single-length text in the single-length label subframe by utilizing the positional overlap relationship between the text content and the number label subframe, specification label subframe, and single-length label subframe. The combination submodule is used to combine number text, specification text, single-length text, side length annotation text, and graphic edge segments to obtain the second rebar specification information.
[0136] In some optional implementations, the second determining submodule includes: The third determining unit is used to determine the vertical distance between the position of each second character corresponding to the recognized text content and the edge segment of the graphic for any graphic edge segment. The fourth determining unit is used to determine the text content corresponding to the second text position whose vertical distance is less than a preset spacing threshold as candidate text. The fifth determining unit is used to determine the target distance from the second character position of each candidate character to the midpoint of the graphic edge segment; The sixth determination unit is used to determine the candidate text with the smallest target distance as the side length label text corresponding to the edge segment of the graphic.
[0137] In some alternative implementations, the composite submodule includes: The extraction unit is used to extract quantity information, grade information, and diameter information from specification text according to preset specification parsing rules; The combination unit is used to combine numbered text, quantity information, grade information, diameter information, and single-length text to obtain key element information; The seventh determination unit is used to determine the specifications of the second reinforcing bar based on the graphic edge segments, the side length annotation text corresponding to the graphic edge lines, and key element information.
[0138] In some alternative implementations, the comparison module 806 includes: The first comparison submodule is used to compare the grade information, diameter information and quantity information of the second steel bar specification information with the grade information and quantity information of the first steel bar specification information to obtain the first comparison result. The target kernel result includes the first comparison result.
[0139] In some optional implementations, the comparison module 806 further includes: The second comparison submodule is used to compare the single length text in the second rebar specification information with the single length information in the first rebar specification information to obtain the second comparison result; The target kernel result includes the second comparison result.
[0140] In some optional implementations, the comparison module 806 further includes: The third comparison submodule is used to compare the value represented by the single-length text in the second rebar specification information with the sum of the values represented by all the side length annotation texts in the second rebar specification information to obtain the third comparison result. The target kernel result includes the third comparison result.
[0141] In some optional implementations, the comparison module 806 further includes: The fourth determination submodule is used to determine the total weight calculated in the drawings based on the grade information, diameter information, quantity information and the numerical value represented by the single-length text in the second rebar specification information; The fourth comparison submodule is used to compare the total weight calculated in the drawing with the total weight information in the table of the first steel bar specification information to obtain the fourth comparison result; The target kernel results include the fourth alignment result.
[0142] The rebar measuring device provided in this application can execute the rebar measuring method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.
[0143] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0144] The following is a detailed reference. Figure 9 This diagram illustrates a suitable structural schematic for implementing the electronic device described in the embodiments of this application. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 901, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 902 or a program loaded from memory 908 into random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device. The processor 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0145] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic devices to exchange data via wireless or wired communication with other devices. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0146] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a memory 908, or installed from a ROM 902. When the computer program is executed by the processor 901, it performs the functions defined in the rebar measurement method of embodiments of this application.
[0147] Figure 9 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0148] This application also provides a computer-readable storage medium. The methods described above according to this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the rebar measurement method shown in the above embodiments is implemented.
[0149] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0150] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.< / clsn>
Claims
1. A method for measuring the quantity of reinforcing bars, characterized in that, The method includes: Obtain the design drawing image to be verified; The design drawing image is inspected to determine the rebar table area and rebar graphic area in the design drawing image; The text content within the rebar table area is identified to obtain the first rebar specification information; Identify the feature guide box within the rebar graphic area, and vectorize the rebar graphic area based on the feature guide box to obtain graphic edge segments; Identify the text annotations in the graphic area of the reinforcing bar, and combine the text annotations with the graphic edge segments to obtain the second reinforcing bar specification information; By comparing the second steel bar specification information with the first steel bar specification information, the target quantity verification result corresponding to the design drawing image is obtained.
2. The method according to claim 1, characterized in that, The process of identifying the text content within the rebar table area to obtain the first rebar specification information includes: The rebar table area is divided by table lines to obtain cell areas; Obtain the first text position corresponding to the text content, and based on the degree of overlap between the first text position and the cell area, fill the text content back into the corresponding cell area; The text content that is filled back into the corresponding cell area is classified to obtain the category of the text content; Based on the positional relationship of the cell area in the rebar table area and the category of the text content, the text content is parsed and backfilled to the corresponding cell area to obtain the first rebar specification information.
3. The method according to claim 1, characterized in that, The step of vectorizing the rebar graphic area based on the element guide box to obtain graphic edge segments includes: Obtain the main steel bar line area associated with the element guide box; The region of the steel reinforcement is segmented at its endpoints to obtain an initial set of endpoints; Filter the endpoints located within the main line area of the reinforcing bar from the initial endpoint set to obtain the target endpoint set; For any target endpoint in the set of target endpoints, other endpoints connected to the target endpoint are determined within the main body of the reinforcing bar line area; The endpoint with the shortest path length to the target endpoint is selected from the other endpoints and paired to generate the graphic edge segment.
4. The method according to claim 3, characterized in that, The step of obtaining the main steel bar line area associated with the element guide box includes: The design drawing image is binarized to determine the foreground pixels in the design drawing image and the connected regions formed by the foreground pixels; Connected regions that overlap with the element guide box are identified as candidate connected regions; The candidate connected region with the largest overlap area with the element guide box in the candidate connected region is determined as the main line region of the reinforcing bar.
5. The method according to claim 1, characterized in that, The step of combining the text annotation with the graphic edge segment to obtain the second rebar specification information includes: Obtain the position of the second text corresponding to the text annotation; Based on the positional relationship between the second text position and the graphic edge segment, determine the side length annotation text corresponding to the graphic edge segment from the text annotation; Within the element guide box, locate the number label sub-box, the specification label sub-box, and the single length label sub-box respectively; By utilizing the positional overlap between the text content and the numbered label sub-frame, the specification label sub-frame, and the single-length label sub-frame, the numbered text within the numbered label sub-frame, the specification text within the specification label sub-frame, and the single-length text within the single-length label sub-frame are determined. The second rebar specification information is obtained by combining the number text, the specification text, the single length text, the side length annotation text, and the graphic edge segment.
6. The method according to claim 5, characterized in that, The step of determining the side length annotation text corresponding to the graphic edge segment from the text content based on the positional relationship between the second text position and the graphic edge segment includes: For any of the graphic edge segments, determine the vertical distance between each of the second text positions corresponding to the identified text content and the graphic edge segment; The text content corresponding to the second text position where the vertical distance is less than a preset spacing threshold is determined as candidate text; Determine the target distance from the second character position of each candidate character to the midpoint of the edge segment of the graphic; The candidate text with the smallest target distance is determined as the side length label text corresponding to the edge segment of the graphic.
7. The method according to claim 5, characterized in that, The combination of the number text, the specification text, the single-length text, the side length annotation text, and the graphic edge segment yields the second rebar specification information, including: According to the preset specification parsing rules, quantity information, grade information and diameter information are extracted from the specification text; By combining the numbered text, the quantity information, the grade information, the diameter information, and the single-length text, key element information is obtained; Based on the graphic edge segments, the edge length annotation text corresponding to the graphic edge lines, and the key element information, the second steel bar specification information is determined.
8. The method according to claim 7, characterized in that, The comparison of the second rebar specification information with the first rebar specification information to obtain the target verification result corresponding to the design drawing image includes: The grade, diameter, and quantity information of the second steel bar specification information are compared with those of the first steel bar specification information to obtain the first comparison result. The target kernel result includes the first comparison result.
9. The method according to claim 8, characterized in that, The method further includes: By comparing the single length text in the second rebar specification information with the single length information in the first rebar specification information, a second comparison result is obtained; The target kernel result includes the second comparison result.
10. The method according to claim 8, characterized in that, The method further includes: The third comparison result is obtained by comparing the value represented by the single length text in the second rebar specification information with the sum of the values represented by all the side length annotation texts in the second rebar specification information. The target kernel result includes the third comparison result.
11. The method according to claim 8, characterized in that, The method further includes: Based on the grade information, diameter information, quantity information, and numerical values represented by the single-length text in the second steel bar specification information, the total weight calculated in the drawings is determined; The fourth comparison result is obtained by comparing the calculated total weight of the drawing with the total weight information in the table of the first steel bar specification information. The target kernel result includes the fourth comparison result.
12. A rebar measuring device, characterized in that, The device includes: The acquisition module is used to acquire the design drawing images to be verified. The detection module is used to detect the design drawing image and determine the rebar table area and rebar graphic area in the design drawing image; The first recognition module is used to recognize the text content within the rebar table area to obtain the first rebar specification information; The second identification module is used to identify the element guide box in the rebar graphic area, and to perform graphic vectorization on the rebar graphic area based on the element guide box to obtain graphic edge line segments. The third recognition module is used to recognize the text annotations in the graphic area of the steel bar, and combine the text annotations with the graphic edge segments to obtain the second steel bar specification information; The comparison module is used to compare the second steel bar specification information with the first steel bar specification information to obtain the target verification result corresponding to the design drawing image.
13. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the steel reinforcement measurement method according to any one of claims 1 to 11.