A steel bar diameter identification method, system, electronic device and storage medium

By combining the Mask R-CNN algorithm with binocular vision technology, and using disparity calculation and deep learning algorithms to correct the diameter of the reinforcing bars, the problem of large manual workload and low accuracy in reinforcing bar diameter detection is solved, achieving efficient and accurate reinforcing bar diameter recognition, which is suitable for the quality inspection of reinforcing bar construction.

CN117011364BActive Publication Date: 2026-02-06SHANGHAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311104787.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2026-02-06
Estimated Expiration
2043-08-30

AI Technical Summary

Technical Problem

Existing technologies for rebar diameter detection suffer from problems such as high manual workload, low accuracy, low level of digitization, and high equipment cost, making it difficult to achieve efficient and accurate rebar diameter identification.

Method used

By combining the Mask R-CNN algorithm with binocular vision technology, the actual position coordinates of the rebar are calculated through parallax, and the diameter of the rebar is corrected using the ConvNeXt deep learning algorithm, thus achieving accurate identification of the rebar diameter.

Benefits of technology

It achieves efficient and accurate identification of rebar diameter, improves detection coverage, reduces labor costs, and has wide applicability, suitable for quality inspection of rebar engineering construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117011364B_ABST
    Figure CN117011364B_ABST
Patent Text Reader

Abstract

The application discloses a steel bar diameter identification method and system, electronic equipment and a storage medium, relates to the technical field of steel bar diameter identification, and the method comprises the steps of acquiring a first image set and a second image set; adopting a trained Mask R-CNN network model to segment each image to obtain a steel bar instance segmentation result corresponding to each image; calculating the actual position coordinates of each steel bar according to the steel bar instance segmentation result; calculating the steel bar diameter according to the actual position coordinates of the steel bar, and correcting the steel bar diameter by adopting a ConvNeXt deep learning algorithm. The application can accurately identify all steel bar diameters in a target range.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of steel bar diameter identification, and in particular to a steel bar diameter identification method and system based on a Mask R-CNN algorithm and binocular vision, an electronic device, and a storage medium. BACKGROUND

[0002] In order to save costs and increase profits, "slim steel bars" are used in the construction process of steel bar projects. Therefore, in the steel bar construction quality detection content, steel bar diameter detection is a very important link, which is related to the safety and reliability of the overall structure. The steel bar diameter deviation should be within 0.8 mm according to the steel bar engineering construction acceptance index, and the precision requirement is high. At present, steel bar diameter detection mainly relies on manual sampling and measuring, which has the following problems:

[0003] (1) The steel bar binding and measuring work is heavy, the technical added value is low, and the cost performance of using manpower is continuously reduced.(2) The steel bar diameter measurement precision requirement is high, the human error causes are complex, and it is not conducive to quality control.(3) The digital level is low, and the sampling method has the problem of omission.

[0004] At present, researchers have proposed a series of automatic steel bar detection methods based on computer vision to detect the diameter of steel bars, including traditional machine vision methods based on edge detection and threshold segmentation, point cloud data processing methods based on machine learning, and image segmentation methods based on Mask R-CNN deep learning algorithm. However, the traditional machine vision method based on edge detection and threshold segmentation does not use artificial intelligence technology, can only realize steel bar identification in a simple background, and cannot obtain three-dimensional information of the steel bar, which has great limitations; the point cloud data processing method based on machine learning can obtain the three-dimensional point cloud model of the steel bar, but needs to use a laser scanner to scan at multiple stations, which has the disadvantages of high equipment cost and complex measurement steps. In the image segmentation method based on Mask R-CNN deep learning algorithm, Mask R-CNN algorithm is used, and the steel bar image recognition effect is good, but the three-dimensional information of the steel bar is not obtained by combining other methods, and the steel bar can only be measured at a fixed distance. SUMMARY

[0005] In order to realize simple, accurate, easy-to-use, and more widely applicable steel bar diameter intelligent identification effect, the present application provides a steel bar diameter identification method and system based on Mask R-CNN algorithm and binocular vision, an electronic device, and a storage medium.

[0006] To achieve the above purpose, the present application provides the following solutions:

[0007] In a first aspect, the present application provides a steel bar diameter identification method, comprising:

[0008] obtaining a first image set and a second image set; images in the first image set are left eye images and right eye images obtained by a first binocular camera shooting a target reinforcement mesh; images in the second image set are left eye images and right eye images obtained by a second binocular camera shooting the target reinforcement mesh; the second binocular camera is obtained by rotating the first binocular camera by 90 degrees around an optical axis; vertical reinforcement in images shot by the first binocular camera is horizontal reinforcement in images shot by the second binocular camera;

[0009] adopting a trained Mask R-CNN network model to segment each image to obtain a reinforcement instance segmentation result corresponding to each image; the reinforcement instance segmentation result includes multiple subgraphs, a number of reinforcements corresponding to each subgraph, a target detection frame position of each reinforcement, and an RGB color value of a region where each reinforcement is located;

[0010] according to the reinforcement instance segmentation result, calculating an actual position coordinate of each reinforcement through parallax;

[0011] calculating a reinforcement diameter according to the actual position coordinate of the reinforcement, and correcting the reinforcement diameter by adopting a ConvNeXt deep learning algorithm.

[0012] In a second aspect, the present application provides a reinforcement diameter identification system, comprising:

[0013] an image acquisition module, configured to obtain a first image set and a second image set; images in the first image set are left eye images and right eye images obtained by a first binocular camera shooting a target reinforcement mesh; images in the second image set are left eye images and right eye images obtained by a second binocular camera shooting the target reinforcement mesh; the second binocular camera is obtained by rotating the first binocular camera by 90 degrees around an optical axis; vertical reinforcement in images shot by the first binocular camera is horizontal reinforcement in images shot by the second binocular camera;

[0014] a reinforcement instance segmentation result determination module, configured to adopt a trained Mask R-CNN network model to segment each image to obtain a reinforcement instance segmentation result corresponding to each image; the reinforcement instance segmentation result includes multiple subgraphs, a number of reinforcements corresponding to each subgraph, a target detection frame position of each reinforcement, and an RGB color value of a region where each reinforcement is located;

[0015] an actual position coordinate calculation module, configured to calculate an actual position coordinate of each reinforcement through parallax according to the reinforcement instance segmentation result;

[0016] a reinforcement diameter determination module, configured to calculate a reinforcement diameter according to the actual position coordinate of the reinforcement, and correct the reinforcement diameter by adopting a ConvNeXt deep learning algorithm.

[0017] In a third aspect, the present application provides an electronic device comprising a memory and a processor, wherein the memory is configured to store a computer program, and the processor is configured to execute the computer program to enable the electronic device to perform the steel bar diameter identification method according to the first aspect.

[0018] In a fourth aspect, the present application provides a computer readable storage medium storing a computer program, wherein the computer program is configured to enable a processor to perform the steel bar diameter identification method according to the first aspect.

[0019] According to the embodiments of the present application, the following technical effects are achieved.

[0020] The present application can accurately identify all steel bar diameters in the target range through the Mask R-CNN algorithm, binocular vision technology and deep learning algorithm, has high detection coverage, eliminates hidden dangers, and efficiently replaces the manual inspection method, thereby saving labor cost. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 The flowchart of the steel bar diameter identification method provided by the embodiments of the present application is shown in the figure.

[0023] Figure 2 The actual installation position diagram of the binocular camera provided by the embodiments of the present application is shown in the figure.

[0024] Figure 3 The parallax calculation coordinate principle diagram provided by the embodiments of the present application is shown in the figure.

[0025] Figure 4 The detailed flowchart of the steel bar diameter identification method provided by the embodiments of the present application is shown in the figure.

[0026] Figure 5 The equivalent pixel distance calculation principle diagram provided by the embodiments of the present application is shown in the figure.

[0027] Figure 6 The steel bar mask image pixel width measurement diagram provided by the embodiments of the present application is shown in the figure.

[0028] Figure 7 The pixel width correction diagram provided by the embodiments of the present application is shown in the figure.

[0029] Figure 8 The steel bar picture segmentation diagram provided by the embodiments of the present application is shown in the figure.

[0030] Figure 9 The correction coefficient marking diagram provided for the embodiment of the application;

[0031] Figure 10 The slice map classification result map provided for the embodiment of the application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the application will be apparently and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the application.

[0033] In order to make the above objectives, characteristics and advantages of the application more apparent, comprehensible and easy to understand, the application will be further described in detail below with reference to the drawings and specific embodiments.

[0034] The application provides a steel bar diameter recognition method and system based on a Mask R-CNN algorithm and binocular vision, an electronic device and a storage medium, and the innovative part is as follows:

[0035] 1. The Mask R-CNN network is combined with a binocular camera.

[0036] 2. The steel bar coordinates are calculated by using the parallax principle, and then the steel bar diameter is calculated.

[0037] 3. The ConvNeXt deep learning algorithm is used to correct the steel bar diameter, and the detection accuracy is improved.

[0038] Embodiment one

[0039] As shown in Figure 1 and Figure 4 The application provides a steel bar diameter recognition method based on a Mask R-CNN algorithm and binocular vision, which comprises the following steps.

[0040] Step 100: acquiring a first image set and a second image set; the images in the first image set are left-eye images and right-eye images of a target steel bar mesh obtained by a first binocular camera; the images in the second image set are left-eye images and right-eye images of the target steel bar mesh obtained by a second binocular camera; the second binocular camera is obtained by rotating the first binocular camera by 90° around the optical axis; and the vertical steel bars in the images captured by the first binocular camera are the horizontal steel bars in the images captured by the second binocular camera.

[0041] One example: using a first binocular camera arranged in parallel to take the reinforcing mesh to be detected, i.e. the target reinforcing mesh, the specific process is as follows: first, arrange two industrial cameras in parallel with each other and install them vertically to the ground, as shown in Figure 2 Then, calibrate the two industrial cameras using the Matlab camera calibration toolbox to obtain the baseline length P of the binocular system. Then, take the reinforcing mesh to be detected using the two industrial cameras at the same time to obtain one left-eye image and one right-eye image, i.e. the first image set.

[0042] Similarly, rotate the first binocular camera by 90° around the optical axis, and then take the reinforcing mesh to be detected at the same time to obtain one left-eye image and one right-eye image, i.e. the second image set.

[0043] Step 200: using the trained MaskR-CNN network model to segment each image to obtain the reinforcing bar instance segmentation result corresponding to each image; the reinforcing bar instance segmentation result includes a plurality of sub-pictures, the number of reinforcing bars corresponding to each sub-picture, the target detection frame position of each reinforcing bar and the RGB color value of the region where each reinforcing bar is located.

[0044] One example is: inputting the left-eye and right-eye reinforcing bar pictures obtained in the previous step into the trained Mask R-CNN network model for prediction, and simultaneously outputting two text files num_record.txt and color_record.txt, num_record.txt records the number of reinforcing bars in each picture; color_record.txt records the target detection frame position of each reinforcing bar and the RGB color value of the mask. At this time, the number of reinforcing bars in each picture can be known.

[0045] Step 300: according to the reinforcing bar instance segmentation result, calculating the actual position coordinates of each reinforcing bar through parallax.

[0046] Since the installation positions of the left-eye and right-eye cameras are different, the number of reinforcing bars in the pictures taken may be different, and in view of this problem, the embodiment of the present application provides a specific implementation mode which can realize automatic compatibility in the case that the left-eye picture has one more or one less reinforcing bar than the right-eye picture. For example: when the left-eye picture has one more vertical reinforcing bar than the right-eye picture, the leftmost reinforcing bar in the left-eye picture has no corresponding same reinforcing bar in the right-eye picture, so it does not participate in the calculation. When the left-eye picture has one less vertical reinforcing bar than the right-eye picture, the rightmost vertical reinforcing bar in the right-eye picture has no corresponding same reinforcing bar in the left-eye picture, so it does not participate in the calculation.

[0047] Therefore, before the step of calculating the actual position coordinates of each steel bar by parallax according to the steel bar instance segmentation result, the method provided by the embodiment of the application further comprises: (1) determining whether the number of steel bars in the left-view image and the number of steel bars in the right-view image in the same image set are the same according to the steel bar instance segmentation result; (2) if yes, calculating the actual position coordinates of the steel bars by parallax according to the steel bar instance segmentation result corresponding to each image in the same image set; and (3) if no, when the number of steel bars in the left-view image is more than the number of steel bars in the right-view image by N vertical steel bars in the same image set, the leftmost N vertical steel bars in the left-view image do not participate in the calculation of the actual position coordinates of the steel bars; or when the number of steel bars in the left-view image is less than the number of steel bars in the right-view image by N vertical steel bars in the same image set, the rightmost N vertical steel bars in the right-view image do not participate in the calculation of the actual position coordinates of the steel bars.

[0048] The principle of the parallax algorithm is as shown in Figure 3 Fig. 1, taking the first binocular camera as an example, O is the optical center of the left-view camera, P is the baseline length of the binocular system, f is the focal length of the camera, L is the width of the left-view camera or the right-view camera, (x, y) is the coordinate of a vertical steel bar in the coordinate system, L1 is the distance between the imaging of the steel bar on the left-view camera and the edge of the left-view camera, and L2 is the distance between the imaging of the steel bar on the right-view camera and the edge of the right-view camera, and L1 and L2 are determined according to the pixel coordinates of the steel bar. Among them, x and y are unknown quantities, and the rest are known quantities or can be calculated according to the pixel coordinates. The binocular system is a system composed of the left-view camera and the right-view camera.

[0049] The calculation formula of the actual position coordinates is as follows:

[0050] Therefore, the step 300 provided by the embodiment of the application specifically comprises:

[0051] The subgraph participating in the calculation of the actual position coordinates of the steel bars is subjected to a first operation.

[0052] The first operation is: first, determining the region where each vertical steel bar is located in the subgraph participating in the calculation of the actual position coordinates of the steel bars; second, fitting the region where the vertical steel bar is located by using an opencv straight line fitting function to obtain a straight line equation; third, dividing the straight line into segments uniformly and calculating the pixel coordinates of the midpoint of each segment of the vertical steel bar according to the straight line equation; fourth, calculating the actual spatial coordinates of the midpoint pixel coordinates according to the parallax of the corresponding midpoint pixel coordinates in the left-view image and the right-view image; and fifth, after obtaining the actual spatial coordinates of the midpoint pixel coordinates of each segment of each vertical steel bar, taking the average value as the actual position coordinates of the vertical steel bar.

[0053] Further, according to the pixel coordinates of each vertical steel bar, the actual position coordinates of each steel bar are calculated through parallax, specifically including: (1) when the subgraph belongs to the first image set, according to the pixel coordinates of each vertical steel bar in each subgraph, the actual position coordinates of each vertical steel bar are calculated through parallax; (2) when the subgraph belongs to the second image set, according to the pixel coordinates of each vertical steel bar in each subgraph, the actual position coordinates of each horizontal steel bar are calculated through parallax.

[0054] Step 400: Calculate the steel bar diameter according to the actual position coordinates of the steel bar, and correct the steel bar diameter by using the ConvNeXt deep learning algorithm.

[0055] In the embodiment of the application, step 400 specifically includes:

[0056] (1) First, calculate the object distance according to the actual position coordinates of the steel bar; the object distance is the vertical distance between the steel bar and the corresponding binocular camera; second, calculate the pixel equivalent distance according to the object distance, the focal length and the pixel size; finally, calculate the steel bar diameter according to the pixel equivalent distance and the number of pixels representing the steel bar width in the image.

[0057] One example is that the coordinate system of the above-mentioned actual position coordinates (x, y) of the steel bar is as shown in the coordinate system. Figure 5 The coordinate y represents the distance between the steel bar axis and the camera lens plane, that is, the object distance.

[0058] According to similar triangles, the following equation can be obtained:

[0059] Object distance / focal length = actual size / size on film = scaling factor;

[0060] Pixel equivalent distance = scaling factor Х pixel size.

[0061] The pixel equivalent distance refers to the actual size on the specified object distance corresponding to one pixel in the photo, with the unit of mm / pix. The pixel size is the actual physical size of one pixel on the camera photosensitive element (film). Therefore, the actual diameter of the steel bar can be obtained by extracting the pixel diameter of the steel bar in the photo. For example, if the pixel diameter of a steel bar is npix, then the actual diameter of the steel bar is n Х pixel size Х object distance / focal length, with the unit of mm.

[0062] The above is the principle of steel bar diameter measurement, and the actual implementation steps are as follows:

[0063] 1) As shown in the figure, the mask graph is segmented to sample the pixel width, and the sampling samples are removed according to the 3σ criterion. The number of samples is 50 by default, and can be adjusted according to the actual situation. Figure 6

[0064] 2) As shown in the figure, the mask graph is segmented to sample the pixel width, and the sampling samples are removed according to the 3σ criterion. The number of samples is 50 by default, and can be adjusted according to the actual situation. Figure 7 ​The pixel width of each sample is corrected according to the slope of the fitting straight line, and the average value is taken as the pixel width of the steel bar.

[0065] 3) Calculate the diameter of the steel bar according to the pixel equivalent distance (mm / pix) based on the distance y of the steel bar obtained in the previous step.

[0066] (2) First, superimpose the image and the steel bar instance segmentation result corresponding to the image to obtain a superimposed image; second, divide each steel bar in the superimposed image into several segments to obtain a plurality of superimposed sub-images corresponding to each steel bar; then input the superimposed sub-images into a correction coefficient determination model to obtain a correction coefficient corresponding to each superimposed sub-image, and take an average of the correction coefficients of each superimposed sub-image corresponding to each steel bar to obtain a correction coefficient corresponding to each steel bar; the correction coefficient determination model comprises a classification model and a correction coefficient calculation model; the classification model is determined according to a ConvNeXt deep learning algorithm; the classification model is used to output a classification result of each superimposed sub-image and a probability corresponding to each classification result; the correction coefficient calculation model is used to multiply each classification result and the corresponding probability to obtain a plurality of multiplication results, and add the plurality of multiplication results to determine a correction coefficient corresponding to the superimposed sub-image; then multiply the steel bar diameter and the corresponding correction coefficient to obtain a corrected steel bar diameter.

[0067] The determination process of the classification model is as follows:

[0068] First, construct sample data; the sample data comprises input data and corresponding label data; the input data is a sample superimposed sub-image; and the label data is a classification result of the sample superimposed sub-image determined by a human.

[0069] Second, train a ConvNeXt-tiny classification network according to the sample data to obtain a classification model.

[0070] An example is that since the diameter detection error of the steel bar should be less than 0.8 mm, the accuracy requirement is high, and therefore it is necessary to adjust the steel bar diameter obtained in the previous step to improve the detection accuracy. The specific implementation steps are as follows:

[0071] 1) Determine the value range of the ratio of the true value of the steel bar diameter to the detected value through experiments, which is the value range of the correction coefficient, and the calculation formula is: correction coefficient = true value of steel bar diameter / predicted value of steel bar diameter

[0072] 2) Discretize the value of the correction coefficient into several values. For example, if the original value range of the correction coefficient is [0.84, 1.12], it can be discretized into 0.85, 0.90, 0.95, 1.00, 1.05, 1.10 at intervals of 0.05, serving as six categories; or it can be discretized into 0.84, 0.87, 0.90, 0.93, 0.96, 0.99, 1.02, 1.05, 1.08, 1.11 at intervals of 0.03, serving as ten categories.

[0073] 3) Superimpose the steel bar picture and its recognition result obtained by Mask R-CNN, divide each steel bar in the superimposed picture into several segments (default is 4 segments, which can be specified according to actual conditions), and save each segment as a picture, as shown in Figure 8

[0074] 4) Observe the segmented picture, classify the picture according to the coincidence degree of the mask edge and the steel bar edge, and combine the classification table to classify the picture, and the classification category is the discrete value in the second step, such as 0.85, 0.90, 0.95, 1.00, 1.05, 1.10 six categories. The classification table considers the relationship between the left and right edges of the mask and the inner and outer diameters of the steel bar, and defines the classification of the corresponding picture, i.e. the correction coefficient.

[0075] Figure 9 The method of manually labeling the correction coefficient is shown. That is, the left and right edges of the steel bar inner diameter and the left and right edges of the mask are labeled using straight lines, the pixel width of the steel bar inner diameter and the pixel width of the mask are obtained from the midpoint pixel coordinates of the labeled lines, and the ratio of the pixel width of the steel bar inner diameter to the pixel width of the mask is taken as the correction coefficient. Then, according to the discrete value classification in the second step, the picture is put into the corresponding category, and the labeling is completed.

[0076] 5) The image slices classified by the above steps are the data set for training the classification network. ConvNeXt-tiny classification network algorithm is used for model training.

[0077] 6) The trained algorithm model is used to predict new input steel bar pictures. Since each steel bar is divided into several parts, several classification results and corresponding probabilities are obtained. For a single slice, the classification results are weighted and averaged according to the probability to obtain the correction coefficient of the segment.

[0078] As shown in Figure 10 , the correction coefficient of the steel bar segment shown in the slice picture is: 0.85*0.979+0.9*0.0187+0.95*0.00111+1.0*0.00023+1.05*0.00017+1.1*0.000584=0.851

[0079] ​The correction coefficients of all segments of the steel bar are averaged to obtain the final correction coefficient of the steel bar, and the final correction coefficient is multiplied by the steel bar diameter calculated according to the equivalent pixel distance to obtain the corrected steel bar diameter.

[0080] Further, the embodiment of the present application further comprises: comparing the steel bar diameter in the target steel bar mesh with the design data to issue a detection report.

[0081] Embodiment two

[0082] In order to perform the method corresponding to the above-mentioned embodiment one to realize the corresponding functions and technical effects, a steel bar diameter identification system based on Mask R-CNN algorithm and binocular vision is provided below.

[0083] The steel bar diameter identification system comprises:

[0084] An image acquisition module is configured to acquire a first image set and a second image set; images in the first image set are left-eye images and right-eye images obtained by a first binocular camera shooting a target steel bar mesh; images in the second image set are left-eye images and right-eye images obtained by a second binocular camera shooting the target steel bar mesh; the second binocular camera is obtained by rotating the first binocular camera by 90 degrees around an optical axis; vertical steel bars in images shot by the first binocular camera are horizontal steel bars in images shot by the second binocular camera.

[0085] A steel bar instance segmentation result determination module is configured to segment each image by using a trained Mask R-CNN network model to obtain a steel bar instance segmentation result corresponding to each image; the steel bar instance segmentation result comprises a plurality of subgraphs, a number of steel bars corresponding to each subgraph, a target detection frame position of each steel bar, and an RGB color value of a region where each steel bar is located.

[0086] An actual position coordinate calculation module is configured to calculate actual position coordinates of each steel bar by parallax according to the steel bar instance segmentation result.

[0087] A steel bar diameter determination module is configured to calculate a steel bar diameter according to the actual position coordinates of the steel bar, and correct the steel bar diameter by using a ConvNeXt deep learning algorithm.

[0088] Embodiment three

[0089] The embodiment of the present application provides an electronic device comprising a memory for storing a computer program and a processor for running the computer program to make the electronic device execute the steel bar diameter identification method of embodiment one.

[0090] Optionally, the above-mentioned electronic device can be a server.

[0091] In addition, the embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steel bar diameter identification method of the embodiment one.

[0092] The various embodiments are described in a progressive manner in the specification, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiments, the description is relatively simple because it corresponds to the method disclosed in the embodiments. The relevant parts can be referred to the description of the method.

[0093] The principles and implementation manners of the present application are described by using specific examples in the present application. The above embodiment is only used to help understand the method and core idea of the present application. Meanwhile, for the general technical personnel in the field, the specific implementation manner and application range can be changed according to the idea of the present application. In conclusion, the content of the specification should not be understood as the limitation of the present application.

Claims

1. A method for identifying the diameter of reinforcing bars, characterized in that, include: Acquire a first image set and a second image set; the images in the first image set are the left and right eye images of the target steel mesh captured by the first binocular camera; the images in the second image set are the left and right eye images of the target steel mesh captured by the second binocular camera; the second binocular camera is the binocular camera obtained by rotating the first binocular camera 90° around the optical axis; the vertical steel bars in the images captured by the first binocular camera are the horizontal steel bars in the images captured by the second binocular camera; The trained Mask R-CNN network model is used to segment each image to obtain the rebar instance segmentation result corresponding to each image; the rebar instance segmentation result includes multiple sub-images, the number of rebars corresponding to each sub-image, the target detection box position of each rebar, and the RGB color value of the region where each rebar is located; Based on the segmentation results of the steel reinforcement instances, the actual position coordinates of each steel reinforcement are calculated using parallax; the formula for calculating the actual position coordinates is as follows: ; ; Wherein, the actual position coordinates are (x, y); P is the baseline length of the binocular system, f is the camera focal length, L is the width of the left or right eye camera, L1 is the distance between the image of the rebar on the left eye camera and the edge of the left eye camera, L2 is the distance between the image of the rebar on the right eye camera and the edge of the right eye camera, and L1 and L2 are determined based on the pixel coordinates of the rebar; the binocular system is a system composed of a left eye camera and a right eye camera; The diameter of the reinforcing bar is calculated based on its actual position coordinates, and then corrected using the ConvNeXt deep learning algorithm. The diameter of the reinforcing bar is calculated based on its actual position coordinates, specifically including: Calculate the object distance based on the actual position coordinates of the reinforcing bar; the object distance is the vertical distance between the reinforcing bar and the corresponding binocular camera. Calculate the equivalent distance of a pixel based on the object distance, focal length, and pixel size; The diameter of the rebar is calculated based on the pixel equivalent distance and the number of pixels in the image that represent the width of the rebar. The process of correcting the diameter of the reinforcing bar using the ConvNeXt deep learning algorithm specifically includes: The image is superimposed with the segmentation results of the corresponding steel bar instances to obtain the overlay image; Each steel bar in the overlay diagram is divided into several segments to obtain multiple overlay sub-diagrams corresponding to each steel bar. The superimposed sub-images are input into the correction coefficient determination model to obtain the correction coefficient corresponding to each superimposed sub-image. The correction coefficients of each superimposed sub-image corresponding to each rebar are averaged to obtain the correction coefficient corresponding to each rebar. The correction coefficient determination model includes a classification model and a correction coefficient calculation model. The classification model is determined based on the ConvNeXt deep learning algorithm. The classification model is used to output the classification result of each superimposed sub-image and the probability corresponding to each classification result. The correction coefficient calculation model is used to multiply each classification result by the corresponding probability to obtain multiple multiplication results, and the result of adding the multiple multiplication results determines the correction coefficient corresponding to the superimposed sub-image. Multiply the diameter of the reinforcing bar by the corresponding correction factor to obtain the corrected diameter of the reinforcing bar.

2. The method for identifying the diameter of reinforcing bars according to claim 1, characterized in that, Before performing the step of calculating the actual position coordinates of each rebar based on the rebar instance segmentation results using parallax, the method further includes: Based on the segmentation results of the steel bar instances, determine whether the number of steel bars in the left eye image and the number of steel bars in the right eye image of the same image set are the same; If so, the actual position coordinates of the steel bars are calculated by parallax based on the segmentation results of the steel bar instances corresponding to each image in the same image set. If not, when the number of steel bars in the left image of the same image set is N more than the number of steel bars in the right image, the leftmost N vertical steel bars in the left image will not be included in the calculation of the actual position coordinates of the steel bars; or when the number of steel bars in the left image of the same image set is N less than the number of steel bars in the right image, the rightmost N vertical steel bars in the right image will not be included in the calculation of the actual position coordinates of the steel bars.

3. The method for identifying the diameter of reinforcing bars according to claim 2, characterized in that, Based on the segmentation results of the steel reinforcement instances, the actual position coordinates of each steel reinforcement are calculated using parallax, specifically including: Perform the first operation on the sub-graph that participates in the calculation of the actual position coordinates of the reinforcing bars; The first operation is as follows: First, in the sub-image involved in calculating the actual position coordinates of the reinforcing bars, determine the area where each vertical reinforcing bar is located; second, use the OpenCV line fitting function to fit the area where the vertical reinforcing bar is located to obtain the line equation; then, divide the line into uniform segments and calculate the pixel coordinates of the midpoint of each segment of the vertical reinforcing bar according to the line equation; next, calculate the actual spatial coordinates of the midpoint pixel coordinates based on the disparity of the corresponding midpoint pixel coordinates in the left and right eye images; finally, after obtaining the actual spatial coordinates of each segment point of each vertical reinforcing bar, take the average value as the actual position coordinates of the vertical reinforcing bar.

4. The method for identifying the diameter of reinforcing bars according to claim 1, characterized in that, The process of determining the classification model is as follows: Construct sample data; the sample data includes input data and corresponding label data; the input data is a sample overlay sub-image; the label data is the classification result of the manually determined sample overlay sub-image; The ConvNeXt-tiny classification network is trained based on the sample data to obtain the classification model.

5. A rebar diameter identification system, characterized in that, include: The image acquisition module is used to acquire a first image set and a second image set; the images in the first image set are left and right eye images of the target steel mesh captured by a first binocular camera; the images in the second image set are left and right eye images of the target steel mesh captured by a second binocular camera; the second binocular camera is a binocular camera obtained by rotating the first binocular camera 90° around its optical axis; the vertical steel bars in the images captured by the first binocular camera are the horizontal steel bars in the images captured by the second binocular camera; The rebar instance segmentation result determination module is used to segment each image using a trained Mask R-CNN network model to obtain the rebar instance segmentation result corresponding to each image. The rebar instance segmentation result includes multiple sub-images, the number of rebars corresponding to each sub-image, the target detection box position of each rebar, and the RGB color value of the region where each rebar is located. The actual position coordinate calculation module is used to calculate the actual position coordinates of each rebar based on the rebar instance segmentation results and using parallax; the calculation formula for the actual position coordinates is: ; ; Wherein, the actual position coordinates are (x, y); P is the baseline length of the binocular system, f is the camera focal length, L is the width of the left or right eye camera, L1 is the distance between the image of the rebar on the left eye camera and the edge of the left eye camera, L2 is the distance between the image of the rebar on the right eye camera and the edge of the right eye camera, and L1 and L2 are determined based on the pixel coordinates of the rebar; the binocular system is a system composed of a left eye camera and a right eye camera; The rebar diameter determination module is used to calculate the rebar diameter based on the actual position coordinates of the rebar, and to correct the rebar diameter using the ConvNeXt deep learning algorithm; The diameter of the reinforcing bar is calculated based on its actual position coordinates, specifically including: Calculate the object distance based on the actual position coordinates of the reinforcing bar; the object distance is the vertical distance between the reinforcing bar and the corresponding binocular camera. Calculate the equivalent distance of a pixel based on the object distance, focal length, and pixel size; The diameter of the rebar is calculated based on the pixel equivalent distance and the number of pixels in the image that represent the width of the rebar. The process of correcting the diameter of the reinforcing bar using the ConvNeXt deep learning algorithm specifically includes: The image is superimposed with the segmentation results of the corresponding steel bar instances to obtain the overlay image; Each steel bar in the overlay diagram is divided into several segments to obtain multiple overlay sub-diagrams corresponding to each steel bar. The superimposed sub-images are input into the correction coefficient determination model to obtain the correction coefficient corresponding to each superimposed sub-image. The correction coefficients of each superimposed sub-image corresponding to each rebar are averaged to obtain the correction coefficient corresponding to each rebar. The correction coefficient determination model includes a classification model and a correction coefficient calculation model. The classification model is determined based on the ConvNeXt deep learning algorithm. The classification model is used to output the classification result of each superimposed sub-image and the probability corresponding to each classification result. The correction coefficient calculation model is used to multiply each classification result by the corresponding probability to obtain multiple multiplication results, and the result of adding the multiple multiplication results determines the correction coefficient corresponding to the superimposed sub-image. Multiply the diameter of the reinforcing bar by the corresponding correction factor to obtain the corrected diameter of the reinforcing bar.

6. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the rebar diameter identification method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the rebar diameter identification method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Steel bar size measuring method and system based on image processing

    CN111932508A

  • Method and system for identifying number of reinforcing steel bars based on binocular camera

    CN115330855A