Automatic detection method for inner diameter and cross rib height of steel bar
By automatically detecting the inner diameter and transverse rib height of steel bars using image processing technology, the problem of low efficiency in existing technologies is solved, achieving efficient and accurate detection results and improving detection efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CENT SOUTH UNIV
- Filing Date
- 2026-01-19
- Publication Date
- 2026-04-21
AI Technical Summary
Existing methods for detecting the inner diameter and transverse rib height of reinforcing bars are inefficient and cannot be automatically measured efficiently. Furthermore, existing devices cannot simultaneously achieve accurate detection of both the inner diameter and transverse rib height.
Image processing technology is used to capture images of the steel bar surface, preprocess them, rotate them to the horizontal direction, extract the inner diameter and transverse rib contour images and measure them, and combine grayscale and binarization processing and edge detection to calculate the inner diameter and transverse rib height.
It has achieved highly efficient automatic detection of the inner diameter and transverse rib height of steel bars, increasing detection efficiency by 20 times and accuracy to 0.8%, freeing workers from manual labor and improving work efficiency.
Smart Images

Figure CN121540071B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of automatic detection technology, specifically relating to an automatic detection method for the inner diameter and transverse rib height of reinforcing bars. Background Technology
[0002] Steel bars are a type of metallic material widely used in construction engineering. They are mainly made of carbon steel and low alloy steel, and have high strength and high toughness. They are the main load-bearing material in concrete structures.
[0003] The binding force between the reinforcing steel and concrete depends primarily on the inner diameter and the height of the transverse ribs. Therefore, these dimensions must be strictly measured when the reinforcing steel leaves the factory. Currently, the most common measurement method is using vernier calipers, but this method suffers from low inspection efficiency. According to field measurements, measuring a single reinforcing steel bar with vernier calipers often takes about 20 seconds.
[0004] Currently, there are no mature technologies for detecting the inner diameter and transverse rib height of reinforcing bars. Patent document CN202010210214.7 discloses a transverse rib height measuring device for seismic-resistant HRB500E reinforcing bars. This device mainly uses a laser rangefinder to automatically measure the transverse rib height. However, its shortcomings include the inability to detect the inner diameter of the reinforcing bars, and the time required to locate the deepest point using the laser rangefinder. Patent document CN201510269881 discloses a method for measuring the inner diameter of reinforcing bars. While this method achieves inner diameter detection, the steps are cumbersome, requiring sample cutting before caliper measurement, thus not improving detection efficiency. Patent document CN202110787272 discloses a method and system for measuring the maximum gap at the ends of transverse ribs of reinforcing bars based on image processing. This method mainly achieves the measurement of the gap at the ends of transverse ribs, and also the measurement of transverse rib height.
[0005] In summary, existing detection technologies cannot efficiently complete the automatic measurement of the inner diameter and transverse rib height of steel bars. In order to improve work efficiency and liberate workers from tedious physical labor, it is urgent to develop an automatic detection method for the inner diameter and transverse rib height of steel bars. Summary of the Invention
[0006] The purpose of this invention is to provide an automatic detection method for the inner diameter and transverse rib height of reinforcing bars, so as to solve the problem that existing detection technologies mentioned in the background art cannot efficiently complete the automatic measurement of the inner diameter and transverse rib height of reinforcing bars.
[0007] To achieve the above objectives, the present invention provides an automatic detection method for the inner diameter and transverse rib height of reinforcing bars, comprising the following steps:
[0008] S1. Take an image of the steel reinforcement surface;
[0009] S2. Preprocess the surface image;
[0010] S3. Rotate the reinforcing bar to a horizontal position;
[0011] S4. Extract the inner diameter and transverse rib contour images of the reinforcing bars;
[0012] S5. Using the extracted inner diameter and transverse rib outline diagram of the steel bar, measure the inner diameter and transverse rib height;
[0013] S6. Output the results.
[0014] In one specific implementation, step S2 is as follows:
[0015] S21. Perform grayscale and binarization processing on the image;
[0016] S22. After binary processing, edge detection is performed on the image, and edge contours are extracted.
[0017] In one specific implementation, in step S21, the image is processed for grayscale and binarization using the cvtColor and threshold functions.
[0018] In one specific implementation, in step S22, edge detection of the image is performed using the Canny function.
[0019] In one specific implementation, step S3 is as follows:
[0020] S31. Eliminate contours with a length less than k pixels, where k is the number of pixels in the x-direction of the image;
[0021] S32. Extract the leftmost and rightmost points of the upper contour, i.e., the points with x-coordinates of 0 and k, denoted as S. z (0, y1), S y (k, y2);
[0022] S33. Calculate the rotation angle α using the following formula:
[0023] ;
[0024] When α is positive, then S z Using point S as the center, rotate the image counterclockwise by α degrees; when α is negative, rotate S... z Rotate the image clockwise around the point that is the center.
[0025] In one specific implementation, step S4 is as follows:
[0026] S41. Extract the coordinates of the i-th point and the (i+1)-th point of the upper contour, denoted as S. i (x) i y i ) and Si+1 (x i+1 , y i+1 );
[0027] S42. Calculate the horizontal angle β between the i-th point and the (i + 1)-th point. The formula is as follows:
[0028] ;
[0029] S43. When the horizontal angle β ≠ 0, eliminate the i-th point and the (i + 1)-th point; when the horizontal angle β = 0, keep the i-th point and the (i + 1)-th point unchanged.
[0030] S44. Calculate each point of the lower contour according to the steps of S41, S42, and S43.
[0031] In a specific implementation, step S5 is specifically as follows:
[0032] S51. Calibrate the image pixels. The formula is as follows:
[0033] ;
[0034] In the formula: Q is the physical size of each pixel, and l g is the total length of the steel bars;
[0035] S52. Perform contour detection on the image again after step S4;
[0036] S53. Extract the ordinate of the first point of each contour. For the contours with the ordinate less than W / 2, label them as the first contour, the second contour,..., the n-th contour from left to right; n is the total number of contours with the ordinate less than W / 2; W is the number of pixels in the y direction of the image;
[0037] S54. Extract the midpoint coordinates of the first contour, denoted as L1(x L1 , y L1 ), and in the remaining contours, find the point with the same abscissa as x L1 , denoted as L2(x L1 , y L2 );
[0038] S55. Calculate the distance between two points. The formula is as follows:
[0039] ;
[0040] S56. Repeat in turn until the midpoint spacing of the n-th contour is calculated, denoted as D n ;
[0041] S57. Compare the magnitudes of D1 and D2. When D1 < D2, take D1, D3, D...v They are grouped into the inner diameter group, and the number of elements in the inner diameter group is denoted as N1. Then, D2, D4, D6, ..., D... w They are grouped into the horizontal rib group, and the number of elements in the horizontal rib group is H1.
[0042] When D1 > D2, then D1, D3, D5, ..., D v They are grouped into horizontal ribs, with the number of elements in the horizontal rib group denoted as H2. Then, elements D2, D4, D6, ..., D... w They are grouped into the inner diameter group, and the number of elements in the inner diameter group is denoted as N2; v is the largest odd number in the range [0, n], and w is the largest even number in the range [0, n].
[0043] S58. Calculate the inner diameter d of the reinforcing bar. 内径 With the height h of the transverse rib 横肋 The formula is as follows:
[0044] ;
[0045] .
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] 1. This invention can efficiently detect the inner diameter and transverse rib height of steel bars, freeing workers from tedious physical labor and improving work efficiency.
[0048] 2. Manual inspection often takes 20 seconds per specimen, while the inspection method of this invention only takes 1 second per specimen, improving the inspection efficiency by more than 20 times.
[0049] 3. The accuracy of the detection results of the inner diameter of the reinforcing bar and the height of the transverse ribs is significantly improved. Compared with manual detection, the maximum measurement error of this invention is only 0.8%.
[0050] 4. This invention has high practicality, is easy for enterprises to transform, and is conducive to in-depth cooperation between industry, academia and research.
[0051] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The present invention will now be described in further detail. Attached Figure Description
[0052] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0053] Figure 1 This is a flowchart of a detection method according to an embodiment of the present invention;
[0054] Figure 2This is a comparative schematic diagram of rebar contour extraction according to an embodiment of the present invention, wherein (a) is a photographed image of the rebar surface, and (b) is a rebar contour image extracted from the photographed rebar surface image.
[0055] Figure 3 This is a schematic diagram of image rotation according to an embodiment of the present invention;
[0056] Figure 4 This is a schematic diagram illustrating the calculation of the midpoint spacing of the contour according to an embodiment of the present invention;
[0057] Among them, S z (0, y1) are the coordinates of the leftmost point of the upper contour, S y (k, y2) are the coordinates of the rightmost point of the upper contour; L1(x L1 y L1 L2(x) represents the coordinates of the midpoint of the first contour. L1 y L2 D1 is the midpoint coordinate of the other contour on the same horizontal coordinate as the midpoint coordinate of the first contour, and D1 is the distance between the upper and lower contours at the midpoint of the first contour. Detailed Implementation
[0058] The embodiments of the present invention will be described in detail below. The specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.
[0059] Example 1
[0060] See Figure 1 The present invention provides an automatic detection method for the inner diameter and transverse rib height of reinforcing bars, comprising the following steps:
[0061] S1. Take an image of the steel reinforcement surface;
[0062] S2. Preprocess the surface image;
[0063] S3. Rotate the reinforcing bar to a horizontal position;
[0064] S4. Extract the inner diameter and transverse rib contour images of the reinforcing bars;
[0065] S5. Using the extracted inner diameter and transverse rib outline diagram of the steel bar, measure the inner diameter and transverse rib height;
[0066] S6. Output the results.
[0067] Furthermore, the specific steps of S2 are as follows:
[0068] S21. Use the cvtColor and threshold functions to perform grayscale and binarization processing on the image, where the threshold for binarization is set to 50.
[0069] S22. After binary processing, the Canny function is used to perform edge detection on the image and extract the edge contours. A schematic diagram of rebar contour extraction is shown below. Figure 2 As shown.
[0070] Furthermore, the specific steps of S3 are as follows:
[0071] S31. Eliminate outlines with a length of less than 1080 pixels;
[0072] S32. Extract the leftmost and rightmost points of the upper contour, i.e., the points with x-coordinates of 0 and 1080, denoted as S. z (0, 50), S y (1080, 75);
[0073] S33. Calculate the rotation angle α as follows:
[0074] ;
[0075] Based on the above results, with S z Using the point as the center, rotate the image counterclockwise by 1.33°. A diagram illustrating the image rotation is shown below. Figure 3 As shown.
[0076] Furthermore, the specific steps of S4 are as follows:
[0077] S41. Extract the coordinates of the second and third points of the upper contour, and denote them as S2(2,50) and S3(3,50);
[0078] S42. Calculate the horizontal angle β between the second and third points, as follows:
[0079] ;
[0080] S43. Calculation shows that the horizontal angle β = 0, so the second and third points remain unchanged. It should be noted that when the horizontal angle β ≠ 0, the second and third points are eliminated.
[0081] S44. Following the steps of S41, S42, and S43, calculate each point of the lower contour.
[0082] Furthermore, step S5 is as follows:
[0083] S51. The image pixels are calibrated using the following formula:
[0084] ;
[0085] In the formula: Q is the physical size of each pixel, and lg is the total length of the steel bar, which is 90mm.
[0086] S52. Perform contour detection on the image again after step S4;
[0087] S53. Extract the ordinate of the first point of each contour, and mark the contours with ordinates less than 325 from left to right as the first contour, the second contour,..., the nth contour. Here, n is the total number of contours with ordinates less than 325.
[0088] S54. Extract the midpoint coordinates of the first contour, denoted as L1(8, 50). Among the remaining contours, find the points with the same abscissa of 8 and mark them as L2(8, 470);
[0089] S55. Calculate the distance between the two points, as Figure 4 shown. The formula is as follows:
[0090] ;
[0091] S56. Repeat the process until the midpoint spacing of the nth contour is calculated, denoted as D n .
[0092] S57. Compare the magnitudes of D1 and D2, where D1 is 35 mm and D2 is 39.96 mm. At this time, D1 < D2. Therefore, classify D1, D3, D5,..., D 11 into the inner diameter group, and denote the number of elements in the inner diameter group as 6. Classify D2, D4, D6,..., D 10 into the transverse rib group, and the number of elements in the transverse rib group is 5 at this time;
[0093] S58. Calculate the inner diameter d 内径 of the steel bar and the transverse rib height h 横肋 , and the formula is as follows:
[0094] ;
[0095] .
[0096] The steel bar measured in this embodiment is a steel bar with a length of 100 mm and a nominal diameter of 32 mm. First, use an industrial camera to capture the surface image of the steel bar, then perform grayscale processing and binary processing on the image. After binary processing, extract the contours of the image and delete the contours with lengths less than 1080 pixel points. Then, rotate the image to horizontal and detect the horizontal angles between adjacent points of the upper and lower contours one by one. When the horizontal angle is equal to 0, the above two points remain unchanged. When the horizontal angle is not equal to 0, the above two points are eliminated. Finally, calibrate the image pixels, extract the contours of the image again, and calculate the intermediate spacing between different contours. According to the intermediate spacing of different contours, obtain the inner diameter and transverse rib height of the steel bar. After calculation, the inner diameter of the steel bar is 32.12 mm and the transverse rib height is 2.46 mm.
[0097] To verify the accuracy of this testing method, the inner diameter and transverse rib height of the reinforcing bar were measured using vernier calipers, yielding results of 32.25 mm and 2.48 mm, respectively. The maximum measurement error of this method was found to be only 0.8%. Therefore, the testing method proposed in this invention exhibits good accuracy.
[0098] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions and substitutions can be made without departing from the inventive concept, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A method for automatically detecting the inner diameter of a reinforcing bar and the height of a transverse rib, characterized by, Includes the following steps: S1. Take an image of the steel reinforcement surface; S2. Preprocess the surface image; S3. Rotate the reinforcing bar to a horizontal position; S4. Extract the inner diameter and transverse rib contour images of the reinforcing bars, specifically: S41, extract the coordinates of the i-th point and the i+1-th point on the contour, denoted as S i (x i , y i ) and S i+1 (x i+1 , y i+1 ); S42. Calculate the horizontal angle β between the i-th point and the (i+1)-th point, using the following formula: ; S43. When the horizontal angle β≠0, the i-th point and the (i+1)-th point are eliminated; when the horizontal angle β=0, the i-th point and the (i+1)-th point remain unchanged. S44. Following the steps of S41, S42, and S43, calculate each point of the lower contour; S5. Using the extracted inner diameter and transverse rib outline diagram of the steel bar, measure the inner diameter and transverse rib height; S6. Output the results.
2. The automatic detection method of the reinforcing bar inner diameter and cross rib height according to claim 1, characterized in that, Step S2 is as follows: S21. Perform grayscale and binarization processing on the image; S22. After binary processing, edge detection is performed on the image, and edge contours are extracted.
3. The automatic detection method of the reinforcing bar inner diameter and cross rib height according to claim 2, characterized in that, In step S21, the image is processed by grayscale and binarization using the cvtColor and threshold functions.
4. The automatic detection method of the steel bar inner diameter and cross rib height according to claim 2, characterized in that, In step S22, the Canny function is used to perform edge detection on the image.
5. The method of claim 1, wherein the step of automatically detecting the inner diameter and the height of the cross rib of the reinforcing bar is characterized by, Step S3 is as follows: S31. Eliminate contours with a length less than k pixels, where k is the number of pixels in the x-direction of the image; S32, extract the points at the leftmost and rightmost of the contour, i.e. the points with horizontal coordinates 0 and k, and denote them as S z (0, y1), S y (k, y2); S33. Calculate the rotation angle α using the following formula: ; When a is positive, then rotate the image counterclockwise by a degrees about the point S z When a is negative, then rotate the image clockwise by a degrees about the point S z When a is positive, then rotate the image counterclockwise by a degrees about the point S 6. The method of automatic detection of the reinforcement bar internal diameter and cross-rib height according to claim 1, characterized in that, Step S5 is as follows: S51. The image pixels are calibrated using the following formula: ; wherein: Q is the physical size of each pixel, l g is the total length of the steel bar, and k is the number of pixels in the x direction of the image; S52. Perform contour detection again on the image after step S4; S53. Extract the ordinate of the first point of each contour. Mark the contours with ordinates less than W / 2 from left to right as the 1st contour, the 2nd contour, ..., the nth contour; n is the total number of contours with ordinates less than W / 2; W is the number of pixels in the y-direction of the image. S54, extract the midpoint coordinate of the first contour, denoted as L1(x L1 , y L1 ), in the remaining contours, find the point with the same x L1 -coordinate, denoted as L2(x L1 , y L2 ); S55. Calculate the distance between two points using the following formula: ; S56, sequentially reciprocate until the midpoint distance of the nth contour is calculated, denoted as D n ; S57. Compare the magnitudes of D1 and D2. When D1 < D2, group D1, D3, D5, …, D v into the inner diameter group. At this time, the number of elements in the inner diameter group is denoted as N1. Group D2, D4, D6, …, D w into the transverse rib group. At this time, the number of elements in the transverse rib group is H1; When D1 > D2, then D1, D3, D5, ..., D v They are grouped into horizontal ribs, with the number of elements in the horizontal rib group denoted as H2. Then, elements D2, D4, D6, ..., D... w They are grouped into the inner diameter group, and the number of elements in the inner diameter group is denoted as N2; v is the largest odd number in the range [0, n]; w is the largest even number in the range [0, n]. S58, Calculate the steel bar inner diameter d 内径 With the cross rib height h 横肋 The formula is as follows: ; 。
Citation Information
Patent Citations
Reinforcing steel bar inner diameter measuring method
CN105135983A
Device for measuring height of transverse rib of anti-seismic HRB500E steel bar
CN111442727A
Method and system for measuring maximum gap of tail ends of transverse ribs of hot-rolled ribbed steel bar based on image processing
CN113375580A