A wire surface defect determination method based on object recognition
Patent Information
- Application Number
- CN202611048553.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-09-04
AI Technical Summary
[0002]在线材高速拉丝和包覆生产过程中,利用图像采集和对象识别算法在线判定线材表面的划痕、起皮等缺陷,是保证产品质量稳定的重要环节,现有技术通常采用单路图像采集单元获取二维原始图像阵列,再利用方向导数算子计算像素梯度,并将二维梯度矩阵沿垂直于线材轴线的方向压缩为一维梯度序列,以减少待处理的数据量,满足连续生产线的实时处理要求,线材高速运行时,机械张力波动和模具磨损会使线材产生高频横向抖动,导致线材在采集图像中的像素位置不断变化,针对此类由张力不均或模具磨损导致的硬件物理局限,单纯依赖辊体形态改良难以完全消除震动,因而通过图像算法等软件控制方法实施横向抖动矫正成为了近年来的主流尝试,然而既有的软件控制方法同样存在不足,例如,公开号为CN117058355A的中国发明专利申请公开了一种高速线材图像横向抖动矫正方法及装置,构建包含特征提取、分类识别分支及回归识别分支的深度学习模型,通过将前一行的边界预测结果与当前行像素进行连接并送入特征金字塔,以完成逐行边界定位与对齐矫正,然而,方案在应对工业现场超高速工况时存在技术原理不匹配的问题:其模型隐性依赖高度理想的连续基底图像,且边界识别采用逐行串行递推机制,在百千赫兹量级高行频连拍的高速线上,其密集的神经网络推理计算会带来严重的计算滞后与数据流阻塞,无法满足高实时在线检测的时效边界;同时,一旦表面油污遮挡导致某一中间行产生误判,定位误差将沿行进方向发生连连续累积传递,导致后续大范围边界拓扑错位,反而加剧图像几何畸变
[0021] 1. In the determination of surface defects of wires in object recognition, the gradient information of the wire surface image is obtained by the directional derivative operator. When the two-dimensional gradient matrix is compressed into a low-dimensional sequence, the topological conjugate continuous nodes are weighted and accumulated according to the gradient polarity and continuous distribution length of adjacent pixel rows. Pixels with opposite sign jumps or below the threshold are truncated to zero. This can enhance the features of slender and weak contrast defects in the projected gradient sequence, while suppressing discrete background noise, avoiding the dilution of defect features by noise during the dimensionality reduction process, and reducing the risk of missed detection.
Smart Images

Figure CN122695248A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically to a method for determining surface defects in wires based on object recognition. Background Technology
[0002] In the high-speed wire drawing and coating process, online determination of surface defects such as scratches and peeling using image acquisition and object recognition algorithms is a crucial step in ensuring stable product quality. Current technologies typically employ a single-channel image acquisition unit to acquire a two-dimensional raw image array, then use directional derivative operators to calculate pixel gradients, and compress the two-dimensional gradient matrix into a one-dimensional gradient sequence along a direction perpendicular to the wire axis to reduce the amount of data to be processed and meet the real-time processing requirements of continuous production lines. During high-speed wire operation, mechanical tension fluctuations and die wear cause high-frequency lateral vibrations, resulting in continuous changes in the pixel positions of the wire in the acquired images. For these hardware limitations caused by uneven tension or die wear, simply relying on roller morphology improvements is insufficient to completely eliminate vibrations. Therefore, implementing lateral vibration correction through software control methods such as image algorithms has become a mainstream approach in recent years. However, existing software control methods also have shortcomings. For example, [the following is a separate section, likely from a different source:] CN Chinese invention patent application 117058355A discloses a method and apparatus for correcting lateral jitter in high-speed wire images. It constructs a deep learning model that includes feature extraction, classification recognition, and regression recognition branches. By connecting the boundary prediction results of the previous row with the pixels of the current row and feeding them into a feature pyramid, it completes row-by-row boundary localization and alignment correction. However, the solution has a problem of technical principle mismatch when dealing with ultra-high-speed working conditions in industrial sites: its model implicitly relies on highly ideal continuous base images, and the boundary recognition adopts a row-by-row serial recursion mechanism. On high-speed lines with high line frequency continuous shooting at hundreds of kilohertz, its dense neural network inference calculation will bring serious computational lag and data flow blockage, which cannot meet the timeliness boundary of high real-time online detection. At the same time, once surface oil stains cause a misjudgment of a certain intermediate row, the positioning error will be continuously accumulated and transmitted along the direction of travel, resulting in large-scale boundary topological misalignment in the future, which will aggravate the geometric distortion of the image.
[0003] Scratches and peeling defects are usually long and thin, and the gray-scale contrast of the defect area may also show local uneven changes. When traditional methods project a two-dimensional matrix into a one-dimensional sequence, they usually directly perform linear summation on each pixel value without distinguishing the differences in spatial continuity and distribution pattern between random noise and linear defects. Therefore, discrete background noise and long and thin defects with weak contrast will be accumulated equally, resulting in the weakening of defect features in the projection sequence. To improve the reliability of the judgment, conventional methods usually add a secondary verification procedure for two-dimensional image blocks in the subsequent processing stage. This increases the computational load of the image processing unit and is prone to data flow blockage. In addition, oil stains on the surface of the wire can interfere with the calculation of edge gradient extreme points, causing the position of the following coordinate system to shift. Simply increasing the image acquisition resolution will increase the data transmission load; directly increasing the global threshold may easily lead to missed detection of weak contrast defects.
[0004] Therefore, in environments where wires operate at high speeds and under constantly fluctuating conditions, how to preserve the continuous distribution characteristics of slender, weak-contrast defects with low computational overhead, and ensure the stability of wire position normalization results, remains a problem that existing technologies need to solve. Summary of the Invention
[0005] To address the problems in the background art, this invention proposes a method for determining surface defects in wires based on object recognition, comprising the following steps:
[0006] Step S1: Obtain image data of the wire surface and calculate the first time derivative of the lateral pixel displacement of the central axis trajectory;
[0007] Step S2: When the first-order time derivative exceeds the preset stability threshold, the number of convolution kernel columns of the directional derivative operator perpendicular to the central axis is reduced proportionally, and the reduced directional derivative operator is used to perform spatial filtering on the wire surface image data to generate a pixel gradient matrix.
[0008] Step S3: Pixels whose absolute gradient values in the pixel gradient matrix are lower than the preset matrix fluctuation threshold are truncated to zero to eliminate random noise, and the variance of the truncated pixels is calculated to update the width constraint parameter. The width constraint parameter is used to limit the sampling window width in step S2. For topological conjugate continuous nodes, self-gain accumulation is performed according to the spatial distribution length of continuous nodes with the same sign to generate horizontal projection gradient sequence and vertical projection gradient sequence.
[0009] Step S4: Calculate the dynamic judgment threshold curve for each spatial location based on the local mean and local standard deviation of the horizontal projection gradient sequence and the vertical projection gradient sequence. Mark the defect candidate interval for sampling points that exceed the dynamic judgment threshold curve and perform inverse mapping to obtain local defect candidate image blocks.
[0010] Step S5: Extract the gradient maxima in the orthogonal direction of the candidate image block of local defects to construct the directional derivative difference residual ratio parameter. When the real-time signal-to-noise ratio is lower than the preset signal-to-noise ratio threshold, introduce a preset non-zero positive constant bias term into the denominator of the directional derivative difference residual ratio parameter. Output the wire surface defect judgment result according to the directional derivative difference residual ratio parameter.
[0011] Preferably, in step S3, the self-gain accumulation based on the spatial distribution length of consecutive nodes with the same sign includes the following sub-steps: Step S31, calculate the spatial distribution length of consecutive nodes with the same polarity sign appearing consecutively in the pixel gradient matrix; Step S32, establish a positively correlated step-by-step weighted accumulation coefficient based on the spatial distribution length; Step S33, use the weighted accumulation coefficient to perform weighted accumulation on the gradient of each pixel in the topological conjugate consecutive nodes to generate a horizontal projection gradient sequence and a vertical projection gradient sequence.
[0012] Preferably, in step S3, truncating pixels whose absolute gradient value in the pixel gradient matrix is lower than a preset matrix fluctuation threshold to eliminate random noise, and statistically analyzing the variance of the truncated pixels to update the width constraint parameter includes the following sub-steps: Step S34, statistically analyzing the variance of the truncated pixels over five consecutive detection periods; Step S35, dynamically updating the current matrix noise mean parameter based on the statistical variance, and overwriting the updated matrix noise mean parameter into the control register; Step S36, dynamically scaling the width constraint parameter based on the matrix noise mean parameter in the control register to change the sampling window width during spatial filtering.
[0013] Preferably, in step S4, the dynamic decision threshold curve for each spatial location is calculated based on the local mean and local standard deviation of the horizontal and vertical projection gradient sequences using the following formula: ,in, The dynamic judgment threshold curve corresponding to each spatial location. This is the local mean within the extracted sliding window. This represents the local standard deviation within the sliding window. This is the set magnification factor.
[0014] Preferably, in step S4, before calculating the dynamic judgment threshold curve for each spatial location, the following sub-steps are included: Step S41, for each sampling point in the spatial location, extract one-dimensional gradient data within a sliding window centered on the sampling point and with a width of 32 pixels; Step S42, calculate the arithmetic mean of the one-dimensional gradient data within the sliding window as the local mean, and calculate the standard deviation of the one-dimensional gradient data as the local standard deviation.
[0015] Preferably, in step S5, extracting the gradient maxima in the orthogonal direction in the local defect candidate image block to construct the directional derivative difference residual ratio parameter includes the following sub-steps: Step S51, searching for the local maxima of the one-dimensional horizontal projection gradient sequence and the corresponding maxima of the one-dimensional vertical projection gradient sequence at the corresponding positions in the local defect candidate image block; Step S52, calculating the difference residual between the local maxima of the one-dimensional horizontal projection gradient sequence and the corresponding maxima of the one-dimensional vertical projection gradient sequence, and determining the ratio of the difference residuals as the directional derivative difference residual ratio parameter.
[0016] Preferably, in step S5, when the real-time signal-to-noise ratio of the local defect candidate image block is lower than the preset signal-to-noise ratio threshold, the introduction of a preset non-zero positive constant bias term into the denominator of the directional derivative difference residual ratio parameter includes the following sub-steps: Step S53, measuring the signal energy and noise energy of the local defect candidate image block and calculating the real-time signal-to-noise ratio; Step S54, when the real-time signal-to-noise ratio is lower than the preset signal-to-noise ratio threshold, activating the adaptive bias logic, accumulating the preset non-zero positive constant bias term into the denominator of the directional derivative difference residual ratio parameter, and blocking the calculation divergence caused by the value approaching 0 when the denominator is transferred.
[0017] Preferably, step S1 includes the following sub-steps: step S11, reading the original two-dimensional grayscale image data containing the running wire area from the continuous image sensor; step S12, using a set homogeneous transformation matrix to perform coordinate space normalization correction on the original two-dimensional grayscale image data, eliminating feature deformation caused by geometric distortion and surface contamination, and generating wire surface image data.
[0018] Preferably, after step S5, the following sub-steps are also included: Step S55, in the anisotropic ratio space composed of the directional derivative difference residual ratio parameter, the distribution boundary of the local defect candidate image block is retrieved; Step S56, according to the distribution boundary, the gradient morphology difference of the orthogonal direction is decoupled, and when the directional derivative difference residual ratio parameter is greater than 0.75, the wire surface defect is automatically classified as a unidirectional scratch defect, and when the directional derivative difference residual ratio parameter is between 0.25 and 0.65, the wire surface defect is automatically classified as a surface peeling defect.
[0019] Preferably, in step S2, the reduction of the number of convolution kernel columns of the directional derivative operator perpendicular to the central axis direction includes the following sub-steps: Step S21, continuously read the first-order time derivative calculated from the lateral pixel displacement of the central axis trajectory, and convert the first-order time derivative into constraint parameters characterizing the kinetic energy consumption of the wire diameter; Step S22, when the first-order time derivative exceeds a preset stability threshold, reduce the number of columns of the discrete convolution kernel matrix of the directional derivative operator in the direction perpendicular to the central axis direction proportionally according to the magnitude of the constraint parameters, so as to counteract the motion blur of the image edges caused by the high-speed operation of the wire.
[0020] The beneficial effects of this invention are:
[0021] 1. In the determination of surface defects of wires in object recognition, the gradient information of the wire surface image is obtained by the directional derivative operator. When the two-dimensional gradient matrix is compressed into a low-dimensional sequence, the topological conjugate continuous nodes are weighted and accumulated according to the gradient polarity and continuous distribution length of adjacent pixel rows. Pixels with opposite sign jumps or below the threshold are truncated to zero. This can enhance the features of slender and weak contrast defects in the projected gradient sequence, while suppressing discrete background noise, avoiding the dilution of defect features by noise during the dimensionality reduction process, and reducing the risk of missed detection.
[0022] 2. By updating the matrix noise mean parameter using the statistical variance of the truncated pixels, and adjusting the width constraint parameter in the preceding axis tracking process accordingly, the search range of the wire edge can be adjusted according to the background noise. This can reduce the interference of false edges formed by surface oil on axis positioning, improve the stability of coordinate space normalization processing, and make the subsequently extracted wire surface image area less prone to positional shift or geometric deformation.
[0023] 3. The gradient difference in different directions is reflected by the parameter of the directional derivative difference residual ratio. When the signal-to-noise ratio of the local defect candidate image block is low, a non-zero positive constant bias term is introduced into the denominator of the parameter. This can avoid the calculation divergence when the denominator is close to zero. Under the condition of low computational load, the method can still maintain the distinguishability of gradient features in different directions, reduce the confusion between unidirectional abrasion defects and surface peeling defects, and improve the stability of defect classification under weak contrast conditions. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. 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.
[0025] Fig. 1 This is a flowchart of the wire surface defect detection and judgment process of the present invention;
[0026] Fig. 2 This is a structural diagram of the wire surface defect determination system of the present invention. Detailed Implementation
[0027] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0028] A method for determining surface defects in wires based on object recognition includes the following steps:
[0029] Step S1: Obtain image data of the wire surface and calculate the first time derivative of the lateral pixel displacement of the central axis trajectory;
[0030] Step S2: When the first-order time derivative exceeds the preset stability threshold, the number of convolution kernel columns of the directional derivative operator perpendicular to the central axis is reduced proportionally, and the reduced directional derivative operator is used to perform spatial filtering on the wire surface image data to generate a pixel gradient matrix.
[0031] Step S3: Pixels whose absolute gradient values in the pixel gradient matrix are lower than the preset matrix fluctuation threshold are truncated to zero to eliminate random noise, and the variance of the truncated pixels is calculated to update the width constraint parameter. The width constraint parameter is used to limit the sampling window width in step S2. For topological conjugate continuous nodes, self-gain accumulation is performed according to the spatial distribution length of continuous nodes with the same sign to generate horizontal projection gradient sequence and vertical projection gradient sequence.
[0032] Step S4: Calculate the dynamic judgment threshold curve for each spatial location based on the local mean and local standard deviation of the horizontal projection gradient sequence and the vertical projection gradient sequence. Mark the defect candidate interval for sampling points that exceed the dynamic judgment threshold curve and perform inverse mapping to obtain local defect candidate image blocks.
[0033] Step S5: Extract the gradient maxima in the orthogonal direction of the candidate image block of local defects to construct the directional derivative difference residual ratio parameter. When the real-time signal-to-noise ratio is lower than the preset signal-to-noise ratio threshold, introduce a preset non-zero positive constant bias term into the denominator of the directional derivative difference residual ratio parameter. Output the wire surface defect judgment result according to the directional derivative difference residual ratio parameter.
[0034] Preferably, in step S3, the self-gain accumulation based on the spatial distribution length of consecutive nodes with the same sign includes the following sub-steps: Step S31, calculate the spatial distribution length of consecutive nodes with the same polarity sign appearing consecutively in the pixel gradient matrix; Step S32, establish a positively correlated step-by-step weighted accumulation coefficient based on the spatial distribution length; Step S33, use the weighted accumulation coefficient to perform weighted accumulation on the gradient of each pixel in the topological conjugate consecutive nodes to generate a horizontal projection gradient sequence and a vertical projection gradient sequence.
[0035] Preferably, in step S3, truncating pixels whose absolute gradient value in the pixel gradient matrix is lower than a preset matrix fluctuation threshold to eliminate random noise, and statistically analyzing the variance of the truncated pixels to update the width constraint parameter includes the following sub-steps: Step S34, statistically analyzing the variance of the truncated pixels over five consecutive detection periods; Step S35, dynamically updating the current matrix noise mean parameter based on the statistical variance, and overwriting the updated matrix noise mean parameter into the control register; Step S36, dynamically scaling the width constraint parameter based on the matrix noise mean parameter in the control register to change the sampling window width during spatial filtering.
[0036] Preferably, in step S4, the dynamic decision threshold curve for each spatial location is calculated based on the local mean and local standard deviation of the horizontal and vertical projection gradient sequences using the following formula: ,in, The dynamic judgment threshold curve corresponding to each spatial location. This is the local mean within the extracted sliding window. This represents the local standard deviation within the sliding window. This is the set magnification factor.
[0037] Preferably, in step S4, before calculating the dynamic judgment threshold curve for each spatial location, the following sub-steps are included: Step S41, for each sampling point in the spatial location, extract one-dimensional gradient data within a sliding window centered on the sampling point and with a width of 32 pixels; Step S42, calculate the arithmetic mean of the one-dimensional gradient data within the sliding window as the local mean, and calculate the standard deviation of the one-dimensional gradient data as the local standard deviation.
[0038] Preferably, in step S5, extracting the gradient maxima in the orthogonal direction in the local defect candidate image block to construct the directional derivative difference residual ratio parameter includes the following sub-steps: Step S51, searching for the local maxima of the one-dimensional horizontal projection gradient sequence and the corresponding maxima of the one-dimensional vertical projection gradient sequence at the corresponding positions in the local defect candidate image block; Step S52, calculating the difference residual between the local maxima of the one-dimensional horizontal projection gradient sequence and the corresponding maxima of the one-dimensional vertical projection gradient sequence, and determining the ratio of the difference residuals as the directional derivative difference residual ratio parameter.
[0039] Preferably, in step S5, when the real-time signal-to-noise ratio of the local defect candidate image block is lower than the preset signal-to-noise ratio threshold, the introduction of a preset non-zero positive constant bias term into the denominator of the directional derivative difference residual ratio parameter includes the following sub-steps: Step S53, measuring the signal energy and noise energy of the local defect candidate image block and calculating the real-time signal-to-noise ratio; Step S54, when the real-time signal-to-noise ratio is lower than the preset signal-to-noise ratio threshold, activating the adaptive bias logic, accumulating the preset non-zero positive constant bias term into the denominator of the directional derivative difference residual ratio parameter, and blocking the calculation divergence caused by the value approaching 0 when the denominator is transferred.
[0040] Preferably, step S1 includes the following sub-steps: step S11, reading the original two-dimensional grayscale image data containing the running wire area from the continuous image sensor; step S12, using a set homogeneous transformation matrix to perform coordinate space normalization correction on the original two-dimensional grayscale image data, eliminating feature deformation caused by geometric distortion and surface contamination, and generating wire surface image data.
[0041] Preferably, after step S5, the following sub-steps are also included: Step S55, in the anisotropic ratio space composed of the directional derivative difference residual ratio parameter, the distribution boundary of the local defect candidate image block is retrieved; Step S56, according to the distribution boundary, the gradient morphology difference of the orthogonal direction is decoupled, and when the directional derivative difference residual ratio parameter is greater than 0.75, the wire surface defect is automatically classified as a unidirectional scratch defect, and when the directional derivative difference residual ratio parameter is between 0.25 and 0.65, the wire surface defect is automatically classified as a surface peeling defect.
[0042] Preferably, in step S2, the reduction of the number of convolution kernel columns of the directional derivative operator perpendicular to the central axis direction includes the following sub-steps: Step S21, continuously read the first-order time derivative calculated from the lateral pixel displacement of the central axis trajectory, and convert the first-order time derivative into constraint parameters characterizing the kinetic energy consumption of the wire diameter; Step S22, when the first-order time derivative exceeds a preset stability threshold, reduce the number of columns of the discrete convolution kernel matrix of the directional derivative operator in the direction perpendicular to the central axis direction proportionally according to the magnitude of the constraint parameters, so as to counteract the motion blur of the image edges caused by the high-speed operation of the wire.
[0043] Example 1: The current image processing unit is set up on a high-strength steel cord drawing production line. The wire runs continuously at a speed of 30m / s. The wire surface has thin, elongated linear scratches with an aspect ratio greater than 15:1 and is coated with drawing lubricant. The discrete false boundaries formed by oil contamination interfere with the lateral pixel gradient distribution of the wire edge. Local aging of the factory light source also causes random fluctuations in light intensity within 15%. The central processing unit reads the original two-dimensional grayscale image data collected by the single-channel image acquisition unit from the input buffer. Before calculating the extreme points of the lateral pixel gradient at the wire edge, the central processing unit calls the global Hough transform linear operator to determine the global linear slope benchmark of the wire boundary and limits the one-dimensional edge retrieval range on both sides of the slope benchmark. Local gradient extreme points are retrieved only within the range to eliminate discrete false boundaries caused by oil contamination.
[0044] The central processing unit (CPU) obtains the coordinates of the left and right edge gradient extreme points in each frame of the image, calculates the arithmetic mean of their horizontal coordinates to obtain the sequence of the center horizontal coordinates of the wire at each pixel row, and determines the trajectory of the central axis based on this sequence. The left and right edge gradient extreme points within the edge retrieval range are used as control points in the original image, and the corresponding boundary positions in the rectangular standard area are used as target control points. The correspondence between the two sets of coordinates is established, and the set homogeneous transformation matrix is obtained. The CPU performs inverse coordinate mapping and grayscale interpolation on the original two-dimensional grayscale image data according to the homogeneous transformation matrix, corrects the edge contour offset and feature deformation caused by geometric distortion, surface oil stains, and uneven reflection, and generates wire surface image data that unfolds horizontally along the central axis. The wire surface image data is in the form of a rectangular standard area image. At the same time, the CPU establishes a follow-up curvature coordinate system based on the central axis trajectory to reduce the spatial position deviation caused by the lateral jitter of the wire.
[0045] Within a continuous time step, the central processing unit (CPU) reads the lateral pixel displacement of the central axis trajectory from the memory stack. The lateral pixel displacement is the absolute pixel difference between the current frame's center horizontal coordinate sequence and the reference axis position in the standard static state of the previous frame. The CPU performs discrete difference analysis on the lateral pixel displacement of two adjacent time steps and divides it by the frame interval time of the image acquisition system to obtain the first time derivative of the lateral pixel displacement of the central axis trajectory. The first time derivative is used to represent the rate of change of the lateral jitter speed of the central axis. The CPU multiplies the square of the first time derivative by a preset nominal mass coefficient per unit length of wire to obtain the constraint parameter characterizing the radial kinetic energy consumption of the wire, hereinafter referred to as the energy consumption constraint parameter. The energy consumption constraint parameter is a dimensionless energy metric value proportional to the radial jitter kinetic energy of the wire.
[0046] During spatial filtering, the central processing unit (CPU) reads the width constraint parameter from the control register and uses it to limit the sampling window width of the directional derivative operator. When the first-order time derivative exceeds a preset stability threshold, the CPU uses the energy consumption constraint parameter corresponding to the preset stability threshold as a reference. Based on the increase ratio of the current energy consumption constraint parameter relative to the reference, the CPU proportionally reduces the number of discrete convolution kernel matrix columns in the direction perpendicular to the central axis, ensuring that the reduced number of convolution kernel columns is within the sampling window width limit set by the width constraint parameter. The number of convolution kernel columns decreases as the energy consumption constraint parameter increases to mitigate motion blur at image edges caused by the high-speed lateral movement of the wire. The CPU then uses the adjusted anisotropic directional derivative operator to perform convolution filtering on the wire surface image data, generating horizontal and vertical pixel gradient matrices, which together constitute the pixel gradient matrix.
[0047] For the pixel gradient matrix, the central processing unit (CPU) performs a vertical scan along the pixel column perpendicular to the central axis, reads the gradient values and polarity signs of adjacent pixel rows at the same horizontal axial coordinate, and identifies pixels with gradient absolute values lower than a preset matrix fluctuation threshold as discrete noise interference points and truncates them to zero. For pixels with gradient absolute values not lower than the preset matrix fluctuation threshold, when the gradient polarity signs of adjacent pixel rows are consecutively the same, these pixels are identified as consecutive nodes with the same sign and assigned to topological conjugate consecutive nodes. A counter records the spatial distribution length of consecutive nodes with the same sign. The CPU determines the positively correlated step-wise weighted accumulation coefficient based on the spatial distribution length, and then uses the weighted accumulation coefficient to perform self-gain accumulation on the gradient of each pixel in the topological conjugate consecutive nodes, so that the gradient of the continuously distributed slender defect accumulates in the projection direction.
[0048] The central processing unit (CPU) calculates the statistical variance of truncated pixels over five consecutive detection cycles. Based on this variance, it dynamically updates the current matrix noise mean parameter and writes the updated parameter to the control register. The matrix noise mean parameter represents the average level of the background noise pixel gradient amplitude, and its unit is the same as the pixel gradient amplitude. When the statistical variance shows a monotonically increasing trend over five consecutive detection cycles, the CPU uses a preset empirical linear mapping coefficient to proportionally convert the increased variance into an incremental step value for the matrix noise mean parameter. This allows the parameter to track the optical degradation and background noise matrix drift of the imaging system. Subsequently, the CPU dynamically scales the width constraint parameter based on the matrix noise mean parameter in the control register. When the matrix noise mean parameter increases, the width constraint parameter decreases according to a preset negative correlation. In the next detection cycle, the sampling window width of the directional guide number operator narrows accordingly. The CPU also reduces the search range of the aforementioned edge gradient extreme points based on the matrix noise mean parameter to reduce the interference of oil stain false boundaries on the central axis trajectory.
[0049] While completing the vertical scan and generating a one-dimensional horizontal projection gradient sequence, the central processing unit performs a horizontal scan along the pixel rows parallel to the central axis. For the gradient values of adjacent pixel columns at the same vertical coordinate, it performs the same continuous same-sign node determination, zero-setting truncation and self-gain accumulation to generate a one-dimensional vertical projection gradient sequence. The accumulated values of each pixel column and each pixel row after processing are written to the specified address in the memory to save the one-dimensional horizontal projection gradient sequence and the one-dimensional vertical projection gradient sequence.
[0050] The central processing unit reads the one-dimensional horizontal projection gradient sequence and the one-dimensional vertical projection gradient sequence. For each sampling point in space, it extracts the one-dimensional gradient data within a sliding window centered on the sampling point and with a width of 32 pixels, and calculates the local mean within the sliding window. With local standard deviation And calculate the dynamic judgment threshold curve corresponding to each spatial location according to the following formula. : ,in, The dynamic judgment threshold curve corresponding to each spatial location. This represents the arithmetic mean of the one-dimensional gradient data within the sliding window. The standard deviation of the one-dimensional gradient data within the sliding window. For the set magnification factor, the central processing unit will dynamically determine the threshold curve. Write to the threshold buffer when the value of a sample point in a one-dimensional horizontal projection gradient sequence or a one-dimensional vertical projection gradient sequence exceeds the dynamic judgment threshold curve. At that time, the corresponding defect candidate interval is marked in memory, and the defect candidate interval is in situ reverse mapped to the wire surface image data to obtain local defect candidate image blocks.
[0051] Within the candidate image patch for local defects, the central processing unit extracts the local maxima of the one-dimensional horizontal projection gradient sequence. And the corresponding maxima of the one-dimensional vertical projection gradient sequence at the corresponding positions. And calculate the directional derivative difference residual ratio parameter according to the following formula. : ,in, For a local maximum of the gradient sequence of a one-dimensional horizontal projection, This represents the local maximum of the one-dimensional vertical projection gradient sequence at the corresponding position. Used to represent the value of a preset non-zero positive constant bias term. The ratio of the directional derivative difference residual is a parameter that, when the real-time signal-to-noise ratio is not lower than a preset signal-to-noise ratio threshold. Set to 0; when the real-time signal-to-noise ratio is lower than the preset signal-to-noise ratio threshold, the central processing unit activates the adaptive bias logic to... The value is set as a non-zero positive constant determined according to the preset matrix fluctuation threshold, and the preset non-zero positive constant bias term is introduced into the denominator of the directional derivative difference residual ratio parameter to avoid calculation divergence when the denominator value approaches 0.
[0052] The real-time signal-to-noise ratio (SNR) is calculated within the local defect candidate image block. The central processing unit (CPU) identifies the set of pixels whose absolute pixel gradient values are greater than a preset matrix fluctuation threshold as the defect signal region and calculates the sum of squares of all pixel gradients within the region as the signal energy. The set of pixels whose absolute pixel gradient values are less than or equal to the preset matrix fluctuation threshold is identified as the background noise region and the sum of squares of all pixel gradients within the region as the noise energy. The signal energy is divided by the noise energy and then logarithmic operation is performed to obtain the real-time SNR that characterizes the image quality of the current local defect candidate image block.
[0053] The central processing unit repeatedly calculates the directional derivative difference residual ratio parameter at each corresponding position within the candidate image patch for local defects. And write the data according to the corresponding sampling position. The anisotropy ratio space is constructed such that, for sampling positions that are consecutively located within the same decision interval, the central processing unit searches point by point towards their adjacent positions. The critical position that exceeds the judgment interval is determined as the distribution boundary of the local defect candidate image patch, and then the images are read along the distribution boundary. and The continuous change of gradient shape in orthogonal directions is decoupled based on the difference between the two.
[0054] When the directional derivative difference residual ratio parameter within the distribution boundary When the value is greater than 0.75, the central processing unit classifies the surface defects of the wire as unidirectional scratch defects extending along the axis; when When the value is between 0.25 and 0.65, the surface defects of the wire are classified as surface peeling defects with spatial isotropic scattering characteristics. If the value is greater than 0.65 but not greater than 0.75, or less than 0.25, the corresponding defect will be judged as a transitional composite defect, and the neighboring historical classification status saved in the previous detection cycle will be called for weighted voting; if a definite classification result cannot be formed, it will be marked as an unknown abnormal defect to be reviewed a second time and an alarm will be issued.
[0055] Using the above processing method, the single-frame image defect determination calculation delay of the image processing unit is kept within 1.5ms; in the continuous production process with an online speed greater than 30m / s, the wire boundary positioning error is kept within 0.5 pixels, and the local defect candidate image block is obtained by direct inverse mapping of the projection gradient sequence. The subsequent determination is completed in the one-dimensional gradient data and the corresponding local area, avoiding repeated secondary feature scanning of the entire image.
[0056] Example 2: The online image data acquisition system of the current high-speed steel cord production line is used as the experimental data source. The system includes a linear array high-speed industrial camera with a line frequency of 100kHz, a resolution of 2048 pixels, and a spatial resolution of 20μm / pixel. The image processing unit uses a processor with a floating-point operation capability of 4TFLOPS and a memory bandwidth of 34GB / s. It directly reads the original two-dimensional grayscale image data of the running wire at a continuous acquisition frequency. The experimental device injects non-uniform exposure flicker interference caused by metal mirror reflection, Gaussian white noise with a signal-to-noise ratio of 18dB, and lateral vibration pixel displacement with an amplitude of 5 pixels at the input end to simulate the working condition fluctuation caused by the wear of the drawing die. During group testing, the input conditions are set according to the vibration amplitude and image contrast corresponding to each sample.
[0057] When calculating the dynamic judgment threshold curve, the sliding window width is determined based on the horizontal projection width of the slender defect in the wire surface image data and the processing overhead of the image matrix. When the sliding window is too wide, the matrix background noise contained in the window increases, the local standard deviation increases accordingly, and the dynamic judgment threshold curve rises. When the sliding window is too narrow, the window cannot completely cover the gray-level gradient change range of the defect area, and the statistical results of the local mean will be biased. When the detected wire edge gradient energy distribution bandwidth is between 20μm and 60μm, the sliding window width is set to 32 pixels so that the window covers the gradient waveform of the slender defect, while limiting the amount of background noise data entering the window.
[0058] The experiment used slender linear scratch defects with an aspect ratio greater than 15:1 as the detection object. In this embodiment of the invention, self-gain accumulation is performed on topological conjugate continuous nodes, and pixels with gradient absolute values lower than the preset matrix fluctuation threshold are truncated to zero. The width constraint parameters are updated according to the statistical variance of the truncated pixels. The control group uses traditional indiscriminate linear summation integral and downstream two-dimensional image block secondary verification procedure. Each sample records vibration amplitude, image contrast value, axis positioning error, integral sequence signal-to-noise ratio, single frame calculation delay and defect judgment accuracy.
[0059] Under input conditions of vibration amplitude of 2 pixels and image contrast of 0.65, after sample 1 was processed by the sample group of the present invention, the axis positioning error was 0.12 pixels, the integral sequence signal-to-noise ratio was 22.4dB, the single frame calculation delay was 1.15ms, and the defect judgment accuracy was 99.2%. Under the same input conditions, after sample 2 was processed by the control group, the axis positioning error was 0.45 pixels, the integral sequence signal-to-noise ratio was 12.1dB, the single frame calculation delay was 14.8ms, and the defect judgment accuracy was 91.5%.
[0060] When the vibration amplitude was increased to 4 pixels and the image contrast was set to 0.45, Sample 3, processed using the method of the present invention, had an axis positioning error of 0.23 pixels, an integral sequence signal-to-noise ratio of 18.6 dB, a single-frame calculation delay of 1.21 ms, and a defect judgment accuracy of 98.7%. Sample 4, processed using the control group method, had an axis positioning error of 0.88 pixels, an integral sequence signal-to-noise ratio of 7.4 dB, a single-frame calculation delay of 16.5 ms, and a defect judgment accuracy of 82.3%.
[0061] Under the conditions of a vibration amplitude of 5 pixels and an image contrast of 0.30, after self-gain accumulation, zero-truncation, and width constraint parameter feedback processing, sample 5 has an axis positioning error of 0.38 pixels, an integral sequence signal-to-noise ratio of 15.3dB, a single-frame calculation delay of 1.32ms, and a defect judgment accuracy of 97.4%. After sample 6 uses indiscriminate linear summation integration and two-dimensional image block secondary verification, the axis positioning error is 1.45 pixels, the integral sequence signal-to-noise ratio is 4.2dB, the single-frame calculation delay is 18.2ms, and the defect judgment accuracy is 68.6%. As the vibration amplitude increases and the image contrast decreases, the control group accumulates discrete background noise and slender defect gradients together, and the defect features in the integral sequence are interfered with by noise. The sample group of this invention implements self-gain accumulation based on the spatial distribution length of consecutive nodes with the same sign, and truncates pixels with different signs or below the preset matrix fluctuation threshold, so that the continuously distributed defect gradients accumulate in the projection sequence.
[0062] The partially missing control group was used to examine the effect of self-gain accumulation on the projection sequence. The vibration amplitude of sample 7 was 4 pixels, and the image contrast was 0.45. Zero-truncation and parameter feedback were retained during the processing, but self-gain accumulation was no longer implemented based on the spatial distribution length of consecutive nodes with the same sign. The axis positioning error of the sample was 0.24 pixels, the signal-to-noise ratio of the integral sequence was 9.5dB, the single-frame calculation delay was 1.18ms, and the defect detection accuracy was 84.1%. Under the condition that the axis positioning error and calculation delay changed little, the continuous defect gradients failed to be weighted and accumulated according to the spatial distribution length, and the signal-to-noise ratio of the integral sequence and the defect detection accuracy decreased accordingly.
[0063] Partially missing control group 2 was used to examine the effect of the preset non-zero positive constant bias term on the computational stability under low signal-to-noise ratio conditions. The vibration amplitude of sample 8 was 4 pixels, the image contrast was 0.10, and the preset non-zero positive constant bias term was not introduced into the denominator of the directional derivative difference residual ratio parameter during processing. The axis positioning error of the sample was 0.25 pixels, the integral sequence signal-to-noise ratio was 14.2dB, the single frame computation delay was 1.26ms, and the defect judgment accuracy was 76.5%. When the denominator value approached zero, the directional derivative difference residual ratio parameter diverged in calculation, and the gradient morphology of unidirectional scratch defects and surface peeling defects overlapped, leading to confusion in the classification results.
[0064] The out-of-range control group 1 was used to observe the response when the image contrast continued to decrease. The vibration amplitude of sample 9 was 5 pixels, the image contrast value was 0.05, the axis positioning error was 0.49 pixels, the integral sequence signal-to-noise ratio was 6.8dB, the single-frame calculation delay was 1.48ms, and the defect judgment accuracy was 88.3%. Under the input conditions, the gray-level difference amplitude of the defect image was lower than the preset matrix fluctuation threshold, the judgment counter of the topological conjugate continuous node stopped triggering, the self-gain accumulation entered the gain saturation state, and the defect gradient in the projection sequence could not continue to accumulate.
[0065] The out-of-range control group 2 was used to observe the response when the radial runout of the wire continued to increase. The lateral vibration amplitude of sample 10 was 8 pixels, the image contrast was 0.30, the axis positioning error was 1.24 pixels, the integral sequence signal-to-noise ratio was 12.1dB, the single-frame calculation delay was 1.52ms, and the defect judgment accuracy was 81.6%. The vibration input caused the first-order time derivative of the lateral pixel displacement of the central axis trajectory to reach numerical saturation. The number of columns of the discrete convolution kernel matrix of the directional derivative operator in the direction perpendicular to the central axis decreased proportionally to the set lower limit with the energy consumption constraint parameter. The edge expansion distortion still caused the central axis trajectory to deviate from its position and caused the follower curvature coordinate system to have topological misalignment.
[0066] The above data corresponds to the processing steps between the original image input, the projection gradient sequence, and the defect judgment result. During the spatial dimensionality reduction process, zero-truncation suppresses random noise, and self-gain accumulation preserves the continuous gradient distribution of slender defects. The central processing unit marks the defect candidate intervals according to the one-dimensional horizontal projection gradient sequence and the one-dimensional vertical projection gradient sequence, and then inversely maps them to the wire surface image data to extract local defect candidate image blocks, eliminating the need for the downstream two-dimensional image block secondary verification procedure. In the working conditions corresponding to the sample group of this invention, the single-frame image defect judgment calculation delay is kept within 1.5ms. During the continuous wire drawing process with a line speed greater than 30m / s and pixel displacement caused by radial jump of the central axis trajectory, the boundary positioning error is kept within 0.5 pixels.
[0067] Example 3: The current high-strength steel cord drawing equipment operates continuously at a fixed drawing speed of 30m / s. The line array industrial camera acquires the original two-dimensional grayscale image data of the running wire at a line frequency of 100kHz. The lubricating grease attached to the wire surface forms discrete oil stain interference. The lighting control component generates random changes in local illumination intensity within 15%. The central processing unit reads the original two-dimensional grayscale image data from the data output terminal of the line array industrial camera. Before solving the extreme points of the lateral pixel gradient of the wire physical boundary, it calls the global Hough transform straight line operator to determine the global straight line slope benchmark of the wire boundary.
[0068] The central processing unit reads the matrix noise mean parameter from the control register. And determine the width constraint parameters accordingly. ,in, The value is expressed as pixel gradient magnitude. The unit is pixels, when When the value is greater than or equal to 0 and less than or equal to 5, Set to 16 pixels; when When the value is greater than 5 and less than or equal to 12, Set to 10 pixels; when When it is greater than 12, Set to 6 pixels, central processing unit The sampling window width of the directional derivative operator is limited, and the edge search range is limited on both sides of the global straight line slope benchmark according to the parameters. Local gradient extreme points are searched only within the range to exclude discrete false boundaries formed by oil pollution.
[0069] Within a continuous time step, the central processing unit reads the lateral pixel displacement of the central axis trajectory from the memory stack, calculates its first-order time derivative, and obtains the rate of change of the lateral displacement of the axis. The central processing unit will The parameters are converted into energy consumption constraints, and the number of columns of the discrete convolution kernel matrix of the directional derivative operator in the direction perpendicular to the central axis is reduced according to the increase ratio of the parameters. ,when When less than 2 pixels / ms, Keep it as 7 columns; when When the resolution reaches 2 pixels / ms, the scale is reduced proportionally starting from 7 columns. Within the range of 2 pixels / ms or greater and 5 pixels / ms or less, Reduced to 5 columns; when If the reduction is greater than 5 pixels / ms, continue to reduce by the same ratio until... Reaching the minimum set value of 3 columns, the shrinkage of the number of convolution kernel columns is used to maintain the steepness of the edge gradient and reduce the motion blur of image edges caused by high-frequency radial jumps.
[0070] The central processing unit establishes a following curvature coordinate system in memory based on the central axis trajectory, converting the original two-dimensional grayscale image data into wire surface image data horizontally unfolded along the central axis direction. The adjusted anisotropic directional derivative operator... Within a limited sampling window width, convolution filtering is performed on the wire surface image data to output the horizontal pixel gradient matrix and the vertical pixel gradient matrix, which together constitute the pixel gradient matrix.
[0071] When performing dimensionality reduction on the pixel gradient matrix, the central processing unit scans along the pixel column perpendicular to the central axis, reads the gradient values and polarity signs of adjacent pixel rows at the same horizontal axial coordinate, and uses a counter to count the spatial distribution length of consecutive occurrences of the same polarity sign. When the gradient polarity signs of adjacent pixel rows are consistent, and the absolute values of the gradients all exceed a preset matrix fluctuation threshold, the current pixel is determined as a topologically conjugate continuous node. The central processing unit then... Retrieve the corresponding positive correlation step-wise weighted cumulative coefficient from the weighted configuration table. :when When less than 3 pixels, Take 1.0; when When the pixel size is greater than or equal to 3 pixels and less than or equal to 8 pixels, Take 1.5; when When it is greater than 8 pixels, Take 2.2, then multiply the current pixel gradient magnitude by... The gradient is then added to the integrator to perform self-gain accumulation on the topologically conjugate continuous nodes, so that the gradient of the slender defect extending along the central axis accumulates in the projection direction.
[0072] When the gradient polarity signs of adjacent pixel rows change abruptly, or when the absolute value of the gradient falls below a preset matrix fluctuation threshold, the central processing unit (CPU) identifies the current pixel as a discrete noise interference point and truncates the current pixel value to zero. Subsequently, it calculates the statistical variance of the truncated pixels over five consecutive detection periods and updates the data based on this statistical variance. And the update result is overwritten to the control register, as As the CPU increases, the central processing unit decreases according to a preset negative correlation mapping relationship. In the next detection cycle, the sampling window width and edge retrieval range of the Chinese guide number operator will be narrowed accordingly.
[0073] The central processing unit writes the processed pixel column accumulation value and pixel row accumulation value to specified addresses in memory, respectively, generating a one-dimensional horizontal projection gradient sequence and a one-dimensional vertical projection gradient sequence, wherein, Indicates the spatial distribution length of consecutive nodes with the same sign. This represents the corresponding weighted cumulative coefficient.
[0074] The central processing unit (CPU) reads the one-dimensional horizontal projection gradient sequence and the one-dimensional vertical projection gradient sequence from a specified address in memory. For each spatial location on the one-dimensional coordinate axis, it extracts the one-dimensional gradient data within a sliding window centered on the corresponding sampling point and with a width of 32 pixels. Based on the local mean, local standard deviation, and magnification factor within the window, it calculates the dynamic judgment threshold curve. The calculation results are then written to a threshold buffer. When the value of a sample point in any projected gradient sequence exceeds a certain threshold, the result is considered valid. At that time, the central processing unit marks the corresponding defect candidate interval in memory and in situ reverse maps the interval to the wire surface image data to obtain local defect candidate image blocks.
[0075] Within the candidate image patch for local defects, the central processing unit extracts the local maxima of the one-dimensional horizontal projection gradient sequence. The corresponding maxima of the one-dimensional vertical projection gradient sequence at the corresponding positions. The directional derivative difference residual ratio parameter is calculated based on the difference residual ratio of the two. When the real-time signal-to-noise ratio of a candidate image patch with a local defect is lower than a preset signal-to-noise ratio threshold, the central processing unit activates adaptive bias logic to adjust the preset non-zero positive constant bias term. Introduction The denominator is such that it remains non-zero under low contrast conditions.
[0076] The central processing unit (CPU) operates according to the continuous sampling positions. The judgment interval is determined by In the anisotropic ratio space, the distribution boundary of local defect candidate image patches is retrieved. When the distribution boundary is within When the value is greater than 0.75, the surface defects of the wire are classified as unidirectional scratch defects; when When the value is between 0.25 and 0.65, the surface defect of the wire is classified as surface peeling defect.
[0077] Using the above processing method, the single-frame image defect determination calculation delay of the image processing unit is kept within 1.5ms; in the continuous production process with an online speed greater than 30m / s, the wire boundary positioning error is kept within 0.5 pixels; the marking, inverse mapping and classification processing of defect candidate intervals are all completed in the one-dimensional projection gradient sequence and its corresponding local defect candidate image block, so that the image processing unit can maintain a continuous data processing process under fluctuating operating conditions.
[0078] Example 4: This example combines Figs. 1-2 This document describes a method for determining surface defects in wires based on object recognition. Fig. 1As shown, step S1 acquires the wire surface image data and calculates the first-order time derivative of the lateral pixel displacement of the central axis trajectory. Step S2, when the first-order time derivative exceeds a preset stability threshold, proportionally reduces the number of convolution kernel columns of the directional derivative operator perpendicular to the central axis direction, and uses the reduced directional derivative operator to perform spatial filtering on the wire surface image data to generate a pixel gradient matrix. Step S3, pixels in the pixel gradient matrix whose absolute gradient value is lower than a preset matrix fluctuation threshold are truncated to eliminate random noise and the variance of the truncated pixels is statistically analyzed to update the width constraint parameter, thereby limiting the sampling window width. Furthermore, for topologically conjugate continuous nodes, the spatial distribution of consecutive nodes with the same sign is considered. Step S4 involves performing self-gain accumulation on the inter-distribution length to generate horizontal and vertical projection gradient sequences. Step S5 calculates the dynamic judgment threshold curve for each spatial location based on the local mean and local standard deviation of the horizontal and vertical projection gradient sequences. Sampling points exceeding the dynamic judgment threshold curve are marked as defect candidate intervals and inversely mapped to obtain local defect candidate image blocks. Step S6 extracts the gradient maxima in the orthogonal directions of the local defect candidate image blocks to construct the directional derivative difference residual ratio parameter. When the real-time signal-to-noise ratio is lower than the preset signal-to-noise ratio threshold, a preset non-zero positive constant bias term is introduced into the parameter denominator. The wire surface defect judgment result is output based on the directional derivative difference residual ratio parameter.
[0079] like Fig. 2 As shown, the high-strength steel cord drawing equipment includes the original two-dimensional grayscale image data of the operating wire area and transmits it to the linear array high-speed industrial camera. The random variation of local illumination intensity generated by the light-gathering and control component acts on the linear array high-speed industrial camera. The linear array high-speed industrial camera outputs the original two-dimensional grayscale image data to the input buffer of the image processing unit. The central processing unit reads the original two-dimensional grayscale image data from the input buffer. At the same time, the central processing unit performs the operation of reading the lateral pixel displacement of the central axis trajectory from the memory stack. The central processing unit dynamically updates the matrix noise mean parameter and width constraint parameter to the control register. The central processing unit writes the dynamic judgment threshold curve to the threshold buffer. The central processing unit saves the one-dimensional horizontal and vertical projection gradient sequence to the memory.
[0080] Example 5: Before the image processing unit starts the real-time determination program, the central processing unit reads the static calibration file, initializes the boundary constraint model, places the steel cord reference sample without surface defects and with oil removed within the imaging field of view of the linear industrial camera, measures the gray-scale jump curve of its edge pixels under uniform illumination, and calculates the first-order discrete difference along the curve to obtain the initial intrinsic edge gradient maximum value under zero noise background. The central processing unit writes the maximum value as a reference quantity into the control register to limit the edge retrieval range and tilt angle solution boundary of the global Hough transform linear operator in subsequent real-time processing.
[0081] Subsequently, the exposure parameters of the linear industrial camera are changed, and a gradient-increasing noise perturbation is applied to the imaging area. The central processing unit (CPU) cyclically calculates the edge position offset of the reference sample at each noise level, counts the pixel span of the discrete false boundary diffusion along the longitudinal direction, and writes the noise amplitude and the corresponding false boundary diffusion pixel span into a hard-coded mapping table. During real-time processing, the matrix noise mean parameter is updated according to the statistical variance of the truncated pixels, and the segmented interval of the width constraint parameter is determined according to the hard-coded mapping table. The sampling window width of the directional derivative operator is limited by the width constraint parameter. At the same time, the retrieval range of local gradient extrema points is limited according to the corresponding edge diffusion range.
[0082] After noise calibration, the wire running speed is increased in stages. During acceleration, the number of edge physical widening pixel columns generated within the integration time of the image sensor is recorded, and the first-order time derivative of the lateral pixel displacement of the central axis trajectory is calculated simultaneously and converted into energy consumption constraint parameters. When the first-order time derivative exceeds the preset stability threshold, the energy consumption constraint parameters corresponding to the preset stability threshold are used as a benchmark. Based on the increase ratio of the current energy consumption constraint parameters relative to the benchmark, the proportional decrease order of the number of discrete convolution kernel matrix columns in the direction perpendicular to the central axis is determined. The central processing unit writes the correspondence between the energy consumption constraint parameters, the number of edge physical widening pixel columns, and the number of discrete convolution kernel matrix columns into the discrete convolution kernel configuration file and fixes the memory addressing location of the configuration data at each level, so that the real-time judgment program can call the corresponding convolution kernel configuration according to the current energy consumption constraint parameters.
[0083] Example 6: Before the high-frequency continuous drawing process is put into operation on the production line, the image processing unit loads the system's initial baseline calibration program. The operator places a steel cord reference sample, confirmed to be defect-free and free of oil stains, in the center of the imaging field of view of the line scan industrial camera. The central processing unit acquires 1000 frames of grayscale images of the reference sample while the sample is stationary, and calculates the pixel gradient amplitude distribution between the image background and the wire substrate through the arithmetic logic unit to determine the initial background noise mean under standard lighting conditions. The grayscale response variance of each pixel is also included. This set of data is stored in the baseline model area of non-volatile memory and used as the dynamic judgment threshold curve when the real-time judgment program starts. The initial offset correction term.
[0084] When the production line is in an idle state awaiting materials, the central processing unit triggers an environmental noise self-check process, acquires a grayscale image of the current unloaded imaging field of view, calculates the pixel gradient magnitude according to the directional derivative operator used in real-time processing, and then calculates the local mean of the pixel gradient magnitude under the idle state. and local standard deviation ,according to and The initial parameters in the baseline model region are first-order weighted and corrected, and the correction result is written to the control register to adjust the matrix noise mean parameter. It will be updated as the current light intensity in the factory decreases. and The units are all pixel gradient magnitude. Use the same units.
[0085] During continuous operation, the central processing unit monitors Compared to The numerical change, when When a monotonic incremental shift of more than 20% occurs within a one-hour observation window, the image processing unit determines that the change is caused by signal contrast attenuation due to dust accumulation in the optical lens or aging of the light source, and initiates an online recalibration procedure.
[0086] During online recalibration, the production line continues to run. The central processing unit continuously acquires 500 frames of image data from the unmarked defective wire sections. Using this set of images as recalibration samples, the convolution kernel parameters of the current anisotropic directional derivative operator are recalculated. Based on the recalculated pixel gradient distribution, a reference value is generated. The newly generated reference value is overwritten and written into the control register for dynamic determination of the threshold curve. Subsequent calculations and calls; magnification factor The adjustment process is kept constant, ensuring that the same threshold amplification relationship is used in different operating segments.
[0087] Through initial installation calibration, no-load environmental noise self-check, and online recalibration during continuous operation, the parameters in the reference model area and control register are updated according to the optical state of the imaging system, dynamically determining the threshold curve. The corresponding adjustments form a closed-loop process from initial baseline determination to online operational adjustments.
[0088] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for determining surface defects in wires based on object recognition, characterized in that, Includes the following steps: Step S1: Obtain image data of the wire surface and calculate the first time derivative of the lateral pixel displacement of the central axis trajectory; Step S2: When the first-order time derivative exceeds the preset stability threshold, the number of convolution kernel columns of the directional derivative operator perpendicular to the central axis is reduced proportionally, and the reduced directional derivative operator is used to perform spatial filtering on the wire surface image data to generate a pixel gradient matrix. Step S3: Pixels whose absolute gradient values in the pixel gradient matrix are lower than the preset matrix fluctuation threshold are truncated to zero to eliminate random noise, and the variance of the truncated pixels is calculated to update the width constraint parameter. The width constraint parameter is used to limit the sampling window width in step S2. For topological conjugate continuous nodes, self-gain accumulation is performed according to the spatial distribution length of continuous nodes with the same sign to generate horizontal projection gradient sequence and vertical projection gradient sequence. Step S4: Calculate the dynamic judgment threshold curve for each spatial location based on the local mean and local standard deviation of the horizontal projection gradient sequence and the vertical projection gradient sequence. Mark the defect candidate interval for sampling points that exceed the dynamic judgment threshold curve and perform inverse mapping to obtain local defect candidate image blocks. Step S5: Extract the gradient maxima in the orthogonal direction of the candidate image block of local defects to construct the directional derivative difference residual ratio parameter. When the real-time signal-to-noise ratio is lower than the preset signal-to-noise ratio threshold, introduce a preset non-zero positive constant bias term into the denominator of the directional derivative difference residual ratio parameter. Output the wire surface defect judgment result according to the directional derivative difference residual ratio parameter.
2. The method for determining surface defects of wires based on object recognition according to claim 1, characterized in that, In step S3, the self-gain accumulation based on the spatial distribution length of consecutive nodes with the same sign includes the following sub-steps: Step S31, calculate the spatial distribution length of consecutive nodes with the same polarity sign that appear consecutively in the pixel gradient matrix; Step S32, establish the weighted accumulation coefficient of positive correlation stepwise step based on the spatial distribution length; Step S33, use the weighted accumulation coefficient to perform weighted accumulation on the gradient of each pixel in the topological conjugate consecutive nodes to generate the horizontal projection gradient sequence and the vertical projection gradient sequence.
3. The method for determining surface defects of wires based on object recognition according to claim 1, characterized in that, In step S3, pixels whose absolute gradient value in the pixel gradient matrix is lower than the preset matrix fluctuation threshold are truncated to zero to eliminate random noise, and the variance of the truncated pixels is calculated to update the width constraint parameter, including the following sub-steps: Step S34, calculate the statistical variance of the truncated pixels in 5 consecutive detection periods; Step S35, dynamically update the current matrix noise mean parameter according to the statistical variance, and write the updated matrix noise mean parameter to the control register; Step S36, dynamically scale the width constraint parameter according to the matrix noise mean parameter in the control register to change the sampling window width during spatial filtering.
4. The method for determining surface defects of wires based on object recognition according to claim 1, characterized in that, In step S4, the dynamic decision threshold curve for each spatial location is calculated based on the local mean and local standard deviation of the horizontal and vertical projection gradient sequences using the following formula: in, The dynamic judgment threshold curve corresponding to each spatial location. This is the local mean extracted within the sliding window. This represents the local standard deviation within the sliding window. This is the set magnification factor.
5. The method for determining surface defects of wires based on object recognition according to claim 4, characterized in that, In step S4, before calculating the dynamic decision threshold curve for each spatial location, the following sub-steps are included: Step S41, for each sampling point in the spatial location, extract one-dimensional gradient data within a sliding window centered on the sampling point and with a width of 32 pixels; Step S42, calculate the arithmetic mean of the one-dimensional gradient data within the sliding window as the local mean, and calculate the standard deviation of the one-dimensional gradient data as the local standard deviation.
6. The method for determining surface defects of wires based on object recognition according to claim 1, characterized in that, In step S5, extracting the gradient maxima in the orthogonal direction in the local defect candidate image block to construct the directional derivative difference residual ratio parameter includes the following sub-steps: Step S51, searching for the local maxima of the one-dimensional horizontal projection gradient sequence and the corresponding maxima of the one-dimensional vertical projection gradient sequence at the corresponding positions in the local defect candidate image block; Step S52, calculating the difference residual between the local maxima of the one-dimensional horizontal projection gradient sequence and the corresponding maxima of the one-dimensional vertical projection gradient sequence, and determining the ratio of the difference residuals as the directional derivative difference residual ratio parameter.
7. The method for determining surface defects of wires based on object recognition according to claim 1, characterized in that, In step S5, when the real-time signal-to-noise ratio of the local defect candidate image block is lower than the preset signal-to-noise ratio threshold, a preset non-zero positive constant bias term is introduced into the denominator of the directional derivative difference residual ratio parameter, including the following sub-steps: Step S53, measure the signal energy and noise energy of the local defect candidate image block, and calculate the real-time signal-to-noise ratio; Step S54, when the real-time signal-to-noise ratio is lower than the preset signal-to-noise ratio threshold, activate the adaptive bias logic, and accumulate the preset non-zero positive constant bias term into the denominator of the directional derivative difference residual ratio parameter to block the calculation divergence caused by the value approaching 0 when the denominator flows.
8. The method for determining surface defects of wires based on object recognition according to claim 1, characterized in that, Step S1 includes the following sub-steps: Step S11, read the original two-dimensional grayscale image data containing the running wire area from the continuous image sensor; Step S12, perform coordinate space normalization correction on the original two-dimensional grayscale image data using a set homogeneous transformation matrix to eliminate feature deformation caused by geometric distortion and surface contamination, and generate wire surface image data.
9. The method for determining surface defects of wires based on object recognition according to claim 1, characterized in that, Step S5 is followed by the following sub-steps: Step S55, in the anisotropic ratio space composed of the directional derivative difference residual ratio parameter, the distribution boundary of the local defect candidate image block is retrieved; Step S56, according to the distribution boundary, the gradient morphology difference of the orthogonal direction is decoupled, and when the directional derivative difference residual ratio parameter is greater than 0.75, the wire surface defect is automatically classified as a unidirectional scratch defect, and when the directional derivative difference residual ratio parameter is between 0.25 and 0.65, the wire surface defect is automatically classified as a surface peeling defect.
10. The method for determining surface defects of wires based on object recognition according to claim 1, characterized in that, In step S2, the reduction of the number of convolution kernel columns of the directional derivative operator perpendicular to the central axis direction includes the following sub-steps: Step S21, continuously read the first-order time derivative calculated from the lateral pixel displacement of the central axis trajectory, and convert the first-order time derivative into constraint parameters characterizing the kinetic energy consumption of the wire diameter; Step S22, when the first-order time derivative exceeds a preset stability threshold, reduce the number of columns of the discrete convolution kernel matrix of the directional derivative operator in the direction perpendicular to the central axis direction proportionally according to the magnitude of the constraint parameters, so as to counteract the motion blur of the image edges caused by the high-speed operation of the wire.
Citation Information
Patent Citations
Method and device for correcting transverse jitter of high-speed wire rod image
CN117058355A
