Rebar testing methods and equipment

By combining a target detection model with color contrast and pixel block count to dynamically select the detection scheme, the problem of low accuracy in traditional rebar detection is solved, achieving high precision and robustness in rebar detection in high pier structures and ensuring bridge construction quality.

CN121033664BActive Publication Date: 2026-04-03HEBEI EXPRESSWAY GRP CO LTD ZHANG ZHUO BRANCH +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Traditional methods for inspecting the quality of embedded steel bars have low accuracy and cannot meet the precision requirements of high pier structures in bridge construction.

Method used

A target detection model is used to identify the bounding box of the reinforcing bars. By combining the color contrast of the reinforcing bars and concrete, the number of black pixel blocks, and the predicted number of reinforcing bars, edge contour analysis or corner detection is dynamically selected to determine the coordinate set of the root of the reinforcing bars. The detection accuracy is improved by combining edge contour analysis and corner detection.

Benefits of technology

It improves the accuracy and adaptability of rebar testing, ensuring testing precision and robustness under different environmental conditions, and meeting the quality and safety requirements of bridge construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033664B_ABST
    Figure CN121033664B_ABST
Patent Text Reader

Abstract

This invention provides a method and equipment for detecting reinforcing bars, relating to the field of bridge construction technology. The method includes: inputting an image to be detected into a target detection model to obtain the bounding box coordinates of the reinforcing bars and the predicted number of reinforcing bars; obtaining a bottom image of the reinforcing bars based on the bounding box coordinates, and determining a classification threshold based on the pixel values ​​of the bottom image; binarizing the bottom image of the reinforcing bars according to the classification threshold, and counting the number of horizontal black pixel blocks corresponding to a certain vertical coordinate in the binarized bottom image of the reinforcing bars; wherein each black pixel block corresponds to a reinforcing bar or a shadow; determining a target detection scheme based on the color contrast between the reinforcing bars and concrete in the bottom image of the reinforcing bars, the number of black pixel blocks, and the predicted number of reinforcing bars; and obtaining a set of coordinates at the root of the reinforcing bars based on the target detection scheme; wherein the target detection scheme includes edge contour analysis or corner detection. This invention can improve the accuracy of reinforcing bar detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of bridge construction technology, and in particular to a method and equipment for detecting reinforcing bars. Background Technology

[0002] In modern bridge construction, high pier structures are a crucial component due to their high working height, complex construction environment, and high precision requirements. Among these, the location and quality of the steel reinforcement, as the main load-bearing component of the high pier structure, directly affect the overall safety, durability, and service life of the bridge.

[0003] Traditional methods for detecting the quality of embedded steel bars mainly rely on manual monitoring and inspection, which suffers from problems such as low accuracy. Summary of the Invention

[0004] This invention provides a method and equipment for detecting reinforcing bars to solve the problem of low accuracy in reinforcing bar detection.

[0005] In a first aspect, embodiments of the present invention provide a method for detecting reinforcing bars, comprising:

[0006] The image to be detected is input into the target detection model to obtain the bounding box coordinates of the reinforcing bars and the predicted number of reinforcing bars.

[0007] The bottom image of the rebar is obtained based on the bounding box coordinate information of the rebar, and the classification threshold is determined based on the pixel values ​​of the bottom image of the rebar.

[0008] The bottom image of the rebar is binarized according to the classification threshold, and the number of black pixels in the horizontal direction corresponding to a certain vertical coordinate in the binarized bottom image of the rebar is counted; where each black pixel corresponds to the rebar or the shadow.

[0009] The target detection scheme is determined based on the color contrast between the steel bars and concrete, the number of black pixel blocks, and the predicted number of steel bars in the bottom image of the steel bars.

[0010] The coordinate set of the rebar root is obtained based on the target detection scheme; the target detection scheme includes edge contour analysis or corner point detection.

[0011] In one possible practical approach, edge contour parsing is performed on the bounding box of the reinforcing bar; corner detection is performed on the bottom image of the reinforcing bar.

[0012] In one possible practical approach, the set of coordinates of the rebar roots is obtained based on the target detection scheme, including:

[0013] When the target detection scheme includes edge contour parsing and corner detection, the bounding box of the rebar is parsed to obtain the parsing result of the bounding box. Based on the parsing result, the bottom contour coordinate information set of the rebar is determined. The bottom image of the rebar is then subjected to corner detection to obtain the corner detection result. Based on the corner detection result, the bottom coordinate information set of the rebar is determined. Based on the bottom contour coordinate information set and the bottom coordinate information set of the rebar, the coordinate set of the root of the rebar is obtained.

[0014] When the target detection scheme includes edge contour parsing, the boundary box of the rebar is parsed to obtain the parsing result of the boundary box. Based on the parsing result, the set of bottom contour coordinate information of the rebar is determined as the final set of rebar root coordinates.

[0015] In one possible practical approach, the set of coordinates at the root of the reinforcing bar is obtained based on the set of bottom profile coordinates and the set of bottom coordinates of the reinforcing bar, including:

[0016] Find the union of the set of bottom contour coordinates of the reinforcing bar and the set of bottom coordinates of the reinforcing bar, and use the result of the union as the set of coordinates of the root of the reinforcing bar.

[0017] In one possible practical approach, before performing edge contour analysis on the bounding box of the reinforcing bars to obtain the analytical result of the bounding box, the following steps are also included:

[0018] The bottom image of the reinforcing bar is preprocessed; the preprocessing includes segmenting the bottom image of the reinforcing bar according to a classification threshold and denoising the segmented image.

[0019] In one possible practical approach, a target detection scheme is determined based on the color contrast between the rebar and concrete in the image at the bottom of the rebar, the number of black pixel blocks, and the predicted number of rebars, including:

[0020] Calculate the ratio of the number of black pixel blocks to the predicted number of steel bars;

[0021] When the color contrast between the steel bar and the concrete in the bottom image of the steel bar is greater than the contrast threshold, and when the ratio is less than the ratio threshold, the target detection scheme is determined to include edge contour parsing and corner detection.

[0022] When the color contrast between the steel bar and concrete in the bottom image of the steel bar is less than or equal to the contrast threshold, or when the ratio is greater than or equal to the ratio threshold, the target detection scheme is determined to include edge contour parsing.

[0023] In one possible realistic approach, the calculation process for the color contrast between the reinforcing steel and concrete in the bottom image of the reinforcing steel includes:

[0024] Convert the bottom image of the rebar to grayscale to obtain the grayscale image of the bottom of the rebar;

[0025] The pixels of the grayscale image of the bottom of the steel bar are divided according to the classification threshold to obtain two sets of pixel values;

[0026] Calculate the median of two sets of pixel values, and calculate the difference between the medians of the two sets of pixel values;

[0027] The difference is defined as the contrast between the colors of the steel bars and concrete in the bottom image of the steel bars.

[0028] In one possible practical approach, after obtaining the bottom image of the reinforcing bar based on its bounding box coordinates, the following is also included:

[0029] Perform a perspective transformation on the bottom image of the reinforcing bar to obtain the perspective-transformed bottom image of the reinforcing bar;

[0030] The classification threshold is determined based on the pixel values ​​of the image at the bottom of the rebar, including:

[0031] Convert the bottom image of the rebar after perspective transformation to grayscale and count the pixel values ​​of the grayscale bottom image of the rebar.

[0032] Calculate the average pixel value;

[0033] The average value is used as the classification threshold.

[0034] In one possible practical approach, after obtaining the set of coordinates of the rebar roots according to the target detection scheme, the following is also included:

[0035] The actual quantity of reinforcing bars is determined based on the coordinate set of the base of the reinforcing bars.

[0036] Calculate the actual coordinate set of the rebar root based on the rebar root coordinate set and transformation coefficient, and calculate the actual rebar spacing and actual rebar diameter based on the actual rebar root coordinate set;

[0037] The quality of the reinforcing bars is assessed based on their actual quantity, spacing, and diameter.

[0038] In one possible practical approach, the image to be detected is input into the target detection model, and the bounding box coordinate information of the pier top structure is also obtained;

[0039] The calculation process for the conversion factor includes:

[0040] The coordinate information of the four vertices of the pier top structure is determined based on the bounding box coordinate information of the pier top structure;

[0041] Perform perspective transformation on the coordinate information of the vertices;

[0042] The number of pixels representing the width of the pier top structure is obtained based on the coordinate information of the vertices after perspective transformation.

[0043] The conversion coefficient between pixels and actual dimensions is obtained based on the number of pixels and the actual width of the bridge pier.

[0044] In a second aspect, embodiments of the present invention provide a rebar detection device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect or any possible implementation of the first aspect.

[0045] In this embodiment of the invention, a target detection scheme is determined based on the color contrast between the steel bars and concrete, the number of black pixels, and the predicted number of steel bars in the bottom image of the steel bars. Edge contour analysis or corner detection is flexibly selected to determine the coordinate set of the steel bar root. This method of determining the appropriate detection scheme based on different conditions, thereby determining the coordinate set of the steel bar root in the bottom image, improves detection accuracy. When the color contrast between the steel bars and concrete, the number of black pixels, and the predicted number of steel bars in the bottom image of the steel bars simultaneously meet the conditions, corner detection is used to further accurately locate the coordinates of the steel bar root by performing edge contour analysis on the bounding box of the steel bars, resulting in a more accurate set of steel bar root coordinates and improving the accuracy of steel bar detection. When the color contrast between the steel bars and concrete, the number of black pixels, and the predicted number of steel bars in the bottom image of the steel bars cannot simultaneously meet the conditions, the coordinate set of the steel bar root is determined based on the result of edge contour analysis of the steel bar bounding box, avoiding corner detection errors caused by shadows and ensuring the accuracy of the steel bar coordinate information. Attached Figure Description

[0046] Figure 1 This is a flowchart illustrating the implementation of the rebar detection method provided in this embodiment of the invention;

[0047] Figure 2a This is a schematic diagram showing the detection results of the target detection model provided in this embodiment of the invention on the top area of ​​the bridge pier;

[0048] Figure 2b This is a schematic diagram showing the results of the target detection model provided in this embodiment of the invention detecting the rebar area;

[0049] Figure 3 This is a schematic diagram of the bottom image of the reinforcing bar provided in an embodiment of the present invention;

[0050] Figure 4 This is a schematic diagram showing the result of obtaining the coordinates of the root of the reinforcing bar through edge contour analysis according to an embodiment of the present invention;

[0051] Figure 5 This is a schematic diagram comparing the results of the rebar root coordinates obtained by edge contour analysis provided in this embodiment of the invention with the drawing;

[0052] Figure 6This is a schematic diagram showing the results of obtaining the coordinates of the steel bar root from the edge contour analysis and corner point detection provided in this embodiment of the invention;

[0053] Figure 7 This is a structural schematic diagram of the rebar detection device provided in an embodiment of the present invention. Detailed Implementation

[0054] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0055] See Figure 1 The flowchart illustrating the implementation of the rebar detection method provided in this embodiment of the invention is described in detail below:

[0056] Step 101: Input the image to be detected into the target detection model to obtain the bounding box coordinates of the reinforcing bars and the predicted number of reinforcing bars.

[0057] Specifically, the image to be detected is input into the target detection model to obtain the bounding box coordinates of the reinforcing bars in the preset area and the predicted number of reinforcing bars; the target detection model is trained based on the bounding box coordinates and the number of reinforcing bars in the preset area in historical images.

[0058] like Figure 2b This is a schematic diagram of the result of the target detection model provided in this embodiment of the invention detecting the rebar area, wherein the border in the figure is the boundary box of the cut rebar.

[0059] For example, the tag Figure 2b The bounding boxes of this row of reinforcing bars are shown. The target detection model is trained based on the bounding boxes of the marked reinforcing bars to obtain the trained target detection model.

[0060] In one possible implementation, the reinforcing bars at preset locations are marked as needed, and the target detection model is trained based on the bounding boxes of the marked reinforcing bars. The trained target detection model is then used to detect the bounding boxes and the number of reinforcing bars at the preset locations.

[0061] Specifically, after determining the target rebar for detection, the target rebar in the historical images is labeled, such as the bounding box and the number of rebars. Then, the target detection model is trained based on the target rebar, so that the trained target detection model can detect the target rebar.

[0062] In this embodiment, the image to be detected refers to a digital image containing the steel reinforcement area of ​​the bridge pier, typically captured by a camera, providing a data foundation for subsequent steel reinforcement detection. The target detection model is an algorithm model trained using technologies such as deep learning, primarily used to identify specific targets in an image and determine their location and quantity. In this invention, the model detects key elements such as steel reinforcement and the pier top structure. For example, the target detection model is the YOLOv11-seg model.

[0063] After the object detection model processes the image to be detected, it outputs the coordinates of the bounding box for each identified rebar. The bounding box is a rectangular box used to accurately locate the position of the rebar in the image, and the coordinate information describes the position of the rectangle in the image in specific numerical form (such as the coordinates of the upper left and lower right corners).

[0064] In addition, the target detection model will also predict the total number of steel bars in the image based on its analysis of the image and the knowledge it has learned, providing a preliminary reference for the subsequent detection process. This allows for comparison and verification with the actual number of steel bars detected, helping to determine the rationality of the detection results and also assisting in selecting a suitable detection scheme in subsequent steps.

[0065] Step 102: Obtain the bottom image of the rebar based on the bounding box coordinate information of the rebar, and determine the classification threshold based on the pixel values ​​of the bottom image of the rebar.

[0066] In this embodiment, the bounding box coordinate information defines the position range of the reinforcing bar in the image. Using the bounding box coordinates, the image of the bottom region of the reinforcing bar can be accurately extracted from the original image, such as... Figure 3 As shown in the image. Typically, the bottom image of a reinforcing bar refers to the part where the reinforcing bar contacts the concrete.

[0067] In the specific implementation process, the bottom image of the rebar is obtained based on the boundary frame coordinate information of the rebar, including: based on the boundary frame coordinate information of all the rebars in the bottom image of the rebar, the image of one-eighth of the coordinate range of the bottom image of the rebar is extracted.

[0068] Pixel values ​​reflect the grayscale or color information of each point in an image. In an image of the bottom of a rebar, the rebar and the surrounding concrete or background will have different pixel value distributions.

[0069] Step 103: Binarize the bottom image of the rebar according to the classification threshold, and count the number of horizontal black pixel blocks corresponding to a certain vertical coordinate in the bottom image of the rebar after binarization; where each black pixel block corresponds to the rebar or shadow.

[0070] In one possible implementation, the classification threshold is a fixed pixel value, enabling fast classification processing.

[0071] In other possible implementations, the classification threshold is calculated based on the pixel values ​​of the bottom image of the rebar, adapting to different detection scenarios and making rebar detection more accurate.

[0072] In this embodiment, the image of the bottom of the rebar is converted into a binary image (black and white image) based on a classification threshold. A black pixel block is a region composed of consecutive black pixels. In the binarized image, a black pixel block may correspond to rebar or shadow. Counting the number of black pixel blocks in the horizontal direction on a certain vertical axis (horizontal line) helps to determine the quantity and distribution of rebar. If the number of black pixel blocks matches the predicted number of rebars, these blocks are likely rebars; if the number of black pixel blocks exceeds the predicted number of rebars, the extra blocks may be shadows or other interference.

[0073] By performing binarization and counting black pixel blocks, the quantity and distribution of steel bars can be preliminarily determined, and potential shadow interference can be identified, providing basic data support for subsequent accurate detection (such as edge contour analysis or corner detection).

[0074] Step 104: Determine the target detection scheme based on the color contrast between the steel bars and concrete in the bottom image of the steel bars, the number of black pixel blocks, and the predicted number of steel bars.

[0075] In this embodiment, color contrast reflects the degree to which the reinforcing steel bars and the surrounding concrete are distinguishable in the image. High contrast means that the color difference between the reinforcing steel bars and the concrete is obvious, making them easy to distinguish; low contrast may make the outline of the reinforcing steel bars unclear, increasing the difficulty of detection. In the binarized image, black pixels may correspond to reinforcing steel bars or shadows. By counting the number of black pixels in the horizontal direction corresponding to a certain vertical coordinate, the quantity and distribution of reinforcing steel bars can be preliminarily determined.

[0076] When color contrast is high, steel bars and concrete are easily distinguishable, allowing for more precise detection methods such as corner detection. However, when color contrast is low, the boundary between steel bars and concrete is unclear, making edge contour analysis more suitable. Comparing the number of black pixels with the predicted number of steel bars helps determine if interference (such as shadows) exists, thus affecting the detection scheme. If the number of black pixels significantly exceeds the predicted number of steel bars, shadow interference may exist. In this case, edge contour analysis of the steel bar's bounding box is prioritized, as the bounding box only includes the steel bar's outline and does not include shadows, thus eliminating shadow interference.

[0077] By comprehensively considering color contrast, the number of black pixels, and the predicted number of rebars, detection errors caused by image conditions or environmental factors can be reduced, enabling better handling of detection challenges in different scenarios and improving the reliability of detection results. By comprehensively analyzing the features of the rebar bottom image and model prediction information, the most suitable detection scheme is dynamically selected to improve detection accuracy and adaptability.

[0078] Step 105: Obtain the set of coordinates of the rebar root according to the target detection scheme; wherein, the target detection scheme includes edge contour analysis or corner point detection.

[0079] Specifically, edge contour analysis determines the edge contour of an object by detecting areas with significant grayscale or color changes in an image. In rebar detection, edge detection of the rebar's bounding box reveals its outline. Edge contour analysis is suitable for situations with low color contrast or significant shadow interference, effectively extracting the overall contour of the rebar and thus determining the coordinate range of its base.

[0080] Specifically, corner detection determines the location of corners in an image by analyzing the gradient information of pixels and the eigenvalues ​​of the autocorrelation matrix. Corners are typically the intersections of two edges in an image and have distinct features. Corner detection is suitable for applications with high color contrast and minimal shadow interference, and can accurately locate the corners at the base of reinforcing bars, providing more precise coordinate information.

[0081] In this embodiment, based on the conditional judgment in the target detection scheme, corner detection is used when the color contrast between the steel bars and concrete is high and the ratio of the number of black pixels to the predicted number of steel bars meets the requirements, because it can more accurately locate the coordinates of the steel bar roots. When the color contrast is low or the ratio does not meet the requirements, the edge contour parsing of the steel bar bounding box is used, because it has a stronger grasp of the overall contour of the image and can better handle complex situations and shadow interference.

[0082] In this embodiment of the invention, a target detection scheme is determined based on the color contrast between the steel bars and concrete, the number of black pixels, and the predicted number of steel bars in the bottom image of the steel bars. Edge contour analysis or corner detection is flexibly selected to determine the coordinate set of the steel bar root. This method of determining the appropriate detection scheme based on different conditions, thereby determining the coordinate set of the steel bar root in the bottom image, improves detection accuracy. When the color contrast between the steel bars and concrete, the number of black pixels, and the predicted number of steel bars in the bottom image of the steel bars simultaneously meet the conditions, corner detection is used to further accurately locate the coordinates of the steel bar root by performing edge contour analysis on the bounding box of the steel bars, resulting in a more accurate set of steel bar root coordinates and improving the accuracy of steel bar detection. When the color contrast between the steel bars and concrete, the number of black pixels, and the predicted number of steel bars in the bottom image of the steel bars cannot simultaneously meet the conditions, the coordinate set of the steel bar root is determined based on the result of edge contour analysis of the steel bar bounding box, avoiding corner detection errors caused by shadows and ensuring the accuracy of the steel bar coordinate information.

[0083] In one possible practical approach, edge contour parsing is performed on the bounding box of the reinforcing bar; corner detection is performed on the bottom image of the reinforcing bar.

[0084] In this embodiment, edge contour analysis is performed on the bounding box of the reinforcing bar. Edge contour analysis is applied to the bounding box of the reinforcing bar, that is, by detecting areas within the bounding box where grayscale or color changes are significant, the edge contour of the reinforcing bar is determined. The overall contour information of the reinforcing bar is extracted, thereby determining the coordinate range of the root of the reinforcing bar.

[0085] Corner detection targets the bottom image of the rebar. It analyzes the gradient information and eigenvalues ​​of the autocorrelation matrix of pixels in the bottom image to determine the location of corner points. These corner points are typically where two edges meet in the image and have distinct features. This precise location of corner points at the base of the rebar provides more accurate coordinate information.

[0086] In one possible implementation, the set of coordinates of the rebar roots is obtained according to the target detection scheme, including:

[0087] When the target detection scheme includes edge contour parsing and corner detection, the bounding box of the rebar is parsed to obtain the parsing result of the bounding box. Based on the parsing result, the bottom contour coordinate information set of the rebar is determined. The bottom image of the rebar is then subjected to corner detection to obtain the corner detection result. Based on the corner detection result, the bottom coordinate information set of the rebar is determined. Based on the bottom contour coordinate information set and the bottom coordinate information set of the rebar, the coordinate set of the root of the rebar is obtained.

[0088] When the target detection scheme includes edge contour parsing, the boundary box of the rebar is parsed to obtain the parsing result of the boundary box. Based on the parsing result, the set of bottom contour coordinate information of the rebar is determined as the final set of rebar root coordinates.

[0089] Specifically, the steps for edge contour parsing include:

[0090] Step B1: Take the y-coordinate of the lowest point in the edge contour. b ;

[0091] Step B2: In the edge contour, find the point with the y-coordinate as... b Given a set of coordinates, find the maximum x-axis coordinate x in that set of coordinates. max and minimum value x min ;

[0092] Step B3: Divide the coordinates of the edge contour into sections with the x-axis as the reference, and divide the sections into those greater than x. max and less than x min Two sets;

[0093] Step B4: Calculate the median of the x-axis coordinates in the two sets, and obtain the x-coordinates respectively. R and x L , will (x L ,y b ) to (x R ,y b () is used as the coordinate of the root of the reinforcing bar.

[0094] Specifically, the corner detection steps include:

[0095] Step C1: Calculate the gradient information of the bottom image of the reinforcing bar, usually using the Sobel operator;

[0096] Step C2: Based on gradient information, construct an autocorrelation matrix for each pixel in the bottom image of the rebar, and calculate the two eigenvalues ​​of the autocorrelation matrix;

[0097] Step C3: Determine the type of pixel based on the size of the feature values: If both feature values ​​are large (greater than the preset threshold), then the pixel is a corner pixel.

[0098] Edge contour parsing is performed on the bounding box of the reinforcing bar to obtain its contour information. Specifically, this involves finding the edges of the reinforcing bar in the image and extracting their coordinate information. Based on the edge contour parsing results, a set of contour coordinate information for the bottom of the reinforcing bar is determined. This coordinate information describes the shape and position of the bottom of the reinforcing bar. The coordinate set of the root of the reinforcing bar is determined directly from the bottom contour coordinate information obtained from the edge contour parsing. This method is suitable for situations with low color contrast or significant shadow interference, where edge contour parsing of the reinforcing bar's bounding box can better extract the overall contour of the reinforcing bar.

[0099] Specifically, corner detection is performed on the bottom image of the rebar to find the corner locations in the image. Corners are usually the intersections of two edges in the image and have obvious features. Based on the results of corner detection, the coordinate information set of the bottom of the rebar is determined. Corner detection can provide more accurate coordinate information, especially when the color contrast is high and the shadow interference is small.

[0100] In this embodiment, when only edge contour analysis is used, the coordinate set of the rebar root is directly determined based on the result of the edge contour analysis of the rebar's bounding box. When both edge contour analysis and corner detection are used simultaneously, the detection results of both are combined to obtain a more accurate coordinate set of the rebar root. This method combines the advantages of edge contour analysis and corner detection, improving the accuracy and robustness of detection under different conditions. Figure 4 The image shows a schematic diagram of the results of the rebar root coordinates obtained from edge contour analysis. The red dots represent the rebar root coordinates obtained from the edge contour analysis of the rebar boundary box. Figure 5 This is a schematic diagram comparing the results of the rebar root coordinates obtained by edge contour analysis provided in this embodiment of the invention with the drawing. The black dots represent the rebars on the drawing, and the red dots represent the rebar root coordinates obtained by edge contour analysis of the rebar boundary frame. Figure 6 This is a schematic diagram showing the results of edge contour analysis and corner detection of the rebar root coordinates provided in this embodiment of the invention. The red dots represent the rebar root coordinates obtained from the edge contour analysis and corner detection of the rebar boundary frame. Figure 4 and Figure 6 It can be seen that Figure 6 The coordinates of the rebar root obtained by edge contour parsing and corner detection of the rebar boundary box are compared with... Figure 4 The edge contour analysis of the boundary box of the reinforcing bar provides a more comprehensive view of the root coordinates of the reinforcing bar.

[0101] In one possible implementation, the coordinate set of the root of the rebar is obtained based on the set of bottom profile coordinate information and the set of bottom coordinate information of the rebar, including:

[0102] Find the union of the set of bottom contour coordinates of the reinforcing bar and the set of bottom coordinates of the reinforcing bar, and use the result of the union as the set of coordinates of the root of the reinforcing bar.

[0103] In this embodiment, edge contour parsing of the rebar bounding box provides overall contour information, while corner detection provides precise corner locations. By combining the results of edge contour parsing and corner detection, the advantages of both methods can be combined to ensure accurate capture of the rebar root location under various conditions. In some cases, a single method may miss certain locations due to image quality or environmental factors; combining the results of edge contour parsing and corner detection reduces this risk. By merging the coordinate information obtained from edge contour parsing and corner detection, a more comprehensive and accurate set of rebar root coordinates is formed.

[0104] In one possible implementation, before performing edge contour analysis on the bounding box of the reinforcing bars to obtain the analysis result of the bounding box, the following steps are also included:

[0105] The bottom image of the reinforcing bar is preprocessed; the preprocessing includes segmenting the bottom image of the reinforcing bar according to a classification threshold and denoising the segmented image.

[0106] Specifically, noise reduction processing includes:

[0107] Step A1: Construct a vertical convolution kernel K, and use K to perform two dilation operations on the segmented image to connect regions that may have been incorrectly segmented.

[0108] Step A2: Perform an erosion operation on the segmented image using the transpose of K to remove some small noise points.

[0109] Step A3: Apply a 7×7 window to perform a median filter to remove salt-and-pepper noise and smooth the image.

[0110] Step A4: Perform a dilation operation on the image using K to further enhance the target region.

[0111] Step A5: Apply a 5x5 window to perform a median filter to further smooth the image.

[0112] The convolution kernel K is constructed as follows:

[0113]

[0114] The dilation operation refers to performing an AND operation between the kernel (1) and the image portion it covers in an image with a black background (0) and a white foreground (1). If all values ​​are 0, the pixel is 0; otherwise, it is 1. In other words, 0 is not easy to obtain, meaning there is more white content, and the white content is dilated.

[0115] The erosion operation refers to performing an AND operation between the kernel (1) and the image portion it covers in an image with a black background (0) and a white foreground (1). If all values ​​are 1, then the pixel is 1; otherwise, it is 0. In other words, 1 is not easy to obtain, meaning that the white portion is less, and the white portion is eroded.

[0116] In step A3, the median filtering algorithm calculates the median of the pixel grayscale values ​​within the neighborhood window and uses it as the update value for the center pixel.

[0117] In this embodiment, the image of the bottom of the reinforcing bar needs to be preprocessed before edge contour analysis. Preprocessing includes image segmentation (binarization based on a classification threshold) and denoising (such as dilation, erosion, and median filtering) to improve image quality and enhance the accuracy and reliability of subsequent edge contour analysis.

[0118] In one possible implementation, a target detection scheme is determined based on the color contrast between the rebar and concrete in the image at the bottom of the rebar, the number of black pixel blocks, and the predicted number of rebars, including:

[0119] Calculate the ratio of the number of black pixel blocks to the predicted number of steel bars;

[0120] When the color contrast between the steel bar and the concrete in the bottom image of the steel bar is greater than the contrast threshold, and when the ratio is less than the ratio threshold, the target detection scheme is determined to include edge contour parsing and corner detection.

[0121] When the color contrast between the steel bar and concrete in the bottom image of the steel bar is less than or equal to the contrast threshold, or when the ratio is greater than or equal to the ratio threshold, the target detection scheme is determined to include edge contour parsing.

[0122] In this embodiment, when the color contrast is greater than the contrast threshold and the ratio of the number of black pixels to the predicted number of rebars is less than the ratio threshold, it means that the color contrast between the rebars and concrete is high, and the number of black pixels is close to the predicted number of rebars, indicating that shadow interference is small. At this time, the image quality is good, making it suitable for a more precise detection method. The target detection scheme includes edge contour analysis and corner detection. Combining the advantages of both methods can improve the accuracy and precision of the detection.

[0123] When the color contrast is less than or equal to the contrast threshold, or the ratio of the number of black pixels to the predicted number of rebars is greater than or equal to the ratio threshold, it means that the color contrast between the rebars and concrete is low, or the number of black pixels is significantly greater than the predicted number of rebars, potentially indicating shadow interference or other complex situations. In this case, the image quality is poor, requiring a more robust detection method. The target detection scheme is determined to include only the edge contour analysis of the rebar bounding box. Edge contour analysis provides a stronger grasp of the overall image contour and can better handle complex situations and shadow interference.

[0124] By analyzing the color contrast and the ratio of the number of black pixels to the predicted number of rebars in the bottom image of the rebar, the most suitable detection scheme is dynamically selected. This dynamic adjustment of the detection method aims to improve the accuracy and adaptability of the detection: when the color contrast is high and the ratio is low, a combination of edge contour analysis of the rebar's bounding box and corner detection of the bottom image of the rebar is used to improve detection accuracy. When the color contrast is low or the ratio is high, only edge contour analysis of the rebar's bounding box is used to ensure the robustness and reliability of the detection.

[0125] In one possible implementation, the calculation process for the color contrast between the reinforcing steel and concrete in the bottom image of the reinforcing steel includes:

[0126] Convert the bottom image of the rebar to grayscale to obtain the grayscale image of the bottom of the rebar;

[0127] The pixels of the grayscale image of the bottom of the steel bar are divided according to the classification threshold to obtain two sets of pixel values;

[0128] Calculate the median of two sets of pixel values, and calculate the difference between the medians of the two sets of pixel values;

[0129] The difference is defined as the contrast between the colors of the steel bars and concrete in the bottom image of the steel bars.

[0130] In this embodiment, the colored image of the bottom of the rebar is converted into a grayscale image. Grayscale conversion reduces data complexity while preserving basic image information. Using a previously determined classification threshold, the pixels in the grayscale image are divided into two categories. Based on the classification threshold, the pixels are divided into two sets: a set of pixels greater than or equal to the classification threshold (typically corresponding to the rebar); and a set of pixels less than the classification threshold (typically corresponding to concrete or other background).

[0131] For each pixel set, the median (the middle value of the pixel) is calculated. The median reflects the typical pixel value of each set, reducing the impact of noise. The difference between the medians of two sets is calculated, and this difference is used as the color contrast of the steel reinforcement and concrete. The color contrast of the steel reinforcement and concrete is obtained by converting the bottom image of the steel reinforcement to grayscale, dividing the pixel sets according to a classification threshold, calculating the median of each set, and then finding the difference. Color contrast reflects the degree to which the steel reinforcement and concrete are distinguishable in the image and is an important basis for subsequent selection of target detection schemes.

[0132] In one possible implementation, after obtaining the bottom image of the reinforcing bar based on its bounding box coordinates, the following is also included:

[0133] Perform a perspective transformation on the bottom image of the reinforcing bar to obtain the perspective-transformed bottom image of the reinforcing bar;

[0134] The classification threshold is determined based on the pixel values ​​of the image at the bottom of the rebar, including:

[0135] Convert the bottom image of the rebar after perspective transformation to grayscale and count the pixel values ​​of the grayscale bottom image of the rebar.

[0136] Calculate the average pixel value;

[0137] The average value is used as the classification threshold.

[0138] In this embodiment, perspective transformation is used to correct perspective distortion in the image, making it appear more like a frontal view for easier subsequent processing. For example, when an image is taken from a certain angle, perspective transformation can convert it into a similar frontal view, ensuring measurement accuracy. The perspective-transformed image of the bottom of the rebar is converted into a grayscale image. Grayscale conversion simplifies the data while retaining sufficient information for subsequent processing. The average value of all pixels in the grayscale image is calculated; this average value reflects the overall brightness distribution of the image. The calculated pixel average value is used as a classification threshold to distinguish between the foreground (rebar) and background (concrete or other parts) in the image for image segmentation.

[0139] In one possible implementation, after obtaining the set of coordinates of the rebar roots according to the target detection scheme, the method further includes:

[0140] The actual quantity of reinforcing bars is determined based on the coordinate set of the base of the reinforcing bars.

[0141] Calculate the actual coordinate set of the rebar root based on the rebar root coordinate set and transformation coefficient, and calculate the actual rebar spacing and actual rebar diameter based on the actual rebar root coordinate set;

[0142] The quality of the reinforcing bars is assessed based on their actual quantity, spacing, and diameter.

[0143] Specifically, the rebar root coordinate set is a collection of rebar root coordinates, with each coordinate corresponding to the position of a single rebar. By counting the number of coordinates in this set, the actual number of rebars detected can be obtained. This step verifies whether the actual number of rebars matches the design requirements. The conversion factor is a scaling factor used to convert pixel coordinates in the image to actual physical dimensions (e.g., meters or millimeters). The conversion factor is typically calculated using known actual dimensions (e.g., the actual width of a bridge pier) and the corresponding pixel width. Using the conversion factor, each pixel coordinate in the rebar root coordinate set is converted to actual physical coordinates (e.g., coordinates in meters or millimeters). By calculating the distance between the actual coordinates of adjacent rebar roots, the actual spacing between rebars is obtained. This step verifies whether the rebar spacing meets the design requirements. By analyzing the rebar's outline or shape (e.g., the results of edge contour analysis), the actual diameter of the rebar is calculated. This step verifies whether the rebar's dimensions meet the design requirements.

[0144] In this embodiment, the actual quantity, spacing, and diameter of the reinforcing bars are compared with the design drawings to assess whether the installation quality of the reinforcing bars meets the standards. If the deviation between the actual measured values ​​and the design values ​​is within the allowable range, it is considered qualified; otherwise, it is considered unqualified and rectification is required. This process ensures that the installation of the reinforcing bars conforms to the design specifications, thereby guaranteeing the quality and safety of bridge construction.

[0145] In one possible implementation, the image to be detected is input into the target detection model, and the bounding box coordinate information of the pier top structure is also obtained;

[0146] The calculation process for the conversion factor includes:

[0147] The coordinate information of the four vertices of the pier top structure is determined based on the bounding box coordinate information of the pier top structure;

[0148] Perform perspective transformation on the coordinate information of the vertices;

[0149] The number of pixels representing the width of the pier top structure is obtained based on the coordinate information of the vertices after perspective transformation.

[0150] The conversion coefficient between pixels and actual dimensions is obtained based on the number of pixels and the actual width of the bridge pier.

[0151] In this embodiment, as Figure 2aAs shown, the bounding box coordinates of the pier top structure output by the object detection model typically include the coordinates of the top-left and bottom-right corners of the bounding box. Based on the bounding box coordinates, the coordinates of the four vertices of the pier top structure can be determined; these four vertices are the four corner points of the pier top structure in the image. Perspective transformation is used to correct perspective distortion in the image, making it more like a frontal view. This step converts the pier top structure in the image to a scale closer to its actual size. Using the vertex coordinates after perspective transformation, the width of the pier top structure in the image (in pixels) is calculated. This step is achieved by calculating the pixel distance between the left and right vertices after transformation.

[0152] The actual width of the bridge pier is a known value (usually obtained from engineering drawings). Dividing the actual width of the pier by the number of pixels in the perspective-transformed image yields the actual size per pixel (e.g., meters or millimeters per pixel). This conversion factor is used to convert pixel coordinates in the image to actual physical dimensions, thus enabling accurate measurement of the actual dimensions of the reinforcing bars (such as spacing and diameter).

[0153] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0154] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0155] Figure 7 A schematic diagram of the rebar detection device provided in an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below:

[0156] like Figure 7 As shown, the rebar detection device 7 includes:

[0157] The target detection model detection module 71 is used to input the image to be detected into the target detection model to obtain the bounding box coordinate information of the reinforcing bars and the predicted number of reinforcing bars;

[0158] The classification threshold calculation module 72 is used to obtain the bottom image of the rebar based on the bounding box coordinate information of the rebar, and to determine the classification threshold based on the pixel values ​​of the bottom image of the rebar.

[0159] The black pixel block count calculation module 73 is used to binarize the bottom image of the rebar according to the classification threshold, and count the number of black pixel blocks in the horizontal direction corresponding to a certain vertical coordinate in the bottom image of the rebar after binarization; wherein, each black pixel block corresponds to the rebar or shadow.

[0160] The target detection scheme determination module 74 is used to determine the target detection scheme based on the color contrast between the steel bars and concrete in the bottom image of the steel bars, the number of black pixel blocks, and the predicted number of steel bars.

[0161] The rebar coordinate determination module 75 is used to obtain the set of rebar root coordinates according to the target detection scheme; wherein, the target detection scheme includes edge contour analysis or corner point detection.

[0162] In one possible implementation, the rebar coordinate determination module 75 is also used for:

[0163] When the target detection scheme includes edge contour parsing and corner detection, the bounding box of the rebar is parsed to obtain the parsing result of the bounding box. Based on the parsing result, the bottom contour coordinate information set of the rebar is determined. The bottom image of the rebar is then subjected to corner detection to obtain the corner detection result. Based on the corner detection result, the bottom coordinate information set of the rebar is determined. Based on the bottom contour coordinate information set and the bottom coordinate information set of the rebar, the coordinate set of the root of the rebar is obtained.

[0164] When the target detection scheme includes edge contour parsing, the boundary box of the rebar is parsed to obtain the parsing result of the boundary box. Based on the parsing result, the set of bottom contour coordinate information of the rebar is determined as the final set of rebar root coordinates.

[0165] In one possible implementation, the rebar coordinate determination module 75 is also used for:

[0166] Find the union of the set of bottom contour coordinates of the reinforcing bar and the set of bottom coordinates of the reinforcing bar, and use the result of the union as the set of coordinates of the root of the reinforcing bar.

[0167] In one possible implementation, the target detection scheme determination module 74 is further configured to:

[0168] Calculate the ratio of the number of black pixel blocks to the predicted number of steel bars;

[0169] When the color contrast between the steel bar and the concrete in the bottom image of the steel bar is greater than the contrast threshold, and when the ratio is less than the ratio threshold, the target detection scheme is determined to include edge contour parsing and corner detection.

[0170] When the color contrast between the steel bar and concrete in the bottom image of the steel bar is less than or equal to the contrast threshold, or when the ratio is greater than or equal to the ratio threshold, the target detection scheme is determined to include edge contour parsing.

[0171] In one possible implementation, the target detection scheme determination module 74 is further configured to:

[0172] Convert the bottom image of the rebar to grayscale to obtain the grayscale image of the bottom of the rebar;

[0173] The pixels of the grayscale image of the bottom of the steel bar are divided according to the classification threshold to obtain two sets of pixel values;

[0174] Calculate the median of two sets of pixel values, and calculate the difference between the medians of the two sets of pixel values;

[0175] The difference is defined as the contrast between the colors of the steel bars and concrete in the bottom image of the steel bars.

[0176] In one possible implementation, the classification threshold calculation module 72 is further used for:

[0177] Perform a perspective transformation on the bottom image of the reinforcing bar to obtain the perspective-transformed bottom image of the reinforcing bar;

[0178] Convert the bottom image of the rebar after perspective transformation to grayscale and count the pixel values ​​of the grayscale bottom image of the rebar.

[0179] Calculate the average pixel value;

[0180] The average value is used as the classification threshold.

[0181] In this embodiment of the invention, a target detection scheme is determined based on the color contrast between the steel bars and concrete, the number of black pixels, and the predicted number of steel bars in the bottom image of the steel bars. Edge contour analysis or corner detection is flexibly selected to determine the coordinate set of the steel bar root. This method of determining the appropriate detection scheme based on different conditions, thereby determining the coordinate set of the steel bar root in the bottom image, improves detection accuracy. When the color contrast between the steel bars and concrete, the number of black pixels, and the predicted number of steel bars in the bottom image of the steel bars simultaneously meet the conditions, corner detection is used to further accurately locate the coordinates of the steel bar root by performing edge contour analysis on the bounding box of the steel bars, resulting in a more accurate set of steel bar root coordinates and improving the accuracy of steel bar detection. When the color contrast between the steel bars and concrete, the number of black pixels, and the predicted number of steel bars in the bottom image of the steel bars cannot simultaneously meet the conditions, the coordinate set of the steel bar root is determined based on the result of edge contour analysis of the steel bar bounding box, avoiding corner detection errors caused by shadows and ensuring the accuracy of the steel bar coordinate information.

[0182] This invention also provides a rebar detection device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the above method embodiment.

[0183] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0184] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for detecting reinforcing bars, characterized in that, include: The image to be detected is input into the target detection model to obtain the bounding box coordinates of the reinforcing bars and the predicted number of reinforcing bars. The bottom image of the reinforcing bar is obtained based on the bounding box coordinate information of the reinforcing bar, and the classification threshold is determined based on the pixel values ​​of the bottom image of the reinforcing bar. The bottom image of the rebar is binarized according to the classification threshold, and the number of black pixels in the horizontal direction corresponding to a certain vertical coordinate in the bottom image of the rebar after binarization is counted; wherein, each black pixel corresponds to the rebar or shadow. The target detection scheme is determined based on the color contrast between the steel bars and concrete in the bottom image of the steel bars, the number of black pixel blocks, and the predicted number of steel bars; The target detection scheme yields a set of coordinates for the root of the reinforcing bar; wherein the target detection scheme employs one of the following: a scheme consisting of edge contour analysis and corner point detection, or a scheme consisting of edge contour analysis.

2. The method for detecting reinforcing bars according to claim 1, characterized in that, The step of obtaining the set of coordinates of the rebar roots according to the target detection scheme includes: When the target detection scheme includes edge contour parsing and corner detection, the boundary box of the reinforcing bar is parsed to obtain the parsing result of the boundary box. The bottom contour coordinate information set of the reinforcing bar is determined based on the parsing result. The bottom image of the reinforcing bar is then subjected to corner detection to obtain the corner detection result. The bottom coordinate information set of the reinforcing bar is determined based on the corner detection result. The root coordinate set of the reinforcing bar is obtained based on the bottom contour coordinate information set and the bottom coordinate information set of the reinforcing bar. When the target detection scheme includes edge contour parsing, the boundary box of the reinforcing bar is parsed to obtain the parsing result of the boundary box. Based on the parsing result, the set of bottom contour coordinate information of the reinforcing bar is determined as the final set of coordinates of the root of the reinforcing bar.

3. The method for detecting reinforcing bars according to claim 2, characterized in that, The step of obtaining the set of coordinates at the root of the reinforcing bar based on the set of coordinates at the bottom contour of the reinforcing bar and the set of coordinates at the bottom of the reinforcing bar includes: The union of the set of bottom contour coordinates of the reinforcing bar and the set of bottom coordinates of the reinforcing bar is used as the set of coordinates of the root of the reinforcing bar.

4. The method for detecting reinforcing bars according to claim 2, characterized in that, Before performing edge contour analysis on the boundary box of the reinforcing bars to obtain the analysis result of the boundary box, the following steps are also included: The bottom image of the reinforcing bar is preprocessed; wherein the preprocessing includes segmenting the bottom image of the reinforcing bar according to the classification threshold, and denoising the segmented image.

5. The method for detecting reinforcing bars according to claim 1, characterized in that, The step of determining the target detection scheme based on the color contrast of the steel bars and concrete in the bottom image of the steel bars, the number of black pixel blocks, and the predicted number of steel bars includes: Calculate the ratio of the number of black pixel blocks to the predicted number of reinforcing bars; When the color contrast between the steel bar and the concrete in the bottom image of the steel bar is greater than the contrast threshold, and when the ratio is less than the ratio threshold, the target detection scheme is determined to include edge contour parsing and corner detection. When the color contrast between the steel bar and the concrete in the bottom image of the steel bar is less than or equal to the contrast threshold, or when the ratio is greater than or equal to the ratio threshold, the target detection scheme is determined to include edge contour parsing.

6. The method for detecting reinforcing bars according to claim 5, characterized in that, The calculation process for the color contrast between the reinforcing steel and concrete in the bottom image of the reinforcing steel includes: The bottom image of the rebar is converted to grayscale to obtain the grayscale image of the bottom of the rebar; The pixels of the grayscale image of the bottom of the steel bar are divided according to the classification threshold to obtain two sets of pixel values; Calculate the median of two sets of pixel values, and calculate the difference between the medians of the two sets of pixel values; The difference is determined as the contrast between the colors of the steel bars and concrete in the bottom image of the steel bars.

7. The method for detecting reinforcing bars according to claim 1, characterized in that, After obtaining the bottom image of the reinforcing bar based on its bounding box coordinates, the process also includes: The bottom image of the steel bar is subjected to perspective transformation to obtain the bottom image of the steel bar after perspective transformation; The step of determining the classification threshold based on the pixel values ​​of the bottom image of the reinforcing bar includes: Convert the bottom image of the rebar after perspective transformation to grayscale and count the pixel values ​​of the grayscale bottom image of the rebar. Calculate the average value of the pixel values; The average value is used as the classification threshold.

8. The method for detecting reinforcing bars according to claim 1, characterized in that, After obtaining the set of coordinates of the rebar roots according to the target detection scheme, the method further includes: The actual quantity of reinforcing bars is determined based on the set of coordinates at the base of the reinforcing bars. Calculate the actual coordinate set of the rebar root based on the rebar root coordinate set and the transformation coefficient, and calculate the actual rebar spacing and actual rebar diameter based on the actual rebar root coordinate set; The quality of the reinforcing bars is assessed based on their actual quantity, actual spacing, and actual diameter.

9. The method for detecting reinforcing bars according to claim 8, characterized in that, The process of inputting the image to be detected into the target detection model also yields the bounding box coordinate information of the pier top structure; The calculation process of the conversion coefficient includes: The coordinate information of the four vertices of the pier top structure is determined based on the bounding box coordinate information of the pier top structure; Perform perspective transformation on the coordinate information of the vertices; The number of pixels representing the width of the pier top structure is obtained based on the coordinate information of the vertices after perspective transformation. The conversion coefficient between pixels and actual dimensions is obtained based on the number of pixels and the actual width of the bridge pier.

10. A steel bar testing device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Bridge engineering construction quality detection method and system

    CN119722683A

  • Flaw detection method and flaw detection device

    JP2017072435A