A method for detecting the overall size of super-large steel mesh
Through image recognition technology and improved Gaussian filtering methods, the problems of insufficient speed and accuracy in detecting ultra-large steel meshes were solved, fast and accurate overall size detection was achieved, and detection accuracy and speed were improved.
Patent Information
- Application Number
- CN202211061272.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-09-01
AI Technical Summary
Existing technologies make it difficult to quickly and accurately detect the overall size of ultra-large steel mesh, and the detection accuracy is insufficient, posing a safety hazard.
Image recognition technology is used to detect the overall size of ultra-large steel mesh through steps such as image acquisition, grayscale conversion, denoising preprocessing, region growing, and steel cross rib removal, combined with Gaussian filtering improvement and size conversion formula.
It achieves fast and accurate detection of super-large steel mesh, improves detection accuracy, meets actual production needs, and reduces the probability of false detection and detection time.
Smart Images

Figure CN115482206B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of engineering measurement, and in particular is a method for detecting the overall size of an ultra-large steel mesh based on image recognition. Background Art
[0002] Simply supported box girders in railway projects typically use steel mesh as the skeleton support. The mesh production process primarily relies on manual processing, sorting, placement, and binding, making it time-consuming, labor-intensive, and labor-intensive. In particular, when the main reinforcement skeleton is composed of oversized mesh sheets, each weighing up to 10 tons, manual processing alone is particularly difficult. Therefore, specialized mesh welding equipment is employed for production. However, due to the straightening, shearing, welding, and bending steps involved in the mesh production process, the overall mesh dimensions may deviate from the design requirements, impacting the proper use and function of the simply supported box girder and posing a significant safety hazard.
[0003] The upper limit of the overall size of ultra-large steel mesh is as high as 32m x 10m. Relying on manual inspection is time-consuming, labor-intensive, and lacks accuracy. Traditional small object detection solutions are difficult to apply, and the size detection of ultra-large objects is less studied. This is because in actual factory production, on-site light sources are severely insufficient, and the image acquisition layout requires strict measurement, which directly affects image quality and recognition accuracy. 3D point cloud modeling methods have a long detection cycle and lack accuracy. Therefore, it is particularly important to develop a fast and accurate method for the overall size detection of ultra-large steel mesh. Summary of the Invention
[0004] In view of the deficiencies in the prior art, the technical problem to be solved by the present invention is to provide a fast and accurate method for detecting the overall size of super-large steel mesh.
[0005] The technical solution adopted by the present invention to solve the technical problem is:
[0006] A method for detecting the overall size of an ultra-large steel mesh, the method comprising the following steps:
[0007] Step 1: Image Acquisition
[0008] Place the oversized steel mesh flat on a base with a white background. Position the industrial camera mounted on the gantry perpendicular to the base and looking down to capture images. Record the vertical distance from the industrial camera to the oversized steel mesh as the working distance, expressed as D. Working distance D = long side of field of view × focal length / chip length. Arrange the image acquisition environment based on the working distance. Obtain the relationship between true size and number of pixels: true size / optical magnification = corresponding number of pixels.
[0009] Step 2: Grayscale the image
[0010] The colors of all pixels in the steel mesh image are represented by the RGB color system, where R, G, and B represent the brightness values of the red, green, and blue color channels, respectively. The image grayscale processing is completed by graying the image using a weighted average. The steel mesh image after image grayscale processing is assumed to be a steel mesh grayscale image, and its brightness value is G, G = R × 0.30 + G × 0.59 + B × 0.11.
[0011] Step 3: Denoising Preprocessing
[0012] A 9×9 Gaussian kernel template is used to perform Gaussian filtering denoising to eliminate or reduce the noise generated in the complex shooting environment of the factory. The image after noise removal is set as the pre-processed image of the steel mesh;
[0013] Step 4: Steel Mesh Area Growth
[0014] Calculate the gradient amplitude and azimuth of all pixels in the pre-processed image of the steel mesh. The position coordinates, scale (i.e., gradient amplitude) and direction (i.e., azimuth) of each pixel can be obtained. Traverse all the pixels of the pre-processed image of the steel mesh and record them in sequence as A1, A2, ...A N , where N represents the total number of all pixels. All pixels are sorted from small to large according to the gradient amplitude, and all the sorted pixels are renamed as k1, k2, ...k i ,…,k N , select the pixel with the largest gradient amplitude as the starting point of region growth, that is, k N The pixel point represented by k is selected as the center to select a 3×3 grid as the starting point of region growing. N The pixel point represented by the gradient descent is most obvious in the 3×3 grid and the azimuth angle is the same as k max Connect the pixels whose azimuth angle difference is within ±22.5°, and select a 3×3 grid with the pixel as the new center for region growing. Repeat this process until there are no pixels with azimuth angle difference within ±22.5° in the 3×3 grid.
[0015] Then, from k N-1 Start with k N-1 A 3×3 grid is selected with the representative pixel as the center for region growing. The region growing process is repeated until all pixels have completed region growing, thus forming a line segment.
[0016] Considering that the steel mesh is composed of horizontal and vertical bars, only horizontal and vertical line segments need to be retained. The slopes of all line segments completed by region growing are calculated, and the line segments with slopes of 0 and infinity are retained, otherwise they are eliminated. After eliminating irrelevant line segments, the number of all remaining line segments is set to M, and the number of pixels contained in each line segment is recorded as T1, T2, ..., T i ,…T M ;
[0017] Step 5: Remove the steel bar transverse ribs
[0018] Set the actual size range of the steel bar transverse rib, obtain the pixel number range of the transverse rib according to the relationship between the actual size and the number of pixels, set the upper limit of the pixel number range of the transverse rib as S, and set the number of pixels T contained in each line segment in the steel mesh preprocessing image obtained in step 4 i Compared with the upper limit S, if T i <S, then the line segment is deleted, that is, the transverse ribs are deleted, and the image without the transverse ribs is set as the final image of the steel mesh;
[0019] Step 6. Calculate the overall size of the steel mesh
[0020] After step five, the final image of the steel mesh only contains the transverse and vertical bars of the steel mesh. The steel bars in the length direction of the super-large steel mesh are assumed to be longitudinal bars, and the steel bars in the width direction are assumed to be transverse bars. The longitudinal bars of the super-large steel mesh are much larger than the transverse bars. The corresponding number of pixels contained in all the remaining line segments after removing the transverse ribs of the steel bars is obtained. According to the two trends of the number of pixel points, the remaining line segments are divided into two categories: transverse bars and longitudinal bars. The category with a significantly larger number of pixel points is classified as longitudinal bars, and the category with a significantly smaller number of pixel points is classified as transverse bars.
[0021] Using the relationship between the actual size and the number of pixels, the average number of pixels contained in each line segment in the longitudinal reinforcement of the steel mesh is taken to convert it into the actual length of the steel mesh. Similarly, the average number of pixels contained in each line segment in the transverse reinforcement of the steel mesh is taken to convert it into the actual width of the steel mesh. At this point, the overall size of the super-large steel mesh is obtained.
[0022] The upper limit of the overall size of the super-large steel mesh is 32m×10m, and the actual size of the steel transverse ribs is in the range of 6-8mm.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] 1. To address the problem that the actual size of a steel mesh image cannot be directly obtained, the present invention sets an experimental environment and a size conversion calculation formula to accurately calculate the actual size from the steel mesh image, thereby achieving size conversion and ensuring detection accuracy.
[0025] 2. To address the problem of excessive image noise affecting detection accuracy in the complex environment of steel bar processing sites, this invention minimizes the possibility of noise generation from the source by setting up an experimental environment and a white background base, thereby reducing the probability of false detection;
[0026] 3. To address the problem that the Gaussian filter preprocessing time of steel mesh images is too long and the detection speed cannot meet actual needs, the present invention reduces the average processing time of a steel mesh grayscale image to 1s by improving the Gaussian filter kernel template, and can run at the fastest speed while removing noise as much as possible;
[0027] 4. To address the problem that the diameter of the steel bars in super-large steel mesh is large and the cross ribs of the steel bars affect the recognition accuracy, the present invention eliminates the cross ribs of the steel bars based on the conversion relationship between pixel points and actual size, thereby improving the detection accuracy;
[0028] 5. In response to the problem that there are few methods for detecting the size of super-large steel meshes, the present invention creatively realizes the overall size detection of steel meshes through steps such as regional growth of steel meshes, removal of steel cross ribs, and size calculation. The speed and accuracy meet actual generation requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is an overall flow chart of the method of the present invention;
[0030] Figure 2 A flow chart of the conversion between the steel mesh image and the overall size of the method of the present invention;
[0031] Figure 3 It is the steel mesh image acquisition environment of the method of the present invention;
[0032] Figure 4 An image of a steel mesh according to a specific embodiment of the method of the present invention;
[0033] Figure 5 A grayscale image of a steel mesh according to a specific embodiment of the method of the present invention;
[0034] Figure 6 A pre-processed image of a steel mesh according to a specific embodiment of the method of the present invention;
[0035] Figure 7 The final image of the steel mesh of a specific embodiment of the method of the present invention; DETAILED DESCRIPTION
[0036] The present invention is further explained below with reference to the embodiments and drawings, but they are not intended to limit the scope of protection of the present application.
[0037] The present invention provides a fast and accurate method for detecting the overall size of an oversized steel mesh, the method comprising the following steps:
[0038] Step 1: Image Acquisition
[0039] The image acquisition equipment consists of a gantry and a base with a white background. The gantry is used to carry the industrial camera, and the base is used to place the oversized steel mesh. During image acquisition, the oversized steel mesh is placed flat on the base with a white background. The industrial camera mounted on the gantry is positioned perpendicular to the base and looking down to capture the image. The vertical distance from the industrial camera to the oversized steel mesh is recorded as the working distance, denoted by D. The industrial camera parameters are referenced and recorded as a × b resolution, c × d pixel size, and f focal length, as shown in Table 1.
[0040] Table 1. Industrial camera parameters
[0041] Serial number Industrial camera parameters Specific value 1 Resolution a×b 2 Pixel size c×d 3 Focal length f
[0042] Step 2: Calculate the size conversion relationship
[0043] Calculate the specific value of the working distance D according to the following calculation formula.
[0044] Chip size = resolution × pixel size
[0045] Optical magnification = long side of field of view / camera chip length = working distance / focal length
[0046] Working distance = long side of field of view × focal length / chip length
[0047] Actual size / optical magnification = corresponding number of pixels
[0048] Adjust the exposure and gain of the industrial camera to capture high-brightness images of the steel mesh, and arrange the image acquisition environment in step 1 according to the working distance.
[0049] Step 3: Grayscale the image
[0050] The colors of all pixels in the steel mesh image are represented using the RGB color system, where R, G, and B represent the brightness values of the red, green, and blue color channels, respectively. Considering that steel mesh is generally gray, with a single color and minimal variation, image preprocessing is performed using a weighted average to grayscale the image. The preprocessed steel mesh image is called the steel mesh grayscale image, and its brightness value is G, where G = R × 0.30 + G × 0.59 + B × 0.11.
[0051] Step 4: Improve Gaussian filtering to remove noise
[0052] To eliminate or reduce the noise generated in the complex factory shooting environment, a Gaussian filter was used for linear smoothing. The image after noise removal was used as the preprocessed image of the steel mesh. Traditional Gaussian filtering uses a 3×3 Gaussian kernel template. Experimental testing shows that the average processing time for a steel mesh grayscale image is approximately 5 seconds. However, due to the large size of the steel mesh and the high shooting accuracy, this Gaussian kernel template cannot meet the rapid inspection requirements of actual production. An improved Gaussian filtering method was used to generate a 9×9 Gaussian kernel template, as shown in Table 2.
[0053] Table 2. Gaussian filter 9×9 Gaussian kernel template
[0054] (x - 4, y + 4) (x - 3, y + 4) (x - 2, y + 4) (x - 1, y + 4) (x, y + 4) (x + 1, y + 4) (x + 2, y + 4) (x + 3, y + 4) (x + 4, y + 4) (x - 4, y + 3) (x - 3, y + 3) (x - 2, y + 3) (x - 1, y + 3) (x, y + 3) (x + 1, y + 3) (x + 2, y + 3) (x + 3, y + 3) (x + 4, y + 3) (x - 4, y + 2) (x - 3, y + 2) (x - 2, y + 2) (x - 1, y + 2)
[0055] Among them, (x, y) is the pixel coordinate of the grayscale image of the steel mesh, and its corresponding Gaussian value is h(x, y). The Gaussian filter is performed using the Gaussian formula:
[0056]
[0057] Considering that the standard deviation σ will affect the operation speed of Gaussian filtering, in order to further improve the detection speed, the standard deviation σ is adjusted. The optimal standard deviation σ suitable for the 9×9 Gaussian kernel template is 1.5. The average processing time of a steel mesh grayscale image is reduced to 1s, which can run at the fastest speed while removing noise as much as possible. The Gaussian filter weight matrix at this time is shown in Table 3.
[0058] Table 3. Weight matrix corresponding to the Gaussian filter 9×9 Gaussian kernel template
[0059]
[0060] Step 5: Steel Mesh Area Growth
[0061] Calculate the gradient amplitude and azimuth of all pixels in the pre-processed image of the steel mesh using the following formula:
[0062] The formula for calculating the image gradient in the horizontal direction is as follows:
[0063]
[0064] The image gradient calculation formula in the y-axis direction of matrix A is as follows:
[0065]
[0066] Gradient amplitude of the pixel points of the steel mesh preprocessing image:
[0067]
[0068] Azimuth angle of the pixel points of the steel mesh preprocessing image:
[0069]
[0070] Among them, each pixel point can obtain the position coordinates (i.e. (x, y)), scale (i.e. gradient amplitude) and direction (i.e. azimuth), traverse all the pixel points of the steel mesh preprocessing image, and record them in sequence as A1, A2, ...A N , where N represents the total number of all pixels. All pixels are sorted from small to large according to the gradient amplitude, and all the sorted pixels are renamed as k1, k2, ...k i ,…,k N , select the pixel with the largest gradient amplitude as the starting point of region growth, that is, k N The pixel point represented by k is selected as the center to select a 3×3 grid as the starting point of region growing. N The pixel point represented by the gradient descent is most obvious in the 3×3 grid and the azimuth angle is the same as k max Connect the pixels whose azimuth angle difference is within ±22.5°, and select a 3×3 grid with the pixel as the new center for region growing. Repeat this process until there are no pixels with azimuth angle difference within ±22.5° in the 3×3 grid.
[0071] Then, from k N-1 Start with k N-1 A 3×3 grid is selected with the representative pixel as the center for region growing. The region growing process is repeated until all pixels have completed region growing, thus forming a line segment.
[0072] Considering that the steel mesh is composed of transverse and longitudinal reinforcement, only horizontal and vertical line segments need to be retained. In this paper, it is assumed that the reinforcement in the length direction of the super-large steel mesh is the longitudinal reinforcement and the reinforcement in the width direction is the transverse reinforcement. The slopes of all line segments completed in the region growth in step 5 are calculated, and the line segments with slopes of 0 and infinity are retained, and irrelevant line segments are eliminated. The number of all remaining line segments is set to M, and the number of pixels contained in each line segment is recorded as T1, T2, ..., T i ,…T M .
[0073] Step 6: Remove the steel bar transverse ribs
[0074] The transverse ribs of the steel bars in the pre-processed image of the steel mesh also contain a large number of pixels, which will directly affect the accuracy of the overall size detection of the steel mesh. Considering that the diameter of the steel bars of the super-large steel mesh is generally 12-16 mm, the size conversion relationship in step 2 can be used to know the range of the number of pixels of the corresponding transverse ribs (the transverse rib range is generally 6-8 mm). Assuming the upper limit of the range of the number of pixels of the transverse ribs is S, the T in the pre-processed image of the steel mesh in step 5 is converted to iThe line segment <S is deleted (i.e., the transverse rib of the steel bar), and the image without the transverse rib of the steel bar is set as the final image of the steel mesh.
[0075] Step 7: Calculate the overall size of the steel mesh
[0076] After processing in step six, the final image of the steel mesh only contains the transverse and longitudinal bars of the steel mesh. Since the longitudinal bars of the super-large steel mesh are much larger than the transverse bars, for the remaining line segments determined after removing the transverse ribs of the steel bars in step six, the number of pixels contained in each remaining line segment is determined by step five, and the remaining line segments are divided into two categories - transverse bars and longitudinal bars. The number of pixels determines the length of the steel bars. The lengths of all transverse bars are similar, and the lengths of all longitudinal bars are similar. The longer ones (i.e., the ones with more pixels) are classified as longitudinal bars, and the shorter ones (i.e., the ones with fewer pixels) are classified as transverse bars.
[0077] Using the size conversion relationship calculation formula in step 2, the average number of pixels contained in each line segment in the longitudinal reinforcement of the steel mesh is taken, and then converted into the actual length of the steel mesh. Similarly, the average number of pixels contained in each line segment in the transverse reinforcement of the steel mesh is taken and converted into the actual width of the steel mesh, ensuring the accuracy of the steel mesh size calculation. At this point, the overall size calculation of the super-large steel mesh is completed.
[0078] The specific values of the camera parameters used for steel mesh image acquisition in this embodiment are shown in Table 4, and the output results after the above-mentioned size detection are shown in Table 5.
[0079] Table 4. Camera parameters used for steel mesh image acquisition
[0080]
[0081] Table 5. Output results
[0082]
[0083] Any matters not described in the present invention are applicable to the prior art.
Claims
1. A method for detecting the overall size of an oversized steel mesh, the method comprising the following steps: Step 1: Image Acquisition Place the oversized steel mesh flat on a base with a white background. Position the industrial camera mounted on the gantry perpendicular to the base and looking down to capture images. Record the vertical distance from the industrial camera to the oversized steel mesh as the working distance, expressed as D. Working distance D = long side of field of view × focal length / chip length. Arrange the image acquisition environment based on the working distance. Obtain the relationship between the actual size and the number of pixels, that is, the actual size / optical magnification = the corresponding number of pixels; Step 2: Grayscale the image The colors of all pixels in the steel mesh image are represented by the RGB color system, where R, G, and B represent the brightness values of the red, green, and blue color channels, respectively. The image grayscale processing is completed by graying the image using a weighted average. The steel mesh image after image grayscale processing is assumed to be a steel mesh grayscale image, and its brightness value is G, G = R × 0.30 + G × 0.59 + B × 0.
11. Step 3: Denoising Preprocessing Gaussian filtering denoising is performed using a 9×9 Gaussian kernel template, and the image after noise removal is set as the pre-processed image of the steel mesh; Step 4: Steel Mesh Area Growth Calculate the gradient amplitude and azimuth of all pixel points in the pre-processed image of the steel mesh. The position coordinates, gradient amplitude and azimuth of each pixel point can be obtained. Traverse all pixel points of the pre-processed image of the steel mesh and record them as A1, A2, ...A N , where N represents the total number of all pixels. All pixels are sorted from small to large according to the gradient amplitude, and all the sorted pixels are renamed k1, k2, ...k i ,…,k N , select the pixel with the largest gradient amplitude as the starting point of region growth, that is, k N The pixel point represented by k is selected as the center to select a 3×3 grid as the starting point of region growing. N The pixel point represented by the gradient descent is most obvious in the 3×3 grid and the azimuth angle is the same as k max Connect the pixels whose azimuth angle difference is within ±22.5°, and select a 3×3 grid with the pixel as the new center for region growing. Repeat this process until there are no pixels with azimuth angle difference within ±22.5° in the 3×3 grid. Then, from k N-1 Start with k N-1 A 3×3 grid is selected with the representative pixel as the center for region growing. The region growing process is repeated until all pixels have completed region growing, thus forming a line segment. Considering that the steel mesh is composed of horizontal and vertical bars, only horizontal and vertical line segments need to be retained. The slopes of all line segments completed by region growing are calculated, and the line segments with slopes of 0 and infinity are retained, otherwise they are eliminated. After eliminating irrelevant line segments, the number of all remaining line segments is set to M, and the number of pixels contained in each line segment is recorded as T1, T2, ..., T i ,…T M ; Step 5: Remove the steel bar transverse ribs Set the actual size range of the steel bar transverse rib, obtain the pixel number range of the transverse rib according to the relationship between the actual size and the number of pixels, set the upper limit of the pixel number range of the transverse rib as S, and set the number of pixels T contained in each line segment in the steel mesh preprocessing image obtained in step 4 i Compared with the upper limit S, if T i <S, then the line segment is deleted, that is, the transverse ribs are deleted, and the image without the transverse ribs is set as the final image of the steel mesh; Step 6. Calculate the overall size of the steel mesh After step five, the final image of the steel mesh contains only the transverse and vertical bars of the steel mesh. The steel bars in the length direction of the super-large steel mesh are assumed to be longitudinal bars, and the steel bars in the width direction are assumed to be transverse bars. The longitudinal bars of the super-large steel mesh are larger than the transverse bars. The corresponding number of pixels contained in all the remaining line segments after removing the transverse ribs of the steel bars is obtained. According to the two trends of the number of pixel points, the remaining line segments are divided into two categories: transverse bars and longitudinal bars. The category with more pixel points is classified as longitudinal bars, and the category with fewer pixel points is classified as transverse bars. By using the relationship between the actual size and the number of pixels, the average number of pixels contained in each line segment in the longitudinal reinforcement of the steel mesh is taken to convert it into the actual length of the steel mesh. Similarly, the average number of pixels contained in each line segment in the transverse reinforcement of the steel mesh is taken to convert it into the actual width of the steel mesh to obtain the overall size of the super-large steel mesh.
2. The method for detecting the overall size of an ultra-large steel mesh according to claim 1, characterized in that: The upper limit of the overall size of the super-large steel mesh is 32m×10m, and the actual size of the steel transverse ribs is in the range of 6-8mm.
3. The method for detecting the overall size of an ultra-large steel mesh according to claim 1, characterized in that: The 9×9 Gaussian kernel template is: Among them, (x, y) is the pixel coordinate of the grayscale image of the steel mesh, and its corresponding Gaussian value is h(x, y). Gaussian filtering is performed using the Gaussian formula: The standard deviation σ is 1.5, and the Gaussian filter weight matrix is: 。 4. The method for detecting the overall size of an ultra-large steel mesh according to claim 3, characterized in that: The calculation process of the gradient amplitude and azimuth of the pixel point is: The horizontal image gradient g x The (x,y) calculation formula is as follows: The image gradient g in the y-axis direction of matrix A y The (x,y) calculation formula is as follows: Gradient amplitude g(x,y) of the pixel point of the steel mesh preprocessing image: Azimuth angle θ(x,y) of the pixel point of the steel mesh preprocessing image:
Citation Information
Patent Citations
Workpiece detection method based on vision
CN109934839A
Steel bar size detection system and method based on image processing
CN111179232A