A method and device for detecting the shape of a plate head based on image processing
Patent Information
- Application Number
- CN202610847355.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-12
- Publication Date
- 2026-09-25
AI Technical Summary
现有的图像检测方案在面对钢板头部复杂的局部凹凸、缺损或反光时,极易产生误判,难以准确界定头部与主体的分界线
(1)本发明通过动态自适应阈值与形态学处理相结合,实现了复杂背景下中厚板主体的鲁棒提取。针对高温轧制现场光照变化大、表面反光及水汽干扰的问题,基于绝对直方图统计分析自动选择包含目标灰度值且上限值最大的区间作为分割阈值,并结合孔洞填充与形态学开运算,有效消除了表面纹理造成的内部孔洞和孤立噪声点;进一步引入面积与矩形度双重特征筛选,确保了提取出的中厚板主体区域的完整性与准确性,为后续头部定位提供了可靠的基准。
Smart Images

Figure CN122820563A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of steel plate shape detection technology during the rolling process, and in particular to a method and apparatus for detecting the head shape of medium and heavy plates based on image processing. Background Technology
[0002] In the rolling process of medium and heavy plates, the detection of the head shape is crucial for quality control. Traditional methods rely on manual visual inspection or contact sensors, which suffer from low efficiency, high subjectivity, and susceptibility to high temperatures. In high-temperature rolling environments, images captured by industrial cameras often exhibit overexposure, blurred edges, and moisture interference, further increasing the difficulty of automated detection. Existing image detection schemes are prone to misjudgment when faced with complex local concavities, defects, or reflections at the steel plate head, making it difficult to accurately define the boundary between the head and the main body. Furthermore, current technologies lack effective methods for quantifying head deformation and symmetry, failing to provide accurate data support for optimizing the rolling process. Therefore, how to accurately extract the head contour of medium and heavy plates and achieve quantitative evaluation of shape features in harsh industrial environments with high temperatures and multiple interferences has become a critical problem that urgently needs to be solved in this field. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a method and apparatus for detecting the head shape of a medium-thick plate based on image processing.
[0004] To solve the above technical problems, the technical solution of the present invention is as follows: In a first aspect, the present invention provides a method for detecting the head shape of a medium-thick plate based on image processing, comprising: acquiring an original image of the medium-thick plate and performing geometric correction on it to obtain a vertical top view; performing image preprocessing and connected component analysis on the vertical top view to extract the main body region of the medium-thick plate; performing multi-level contour scanning along the longitudinal direction based on the main body region of the medium-thick plate, and determining the head starting line of the medium-thick plate based on the width contraction feature of the continuous scanning lines to determine the corresponding head region and its contour; dividing the contour of the head region into equal horizontal sections to generate contour feature curves, and calculating the area of the left and right sides of the head region respectively, thereby calculating the left-right symmetry ratio of the head.
[0005] Secondly, the present invention also provides a machine vision-based head shape detection device for medium-thick plates, comprising: an image correction module for acquiring the original image of the medium-thick plate and performing geometric correction to obtain a vertical top view; a main body extraction module for performing image preprocessing and connected region analysis on the vertical top view to extract the main body region of the medium-thick plate; a head region extraction module for performing multi-level contour scanning along the longitudinal direction based on the main body region of the medium-thick plate, and determining the head starting line of the medium-thick plate based on the width contraction feature of the continuous scanning lines to define the corresponding head region and its contour; and a quantization evaluation module for performing equal horizontal division based on the contour of the head region to generate contour feature curves, and calculating the area of the left and right sides of the head region respectively, thereby calculating the left-right symmetry ratio of the head.
[0006] The beneficial effects of this invention are: (1) This invention achieves robust extraction of the main body of medium-thick plates under complex backgrounds by combining dynamic adaptive thresholding with morphological processing. In view of the problems of large changes in lighting, surface reflection and water vapor interference in the high-temperature rolling site, the interval containing the target gray value and the largest upper limit value is automatically selected as the segmentation threshold based on absolute histogram statistical analysis. Combined with hole filling and morphological opening operation, internal holes and isolated noise points caused by surface texture are effectively eliminated. Furthermore, the dual feature screening of area and rectangularity is introduced to ensure the integrity and accuracy of the extracted main body area of medium-thick plates, providing a reliable benchmark for subsequent head positioning.
[0007] (2) Traditional bottom-up scanning is prone to mistaking pits on the head edge for dividing lines. This invention innovatively proposes a multi-level contour scanning strategy of "positioning anchor points + reverse fine scanning + counter backtracking", which completely solves the problem of misjudgment caused by local concavity and convexity of the head edge. First, a preliminary scan confirms the entry into the main body area with stable width and establishes the "positioning anchor point row". Then, a single-pixel-level fine scan is performed from the anchor point row in reverse towards the head, and the narrowing state counter is used to determine the continuous narrowing trend. Finally, the backtracking stabilization threshold is used to accurately lock the real head starting row. This strategy effectively filters out local defects and noise interference, and greatly improves the robustness and accuracy of head contour positioning.
[0008] (3) This invention converts the head contour into a piecewise linear curve to depict the overall trend, and generates left and right half-region rectangles by calculating the vertical central axis. The left and right regions are accurately separated by the region difference operation. By calculating the area of the left and right sides and their symmetry ratio, the "uniformity of the head shape" that originally relied on subjective human judgment is transformed into a precise quantitative indicator, providing solid data support for the closed-loop control of rolling process parameters and product quality rating. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 A schematic flowchart of the image processing-based head shape detection method for medium-thick plates provided by the present invention; Figure 2 This is a schematic diagram illustrating the selection of coordinate points in the affine coordinate transformation of an image in this invention; Figure 3 This is a schematic diagram comparing the image before and after affine transformation in this invention; Figure 4 This is a schematic diagram of the image preprocessing process in this invention, wherein... Figure 4 'a' is a binarized image. Figure 4 b is the image after image filling. Figure 4 c represents the image after the image opening operation; Figure 5 This is a schematic diagram of the main body area and outline of the medium-thick plate extracted in this invention; Figure 6 This is a schematic diagram of the equal division of the head contour and the generation of feature curves in this invention; Figure 7 This is a schematic diagram illustrating the division of the left and right sides of the head in this invention. Figure 7 'a' represents the left side contour area of the head. Figure 7 b represents the right side contour area of the head; Figure 8 This is a schematic diagram of the structure of a machine vision-based head shape detection device for medium-thick plates provided by the present invention. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0012] The terms "first," "second," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein.
[0013] It should be understood that in this invention, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0014] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0015] This invention provides a method for detecting the head shape of a medium-thick plate based on image processing, such as... Figure 1 As shown, the method specifically includes the following steps: S1. Obtain the original image of the medium-thick plate and perform geometric correction to obtain a vertical top view.
[0016] It should be noted that in steel rolling mills, industrial cameras are typically mounted at an angle close to 90° above the rolling line. Due to this shooting angle, the raw images acquired exhibit perspective distortion (objects appear larger in the foreground and smaller in the background), and direct processing would lead to dimensional measurement inaccuracies. This step aims to eliminate this geometric distortion and restore the true physical proportions of the steel sheet.
[0017] Understandably, the system synchronously triggers an industrial camera (such as a 2-megapixel GigE Vision camera) via fiber optic cable to capture the original image when the steel plate head enters the field of view. Combined with... Figure 2 As shown, multiple key points (such as the four corner points) and their corresponding actual physical coordinates are selected in the roller conveyor area of the original image; the projection transformation matrix is calculated based on the key points and their actual coordinates. Figure 3 As shown, an affine transformation is performed on the original image using a projection transformation matrix to obtain a vertical top view that eliminates perspective distortion.
[0018] The vertical top view refers to an image projected vertically downwards from directly above, in which the width ratio of the steel plate is consistent with its actual physical dimensions.
[0019] S2, perform image preprocessing and connected region analysis on the vertical top view to extract the main body region of the medium-thick plate.
[0020] It should be noted that the steel rolling mill environment is harsh, and images are often obscured by moisture, reflective iron oxide scale, and interference from background roller conveyors. The core of this step is to robustly extract the complete target area of medium-thick plates from the complex industrial scene.
[0021] In some embodiments, step S2 specifically includes S21-S23: S21, the vertical top view is filtered and smoothed, and the initial binary region is obtained by binarization segmentation based on dynamic adaptive threshold.
[0022] Understandably, the original grayscale image is processed first. Gaussian filtering or median filtering is performed to obtain a smooth image. .calculate absolute histogram The calculation formula is as follows: Where W and H are the width and height of the image, respectively; Let Kronecker function be used when The value is 1 when the time is right, and 0 otherwise. It is a grayscale level.
[0023] Based on the absolute histogram, a set of optimal threshold intervals is automatically calculated using statistical analysis methods. The system sets a desired target grayscale value. And automatically select from the threshold range that contain And the upper limit The largest interval is taken as the target interval, that is: Set the upper limit of the target interval. This serves as a dynamic adaptive threshold for binarization segmentation. This adaptive process ensures that, under varying lighting and overexposure conditions, the most suitable threshold is always selected to separate the steel plate from the background, yielding the initial binary region. .
[0024] S22, the initial binary region is sequentially processed by hole filling and morphological opening operations to obtain a smooth binary image.
[0025] It is understandable that, such as Figure 4 As shown, slight reflection on the steel plate surface can cause internal holes in the binarized image (see...). Figure 4 Binary image of a The hole-filling operation can make its area complete (see...). Figure 4 Image filling result of b Then, morphological opening operations are performed to effectively smooth region boundaries and eliminate small, isolated noise points, while maintaining the shape and size of the main body (see [link]). Figure 4 Image opening operation result of c ).
[0026] S23, perform connected component analysis on the smoothed binary image to obtain several independent candidate regions, and select the region with the largest area from the independent candidate regions based on area and rectangularity features as the main body region of the medium-thick plate.
[0027] Understandably, for Connectivity analysis was performed, resulting in several independent regions. The rectangularity is defined as the ratio of the area of an independent candidate region to the area of its smallest bounding rectangle, and the calculation formula is: ,in, Indicates the region The minimum bounding rectangle. Set threshold ranges for area and rectangularity: , Filter out regions that simultaneously meet the conditions. And select the area with the largest area. As the main area of the medium-thick plate: .like Figure 5 As shown, the extracted main body area and outline of the medium-thick plate. Complete and undisturbed, providing a reliable benchmark for subsequent head localization.
[0028] S3, based on the main body area of the medium-thick plate, performs multi-level contour scanning along the longitudinal direction, and determines the head starting line of the medium-thick plate based on the width contraction feature of the continuous scanning line, so as to determine the corresponding head area and its contour.
[0029] It should be noted that the head of the steel plate is prone to irregular deformation during the rolling process, and the edges are often accompanied by local concavities or defects. If the head is judged solely by the narrowing of the width, it is easy to mistake the "pits" on the edge for the starting point of the head. This step adopts a multi-level positioning strategy from coarse to fine, cleverly utilizing the stability of the main body width to establish anchor points, thereby avoiding local interference.
[0030] In some embodiments, step S3 specifically includes S31-S34: S31, obtain the outline width at the preset height of the main body area of the medium-thick plate, and use it as the reference width.
[0031] Understandably, in combination Figure 5 As shown, draw a horizontal line in the lower half of the image height, and calculate the intersection of this horizontal line and the smooth contour. Column coordinates of the intersection of the left and right sides and Reference width The calculation formula is: .
[0032] S32, perform a preliminary scan from the bottom to the top of the main body area with the first step length and calculate the width of each scan line. If the width of multiple consecutive scan lines is greater than or equal to the reference reference width, it is determined that the scan has entered the main body area and the corresponding scan line is determined as the positioning anchor line.
[0033] It should be noted that, from the bottom of the area Start with a fixed step size Scan upwards. In each scan line... Calculate width .if State counter Increment. When the counter exceeds the set threshold... At that point, it is determined that the scan has successfully crossed the head and entered the main body area, and the rough starting position of the current scanning behavior (location anchor line) is recorded. .
[0034] S33, starting from the self-positioning anchor point, perform a second scan towards the head region with a second step length less than the first step length.
[0035] Understandably, the second step size is usually set to 1 pixel. From the anchor line Starting from the beginning, perform a fine, single-pixel-level scan in the reverse direction (towards the head) to find the critical point where the width begins to shrink substantially.
[0036] S34. If multiple consecutive scan lines maintain a narrowing trend with a width smaller than the previous scan line, determine the starting line of the head based on the starting position of the narrowing trend, and record the left and right boundaries of the contour corresponding to that position.
[0037] Specifically, in row coordinates Calculate the current line width .like Narrowing state counter Add 1. When Continuously reaching the stable threshold When multiple consecutive rows maintain a narrowing trend, the row coordinates at which the current row reverts to the stabilization threshold are determined as the starting row of the header. : Simultaneously, record the left and right boundaries of the contour corresponding to that position. and This position is the feature line that separates the head from the body.
[0038] S4. Based on the contour of the head region, the contour is divided into equal horizontal sections to generate contour feature curves. The areas of the left and right sides of the head region are calculated respectively, and then the left-right symmetry ratio of the head is calculated.
[0039] It should be noted that this step enters the core quantitative analysis stage, which aims to transform the irregular head contour into calculable geometric features, providing objective indicators for quality assessment.
[0040] In some embodiments, step S4 specifically includes S41-S43: S41, equal horizontal division is performed based on the contour of the head region to generate contour feature curves.
[0041] It is understandable that the total width of the head at the initial boundary is Set the number of segments N, and the segmentation step size for each segment. Calculate the coordinates of each column divider line. In the contour point set Find the point with the smallest row coordinate in the corresponding column coordinates as the intermediate dividing point. : .
[0042] like Figure 6 As shown, the starting point, all intermediate dividing points, and the ending point are connected sequentially with straight lines to generate a piecewise linear curve, which serves as a contour feature curve that approximates the overall contour trend of the head.
[0043] S42, calculate the column coordinates of the vertical centerline based on the total width of the head region and the column coordinates of the starting boundary; generate a left half rectangle covering the left half of the image and a right half rectangle covering the right half of the image based on the vertical centerline.
[0044] It is understandable that the column coordinates of the central axis... Then, the left half rectangle is generated. and the right half of the rectangle .
[0045] S43, through the region difference operation, calculate the left region obtained by subtracting the right half rectangle from the head region and the right region obtained by subtracting the left half rectangle from the head region respectively; calculate the area of the left region and the area of the right region respectively, and take the ratio of the area of the left region to the area of the right region as the left-right symmetry ratio of the head.
[0046] It is understandable that by using the region difference operation, the portions of the head located to the left and right of the central axis can be obtained respectively: , Calculate the areas of the two regions, and denote them as follows: and .like Figure 7 As shown ( Figure 7 'a' represents the left side contour area of the head. Figure 7 b represents the right side contour area of the head, and the left-right symmetry ratio of the head. It can be calculated using the following formula: If the ratio is close to 1, it indicates that the head shape is good; if it deviates significantly from 1, it suggests that the rolls are worn or the temperature distribution is uneven.
[0047] See Figure 8 This is a schematic diagram of a machine vision-based head shape detection device for medium-thick plates, provided in an embodiment of the present invention. The device includes: The image correction module is used to acquire the original image of the medium-thick plate and perform geometric correction to obtain a vertical top view.
[0048] Specifically, this module is responsible for selecting multiple key points in the roller conveyor area of the original image and their corresponding actual coordinate points, calculating the projection transformation matrix based on them, and using the transformation matrix to perform an affine transformation on the original image to eliminate perspective distortion.
[0049] The main subject extraction module performs image preprocessing and connected component analysis on the vertical top view to extract the main subject region of the medium-thick plate. This module integrates histogram analysis, adaptive threshold calculation, and morphological processing functions. After obtaining a smoothed binary image, it further selects the most stable main subject region by calculating the area and rectangularity of the candidate regions.
[0050] The head region extraction module is used to perform multi-level contour scanning along the longitudinal direction based on the main body region of the medium-thick plate, and to determine the head starting line of the medium-thick plate based on the width contraction characteristics of the continuous scan lines, so as to determine the corresponding head region and its contour. This module performs a first-level scan to determine the positioning anchor line based on the reference datum width, and a second-level scan to perform reverse fine calculation of the line width from the anchor line towards the head region, relying on the narrowing state counter for fault tolerance.
[0051] The quantitative evaluation module is used to divide the head region into equal horizontal sections based on its contour to generate contour feature curves, and to calculate the areas of the left and right sides of the head region, thereby determining the left-right symmetry ratio of the head. This module utilizes a region difference operation mechanism to split the left and right halves, forming a quantitative basis for evaluating the deformation symmetry of the head of medium-thick plates.
[0052] In addition to the above embodiments, the present invention may have other implementation methods; all technical solutions formed by equivalent substitution or equivalent transformation fall within the protection scope claimed by the present invention.
Claims
1. A method for detecting the head shape of a medium-thick plate based on image processing, characterized in that: include: Obtain the original image of the medium-thick plate and perform geometric correction to obtain a vertical top view; Image preprocessing and connected component analysis are performed on the vertical top view to extract the main body region of the medium-thick plate; Based on the main body area of the medium-thick plate, multi-level contour scanning is performed along the longitudinal direction, and the head starting line of the medium-thick plate is determined based on the width contraction feature of the continuous scanning line, so as to determine the corresponding head area and its contour. The head region is divided into equal horizontal sections based on its contour to generate a contour feature curve. The areas of the left and right sides of the head region are calculated respectively, and the ratio of the left and right symmetry of the head is then calculated.
2. The method for detecting the head shape of a medium-thick plate based on image processing according to claim 1, characterized in that: Performing geometric correction on the original image to obtain a vertical top view includes: Select multiple key points in the roller conveyor area of the original image and their corresponding actual coordinate points; Calculate the projection transformation matrix based on the key points and actual coordinate points; The original image is subjected to an affine transformation using the projection transformation matrix to obtain the vertical top view.
3. The method for detecting the head shape of a medium-thick plate based on image processing according to claim 1, characterized in that: Image preprocessing and connected component analysis were performed on the vertical top view to extract the main body region of the medium-thick plate, including: The vertical top view is filtered and smoothed, and then binarized based on a dynamic adaptive threshold to obtain an initial binary region. The initial binary region is sequentially processed with hole filling and morphological opening operations to obtain a smooth binary image; Connectivity analysis is performed on the smoothed binary image to obtain several independent candidate regions. Based on area and rectangularity features, the region with the largest area is selected from the independent candidate regions as the main body region of the medium-thick plate.
4. The method for detecting the head shape of a medium-thick plate based on image processing according to claim 3, characterized in that: The initial binary region obtained by binarization based on dynamic adaptive threshold includes: Calculate the absolute histogram of the image after filtering and smoothing. A set of optimal threshold intervals is calculated based on the absolute histogram; Set a target grayscale value, and automatically select the interval containing the target grayscale value and having the largest upper limit value from the optimal threshold interval as the target interval; The upper limit of the target interval is used as the dynamic adaptive threshold for binarization segmentation.
5. The method for detecting the head shape of a medium-thick plate based on image processing according to claim 1, characterized in that: The step of selecting the region with the largest area from the independent candidate regions based on area and rectangularity features as the main region of the medium-thick plate includes: Calculate the area and rectangularity of each independent candidate region, wherein the rectangularity is the ratio of the area of the independent candidate region to the area of its smallest bounding rectangle; Set an area threshold range and a rectangle threshold range, and filter out regions that simultaneously meet the area threshold range and the rectangle threshold range as target candidate regions; The region with the largest area among the target candidate regions is selected as the main body region of the medium-thick plate.
6. The method for detecting the head shape of a medium-thick plate based on image processing according to claim 1, characterized in that: The process of performing multi-level contour scanning along the longitudinal direction and determining the head starting line of the medium-thick plate based on the width contraction characteristics of continuous scan lines includes: Obtain the outline width at a preset height in the main body area of the medium-thick plate, and use it as a reference width; A preliminary scan is performed from the bottom to the top of the main area using the first step length, and the width of each scan line is calculated. If the width of multiple consecutive scan lines is greater than or equal to the reference reference width, it is determined that the scan has entered the main area, and the corresponding scan line is identified as the positioning anchor line. Starting from the positioning anchor point, a second scan is performed towards the head region with a second step length smaller than the first step length. If multiple consecutive scan lines maintain a narrowing trend with a width smaller than the previous scan line, the starting line of the head is determined based on the starting position of the narrowing trend, and the left and right boundaries of the contour corresponding to that position are recorded.
7. The method for detecting the head shape of a medium-thick plate based on image processing according to claim 6, characterized in that: Starting from the anchor point row, a second scan is performed towards the head region with a second step length smaller than the first step length. If multiple consecutive scan rows maintain a narrowing trend with a width smaller than the previous scan row, the starting row of the head is determined based on the starting position of the narrowing trend, including: Starting from the row of positioning anchor points, calculate the current row width of each scan row in the direction of the head region with the second step length mentioned above; If the current row width is less than the previous row width, then the narrowing state counter is incremented; When the narrowing state counter continuously reaches the set stable threshold, it is determined that multiple consecutive lines maintain a narrowing trend, and the line coordinates of the current line that fall back to the stable threshold are determined as the head starting line.
8. The method for detecting the head shape of a medium-thick plate based on image processing according to claim 1, characterized in that: The process of dividing the head region into equal horizontal sections to generate contour feature curves includes: The segmentation step size for each segment is calculated based on the total width of the head region at the starting boundary and the set number of segments. Based on the starting point coordinates and the segmentation step size, calculate the coordinates of each column segmentation line, and find the point with the smallest row coordinate in the corresponding column coordinates in the contour point set as the intermediate segmentation point. Connect the starting point, all intermediate dividing points, and the ending point sequentially with straight lines to generate a piecewise linear curve, which serves as the contour feature curve.
9. The method for detecting the head shape of a medium-thick plate based on image processing according to claim 1, characterized in that: The calculation of the areas of the left and right sides of the head region, respectively, and the subsequent calculation of the head's left-right symmetry ratio, includes: Calculate the column coordinates of the vertical centerline based on the total width of the head region and the column coordinates of the starting boundary; Based on the vertical central axis, generate a left half rectangle covering the left half of the image and a right half rectangle covering the right half of the image. By using the region difference operation, the left region obtained by subtracting the right half rectangle from the head region and the right region obtained by subtracting the left half rectangle from the head region are calculated respectively. Calculate the area of the left side region and the area of the right side region respectively, and use the ratio of the area of the left side region to the area of the right side region as the ratio of the left and right symmetry of the head.
10. A machine vision-based head shape detection device for medium-thick plates, characterized in that, include: The image correction module is used to acquire the original image of the medium-thick plate and perform geometric correction on it to obtain a vertical top view; The main body extraction module is used to perform image preprocessing and connected region analysis on the vertical top view to extract the main body region of the medium-thick plate. The head region extraction module is used to perform multi-level contour scanning along the longitudinal direction based on the main body region of the medium-thick plate, and determine the head starting line of the medium-thick plate based on the width contraction feature of the continuous scanning line, so as to determine the corresponding head region and its contour. The quantitative evaluation module is used to divide the head region into equal horizontal sections based on the contour of the head region to generate a contour feature curve, and to calculate the area of the left and right sides of the head region respectively, thereby calculating the left-right symmetry ratio of the head.