A method and system for measuring the spacing between steel bars based on binocular vision
By employing a binocular vision-based method for measuring rebar spacing, and utilizing multi-angle recognition and 3D reconstruction algorithms, the problem of low rebar detection efficiency is solved, achieving efficient and accurate measurement of rebar spacing and diameter.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CCCC SECOND HARBOR ENGINEERING CO LTD
- Filing Date
- 2022-09-28
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies for steel bar inspection are inefficient and lack precision, and manual inspection often results in false positives and false negatives.
A binocular vision-based method for measuring rebar spacing is adopted. The rebar spacing is calculated by combining multi-angle rebar recognition algorithm and image space intersection recognition and three-dimensional coordinate determination algorithm with image edge line extraction and intersection three-dimensional reconstruction.
It has enabled automated and efficient measurement of rebar spacing and diameter, improving measurement efficiency and accuracy, and reducing the labor intensity of workers.
Smart Images

Figure CN115682970B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of bridge engineering construction technology, specifically relating to a method and system for measuring rebar spacing based on binocular vision. Background Technology
[0002] In construction projects, the selection and binding of reinforcing bars directly affect the construction quality and lifespan of the project. Therefore, it is necessary to inspect the reinforcing bar binding to ensure that it meets the requirements of engineering design and construction specifications. Measuring the spacing and diameter of reinforcing bars is the main task of reinforcing bar inspection. Currently, during construction, reinforcing bar inspection mainly relies on manual measurement. Due to the large number of reinforcing bars in building structures, the inspection efficiency is low, the physical labor intensity is high, and it may lead to errors and omissions in inspection. Summary of the Invention
[0003] To address the issues of low detection efficiency and insufficient accuracy in current rebar inspection processes, this invention proposes a method and system for measuring rebar spacing based on binocular vision. A multi-angle rebar recognition algorithm solves problems related to crisscrossing rebar layouts and image rotation; an image spatial intersection point recognition and spatial three-dimensional coordinate determination algorithm solves the problem of spatially disparate intersections between rebars; and finally, the rebar spacing is determined by calculating the distance between intersection points.
[0004] A method for measuring rebar spacing based on binocular vision to achieve one of the objectives of this invention includes the following steps:
[0005] S1. Obtain multiple images of the tied rebar from different angles and extract the edge lines of each image;
[0006] S2. Obtain the intersection points of the reinforcing bars in each image based on the edge lines of each image;
[0007] S3. Perform 3D reconstruction based on the intersection points of the reinforcing bars in each image to obtain the 3D coordinates of the reinforcing bar intersection points;
[0008] S4. Traverse the three-dimensional coordinates of the intersection points of the reinforcing bars to obtain the spacing of the reinforcing bars.
[0009] Further, step S2 includes extracting the intersection points of the edge lines in each image and the corner points of each image based on the edge lines of each image. The intersection points of the edge lines and the corner points of each image form the edge intersection point set of each image. The edge intersection point set of each image is used to obtain the intersection points of the reinforcing bars in each image.
[0010] Furthermore, methods for obtaining the intersection points of reinforcing bars in each image based on the set of edge intersection points include:
[0011] Iterate through the edge intersection point set of each image to obtain the nearest neighbor points N1 and N2 of the selected pixel coordinate point in the edge intersection point set that are less than or equal to a first set distance. When N1 is greater than or equal to a set number or N2 is greater than or equal to a set number, then the point is the intersection point of the steel bars in the image.
[0012] Step S3 further includes traversing each point in the edge intersection point set of each image to obtain the matching point of each pixel coordinate point in other images. Each pixel coordinate point and its matching point are used to perform three-dimensional reconstruction of each steel bar intersection.
[0013] Furthermore, it also includes calculating the similarity between two pixel coordinates based on the feature descriptor of each pixel coordinate in the set of edge intersections in each image.
[0014] The similarity calculation method includes:
[0015]
[0016] In the formula:
[0017] L_i,j represents the similarity between pixel i in one image and pixel j in another image;
[0018] i_L1, i_L2, and i_L3 represent the sets S of steel bar intersections in an image. image_L_cor The selected pixel i and the set S image_L_cor The distance values of the other three selected pixels L1, L2 and L3;
[0019] j_R1, j_R2, j_R3 are sets S representing the intersection points of steel bars from another image. image_R_cor The selected pixel j and the set S image_R_cor The distance values of the other three selected pixels R1, R2 and R3;
[0020] θ_L1, θ_L2, and θ_L3 represent the angles between the three selected pixels L1, L2, and L3 and pixel i, respectively.
[0021] θ_R1, θ_R2, and θ_R3 represent the angles between the three selected pixels R1, R2, and R3 and pixel j, respectively.
[0022] i_Lpiexl is the pixel value of the selected pixel point i;
[0023] j_Rpiexl is the pixel value of the selected pixel j.
[0024] Furthermore, the point with the highest similarity to the feature descriptor of point i is selected as the matching point of point i.
[0025] The second objective of this invention is a binocular vision-based rebar spacing measurement system, which includes an edge line extraction module, a rebar intersection extraction module, a rebar intersection three-dimensional coordinate acquisition module, and a rebar spacing calculation module.
[0026] The edge line extraction module is used to acquire multiple images of the tied rebar from different angles and extract the edge lines of each image;
[0027] The rebar intersection extraction module is used to obtain the rebar intersection points in each image based on the edge lines of each image;
[0028] The three-dimensional coordinate acquisition module for rebar intersections is used to perform three-dimensional reconstruction based on the rebar intersections in each image to obtain the three-dimensional coordinates of the rebar intersections.
[0029] The rebar spacing calculation module is used to traverse the three-dimensional coordinates of the rebar intersections to obtain the rebar spacing.
[0030] Furthermore, the three-dimensional coordinate acquisition module for the rebar intersection also includes a similarity calculation module, which is used to calculate the similarity between two pixel coordinate points based on the feature descriptor of each pixel coordinate point in the set of edge intersection points in each image.
[0031] Furthermore, the rebar spacing calculation module also includes a rebar diameter calculation module for calculating the diameter of each rebar, the calculation method of which includes:
[0032] S901. Calculate the angle θ_th1 to θ_thn between the vector formed by the intersection point i_th of the steel bars and multiple nearest neighbor points i_th1 to i_thn and the Z-axis respectively.
[0033] S902. Calculate the diameter d of the stirrup at the intersection point i_th and / or the diameter D of the ribbed steel bar at the intersection point i_th based on θ_th 1 to θ_th n, the first set angle to the nth set angle.
[0034] Taking a stereo camera as an example, the Z-axis is defined as follows: the optical center of the left camera of the stereo camera is the origin 0, the optical axis of the left camera is the X-axis, the line connecting the optical centers of the left and right cameras is the Y-axis, and the vector passing through the origin 0 and perpendicular to the XOY plane is the Z-axis.
[0035] Furthermore, when the number of nearest neighbors is 2, the methods for calculating the diameter d of the stirrup at the intersection point i_th and / or the diameter D of the ribbed steel bar at the intersection point i_th include:
[0036] Step 1: Traverse the three-dimensional coordinates of the rebar intersections and search for the two nearest neighbors i_th1 and i_th2 of each rebar intersection i_th.
[0037] Step 2: Calculate the angle θ_th 1 between the vector formed by i_th and i_th1 and the Z-axis; calculate the angle θ_th 2 between the vector formed by i_th and i_th2 and the Z-axis.
[0038] Step 3: When θ_th 1 is greater than θ1 and θ_th 2 is less than θ1, the diameter d of the stirrup at the intersection of the steel bars i_th is a set multiple a of the distance between i_th and i_th2, and the diameter D of the ribbed steel bar at the intersection of the steel bars i_th is the distance between i_th and i_th1.
[0039] When θ_th 1 is less than θ1 and θ_th 2 is greater than θ1, the diameter d of the stirrup at the intersection of the reinforcing bars i_th is a set multiple a of the distance between i_th and i_th1, and the diameter D of the ribbed reinforcing bar at the intersection of the reinforcing bars i_th is the distance between i_th and i_th2.
[0040] Furthermore, the method for calculating the rebar spacing in the rebar spacing calculation module includes:
[0041] S1001, Obtain the spacing between the edge lines of the reinforcing bars;
[0042] S1002. Calculate the spacing of the reinforcing bars based on the distance between the edge lines of the reinforcing bars and the diameter of the reinforcing bars.
[0043] Furthermore, in step S1001, the method for obtaining the spacing between the edge lines of the reinforcing bars includes:
[0044] Step 1.1: Construct a plane VOZ using the optical axis V and Z axis of the binocular camera. Project the three-dimensional coordinates of the steel bar intersection points onto the plane VOZ to construct a point set Q. The Z axis is defined as follows: the origin O is the optical center of the left camera of the binocular camera, the X axis is the optical axis of the left camera, the Y axis is the line connecting the optical centers of the left and right cameras of the binocular camera, and the Z axis is the vector passing through the origin O and perpendicular to the XOY plane.
[0045] Step 1.2: Traverse the point set Q, randomly select multiple nearest neighbors of point i in the point set Q, and point i and its multiple nearest neighbors together form a point cloud block cloud_Qi. Record the index of cloud_i in the point cloud set R. Points in cloud_Qi no longer participate in the traversal of Q.
[0046] Step 1.3: Based on the index of cloud_Qi in the point cloud set R, establish the corresponding point of cloud_i in the point cloud set R, and form the cloud_i point cloud data block;
[0047] Step 1.4: Calculate the two points in cloud_i with the largest coordinates on the Z-axis, imax_Z1 and imax_Z2. Set imax_Z1 to be larger on the V-axis and imax_Z2 to be smaller on the V-axis.
[0048] Step 1.5: Calculate the two points imin_V1 and imin_V2 with the smallest coordinates of cloud_i on the V-axis, and determine the size of points imin_V1 and imin_V2 on the V-axis. Set imin_V1 to be larger on the V-axis and imin_V2 to be smaller on the V-axis.
[0049] Step 1.6: Calculate the spacing between the edges of the ribbed steel bars, S_car, and the spacing between the edges of the stirrups, S_sti;
[0050] Delete the point cloud block cloud_i in the point set Q, search for the two nearest neighbors of the point imax_Z1 in the point set cloud_i along the positive Z-axis and positive Y-axis, establish the vectors of imax_Z1 and the two nearest neighbors, and calculate the angles between the two vectors and the Z-axis and Y-axis.
[0051] When the angle between the vector and the Z-axis is less than 45° and the angle with the Y-axis is greater than 45°, the length of the vector is the spacing S_sti between the edges of the stirrups where point i is located.
[0052] When the angle between the vector and the Z-axis is greater than 45° and the angle with the V-axis is less than 45°, the length of the vector is the spacing S_car between the edges of the ribbed steel bars where point i is located.
[0053] Delete the points contained in the point cloud block cloud_i in the point set Q, search for the two nearest neighbors of the point imax_Z2 in the point set cloud_i along the positive Z-axis and negative Y-axis, establish the vectors of imax_Z1 and the two nearest neighbors, and calculate the angles between the two vectors and the Z-axis and Y-axis.
[0054] When the angle between the vector and the Z-axis is less than 45° and the angle with the Y-axis is greater than 45°, the length of the vector is the spacing S_sti between the edges of the stirrups where point i is located.
[0055] When the angle between the vector and the Z-axis is greater than 45° and the angle with the Y-axis is less than 45°, the length of the vector is the spacing S_car between the edges of the ribbed steel bars where point i is located.
[0056] Delete the point cloud block cloud_i in the point set Q, search for the two nearest neighbors of point imin_Y1 in the point set cloud_i along the negative Z-axis and positive Y-axis, establish the vectors of imin_Y1 and the two nearest neighbors, and calculate the angles between the two vectors and the Z-axis and Y-axis.
[0057] When the angle between the vector and the Z-axis is less than 45° and the angle with the Y-axis is greater than 45°, the length of the vector is the spacing S_sti between the edges of the stirrups where point i is located.
[0058] When the angle between the vector and the Z-axis is greater than 45° and the angle with the Y-axis is less than 45°, the length of the vector is the spacing S_car between the edges of the ribbed steel bars where point i is located.
[0059] Delete the point cloud block cloud_i in the point set Q, search for the two nearest neighbors of point imin_Y2 in the point set cloud_i along the negative Z-axis and negative Y-axis, establish the vectors of imin_Y2 and the two nearest neighbors, and calculate the angles between the two vectors and the Z-axis and Y-axis.
[0060] When the angle between the vector and the Z-axis is less than 45° and the angle with the Y-axis is greater than 45°, the length of the vector is the spacing S_sti between the edges of the stirrups where point i is located.
[0061] When the angle between the vector and the Z-axis is greater than 45° and the angle with the Y-axis is less than 45°, the length of the vector is the spacing S_car between the edges of the ribbed steel bars where point i is located.
[0062] Return to step 1.2, and continue to select a point from the point set Q. Calculate the spacing between the stirrup edges S_sti and the spacing between the ribbed steel bars S_car at the point, until the point set Q is empty.
[0063] Beneficial effects:
[0064] By applying digital image processing and machine vision measurement technology to the measurement technology of rebar spacing, the problems of large workload, low efficiency, and easy misdetection and missed detection that exist in manual measurement using steel rulers are effectively reduced.
[0065] Unlike simple image-based rebar identification and extraction, this invention extracts the spatial three-dimensional coordinates of the intersection points of the tied rebars, solving the problem that image technology cannot distinguish the spatial skewness of the intersection points of tied rebars and requires placing a ruler on the surface of the rebar to be measured. This technology is simple to use, highly accurate, fast, and widely applicable.
[0066] This invention enables automated and efficient measurement of the spacing and diameter of reinforcing bars, improving the efficiency and accuracy of reinforcing bar measurement and reducing the labor intensity of workers. Attached Figure Description
[0067] Figure 1 This is an embodiment of the method described in this invention;
[0068] Figure 2 This is a binocular camera system, an embodiment of the method described in this invention;
[0069] Figure 3 This is a schematic diagram of the image edge lines in an embodiment of the method described in this invention;
[0070] Figure 4 This is a schematic diagram of obtaining the diameter of the reinforcing bar in an embodiment of the method described in this invention. Detailed Implementation
[0071] The following detailed embodiments are provided to explain the technical solutions of the claims of this invention, so that those skilled in the art can understand the claims. The scope of protection of this invention is not limited to the following specific embodiments. Any modifications made by those skilled in the art that incorporate the technical solutions of the claims but differ from the following detailed embodiments are also within the scope of protection of this invention.
[0072] In the description of this invention, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0073] The following is combined Figures 1-3 An embodiment of the method described in this invention is presented.
[0074] S1. Obtain multiple images of the tied rebar from different angles and extract the edge lines of each image;
[0075] In this embodiment, two images of the tied rebar are obtained from two different angles, one on the left and one on the right, using the following method:
[0076] Step 1, as follows Figure 2 As shown, a binocular camera system is assembled, which includes a binocular camera bracket, two industrial cameras, and a computer. The industrial cameras are mounted on the industrial camera bracket, and the optical axes of the two industrial cameras are installed in parallel. The computer and the binocular cameras are connected via a network. In this embodiment, the two industrial cameras are used to capture two images of the left and right angles of the rebar being tied.
[0077] Step 2: Acquire two images of the tied rebar using a binocular camera system. The image acquired by the left binocular camera is denoted as image_L, and the image acquired by the right binocular camera is denoted as image_R.
[0078] Preferably, after obtaining images image_L and image_R, the method further includes preprocessing images image_L and image_R; the preprocessing method includes grayscale processing, image blur restoration processing, and image noise reduction processing.
[0079] The specific implementation method of preprocessing is as follows:
[0080] Step 1: Convert images image_L and image_R to grayscale to obtain the grayscale images image_L_gray and image_R_gray respectively;
[0081] The formula for grayscale processing in this embodiment is as follows (1), but it is not limited to this;
[0082] Gray = R*0.3 + G*0.59 + B*0.11 Equation (1)
[0083] Step 2: Perform image blur restoration on the grayscale images image_L_gray and image_R_gray to obtain the restored images image_L_re and image_R_re respectively; the image blur restoration method used in this embodiment is Wiener filtering restoration technology, but it is not limited to this.
[0084] Step 3: Perform denoising on the images image_L_re and image_R_re after image blur restoration to obtain the denoised images image_L_dn and image_R_dn respectively. In this embodiment, the denoising method used is to calculate the average value p'(u,v) of the pixel values in the surrounding 5*5 area at any pixel p(u,v) in the image, and let p(u,v) = p'(u,v), but it is not limited to this.
[0085] The following describes an example of extracting edge lines from each image, using the following method:
[0086] Step 1: Binarize the denoised images image_L_dn and image_R_dn to obtain the binarized images image_L_bn and image_R_bn, respectively.
[0087] Step 2: Perform edge extraction on the binarized images image_L_bn and image_R_bn to obtain the images after edge extraction; in this embodiment, the Sobel operator is used to perform edge extraction on the images image_L_bn and image_R_bn.
[0088] Step 3: Perform line detection on the image after edge extraction, extracting the edge lines that are straight lines, and obtain images image_L_ed and image_R_ed containing only straight line edges. The edge lines are as follows: Figure 3 As shown, in this embodiment, the Hough transform is used to perform line detection on the image after edge extraction.
[0089] S2. Obtain the intersection points of the reinforcing bars in each image based on the edge lines of each image; specifically including the following steps:
[0090] Step 1: Extract the set of edge intersection points from the images image_L_ed and image_R_ed, which contain only straight-line edges. The extraction method includes the following steps:
[0091] Step 1.1: Extract the set S of pixel coordinates of all intersection points of edge lines in images image_L_ed and image_R_ed respectively. L,交点 S R,交点 ;
[0092] This embodiment uses the line intersection method to obtain the set of edge intersection points. The principle is as follows: Assume that the definitions of lines L1 and L2 are:
[0093]
[0094]
[0095] In the formula:
[0096] (u1 v1) and (u2 v2) are two points selected on line L1;
[0097] (u3 v3) and (u4 v4) are two points selected on line L2;
[0098] t and s are both set real numbers, and their calculation methods are as follows:
[0099]
[0100]
[0101] When 0 ≤ t ≤ 1 and when 0 ≤ s ≤ 1, the intersection point p(u) is obtained. k v k The pixel coordinates of ) are:
[0102] (u1+t(u2-u1), v1+t(v2-v1))
[0103] Based on the above principle, the set S of pixel coordinates of all intersection points of edge lines is obtained. L,交点 S R,交点 ;
[0104] Step 1.2: Obtain the set S of pixel coordinates of all corner points of the images image_L_ed and image_R_ed. L,交点 S R,角点 This embodiment uses the Harris corner detection algorithm to obtain the pixel coordinates of the corner points of the image, but is not limited to this method.
[0105] Step 1.3, Set S L,交点 and set SL,角点 The intersection of these points is the set of edge intersection points of the image image_L_ed to be obtained, denoted as S. image_L_cor Set S R,交点 and set S R,角点 The intersection of these points is the set of edge intersection points of the image image_R_ed to be obtained, denoted as S. image_R_cor .
[0106] Step 2: Extract the intersections of the reinforcing bars. The extraction method includes the following steps:
[0107] Step 2.1: Traverse the set of edge intersection points S image_L_cor For each pixel coordinate point in the search, search the set S of edge intersection points. image_L_cor The number of nearest neighbors N1 that is less than or equal to a first preset distance and the number of nearest neighbors N2 that is less than or equal to a second preset distance are respectively defined as the distance between the selected pixel coordinate point i and the selected pixel coordinate point i. In this embodiment, the first preset distance is... The second set distance is 2*S in this embodiment. i,i’ ;where S i,i’ is the pixel distance between pixel coordinate point i and its nearest neighbor i';
[0108] Traverse the set of edge intersections S image_R_cor For each pixel coordinate point in the search, search the set S of edge intersection points. image_R_cor The distances between the selected pixel coordinate point j and the nearest neighbor number N3 are less than or equal to a first preset distance, and the distances between the nearest neighbor number N4 are less than or equal to a second preset distance. In this embodiment, the first preset distance is... The second set distance is 2*S in this embodiment. j,j’ ;where S j,j’ is the pixel distance between pixel coordinate point j and its nearest neighbor j';
[0109] Step 2.2: If either of the two search distances N1 and N2 exceeds a set quantity, then save point i; if either of the two search distances N3 and N4 exceeds a set quantity, then save point j, forming the set S of intersection points of the reinforcing bars. image_L_st_cor S image_R_st_cor In this embodiment, the set quantity is 6, but it is not limited to this.
[0110] S3. Perform 3D reconstruction on the intersection points of the steel bars in each image to obtain the 3D coordinates of the steel bar intersection points;
[0111] Before performing 3D reconstruction of the steel bar intersections in each image, it is necessary to obtain set S. image_L_st_cor Each pixel in set S and its position in set S image_R_st_cor The matching point in the data is determined as follows:
[0112] Step 1: Traverse set S image_R_st_cor S image_R_st_cor For each pixel in the set, we get set S. image_L_st_cor S image_R_st_cor The feature descriptor F for each pixel image_L i and F image_R j The expression is as follows:
[0113] F image_L i =[i_L1, i_L2, i_L3, θ_L1, θ_L2, θ_L3, i_Lpiexl]
[0114] F image_R j =[j_R1, j_R2, j_R3, θ_R1, θ_R2, θ_R3, j_Rpiexl]
[0115] In the formula:
[0116] F image_L i Indicates from set S image_L_st_cor The feature descriptor of the selected pixel i;
[0117] F image_R j Indicates from set S image_R_st_cor The feature descriptor of the selected pixel j;
[0118] i_L1, i_L2, i_L3 are from set S image_L_st_cor The distance values between the three selected pixels L1, L2, and L3 and the selected pixel i;
[0119] j_R1, j_R2, j_R3 are from set S image_R_st_cor The distance values between the three selected pixels R1, R2, and R3 and the selected pixel j;
[0120] θ_L1, θ_L2, θ_L3 are the angles between the three selected pixels L1, L2, and L3 and the selected pixel i.
[0121] θ_R1, θ_R2, θ_R3 are the angles between the three selected pixels R1, R2, and R3 and the selected pixel j.
[0122] i_Lpiexl is the pixel value of the selected pixel point i;
[0123] j_Rpiexl is the pixel value of the selected pixel j;
[0124] Preferably, in this embodiment, the method for selecting the three pixels L1, L2, and L3 is as follows:
[0125] Get set S image_L_st_corThe 16 nearest neighbors of the selected pixel i are sorted in ascending order of distance, and the 4th, 8th and 13th points in the sort are selected as the three pixels L1, L2 and L3.
[0126] The selection method for pixels R1, R2, and R3 is the same as that for pixels L1, L2, and L3, and will not be repeated here.
[0127] Step 2: Traverse set S image_L_st_cor For each pixel, calculate its relationship with S based on the feature descriptor of each pixel. image_R_st_cor The similarity of feature descriptors for all points is calculated, and the similarity between two points is calculated using the following formula:
[0128]
[0129] In the formula:
[0130] L_i,j denotes the set S image_L_st_cor The selected point i and S image_R_st_cor The similarity of feature descriptors of selected point j;
[0131] Other parameters are taken from the feature descriptor F described in step 1. image_L i and F image_R j ;
[0132] Step 3, Select S image_R_st_cor Feature descriptors and sets S image_R_st_cor The point with the highest similarity to the feature descriptor of point i is taken as point i in set S. image_R_st_cor The matching point in the set S is the point i corresponding to max(L_i, i′). image_R_st_cor The matching point in S, where i′∈S image_R_st_cor .
[0133] Using the above method, set S is obtained. image_L_st_cor Each pixel in the set S and its position in the set S image_R_st_cor After matching the points, the binocular camera is calibrated, and the camera's intrinsic and extrinsic parameters are obtained. Based on each pixel and its matching point, 3D reconstruction is performed to obtain the 3D coordinates of each steel bar intersection.
[0134] S4. Traverse the three-dimensional coordinates of the intersection points of the reinforcing bars to obtain the spacing of the reinforcing bars.
[0135] Before obtaining the spacing of the reinforcing bars, it is necessary to obtain the diameter of the reinforcing bars; in this embodiment, the method for obtaining the diameter of the reinforcing bars is as follows: Figure 4 As shown, it includes the following steps:
[0136] Step 1: Traverse the three-dimensional coordinates of the rebar intersections and search for the two nearest neighbors i_th1 and i_th2 of each rebar intersection i_th.
[0137] Step 2: Calculate the angle θ_th 1 between the vector formed by i_th and i_th1 and the Z-axis; calculate the angle θ_th 2 between the vector formed by i_th and i_th2 and the Z-axis.
[0138] Step 3: When θ_th 1 is greater than 45° and θ_th 2 is less than 45°, the diameter d of the stirrup at the intersection point i_th is 0.5 times the distance between i_th and i_th2, and the diameter D of the ribbed steel bar at the intersection point i_th is the distance between i_th and i_th1. The above-mentioned multiple of 0.5 needs to be adjusted according to actual needs. In this embodiment, 0.5 times is because stirrups are usually tied in pairs. 45° is the angle set in this embodiment. On the XOZ plane, generally, if it is less than 45°, the vector is considered to be in the X direction, and if it is greater than 45°, the vector is considered to be in the Z direction.
[0139] When θ_th 1 is less than 45° and θ_th 2 is greater than 45°, the diameter d of the stirrup at the intersection of the reinforcing bars i_th is 0.5 times the distance between i_th and i_th1, and the diameter D of the ribbed reinforcing bar at the intersection of the reinforcing bars i_th is the distance between i_th and i_th2.
[0140] The method for obtaining the spacing between reinforcing bars in this embodiment is as follows:
[0141] Step 1: Obtain the spacing between the edge lines of the reinforcing bars.
[0142] The spacing of the reinforcing bar edge lines includes the spacing between the edges of ribbed reinforcing bars, S_car, and the spacing between the edges of stirrups, S_sti; the specific method is as follows:
[0143] Step 1.1, as follows Figure 2 As shown, a plane YOZ is constructed using the camera's optical axis Y and Z axes. The three-dimensional coordinates of the steel bar intersections are projected onto the plane YOZ to construct a point set Q; the optical axis Y is... Figure 2 The X-axis in;
[0144] Step 1.2: Traverse the point set Q, randomly select point i in the point set Q, and obtain the 5 nearest neighbors of point i. Point i and its 5 nearest neighbors together form a point cloud block cloud_Qi. Record the index of cloud_i in the point cloud set R. Points in cloud_Qi no longer participate in the traversal of Q.
[0145] Step 1.3: Based on the index of cloud_Qi in the point cloud set R, establish the corresponding point of cloud_i in the point cloud set R, and form the cloud_i point cloud data block;
[0146] Step 1.4: Calculate the two points in cloud_i with the largest coordinates on the Z-axis, imax_Z1 and imax_Z2. Set imax_Z1 to be larger on the Y-axis and imax_Z2 to be smaller on the Y-axis.
[0147] Step 1.5: Calculate the two points imin_Y1 and imin_Y2 with the smallest Y-axis coordinates of cloud_i, determine the size of points imin_Y1 and imin_Y2 on the Y-axis, and set imin_Y1 to be larger on the Y-axis and imin_Y2 to be smaller on the Y-axis;
[0148] Step 1.6: Calculate the spacing between the edges of the ribbed steel bars, S_car, and the spacing between the edges of the stirrups, S_sti;
[0149] Delete the point cloud block cloud_i in the point set Q, search for the two nearest neighbors of the point imax_Z1 in the point set cloud_i along the positive Z-axis and positive Y-axis, establish the vectors of imax_Z1 and the two nearest neighbors, and calculate the angles between the two vectors and the Z-axis and Y-axis.
[0150] When the angle between the vector and the Z-axis is less than 45° and the angle with the Y-axis is greater than 45°, the length of the vector is the spacing S_sti between the edges of the stirrups where point i is located.
[0151] When the angle between the vector and the Z-axis is greater than 45° and the angle with the Y-axis is less than 45°, the length of the vector is the spacing S_car between the edges of the ribbed steel bars where point i is located.
[0152] Delete the point cloud block cloud_i in the point set Q, search for the two nearest neighbors of the point imax_Z2 in the point set cloud_i along the positive Z-axis and negative Y-axis, establish the vectors of imax_Z1 and the two nearest neighbors, and calculate the angles between the two vectors and the Z-axis and Y-axis.
[0153] When the angle between the vector and the Z-axis is less than 45° and the angle with the Y-axis is greater than 45°, the length of the vector is the spacing S_sti between the edges of the stirrups where point i is located.
[0154] When the angle between the vector and the Z-axis is greater than 45° and the angle with the Y-axis is less than 45°, the length of the vector is the spacing S_car between the edges of the ribbed steel bars where point i is located.
[0155] Delete the point cloud block cloud_i in the point set Q, search for the two nearest neighbors of point imin_Y1 in the point set cloud_i along the negative Z-axis and positive Y-axis, establish the vectors of imin_Y1 and the two nearest neighbors, and calculate the angles between the two vectors and the Z-axis and Y-axis.
[0156] When the angle between the vector and the Z-axis is less than 45° and the angle with the Y-axis is greater than 45°, the length of the vector is the spacing S_sti between the edges of the stirrups where point i is located.
[0157] When the angle between the vector and the Z-axis is greater than 45° and the angle with the Y-axis is less than 45°, the length of the vector is the spacing S_car between the edges of the ribbed steel bars where point i is located.
[0158] Delete the point cloud block cloud_i in the point set Q, search for the two nearest neighbors of point imin_Y2 in the point set cloud_i along the negative Z-axis and negative Y-axis, establish the vectors of imin_Y2 and the two nearest neighbors, and calculate the angles between the two vectors and the Z-axis and Y-axis.
[0159] When the angle between the vector and the Z-axis is less than 45° and the angle with the Y-axis is greater than 45°, the length of the vector is the spacing S_sti between the edges of the stirrups where point i is located.
[0160] When the angle between the vector and the Z-axis is greater than 45° and the angle with the Y-axis is less than 45°, the length of the vector is the spacing S_car between the edges of the ribbed steel bars where point i is located.
[0161] Step 2: Calculate the spacing L_car between the ribbed reinforcing bars at point i and the spacing L_sti between the stirrups at point i, based on the spacing between the edge lines of the reinforcing bars. The calculation formula is as follows:
[0162] L_car = S_car
[0163] L_sti=S_sti+d
[0164] In the formula:
[0165] S_car represents the spacing between the edges of the ribbed steel bars where point i is located;
[0166] S_sti represents the spacing between the edges of the stirrups where point i is located;
[0167] d represents the diameter of the stirrup at point i.
[0168] 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 this application.
[0169] This application embodiment also provides a measurement system for rebar spacing based on binocular vision, including an edge line extraction module, a rebar intersection extraction module, a rebar intersection three-dimensional coordinate acquisition module, and a rebar spacing calculation module;
[0170] The edge line extraction module is used to acquire multiple images of the tied rebar from different angles and extract the edge lines of each image;
[0171] The rebar intersection extraction module is used to obtain the intersection points of rebars in each image based on the edge lines of each image;
[0172] The 3D coordinate acquisition module for rebar intersections is used to perform 3D reconstruction based on the rebar intersections in each image to obtain the 3D coordinates of the rebar intersections.
[0173] The rebar spacing calculation module is used to traverse the three-dimensional coordinates of the rebar intersections to obtain the rebar spacing.
[0174] In another embodiment, the three-dimensional coordinate acquisition module for rebar intersections further includes a similarity calculation module for calculating the similarity between two pixel coordinate points based on the feature descriptor of each pixel coordinate point in the set of edge intersection points in each image.
[0175] In another embodiment, the rebar spacing calculation module further includes a rebar diameter calculation module for calculating the diameter of each rebar, the calculation method of which includes:
[0176] S901. Calculate the angle θ_th1 to θ_thn between the vector formed by the intersection point i_th of the steel bars and multiple nearest neighbor points i_th1 to i_thn and the Z-axis respectively.
[0177] S902. Calculate the diameter d of the stirrup at the intersection point i_th and the diameter D of the ribbed steel bar at the intersection point i_th based on θ_th 1 to θ_th n and the first set angle to the nth set angle.
[0178] In another embodiment, the method for calculating the rebar spacing in the rebar spacing calculation module includes:
[0179] S1001, Obtain the spacing between the edge lines of the reinforcing bars;
[0180] S1002. Calculate the spacing of the reinforcing bars based on the distance between the edge lines of the reinforcing bars and the diameter of the reinforcing bars.
[0181] The contents not described in detail in this specification are existing technologies known to those skilled in the art.
Claims
1. A method for measuring rebar spacing based on binocular vision, characterized in that, It includes the following steps: S1. Obtain multiple images of the tied rebar from different angles and extract the edge lines of each image; S2. Obtain the intersection points of the reinforcing bars in each image based on the edge lines of each image; S3. Perform 3D reconstruction based on the intersection points of the reinforcing bars in each image to obtain the 3D coordinates of the reinforcing bar intersection points; S4. Traverse the three-dimensional coordinates of the intersection points of the reinforcing bars to obtain the spacing of the reinforcing bars; In step S2, the intersection points of the edge lines in each image and the corner points of each image are extracted based on the edge lines of each image. The intersection points of the edge lines and the corner points of each image form the edge intersection point set of each image. The edge intersection point set of each image is used to obtain the intersection points of the reinforcing bars in each image. Methods for obtaining the intersection points of reinforcing bars in each image based on the set of edge intersection points include: Iterate through the edge intersection point set of each image to find the nearest neighbor points N1 and N2 of the selected pixel coordinate point that are less than or equal to a first set distance from the selected pixel coordinate point in the edge intersection point set; when N1 is greater than or equal to a set number or N2 is greater than or equal to a set number, then the point is the intersection point of the steel bars in the image. In step S4, the methods for obtaining the rebar spacing include: Obtain the spacing between the edge lines of the reinforcing bars; The spacing of the reinforcing bars is calculated based on the distance between the edge lines of the reinforcing bars and the diameter of the reinforcing bars. Methods for calculating the diameter of reinforcing bars include: Calculate the angles θ_th1~θ_thn between the vector formed by the intersection point i_th of the steel bars and multiple nearest neighbor points i_th1~i_thn and the Z-axis respectively; Calculate the diameter d of the stirrup at the intersection point i_th and / or the diameter D of the ribbed steel bar at the intersection point i_th based on θ_th1~θ_thn and the first set angle~nth set angle.
2. The method for measuring rebar spacing based on binocular vision as described in claim 1, characterized in that, Step S3 further includes traversing each pixel coordinate point in the edge intersection point set of each image to obtain the matching point of each pixel coordinate point in other images. Each pixel coordinate point and its matching point are used to perform three-dimensional reconstruction of each steel bar intersection.
3. The method for measuring rebar spacing based on binocular vision as described in claim 2, characterized in that, It also includes calculating the similarity between two pixel coordinates based on the feature descriptor of each pixel coordinate in the set of edge intersections in each image.
4. The method for measuring rebar spacing based on binocular vision as described in claim 3, characterized in that, Methods for calculating the similarity between two pixel coordinates include: ; In the formula: L_i,j represents the similarity between pixel i in one image and pixel j in another image; i_L1, i_L2, and i_L3 represent the sets S of steel bar intersections in an image. image_L_cor The selected pixel i and the set S image_L_cor The distance values of the other three selected pixels L1, L2 and L3; j_R1, j_R2, and j_R3 are sets S representing the intersections of steel bars from another image. image_R_cor The selected pixel j and the set S image_R_cor The distance values of the other three selected pixels R1, R2 and R3; θ_L1, θ_L2, and θ_L3 represent the angles between the three selected pixels L1, L2, and L3 and pixel i, respectively. θ_R1, θ_R2, and θ_R3 represent the angles between the three selected pixels R1, R2, and R3 and pixel j, respectively. i_Lpiexl is the pixel value of the selected pixel point i; j_Rpiexl is the pixel value of the selected pixel j.
5. A binocular vision-based rebar spacing measurement system employing the method described in claim 1, characterized in that, It includes an edge line extraction module, a rebar intersection extraction module, a rebar intersection 3D coordinate acquisition module, and a rebar spacing calculation module; The edge line extraction module is used to acquire multiple images of the tied rebar from different angles and extract the edge lines of each image; The rebar intersection extraction module is used to obtain the rebar intersection points in each image based on the edge lines of each image; The three-dimensional coordinate acquisition module for rebar intersections is used to perform three-dimensional reconstruction based on the rebar intersections in each image to obtain the three-dimensional coordinates of the rebar intersections. The rebar spacing calculation module is used to traverse the three-dimensional coordinates of the rebar intersections to obtain the rebar spacing.
6. The rebar spacing measurement system based on binocular vision as described in claim 5, characterized in that, The three-dimensional coordinate acquisition module for the rebar intersection also includes a similarity calculation module, which is used to calculate the similarity between two pixel coordinate points based on the feature descriptor of each pixel coordinate point in the set of edge intersection points in each image.
7. The rebar spacing measurement system based on binocular vision as described in claim 5, characterized in that, The rebar spacing calculation module also includes a rebar diameter calculation module for calculating the diameter of the rebar, the calculation method of which includes: S901. Calculate the angles θ_th1~θ_thn between the vector formed by the intersection point i_th of the steel bars and multiple nearest neighbor points i_th1~i_thn and the Z-axis respectively. S902. Calculate the diameter d of the stirrup at the intersection point i_th and / or the diameter D of the ribbed steel bar at the intersection point i_th based on θ_th1~θ_thn and the first set angle~nth set angle.
8. The rebar spacing measurement system based on binocular vision as described in claim 7, characterized in that, The method for calculating the rebar spacing in the rebar spacing calculation module includes: S1001, Obtain the spacing between the edge lines of the reinforcing bars; S1002. Calculate the spacing of the reinforcing bars based on the distance between the edge lines of the reinforcing bars and the diameter of the reinforcing bars.