A method for determining the posture of a profiled steel based on the Hough transform

By using a steel profile attitude discrimination method based on Hough transform, the problems of errors and wasted manpower caused by reliance on human eyes for steel profile attitude detection are solved, and automated detection of steel profile attitude and improved production efficiency are realized.

CN116805332BActive Publication Date: 2026-02-03HUATIAN NANJING ENG & TECH CORP MCC +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310170231.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2026-02-03
Estimated Expiration
2043-02-27

AI Technical Summary

Technical Problem

Current technologies for detecting the posture of medium-sized steel sections rely on human visual inspection, which leads to large errors, waste of human resources, and potential safety hazards in production, making it impossible to achieve efficient automated production.

Method used

A steel profile attitude discrimination method based on Hough transform is adopted, including image preprocessing, edge detection, cross-sectional contour extraction and line detection. Through Gaussian filtering, histogram equalization, Canny operator and Hough transform, automatic steel profile attitude discrimination is achieved.

Benefits of technology

It enables precise and rapid detection of steel profile posture, reduces labor costs, improves production efficiency, and promotes automated production and intelligent manufacturing in steel enterprises.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116805332B_ABST
    Figure CN116805332B_ABST
Patent Text Reader

Abstract

The application discloses a method for identifying the posture of a profiled steel based on Hough transformation. The method comprises the following steps: S1, performing image preprocessing on an input profiled steel section image; S2, performing edge detection on the profiled steel image and extracting a contour; S3, extracting a section contour of a target profiled steel according to a region center coordinate; S4, performing straight line detection on the section contour by adopting Hough transformation; and S5, judging the posture of the profiled steel according to the straight line slope of the section. By means of image processing and Hough transformation and other related technologies, the application constructs an automatic identification system for the posture of the profiled steel, realizes the identification of the posture of the profiled steel section on a profiled steel production line, marks the profiled steel with an abnormal posture, further realizes intelligent sorting of the profiled steel production line, improves the production efficiency of a steel enterprise, reduces the labor cost, and further promotes the intelligent manufacturing transformation and upgrading and the intelligent development of the steel metallurgy field in China.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent manufacturing in metallurgy, machine vision, and image processing; more specifically, it relates to a method for determining the attitude of steel profiles based on Hough transform. Background Technology

[0002] On the steel section production line of steel enterprises, it is necessary to track the position, posture, and forming status of the steel sections in real time so as to provide immediate feedback and processing in case of abnormalities. Therefore, how to accurately, continuously, and over a long period of time detect the position and posture of the steel sections on the production line has become a research hotspot for metallurgical professionals. Currently, most steel mills in my country still rely on human eyes to detect the posture of steel sections on the production line, that is, sending front-line workers to monitor in real time through cameras or on-site. However, this detection method not only wastes human resources, but also inevitably introduces errors due to long working hours, leading to various production problems. Therefore, it is necessary to develop a steel section posture detection system based on machine vision. Through image processing and combined with machine learning and other related algorithms, the system can collect, analyze, and detect the cross-sectional images of the steel sections on the production line in real time, and feed the detection results back to the operators on-site or in the central control room in real time. This will enable remote automatic detection of the posture of steel sections on the production line, further realize automated production, improve the production efficiency of steel enterprises, reduce labor costs, and alleviate production or safety problems caused by human factors. Summary of the Invention

[0003] In view of the defects and shortcomings of the existing technology, the present invention provides a method for steel profile attitude discrimination based on Hough transform.

[0004] To achieve the above objectives, the steel profile attitude determination method based on Hough transform of the present invention includes the following steps:

[0005] S1: Perform image preprocessing on the input steel section image, including denoising, histogram equalization, grayscale transformation, etc.

[0006] S2: Use the Canny operator to perform edge detection and extract contours from the steel profile image;

[0007] S3: Extract the cross-sectional profile of the target steel section based on the coordinates of the region center;

[0008] S4: Use Hough transform to detect straight lines in the cross-sectional profile;

[0009] S5: Determine the posture of the steel section based on the slope of the straight section.

[0010] Furthermore, step S1 specifically includes:

[0011] S11: Preprocess the input steel section image. First, perform image denoising by applying Gaussian filtering to the image containing noise points to suppress noise while preserving the image's details.

[0012] S12: Perform histogram equalization on the image after Gaussian filtering. This process enhances the contrast between the target and the background in images with poor contrast and blurred key areas.

[0013] S13: After completing bilateral filtering and histogram equalization of the image in steps S11 and S12, the image is transformed to extract the grayscale image, which facilitates subsequent contour extraction.

[0014] Furthermore, step S2 specifically includes:

[0015] S21: Calculate the horizontal and vertical gradients of the image, and calculate the combined gradient value and its direction.

[0016] S22: Use nonmaximum suppression to suppress pseudo-boundary points.

[0017] S23: Perform double threshold detection on the binary image after nonmaximum suppression.

[0018] S24: Edge detection is performed by hysteresis tracking of edges and suppression of all weak edges that are not connected to strong edges, thus extracting the boundary contours of the image.

[0019] Furthermore, step S4 specifically includes:

[0020] S41: Transform the cross-sectional profile coordinates of the target steel extracted in steps S2 and S3 to the polar coordinate system, and establish a two-dimensional array as an accumulator.

[0021] S42: Traverse all pixels in the image, map each target pixel to the corresponding point in the parameter space, and increment the accumulator of the corresponding point by 1.

[0022] S43: Find the maximum value of the accumulator in the parameter space and obtain its corresponding polar coordinate position.

[0023] S44: Map the position of the maximum point in the parameter space to the image space to obtain the corresponding straight line, thus completing the straight line detection of the cross-sectional contour.

[0024] Furthermore, the Gaussian filtering operation is a weighted averaging process of the image. The value of each pixel is obtained by weighting its own value and the values ​​of other pixels in its neighborhood, which is a linear smoothing filter. For a given Gaussian filter template, the coordinates of each position are substituted into the Gaussian function, and the resulting values ​​are the coefficients of the Gaussian template. The two-dimensional Gaussian function is as follows:

[0025]

[0026] Where σ is the standard deviation of the normal distribution, and the commonly used 3*3 and 5*5 Gaussian templates are as follows:

[0027]

[0028] The Gaussian filter iterates through each pixel of the image using a Gaussian template. Each pixel is multiplied by its neighbors and the corresponding template element, and the sum replaces the original pixel value. After iterating through all pixels, the image is successfully filtered using Gaussian filtering. Gaussian filtering effectively suppresses noise and smooths the image. The farther away from the center of the template, the smaller the template coefficients of the Gaussian filter. Therefore, the Gaussian filter produces less blurring than the mean filter.

[0029] Furthermore, the histogram equalization process first scans each pixel in the original image and calculates the histogram of pixel values ​​in different channels; second, it calculates the cumulative distribution function of the histogram for each channel; then, based on the cumulative distribution function and the histogram equalization principle, it obtains the mapping relationship between the input and output; finally, it performs image transformation based on the mapping relationship to enhance the contrast between the target object and the background in the image. The mapping method is as follows:

[0030]

[0031] Where S k The value of the current channel pixel is the result of the cumulative distribution function mapping, where n is the sum of the pixels in the image. j L represents the number of pixel levels in the current channel, where L is the total number of pixel levels in a single channel of the image.

[0032] Furthermore, the grayscale transformation is defined by the following formula:

[0033] f(i,j)=0.30R(i,j)+0.59G(i,j)+0.11B(i,j)

[0034] Where f(i,j) represents the pixel value of the point after transformation, and R(i,j), G(i,j), and B(i,j) represent the R, G, and B values ​​of the point before transformation.

[0035] A method for determining the attitude of structural steel based on Hough transform, characterized in that: the gradient calculation can use the Prewitt operator to calculate the gradient magnitude and direction, wherein the templates for the vertical and horizontal directions of the Prewitt operator are as follows:

[0036]

[0037] Using the Prewitt template, traversing each pixel of the image from left to right and top to bottom, the formulas for calculating the gradients in the vertical and horizontal directions are as follows:

[0038]

[0039] Where P5 is the current pixel, and P1-P7 are the 8 neighboring pixels.

[0040] The combined gradient based on the Prewitt operator is the root of the sum of the squares of the gradients in the horizontal and vertical directions. The formulas for calculating its gradient magnitude and direction are as follows:

[0041]

[0042] Furthermore, the non-maximum suppression operation involves finding the local maximum value of a pixel in the gradient image and setting the gray value corresponding to the non-maximum point to 0. Specifically, this is done by comparing the gradient intensity of the current pixel with two pixels along the positive and negative gradient directions. If the gradient intensity of the current pixel is the largest compared to the other two pixels, then the pixel is retained as an edge point; otherwise, the pixel is suppressed (its gray value is set to 0). Through the non-maximum suppression operation, a large portion of non-edge points in the image can be removed.

[0043] Furthermore, the dual-threshold detection involves setting two appropriate high and low thresholds. If the gradient value of an edge pixel is higher than the high threshold, it is marked as a strong edge pixel. If the gradient value of an edge pixel is lower than the high threshold but higher than the low threshold, it is marked as a weak edge pixel. If the gradient value of an edge pixel is lower than the low threshold, it is suppressed. In other words, pixels with a gradient value greater than the high threshold (strong edge points) are considered true boundaries, pixels with a gradient value between the high and low thresholds (weak edge points) are considered false boundaries, and pixels with a gradient value less than the low threshold are considered non-boundary points and their values ​​are set to 0.

[0044] Furthermore, the aforementioned hysteresis tracking edge mainly involves detecting strong and weak edges, checking whether there are strong edge points within the 8-neighborhood pixels of a weak edge point. Strong and weak edge points in a real edge are connected, while weak edge points caused by noise are independent. If there are no strong edge points within the 8-neighborhood of a weak edge point, then the pixel of that point is set to 0. By hysteresis boundary tracking, it can be determined whether a weak edge is a real edge, thus removing false boundaries.

[0045] Furthermore, the coordinate system transformation, for a point (x, y) in a two-dimensional rectangular coordinate system, transforms it to a point (ρ, θ) in a polar coordinate system, and the transformation formula is as follows:

[0046]

[0047] Furthermore, regarding the determination of steel profile posture based on the slope of a straight line, this project proposes corresponding posture determination methods for four types of steel profiles: H-beams, angle steel, channel steel, and T-beams.

[0048] For H-beams, a correctly oriented H-beam can be detected by the Hough transform to have 6 perpendicular straight lines, while an incorrectly oriented H-beam can only be detected to have 4 perpendicular straight lines.

[0049] For angle steel, the Hough transform cannot detect perpendicular straight lines in angle steel with the correct orientation, while two perpendicular straight lines can be detected in angle steel with the incorrect orientation.

[0050] For channel steel, the correct orientation of H-beams can be detected by Hough transform to have four horizontal straight lines. The two shorter lines are on the same horizontal line and are located at the top, while the two longer lines are located at the bottom.

[0051] For T-shaped steel, a T-shaped steel with the correct orientation can be detected by Hough transform with three horizontal straight lines, while a T-shaped steel with the incorrect orientation cannot be detected with horizontal straight lines.

[0052] This invention provides a steel section posture detection method based on Hough transform. Through image processing and machine learning, it performs Gaussian denoising and histogram equalization on the steel section image to remove irrelevant noise points, enhance the contrast between the target and background, and highlight the edge features of the section. The Canny operator is used to detect the overall edge of the image, and the section contour is extracted based on the region center coordinates. Finally, the slope of the straight line of the section contour is detected by Hough transform, and the posture of the steel section is determined using a given discrimination method. The establishment of this automatic steel section posture discrimination system enables intelligent detection of steel section posture on the production line in steel enterprises. It boasts high accuracy, high speed, and 24-hour uninterrupted detection, significantly reducing labor costs and production or safety issues caused by human factors, thereby improving the production efficiency of steel enterprises. This project further realizes automated production in steel enterprises through machine vision inspection methods, promoting the intelligent manufacturing transformation and upgrading and intelligent development of my country's metallurgical industry. Attached Figure Description

[0053] Figure 1 This is a flowchart of the present invention.

[0054] Figure 2 This is a diagram showing the edge detection effect based on Canny in this invention.

[0055] Figure 3 This is an extraction diagram of the cross-sectional contour of the present invention.

[0056] Figure 4 This is a diagram showing the detection effect of the Hough transform in this invention.

[0057] Figure 5 This is an actual detection diagram of the angle steel posture in this invention.

[0058] Figure 6A This diagram illustrates the correct orientation of an H-beam. Figure 6B This is a diagram illustrating an incorrect posture of an H-beam.

[0059] Figure 7A A diagram showing the correct posture of angle steel. Figure 7B , Figure 7C This is a diagram illustrating an incorrect posture of an angle steel.

[0060] Figure 8A This is a diagram showing the correct orientation of the channel steel. Figure 8B , Figure 8C and Figure 8D This is a diagram illustrating an incorrect orientation of the channel steel.

[0061] Figure 9A This diagram illustrates the correct orientation of a T-shaped steel beam. Figure 9B , Figure 9C This is a diagram illustrating an incorrect posture of a T-shaped steel beam. Detailed Implementation

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

[0063] In the description of this invention, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0064] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0065] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0066] The steel profile attitude determination method based on Hough transform of the present invention includes the following steps:

[0067] S1: Perform image preprocessing on the input steel section image, including denoising, histogram equalization, grayscale transformation, etc.

[0068] S2: Use the Canny operator to perform edge detection and extract contours from the steel profile image;

[0069] S3: Extract the cross-sectional profile of the target steel section based on the coordinates of the region center;

[0070] S4: Use Hough transform to detect straight lines in the cross-sectional profile;

[0071] S5: Determine the posture of the steel section based on the slope of the straight section.

[0072] Specifically, step S1 described above is as follows:

[0073] S11: Preprocess the input steel section image. First, perform image denoising by applying Gaussian filtering to the image containing noise points to suppress noise while preserving the image's details.

[0074] S12: Perform histogram equalization on the image after Gaussian filtering. This process enhances the contrast between the target and the background in images with poor contrast and blurred key areas.

[0075] S13: After completing bilateral filtering and histogram equalization of the image in steps S11 and S12, the image is transformed to extract the grayscale image, which facilitates subsequent contour extraction.

[0076] Specifically, step S2 above is as follows:

[0077] S21: Calculate the horizontal and vertical gradients of the image, and calculate the combined gradient value and its direction.

[0078] S22: Use nonmaximum suppression to suppress pseudo-boundary points.

[0079] S23: Perform double threshold detection on the binary image after nonmaximum suppression.

[0080] S24: Edge detection is performed by hysteresis tracking of edges and suppression of all weak edges that are not connected to strong edges, thus extracting the boundary contours of the image.

[0081] Specifically, step S4 above is as follows:

[0082] S41: Transform the cross-sectional profile coordinates of the target steel extracted in steps S2 and S3 to the polar coordinate system, and establish a two-dimensional array as an accumulator.

[0083] S42: Traverse all pixels in the image, map each target pixel to the corresponding point in the parameter space, and increment the accumulator of the corresponding point by 1.

[0084] S43: Find the maximum value of the accumulator in the parameter space and obtain its corresponding polar coordinate position.

[0085] S44: Map the position of the maximum point in the parameter space to the image space to obtain the corresponding straight line, thus completing the straight line detection of the cross-sectional contour.

[0086] The Gaussian filtering operation described above is a weighted averaging process for an image. The value of each pixel is obtained by weighting its own value and the values ​​of other pixels in its neighborhood, which is a linear smoothing filter. For a given Gaussian filter template, substituting the coordinates of each position into the Gaussian function yields the coefficients of the Gaussian template. The two-dimensional Gaussian function is as follows:

[0087]

[0088] Where σ is the standard deviation of the normal distribution, and the commonly used 3*3 and 5*5 Gaussian templates are as follows:

[0089]

[0090] The Gaussian filter iterates through each pixel of the image using a Gaussian template. Each pixel is multiplied by its neighbors and the corresponding template element, and the sum replaces the original pixel value. After iterating through all pixels, the image is successfully filtered using Gaussian filtering. Gaussian filtering effectively suppresses noise and smooths the image. The farther away from the center of the template, the smaller the template coefficients of the Gaussian filter. Therefore, the Gaussian filter produces less blurring than the mean filter.

[0091] The aforementioned histogram equalization first scans each pixel in the original image and calculates the histogram of pixel values ​​in different channels; secondly, it calculates the cumulative distribution function of the histogram for each channel; then, based on the cumulative distribution function and the principle of histogram equalization, it obtains the mapping relationship between the input and output; finally, it performs image transformation based on the mapping relationship to enhance the contrast between the target object and the background in the image. The mapping method is as follows:

[0092]

[0093] Where S k The value of the current channel pixel is the result of the cumulative distribution function mapping, where n is the sum of the pixels in the image. j L represents the number of pixel levels in the current channel, where L is the total number of pixel levels in a single channel of the image.

[0094] The grayscale transformation described above is calculated using the following formula:

[0095] f(i,j)=0.30R(i,j)+0.59G(i,j)+0.11B(i,j)

[0096] Where f(i,j) represents the pixel value of the point after transformation, and R(i,j), G(i,j), and B(i,j) represent the R, G, and B values ​​of the point before transformation.

[0097] The gradient calculation described above can be performed using the Prewitt operator to calculate the gradient magnitude and direction. The templates for the vertical and horizontal directions of the Prewitt operator are as follows:

[0098]

[0099] Using the Prewitt template, traversing each pixel of the image from left to right and top to bottom, the formulas for calculating the gradients in the vertical and horizontal directions are as follows:

[0100]

[0101] Where P5 is the current pixel, and P1-P7 are the 8 neighboring pixels.

[0102] The combined gradient based on the Prewitt operator is the root of the sum of the squares of the gradients in the horizontal and vertical directions. The formulas for calculating its gradient magnitude and direction are as follows:

[0103]

[0104] The non-maximum suppression operation described above finds the local maximum value of a pixel in the gradient image and sets the gray value corresponding to the non-maximum point to 0. Specifically, it compares the gradient strength of the current pixel with that of two pixels along the positive and negative gradient directions. If the gradient strength of the current pixel is the largest compared to the other two pixels, the pixel is retained as an edge point; otherwise, the pixel is suppressed (its gray value is set to 0). This non-maximum suppression operation can remove a large portion of non-edge points from the image.

[0105] The aforementioned dual-threshold detection sets two appropriate high and low thresholds. If the gradient value of an edge pixel is higher than the high threshold, it is marked as a strong edge pixel. If the gradient value of an edge pixel is lower than the high threshold but higher than the low threshold, it is marked as a weak edge pixel. If the gradient value of an edge pixel is lower than the low threshold, it is suppressed. In other words, pixels with a gradient value greater than the high threshold (strong edge points) are considered true boundaries, pixels with a gradient value between the high and low thresholds (weak edge points) are considered false boundaries, and pixels with a gradient value less than the low threshold are considered non-boundary points and their values ​​are set to 0.

[0106] The aforementioned hysteresis tracking edge mainly detects strong and weak edges, checking whether there are strong edge points within the 8-neighborhood pixels of a weak edge point. Strong and weak edge points in a real edge are connected, while weak edge points caused by noise are independent. If there are no strong edge points within the 8-neighborhood of a weak edge point, the pixel of that point is set to 0. By hysteresis boundary tracking, it can be determined whether a weak edge is a real edge and remove false edges.

[0107] The coordinate system transformation described above, for a point (x, y) in a two-dimensional rectangular coordinate system, transforms it to a point (ρ, θ) in a polar coordinate system. The transformation formula is as follows:

[0108]

[0109] The above method for judging the posture of steel sections based on the slope of a straight line is discussed. This project proposes corresponding posture judgment methods for four types of steel sections: H-beams, angle steel, channel steel, and T-beams. For H-beams, the correct and incorrect posture conditions and the judgment methods are as follows:

[0110] For H-beams, a correctly oriented H-beam can be detected by the Hough transform to have six perpendicular straight lines, such as... Figure 6A As shown, incorrect poses can only detect 4 perpendicular straight lines, such as... Figure 6B As shown.

[0111] For channel steel, the Hough transform cannot detect perpendicular straight lines in angle steel with the correct orientation, such as... Figure 7A As shown, angle steel with incorrect posture can be detected with two perpendicular straight lines, such as... Figure 7B and Figure 7C As shown.

[0112] For channel steel, a correctly oriented H-beam can be detected using the Hough transform to show four horizontal straight lines: the two shorter lines are on the same horizontal plane and positioned higher, while the two longer lines are positioned lower. Figure 8A As shown, all others are incorrect, such as... Figure 8B , Figure 8C and Figure 8D As shown.

[0113] For T-shaped steel, a correctly oriented T-shaped steel can be detected by Hough transform to have three horizontal straight lines, such as... Figure 9A As shown, a T-shaped steel beam with an incorrect orientation cannot be detected as having a horizontal straight line. Figure 9B and Figure 9C As shown.

[0114] Example 1

[0115] This embodiment presents a steel profile attitude detection algorithm based on Hough transform, which includes Gaussian filtering for noise reduction of the steel profile cross-section image, histogram equalization, grayscale transformation, Canny edge detection, Hough transform, and actual detection of the steel profile. The steps are as follows:

[0116] Step 1: For the input steel cross-section image, first perform Gaussian filtering to remove noise. For the steel section image in this example, select a 5*5 Gaussian filter template, traverse each pixel in the image, and multiply and sum the values ​​of each pixel and its 5*5 neighboring pixels with the 25 values ​​at the corresponding positions of the Gaussian template. Replace the original pixel value with the final value. Perform the above operation on the pixel values ​​of the three channels in the image to complete the Gaussian filtering noise removal of the steel section image.

[0117] Step 2: Perform histogram equalization on the image processed by Gaussian filtering in Step 1. Count the pixel values ​​of all pixels in each of the three channels (R (red), G (green), and B (blue) of the input image, and classify them. Count the number of pixels at each pixel level to form a histogram. Then, sum the histograms from each channel to calculate the cumulative distribution function for each channel. Interpolate the cumulative distribution function to obtain new pixel values. Replace the original pixel values ​​with the new pixel values ​​for each channel to obtain the result of histogram equalization of the color image. Histogram equalization compresses the small percentage of pixels in the image, making the histogram distribution more uniform and expanding the dynamic range of pixel value differences, thereby enhancing the overall contrast of the image.

[0118] Step 3: Perform grayscale processing on the images processed in Step 1 and Step 2. Specifically, the pixel values ​​of the three channels of the image are weighted and averaged, with the R, G, and B channels assigned weights of 0.3, 0.59, and 0.11 respectively. The results are then summed, and the original three-channel pixel values ​​are converted into a single-channel grayscale image.

[0119] Step 4: After completing the image preprocessing, the image is then subjected to Canny edge detection. First, the gradient image of the image is calculated based on the Prewitt operator. Specifically, the vertical and horizontal templates of the Prewitt operator are applied to each pixel of the input image to obtain the vertical and horizontal gradients of each pixel. Then, the comprehensive gradient value and its direction are calculated, and the comprehensive gradient value is used to replace the original pixel value to obtain the gradient image based on the Prewitt operator.

[0120] Step 5: After completing the gradient extraction based on the Prewitt operator, the edge information of the image is obtained. Next, non-maximum suppression is performed on the image. Specifically, each pixel is traversed, and the gradient strength of the current pixel is compared with the two pixels along the positive and negative gradient directions. If the gradient strength of the current pixel is the largest compared with the other two pixels, the pixel is retained as an edge point; otherwise, the pixel is suppressed (its grayscale value is set to 0). When the above operation is performed on all pixels in the gradient image, the non-maximum suppression operation on the gradient image is completed.

[0121] Step Six: For the gradient image after non-maximum suppression, a large portion of non-edge points have been removed. Then, perform double threshold detection on the image, setting two appropriate high and low thresholds (in this example, the high and low thresholds are set to 150 and 50 respectively). Iterate through all pixels in the gradient image. If the gradient value of a pixel is higher than the high threshold, it is marked as a strong edge pixel; if it is between the high and low thresholds, it is marked as a weak edge pixel; and if it is lower than the low threshold, it is removed (pixel value is set to 0). Perform the above operation on all edge pixels in the gradient image to complete the double threshold detection of the gradient image.

[0122] Step 7: After completing the dual-threshold detection, the edge pixels in the gradient image are divided into strong edge points and weak edge points. Finally, weak edges are filtered using hysteresis tracking to obtain a Canny-based edge map. Specifically, it checks whether there are strong edge points within the 8-neighborhood pixels of all weak edge points in the gradient image. If so, the edge point is saved; if there are no strong edge points within the 8-neighborhood, the edge point is removed (pixel value set to 0). In this example, the Canny edge detection effect for the steel profile is as follows: Figure 2 As shown.

[0123] Step 8: After obtaining the edge map based on Canny, for all contours in the map, calculate the center coordinates of these contours. Using the Euclidean distance formula, measure the distance between these contours and the coordinates of the image center region. The contour with the smallest distance is the contour of the steel section. In this example, the steel section contour extracted based on the Canny algorithm and comparison of the region center coordinates is as follows: Figure 3 As shown.

[0124] Step 8: After extracting the cross-sectional profile of the steel section, the final step is to perform a Hough transform on the profile to detect the slope of the straight lines. First, a coordinate system transformation is performed to convert the coordinates of the two-dimensional plane cross-sectional profile to a polar coordinate system, and a two-dimensional array accumulator is established. Then, all pixels in the cross-sectional profile image are traversed for polar coordinate mapping. The accumulator is incremented by one after each target pixel is mapped. Finally, the maximum value of the accumulator in the mapped parameter space is calculated, and its corresponding polar coordinate position is obtained. Then, the position of the maximum value is mapped back to the original image space to obtain the corresponding straight line. The detection effect of the Hough transform in this example is as follows: Figure 4 As shown (horizontal and vertical slopes are represented by red and green colors, and other slopes are not set).

[0125] Step Nine: After detecting the straightness of the steel section profile using the Hough transform, the steel posture is judged according to the given criteria. A correctly postured H-beam has 6 vertical straight lines, a correctly postured angle steel has no vertical straight lines, a correctly postured channel steel has 4 horizontal straight lines (two shorter lines at the top and at the same level), and a correctly postured T-beam has 3 horizontal straight lines. All other postures are incorrect. This example focuses on the posture detection of angle steel. Figure 5 As shown.

[0126] This invention provides a steel section posture detection method based on Hough transform. Through image processing and machine learning, it performs Gaussian denoising and histogram equalization on the steel section image to remove irrelevant noise points, enhance the contrast between the target and background, and highlight the edge features of the section. The Canny algorithm is used to detect the overall edge of the image, and the section contour is extracted based on the region center coordinates. Finally, the slope of the straight line of the section contour is detected by Hough transform, and the posture of the steel section is determined using a given discrimination method. The establishment of this automatic steel section posture discrimination system enables intelligent detection of steel section posture on the production line in steel enterprises. It boasts high accuracy, high speed, and 24-hour uninterrupted detection, significantly reducing labor costs and production or safety issues caused by human factors, thereby improving the production efficiency of steel enterprises. This project further realizes automated production in steel enterprises through machine vision inspection methods, promoting the intelligent manufacturing transformation and upgrading and intelligent development of my country's metallurgical industry.

[0127] In the description of this specification, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.

[0128] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for determining the attitude of structural steel based on Hough transform, characterized in that, The method includes the following steps: S1: Perform image preprocessing on the input steel section image; S2: Perform edge detection and extract contours from the steel profile image; S3: Extract the cross-sectional profile of the target steel section based on the coordinates of the region center; S4: Use Hough transform to detect straight lines in the cross-sectional profile; S5: Determine the posture of the steel section based on the slope of the straight section; The specific steps of S4 are as follows: S41: Transform the cross-sectional profile coordinates of the target steel extracted in steps S2 and S3 to the polar coordinate system, and establish a two-dimensional array as an accumulator. S42: Traverse all pixels in the image, map each target pixel to the corresponding point in the parameter space, and increment the accumulator of the corresponding point by 1; S43: Find the maximum value of the accumulator in the parameter space and obtain its corresponding polar coordinate position; S44: Map the position of the maximum point in the parameter space to the image space to obtain the corresponding straight line, and complete the straight line detection of the cross-sectional contour; The steps for determining the attitude of the steel section based on the slope of the cross-section include: Obtain the types of structural steel; For H-beams, a correctly oriented H-beam can be detected by the Hough transform to have 6 perpendicular straight lines. For angle steel, a perpendicular straight line cannot be detected by the Hough transform for angle steel in the correct orientation. For channel steel, the H-beam with the correct posture can be detected by Hough transform to have 4 horizontal straight lines. The two shorter ones are on the same horizontal line and are located at the top, while the two longer ones are located at the bottom. For T-shaped steel, the correct orientation of the T-shaped steel can be detected by Hough transform, which can identify three horizontal straight lines.

2. The method for determining the attitude of structural steel based on Hough transform as described in claim 1, characterized in that, The specific steps of S1 are as follows: S11: Denoise the input steel section image and perform Gaussian filtering on the image containing noise points; S12: Perform histogram equalization on the Gaussian filtered image to enhance the contrast between the target and the background; S13: Perform grayscale transformation on the image to extract the grayscale image.

3. The method for determining the attitude of steel profiles based on Hough transform as described in claim 1, characterized in that, The specific steps of step S2 are as follows: S21: Calculate the horizontal and vertical gradients of the image, and calculate the combined gradient value and its direction; S22: Use nonmaximum suppression to suppress false boundary points; S23: Perform double threshold detection on the binary image after nonmaximum suppression; S24: Edge detection is performed by hysteresis tracking of edges and suppression of all weak edges that are not connected to strong edges, thus extracting the boundary contours of the image.

4. The method for determining the attitude of steel profiles based on Hough transform as described in claim 2, characterized in that: The Gaussian filtering operation described above uses a given Gaussian template to traverse each pixel of the image. The pixel is multiplied by its neighborhood and the corresponding template element, and the summation value replaces the original pixel value.

5. The method for determining the attitude of steel profiles based on Hough transform as described in claim 2, characterized in that: The histogram equalization process first scans each pixel in the original image and calculates the histogram of the image's pixel values ​​in different channels. Secondly, the cumulative distribution function of the histogram for each channel is calculated; then, based on the cumulative distribution function and the histogram equalization principle, the mapping relationship between input and output is obtained; finally, image transformation is performed based on the mapping relationship; the mapping method is as follows: Where S k The value of the current channel pixel is the result of the cumulative distribution function mapping, where n is the sum of the pixels in the image. j L represents the number of pixel levels in the current channel, where L is the total number of pixel levels in a single channel of the image.

6. The method for determining the attitude of steel profiles based on Hough transform as described in claim 2, characterized in that: The grayscale transformation formula is as follows: f(i,j)=0.30R(i,j)+0.59G(i,j)+0.11B(i,j) Where f(i,j) represents the pixel value of the point after transformation, and R(i,j), G(i,j), and B(i,j) represent the R, G, and B values ​​of the point before transformation.

7. The method for determining the attitude of steel profiles based on Hough transform as described in claim 3, characterized in that: The steps of the nonmaximum suppression operation include: comparing the gradient intensity of the current pixel with two pixels along the positive and negative gradient directions; if the gradient intensity of the current pixel is the largest compared with the other two pixels, then the pixel is retained as an edge point; otherwise, the pixel will be suppressed.

Citation Information

Patent Citations

  • Identification method of buckling of band steel

    CN105678731A