An image analysis-based roll surface spray defect recognition system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING JUNSHAN SURFACE TECH ENG
- Filing Date
- 2026-07-08
- Publication Date
- 2026-08-07
AI Technical Summary
然而,上述现有技术仍存在以下缺陷:1、辊轴金属柱面曲率导致反射光强随曲率角度剧烈变化,且高光区域的灰度饱和程度随辊轴转速波动呈非线性变化,现有方案采用静态补偿参数或统一偏振模式,难以同时适应不同转速下的光照分布变化,导致校正后的图像背景灰度分布不一致,低光对比度区域的微小缺陷因信噪比不足而难以识别
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The present invention acquires multiple frames of pre-detection images and calculates the median of the overexposure ratio, compares it with the pre-calibrated overexposure tolerance threshold, and switches to polarization imaging mode only when the ratio exceeds the limit. The application of this pre-decision mechanism avoids the energy loss of diffuse reflection light caused by the full-process use of polarization in the prior art, and ensures that the conventional imaging mode is still used when the specular reflection is weak, thereby preserving the detail information of the low contrast area.
Smart Images

Figure CN122530710A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology and relates to a roller surface spraying defect recognition system based on image analysis. Background Technology
[0002] In the manufacturing and surface treatment process of rollers, spraying is a key step to ensure the corrosion resistance, wear resistance, and surface quality of the rollers. After spraying, the roller surface must be inspected for defects in order to promptly identify and eliminate quality problems such as coating blistering, peeling, scratches, and contamination, and to prevent defective parts from flowing into the next process and causing losses.
[0003] In existing technologies, there are various solutions for surface defect detection of roller-type metal parts. For example, linear or area array cameras combined with encoder triggering are used to acquire full-circumference images of the rotating roller, and the defect area is identified using grayscale threshold segmentation; or 3D line laser contour scanning technology is used to obtain three-dimensional topographic data of the roller surface, and the surface defect level is determined accordingly. For the problem of specular reflection on metal surfaces, polarization imaging methods are also used, acquiring polarized images through a combination of linear polarizers and orthogonal analyzers to suppress specular reflection interference and highlight defect features. However, the above-mentioned existing technologies still have the following drawbacks: 1. The curvature of the roller's metal cylindrical surface causes the reflected light intensity to change drastically with the curvature angle, and the grayscale saturation of the high-light area changes non-linearly with the roller speed. Existing solutions use static compensation parameters or a uniform polarization mode, which is difficult to adapt to changes in illumination distribution at different speeds simultaneously, resulting in inconsistent background grayscale distribution in the corrected image. Small defects in low-contrast areas are difficult to identify due to insufficient signal-to-noise ratio.
[0004] 2. Polarization imaging technology lacks a pre-decision mechanism in roller inspection scenarios. Existing solutions default to using polarization mode throughout the process to suppress highlights. However, when the specular reflection on the roller surface is weak, the polarization mode simultaneously reduces the light energy of the diffuse reflection component entering the camera, which deteriorates the imaging quality of low-contrast areas and causes the loss of detail information in inspection areas that do not require polarization suppression.
[0005] 3. Existing defect identification methods, when dealing with four types of defects—blistering, peeling, scratches, and contamination—mostly employ a uniform segmentation threshold or rely on classifiers for black-box identification, failing to establish hierarchical comparison logic based on the unique characteristics of each defect type in grayscale distribution and geometric morphology. This makes accurate differentiation difficult when there is overlap between specular artifacts and real defect feature regions. Summary of the Invention
[0006] In view of this, in order to solve the problems mentioned in the background art, a roller surface spraying defect recognition system based on image analysis is proposed.
[0007] The objective of this invention can be achieved through the following technical solution: This invention provides a roller surface spraying defect identification system based on image analysis, including: an image acquisition module, a region division module, an illumination compensation module, a defect identification module, and a result output module.
[0008] The image acquisition module is connected to the region segmentation module, the region segmentation module is connected to the illumination compensation module, the illumination compensation module is connected to the defect recognition module, and the defect recognition module is connected to the result output module.
[0009] The image acquisition module selects either the conventional imaging mode or the polarization imaging mode based on the proportion of overexposed pixels to acquire the original image of the surface of the roller to be inspected.
[0010] The region segmentation module divides the roller surface covered by the original image into multiple sub-regions along the axial direction based on the roller's curvature radius and the camera's field of view.
[0011] The illumination compensation module obtains the theoretical reflected light intensity corresponding to the rotation speed and curvature angle, which is determined through pre-calibration experiments, based on the real-time rotation speed of the roller and the curvature angle of the center point of each sub-region. It calculates the illumination attenuation compensation factor for each sub-region, performs multiplicative correction on the pixel grayscale values of the corresponding sub-regions in the original image, and stitches the corrected sub-region images into the target image.
[0012] The defect identification module performs region extraction and feature calculation on the target image, and matches the defect type by feature comparison. The defect type includes blistering, peeling, scratches or contamination.
[0013] The results output module performs specular artifact removal and defect contour repair based on the defect type matching results, and outputs the final defect detection results.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The present invention acquires multiple frames of pre-detection images and calculates the median of the overexposure ratio, compares it with the pre-calibrated overexposure tolerance threshold, and switches to polarization imaging mode only when the ratio exceeds the limit. The application of this pre-decision mechanism avoids the energy loss of diffuse reflection light caused by the full-process use of polarization in the prior art, and ensures that the conventional imaging mode is still used when the specular reflection is weak, thereby preserving the detail information of the low contrast area.
[0015] (2) The present invention pre-calibrates the theoretical reflected light intensity corresponding to each curvature angle at different rotation speeds, establishes a three-dimensional correspondence set, and calculates the light attenuation compensation factor to correct the pixel gray value by monitoring the real-time rotation speed of the roller and the curvature angle of the center point of each sub-region, so that the background gray value distribution of the target image tends to be consistent, the small defect contours of the low light contrast area remain intact, and avoids the problem that static compensation cannot fit the nonlinear change of rotation speed.
[0016] (3) This invention pre-configures confidence contribution values for each defect type on each feature dimension, accumulates scores by ensuring feature values fall within the reference interval, and extracts non-overlapping exclusive feature dimensions for secondary adjudication when total scores are tied. This helps solve the misjudgment problem caused by overlapping feature intervals, achieves accurate differentiation of four types of defects: blistering, peeling, scratches, and contamination, and avoids the uninterpretability of black-box classifiers. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments 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.
[0018] Figure 1 This is a schematic diagram of the module connection of the present invention;
[0019] Figure 2 This is a schematic diagram of the process for acquiring the original image of the surface of the roller shaft to be inspected in this invention;
[0020] Figure 3 This is a schematic diagram illustrating the calculation process of the illumination attenuation compensation factor for each sub-region in this invention. Detailed Implementation
[0021] 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.
[0022] Please see Figure 1 As shown, the present invention provides a roller surface spraying defect recognition system based on image analysis, including: an image acquisition module, a region division module, an illumination compensation module, a defect recognition module, and a result output module.
[0023] The image acquisition module is connected to the region segmentation module, the region segmentation module is connected to the illumination compensation module, the illumination compensation module is connected to the defect recognition module, and the defect recognition module is connected to the result output module.
[0024] The image acquisition module selects either a conventional imaging mode or a polarization imaging mode based on the proportion of overexposed pixels to acquire the original image of the surface of the roller shaft to be inspected.
[0025] Given that the specular reflection intensity in the defect detection scenario of metal cylindrical roller coating exhibits a non-linear variation with curvature angle and rotation speed, using polarization imaging mode throughout the process would reduce diffuse reflection light energy, making it difficult to identify minute defects in low-contrast areas due to insufficient signal-to-noise ratio. Conversely, using conventional imaging mode throughout the process cannot suppress overexposure caused by strong specular reflection. Therefore, it is necessary to adaptively select the imaging mode based on the real-time overexposure level to balance highlight suppression and detail preservation. Therefore, referring to... Figure 2 As shown, in this embodiment, the conventional imaging mode or polarization imaging mode is selected based on the proportion of overexposed pixels. The specific execution process is as follows: Before the formal acquisition, the industrial camera continuously acquires multiple frames (e.g., 10 frames) of pre-inspection images in the conventional imaging mode. The conventional imaging mode is the camera directly exposing and acquiring the original image of the roller surface.
[0026] Calculate the proportion of overexposed pixels in each frame of the pre-detection image to the total number of pixels in the entire image, and use this as the overexposure percentage for a single frame. Take the median of the overexposure percentages across multiple frames as the reference overexposure percentage.
[0027] Obtain the overexposure tolerance threshold determined in advance through calibration experiments. If the reference overexposure ratio is greater than the overexposure tolerance threshold, it is determined that the current roller surface is in a strong specular reflection state. Subsequently, for the complete detection task of the current roller, switch to polarization imaging mode for image acquisition; otherwise, maintain the conventional imaging mode.
[0028] The polarization imaging mode is as follows: the polarization direction of the linear polarizer placed in front of the industrial camera lens is orthogonal to the polarization direction of the linear polarizer placed on the light-emitting surface of the LED light source, and the original image of the roller surface is acquired.
[0029] It should be noted that the overexposed pixel screening condition is as follows: under no-light conditions, the industrial camera lens is blocked, and multiple frames of dark field images are continuously acquired; the gray value range of each pixel in the dark field image between multiple frames is calculated, and the maximum value among all pixel ranges is taken as the noise fluctuation benchmark value of the camera.
[0030] Obtain the maximum gray value corresponding to the image quantization bit depth, and use the difference between it and the noise fluctuation reference value as the saturation gray value threshold.
[0031] The grayscale value of each pixel in the pre-detection image is compared with the saturation grayscale threshold value. If it is greater than or equal to the threshold value, it is determined to be an overexposed pixel.
[0032] The calibration experiment for the overexposure tolerance threshold is as follows: A standard diffuse reflection reference plate is attached to the surface of a calibration roller of the same specifications as the roller to be tested. The calibration roller is driven to rotate at the rated speed. During one revolution of the roller, reference plate images are acquired at multiple curvature angle positions. The overexposure pixel ratio of the reference plate area at each position is extracted. The maximum value of the overexposure ratio at all curvature angles is taken as the maximum theoretical overexposure ratio at the rated speed. The theoretical overexposure ratio is added to the preset safety offset to obtain the overexposure tolerance threshold. The safety offset is a positive real number. It is calculated by acquiring several normal, defect-free roller surface images in advance, statistically analyzing the overexposure pixel ratio of each frame image and calculating the standard deviation. A specified multiple of the standard deviation is taken as the safety offset. For example, 3 times the standard deviation can be selected.
[0033] The region division module divides the roller surface covered by the original image into multiple sub-regions along the axial direction based on the roller's curvature radius and the camera's field of view.
[0034] Since the radius of curvature of the roller is fixed along the axial direction, the curvature angle of the roller surface within the camera's field of view varies with the axial position, resulting in a gradual distribution of light attenuation along the axial direction. If a single compensation method is used to correct the entire image, it cannot adapt to the attenuation differences at different axial positions. To facilitate subsequent zonal compensation, the original image needs to be divided into multiple sub-regions along the axial direction. Therefore, in this embodiment, the roller surface covered by the original image is divided into multiple sub-regions along the axial direction. The specific process is as follows: A pixel coordinate system is established with the upper left corner of the original image as the origin, and the X-axis direction is set to correspond to the roller axial direction, and the Y-axis direction corresponds to the roller circumferential direction.
[0035] The physical width of the field of view in the X-axis direction is calculated based on the camera calibration parameters. Specifically: First, the pixel size of the camera is multiplied by the total number of pixels in the image width direction to obtain the total physical size of the image sensor in the horizontal direction. Second, the arctangent value of the ratio of the total physical size to the lens focal length is used as the horizontal field of view, and the half-angle tangent value of the horizontal field of view is obtained simultaneously. Then, the vertical distance between the front end of the industrial camera lens and the surface of the roller shaft to be inspected is marked as the working distance. The working distance is manually measured and configured by the calibration block during system installation, or automatically measured and obtained by the laser rangefinder sensor. Finally, the working distance is multiplied by twice the half-angle tangent value to obtain the physical width of the field of view in the X-axis direction.
[0036] Divide the physical width of the field of view by the preset baseline partition width, and round the result up to obtain the initial number of partitions.
[0037] The initial number of partitions is linearly corrected based on the ratio of the preset reference diameter to the roller diameter. Specifically, the initial number of partitions is multiplied by the ratio of the preset reference diameter to the roller diameter, and the product is rounded to the nearest integer to obtain the final number of partitions.
[0038] The original image is divided into continuous and equally wide strips along the X-axis according to the final number of partitions. Each strip has the same pixel width along the X-axis, and the Y-axis maintains the full height of the original image. Each strip is treated as an independent sub-region, and the start and end pixel column numbers of each sub-region along the X-axis are recorded synchronously.
[0039] It should be noted that if the original image width cannot be divided evenly by the final number of partitions, the pixel width of the last strip is adjusted so that the difference between it and the standard strip width does not exceed one pixel.
[0040] The purpose of setting the reference partition width is to ensure that the illumination difference within each sub-region is within an acceptable range, making the grayscale distribution within the sub-region relatively uniform, which facilitates subsequent correction. The specific method for determining the reference partition width is as follows: under standard illumination conditions, grayscale values are collected at equal intervals along the axial direction of the roller shaft, the grayscale change rate between adjacent sampling points is calculated, the length of all continuous intervals where the grayscale change rate exceeds the set tolerance value (e.g., 5%) is counted, and the minimum value of all continuous interval lengths is taken as the reference partition width.
[0041] The purpose of setting the reference diameter is to provide a normalized reference for changes in roller diameter, allowing the number of zones to be adjusted linearly with the roller diameter, thereby maintaining a relatively consistent width for each sub-region in physical space. The reference diameter can be taken as the median value within the range of roller diameter specifications to be tested.
[0042] The illumination compensation module obtains the theoretical reflected light intensity corresponding to the rotation speed and curvature angle, which is determined through a pre-calibrated experiment, based on the real-time rotation speed of the roller and the curvature angle of the center point of each sub-region. It calculates the illumination attenuation compensation factor for each sub-region, performs multiplicative correction on the pixel grayscale values of the corresponding sub-regions in the original image, and stitches the corrected sub-region images into the target image.
[0043] In this embodiment, obtaining the theoretical reflected light intensity corresponding to the rotational speed and curvature angle, which is determined through a pre-calibration experiment, includes: attaching a standard diffuse reflection reference plate to the surface of a calibration roller of the same specifications as the roller to be tested.
[0044] Place the calibration roller at the testing station, keep the light source intensity of the image acquisition module constant, and drive the calibration roller to rotate sequentially with multiple different preset speed values.
[0045] At each preset rotation speed, during one revolution of the calibration roller, reference plate images at multiple curvature angle positions are acquired circumferentially. The average pixel grayscale value within the reference plate area at each position is extracted. Combined with the reflectivity of the standard diffuse reflection reference plate, the theoretical reflected light intensity is calculated, and a one-dimensional correspondence sequence between the curvature angle and the theoretical reflected light intensity is established at the preset rotation speed. The reflectivity of the standard diffuse reflection reference plate is a known constant, obtained from the factory calibration value of the reference plate or by measurement in the visible light band (e.g., center wavelength 630nm) using a spectrophotometer, and its value is between 0.95 and 0.99.
[0046] The theoretical reflected light intensity calculation process is as follows: the average pixel gray level is divided by the reflectivity of the standard diffuse reflection reference plate, and then multiplied by the incident light intensity reference value. The calibration process of the incident light intensity reference value is as follows: the standard diffuse reflection reference plate is placed horizontally at the testing station, the current and working distance of the LED light source are kept exactly the same as during the formal testing, and the industrial camera is used to image the central area of the reference plate with the polarization element turned off. Multiple frames of images are acquired and the average pixel gray level of the area is calculated as the incident light intensity reference value.
[0047] The one-dimensional correspondence sequences obtained at each preset rotation speed are combined to form a set of three-dimensional correspondences between rotation speed, curvature angle and theoretical reflected light intensity.
[0048] Reference Figure 3 As shown, in this embodiment, the calculation of the illumination attenuation compensation factor for each sub-region includes: using the real-time rotational speed of the roller and the curvature angle of the center point of the sub-region as search conditions, and searching for matching items in the three-dimensional correspondence set; if there is a record item in the set that is the same as the real-time rotational speed of the roller and the curvature angle of the center point of the sub-region, then the theoretical reflected light intensity in the record item is directly read as the theoretical reflected light intensity estimate of the current sub-region.
[0049] Otherwise, select two neighboring rotational speed values and two neighboring curvature angle values along the rotational speed dimension and curvature angle dimension respectively, and use the bilinear interpolation algorithm to calculate the theoretical reflected light intensity estimate of the current sub-region based on the theoretical reflected light intensity values of the four neighboring terms.
[0050] The selection method for the two adjacent rotational speed values is as follows: in the three-dimensional correspondence set, the maximum rotational speed value that is less than or equal to the current real-time rotational speed and the minimum rotational speed value that is greater than or equal to the current real-time rotational speed are found respectively. If the current real-time rotational speed is equal to a certain preset rotational speed value, it is directly matched; otherwise, the two adjacent rotational speed values are taken as interpolation nodes. The selection method for the adjacent values of curvature angle is similar.
[0051] The execution process of the bilinear interpolation algorithm is as follows: along the rotation direction, at the lower boundary rotation speed and the upper boundary rotation speed respectively, the theoretical reflected light intensity is linearly interpolated based on the two adjacent values of curvature angle to obtain two intermediate values; the two intermediate values are linearly interpolated along the curvature angle direction to obtain the theoretical reflected light intensity estimate of the current sub-region.
[0052] Calculate the average gray value of all pixels in the current sub-region, obtain the pre-calibrated expected background gray value, and use the ratio of the expected background gray value to the average gray value as the base gain ratio.
[0053] The desired background gray value refers to the target gray value that maximizes the gray value difference between the coating defect and the normal background. It is determined by selecting the best value after conducting contrast tests on standard defect samples at different gray levels. Specifically, a batch of standard sample rollers containing various typical defects (blistering, peeling, scratches, contamination) are prepared, and their surface images are acquired in conventional imaging mode.
[0054] Apply multiple sets of different grayscale linear transformations to each image, such as multiplying the original grayscale value by multiple different coefficients and then truncating it, so that the grayscale of the image background is adjusted to multiple preset candidate target values.
[0055] For each candidate target value, calculate the grayscale difference between each defect area and the surrounding normal background area, and take the average of the grayscale differences of all defect areas as the contrast score of the candidate target value.
[0056] The candidate target value with the highest contrast score is selected as the desired background grayscale value. In this embodiment, the value range of the candidate target value is the middle range of the image grayscale dynamic range (e.g., 80 to 200), and the step size is 10.
[0057] The ratio of the incident light intensity reference value to the theoretical reflected light intensity estimate is used as the attenuation correction ratio.
[0058] Multiply the base gain ratio by the attenuation correction ratio to obtain the illumination attenuation compensation factor for the current sub-region.
[0059] In this embodiment, the multiplicative correction process includes: obtaining the original grayscale value of each pixel in the current sub-region, multiplying the original grayscale value by the illumination attenuation compensation factor of the current sub-region, and obtaining the product result.
[0060] Determine whether the product result exceeds the maximum grayscale value allowed by the digital image: if it does not exceed, use the product result as the grayscale value after pixel correction; if it exceeds, set the corrected grayscale value of the pixel to the maximum grayscale value allowed by the digital image.
[0061] Iterate through all pixels in the current sub-region and perform pixel-by-pixel correction calculations.
[0062] Arrange the corrected grayscale values of all pixels in the current sub-region according to their original pixel positions to generate a corrected image block.
[0063] It should be noted that the maximum allowed grayscale value of the digital image is determined by the quantization bit depth of the image acquisition module. For example, when an industrial camera outputs an 8-bit grayscale image, the corresponding maximum grayscale value is 255; when it outputs a 10-bit grayscale image, the corresponding maximum grayscale value is 1023. The system automatically obtains this value by reading camera parameters during initialization.
[0064] The defect identification module performs region extraction and feature calculation on the target image, and matches the defect type by feature comparison. The defect type includes blistering, peeling, scratches or contamination.
[0065] In this embodiment, the process of performing region extraction and feature calculation on the target image includes: denoising the target image and extracting the edge map using a multi-scale Canny edge detection operator. Specifically, the process involves: calculating the gradient magnitude of each pixel in the target image, statistically analyzing the distribution frequency of the gradient magnitude, and forming a global grayscale gradient histogram.
[0066] The high and low thresholds for edge detection are dynamically set based on the global grayscale gradient histogram: a first quantile (e.g., 0.8) and a second quantile (e.g., 0.4) are selected. The gradient magnitude corresponding to the cumulative frequency in the histogram equal to the first quantile is used as the high threshold, and the gradient magnitude corresponding to the cumulative frequency equal to the second quantile is used as the low threshold. Those skilled in the art can adjust the first quantile within the range of 0.7-0.9 and the second quantile within the range of 0.3-0.5 according to the proportion of weak edges to strong edges in the target image. When the proportion of weak edges is greater than that of strong edges, the first quantile is decreased; when the proportion of strong edges is greater than that of weak edges, the second quantile is increased.
[0067] The target image is smoothed using Gaussian filter kernels of various scales, such as kernel sizes of 3×3, 5×5, and 7×7. Thresholded Canny edge detection is then performed on the smoothed image at each scale to obtain the edge map at the corresponding scale.
[0068] The edge maps detected at each scale are merged by performing a pixel-by-pixel logical OR operation, that is, all pixels that are determined to be edges at any scale are retained, resulting in the final fused edge map.
[0069] A morphological closing operation is performed on the edge map. The structuring element of the morphological closing operation is a circle or a rectangle. The size of the structuring element is determined as follows: a standard defect-free roller sample image is acquired during system initialization. The image is subjected to the same noise reduction, edge detection, and connected component analysis as the formal inspection to obtain multiple defect-free background connected components. The Euclidean distance between adjacent edge points on the edge contour of each connected component is measured, and all distance values greater than 2 pixels are recorded as the width of the fracture gap. The median of all measured values is taken and rounded up to a range of 3 to 7 pixels, which is used as the diameter or side length of the structuring element.
[0070] After connected component analysis, connected components with an area greater than or equal to the preset lower limit of area and an aspect ratio less than or equal to the preset lower limit of slenderness ratio are retained as the regions to be analyzed.
[0071] The method for determining the preset area lower limit is as follows: collect no less than 100 noise connected regions from the target image of a normal, defect-free roller surface, calculate the statistical distribution of the area of each connected region, and take the 95th percentile as the preset area lower limit. If the 95th percentile is less than 1 pixel, it is set to 1 pixel.
[0072] The preset slenderness ratio lower limit is determined by: taking half of the minimum aspect ratio of the smallest bounding rectangle of various real defects in the statistical sample library as the preset slenderness ratio lower limit.
[0073] Calculate the grayscale distribution features and geometric morphology features of each region to be analyzed. The grayscale distribution features include contrast features, texture energy features, and orientation consistency features. The geometric morphology features include rectangularity, shape complexity, and contour smoothness features.
[0074] The various feature parameters are combined into a multidimensional feature vector through normalization.
[0075] It should be noted that the calculation process of the above feature parameters is as follows: Contrast feature: Extract the gray values of all pixels inside the region to be analyzed, calculate the difference between the average gray value inside the region and the average gray value of the neighboring background outside the region, and take the absolute value of the difference as the contrast feature value, where the neighboring background is a ring-shaped region with a preset width (e.g., 10 pixels) extended outward from the smallest bounding rectangle of the region to be analyzed.
[0076] Texture energy feature: Calculate the standard deviation of pixel gray values in the region to be analyzed, and use the standard deviation as the texture energy feature value.
[0077] Directional consistency feature: Calculate the gray-level co-occurrence matrix of four directions (0°, 45°, 90°, and 135°) in the region to be analyzed, extract the correlation parameter of each direction, and take the reciprocal of the standard deviation of the correlation parameter of the four directions as the directional consistency feature value.
[0078] Rectangularity: The rectangularity is the ratio obtained by dividing the area of the region to be analyzed by the area of its smallest bounding rectangle.
[0079] Shape complexity: The square of the perimeter of the region to be analyzed is divided by the area of the region to be analyzed, and the resulting value is used as the shape complexity.
[0080] Contour smoothness feature: Extract the edge contour point sequence of the region to be analyzed, perform Fourier transform on the contour point sequence, take the sum of the amplitudes of the first 5 low-frequency components, and then divide by the sum of the amplitudes of all frequency components to obtain the contour smoothness feature value.
[0081] In this embodiment, the step of matching defect types by feature comparison includes: pre-calculating the reference numerical range of each type of defect in each feature dimension from a sample library of known defect types, and configuring a confidence contribution value for each type of defect in each feature dimension.
[0082] The statistical method for the reference numerical interval is as follows: for each type of defect, a preset number of samples are collected, and a multi-dimensional feature vector is extracted from each sample; for each feature dimension, the mean value of the samples of the current type of defect is calculated. and standard deviation ,by As a reference range of values, The pre-defined interval expansion coefficient controls the range of sample dispersion that the interval can cover. For example, a value of 2 can be used, which allows the interval to cover approximately 95% of the sample distribution. In addition, if the number of samples of a certain type of defect is lower than the preset minimum sample size threshold (e.g., 30), the minimum and maximum values of each dimension in the sample are directly used as the interval endpoints.
[0083] The confidence contribution value is configured as follows: for each feature dimension, calculate the width of the reference value interval for the current class of defect samples. And the average distance between the mean of the current defect sample and the mean of all other defect samples. Configure the confidence contribution value as and The ratio, and setting the lower limit of the confidence contribution value to 0.1, when and When the ratio is less than 0.1, the value is directly taken as 0.1. This configuration process is completed offline during the system calibration phase, and the generated contribution value table is stored in the defect identification module.
[0084] For the multidimensional feature vector of the current region to be analyzed, the feature value of each dimension is compared with the reference value range of all defect types in turn. When the feature value falls into the reference value range of a certain defect type, the confidence contribution value of the defect type in the corresponding dimension is added to the total score of the defect type.
[0085] After traversing all feature dimensions, compare the total scores of each defect type and select the defect type with the highest total score as the judgment result.
[0086] When the defect types with the highest total scores are tied, the categories with exclusive feature dimensions are extracted from the tied defect types. The exclusive feature dimension refers to the dimension in which the reference value range of a certain defect type does not overlap with the reference value ranges of all other tied defect types. The confidence contribution values of each tied defect type on its exclusive dimension are summed, and the one with the largest summation result is selected from the tied defect types as the judgment result.
[0087] The non-overlapping determination rule is as follows: for two intervals and ,like or If, then it is determined that there is no overlap; if or If the boundaries are unclear, they are still considered to overlap to avoid misjudgment caused by ambiguous boundaries. When determining the exclusive feature dimension, only the interval overlap between currently parallel defect types is considered, and non-parallel types are not involved.
[0088] When the region cannot be distinguished after comparison using the exclusive dimension, or when none of the parallel types possess an exclusive feature dimension, the region to be analyzed is marked as a suspected defect and transferred to the results output module for manual verification. The manual verification process is as follows: the results output module pushes the location of the suspected defect region, the image block, and its feature vector to the human-computer interaction interface, where the operator selects the actual defect type or marks it as a pseudo-defect. The confirmed result is added to the sample library as a new sample, triggering the defect identification module to recalculate the reference value range and reconfigure the confidence contribution value, thus enabling the system's online incremental learning.
[0089] Because the defect type determination results output by the defect identification module may contain specular artifacts caused by specular reflection that are mistakenly identified as real defects, it is necessary to further eliminate specular artifacts in the areas identified as defects to reduce the false detection rate. Simultaneously, after the aforementioned edge detection and connected component analysis, the edge contours of real defects may exhibit local breaks due to illumination or segmentation discontinuities, affecting the accuracy of defect localization and measurement. Therefore, it is necessary to perform contour restoration on the retained real defects to output continuous and complete defect boundaries.
[0090] Therefore, the result output module performs specular artifact elimination and defect contour repair based on the defect type matching result, and outputs the final defect detection result.
[0091] In this embodiment, the highlight artifact elimination includes: for the region to be analyzed with a known defect type, locating its edge contour in the target image, wherein the edge contour is a closed continuous pixel chain.
[0092] Calculate the grayscale gradient direction of each pixel on the edge contour. Use the direction of the line connecting the current edge point and the centroid of the defect area as the reference direction pointing inward. If the centroid is located on or outside the edge contour, the center of the contour point set is used instead. Calculate the angle difference between the gradient direction of each pixel on the edge contour and the reference direction. If the angle difference is less than 90°, it is determined that the gradient direction of the pixel points inward. Then, count the percentage of edge points whose gradient direction points inward.
[0093] If the number of edge points accounts for more than half, the area to be analyzed is determined to be a specular artifact formed by specular reflection and is removed from the detection results.
[0094] Otherwise, it is determined to be a real defect, and the defect type mark is retained.
[0095] In this embodiment, the defect contour repair includes: obtaining an edge chain composed of edge points arranged in order in the real defect region, traversing adjacent edge points in the edge chain, and calculating the Euclidean distance between each pair of adjacent points.
[0096] When the Euclidean distance is greater than the preset break distance threshold (e.g., 3 pixels), it is determined that there is a break point between adjacent points.
[0097] For each breakpoint, extract two edge points forward and two edge points backward along the edge chain direction, for a total of four points as control points.
[0098] A cubic B-spline curve equation is constructed using four control points. An interpolation point sequence is generated by parameterization with equal arc length. The equal arc length parameterization refers to dividing the curve parameters from 0 to 1 into N segments, where N is an integer value representing the distance between the breakpoints, so that the generated interpolation points are approximately equidistant. The cubic B-spline curve equation is existing technology and will not be elaborated here.
[0099] The interpolation point sequence is inserted sequentially between two edge points at the break point to replace the original break gap, forming a continuous and uninterrupted edge chain.
[0100] After traversing all breakpoints and performing interpolation repair, the complete closed defect profile is output.
[0101] The above content is merely an example and illustration of the concept of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the concept of the invention or exceed the scope defined by the present invention, and all such modifications or additions should fall within the protection scope of the present invention.
Claims
1. A roller surface spraying defect identification system based on image analysis, characterized in that, include: The image acquisition module selects either the conventional imaging mode or the polarization imaging mode based on the proportion of overexposed pixels to acquire the original image of the surface of the roller to be inspected. The region segmentation module divides the roller surface covered by the original image into multiple sub-regions along the axial direction based on the roller's radius of curvature and the camera's field of view. The illumination compensation module obtains the theoretical reflected light intensity corresponding to the rotation speed and curvature angle, which is determined through a pre-calibrated experiment, based on the real-time rotation speed of the roller and the curvature angle of the center point of each sub-region. It calculates the illumination attenuation compensation factor for each sub-region, performs multiplicative correction on the pixel grayscale values of the corresponding sub-regions in the original image, and stitches the corrected sub-region images into the target image. The defect identification module performs region extraction and feature calculation on the target image, and matches the defect type by feature comparison. The defect type includes blistering, peeling, scratches or contamination. The results output module performs specular artifact removal and defect contour repair based on the defect type matching results, and outputs the final defect detection results.
2. The roller surface spraying defect identification system based on image analysis according to claim 1, characterized in that, The selection of conventional imaging mode or polarization imaging mode based on the proportion of overexposed pixels includes: Before the formal acquisition is performed, the industrial camera continuously acquires multiple frames of pre-inspection images in a conventional imaging mode, which is the camera directly exposes and acquires the original image of the roller surface. The proportion of overexposed pixels in each frame of the pre-detection image to the total number of pixels in the entire image is calculated as the overexposure ratio of a single frame, and the median of the overexposure ratios of multiple frames is taken as the reference overexposure ratio. Obtain the overexposure tolerance threshold determined in advance through calibration experiments. If the reference overexposure ratio is greater than the overexposure tolerance threshold, it is determined that the current roller surface is in a strong specular reflection state. Subsequently, for the complete detection task of the current roller, switch to polarization imaging mode for image acquisition; otherwise, maintain the conventional imaging mode. The polarization imaging mode is as follows: the polarization direction of the linear polarizer placed in front of the industrial camera lens is orthogonal to the polarization direction of the linear polarizer placed on the light-emitting surface of the LED light source, and the original image of the roller surface is acquired.
3. The roller surface spraying defect identification system based on image analysis according to claim 1, characterized in that, The process of dividing the roller surface covered by the original image into multiple sub-regions along the axial direction includes: Establish a pixel coordinate system with the top left corner of the original image as the origin, and set the X-axis direction to correspond to the roller axis and the Y-axis direction to correspond to the roller circumference. The physical width of the field of view in the X-axis direction is calculated based on the camera calibration parameters, and the initial number of partitions is obtained by dividing the physical width of the field of view by the preset baseline partition width. The initial number of partitions is linearly corrected based on the ratio of the preset reference diameter to the roller diameter to obtain the final number of partitions; The original image is divided into continuous and equally wide strips along the X-axis according to the final number of partitions. Each strip has the same pixel width along the X-axis, and the Y-axis maintains the full height of the original image. Each strip is treated as an independent sub-region, and the start and end pixel column numbers of each sub-region along the X-axis are recorded synchronously.
4. The roller surface spraying defect identification system based on image analysis according to claim 1, characterized in that, The acquisition of the theoretical reflected light intensity corresponding to the rotational speed and curvature angle, determined through a pre-calibrated experiment, includes: A standard diffuse reflection reference plate is attached to the surface of a calibration roller of the same specifications as the roller to be tested; Place the calibration roller at the testing station, keep the light source intensity of the image acquisition module constant, and drive the calibration roller to rotate sequentially with multiple different preset speed values; At each preset rotation speed, during one revolution of the calibration roller, reference plate images at multiple curvature angle positions are acquired along the circumference. The average pixel grayscale value within the reference plate area at each position is extracted. Combined with the reflectivity of the standard diffuse reflection reference plate, the theoretical reflected light intensity is calculated, and a one-dimensional correspondence sequence between curvature angle and theoretical reflected light intensity at the preset rotation speed is established. The one-dimensional correspondence sequences obtained at each preset rotation speed are combined to form a set of three-dimensional correspondences between rotation speed, curvature angle and theoretical reflected light intensity.
5. The roller surface spraying defect identification system based on image analysis according to claim 4, characterized in that, The calculation of the illumination attenuation compensation factor for each sub-region includes: Using the real-time rotational speed of the roller and the curvature angle of the center point of the sub-region as search criteria, matches are found in the three-dimensional correspondence set: If there is a record in the set that has the same real-time rotational speed of the roller and the curvature angle of the center point of the sub-region, then the theoretical reflected light intensity in the record is directly read as the theoretical reflected light intensity estimate of the current sub-region. Otherwise, select two neighboring rotational speed values and two neighboring curvature angle values along the rotational speed dimension and curvature angle dimension respectively, and use the bilinear interpolation algorithm to calculate the theoretical reflected light intensity estimate of the current sub-region based on the theoretical reflected light intensity values of the four neighboring terms; Calculate the average gray value of all pixels in the current sub-region, obtain the pre-calibrated expected background gray value, and use the ratio of the expected background gray value to the average gray value as the base gain ratio. The ratio of the incident light intensity reference value to the theoretical reflected light intensity estimate is used as the attenuation correction ratio; Multiply the base gain ratio by the attenuation correction ratio to obtain the illumination attenuation compensation factor for the current sub-region.
6. The roller surface spraying defect identification system based on image analysis according to claim 1, characterized in that, The multiplicative correction process includes: Obtain the original grayscale value of each pixel in the current sub-region, multiply the original grayscale value by the illumination attenuation compensation factor of the current sub-region, and obtain the product result; Determine whether the product result exceeds the maximum grayscale value allowed by the digital image: if it does not exceed the maximum grayscale value allowed by the digital image, then use the product result as the grayscale value after pixel correction; if it exceeds the maximum grayscale value allowed by the digital image, then set the corrected grayscale value of the pixel to the maximum grayscale value allowed by the digital image. Traverse all pixels within the current sub-region and perform pixel-by-pixel correction calculations; Arrange the corrected grayscale values of all pixels in the current sub-region according to their original pixel positions to generate a corrected image block.
7. The roller surface spraying defect identification system based on image analysis according to claim 1, characterized in that, The process of performing region extraction and feature calculation on the target image includes: To denoise the target image, a multi-scale Canny edge detection operator is used to extract the edge map; Perform morphological closing operations on the edge graph. After connected component analysis, retain connected components whose area is greater than or equal to the preset lower limit of area and whose aspect ratio is less than or equal to the preset lower limit of slenderness ratio as the region to be analyzed. Calculate the grayscale distribution features and geometric morphology features of each region to be analyzed. The grayscale distribution features include contrast features, texture energy features, and orientation consistency features. The geometric morphology features include rectangularity, shape complexity, and contour smoothness features. The various feature parameters are combined into a multidimensional feature vector through normalization.
8. A roller surface spraying defect identification system based on image analysis according to claim 7, characterized in that, The method of matching defect types through feature comparison includes: The reference numerical range of each type of defect in each feature dimension is statistically analyzed from a sample library of known defect types in advance, and a confidence contribution value is configured for each type of defect in each feature dimension. For the multidimensional feature vector of the current region to be analyzed, the feature value of each dimension is compared with the reference value range of all defect types in turn. When the feature value falls into the reference value range of a certain defect type, the confidence contribution value of the defect type in the corresponding dimension is added to the total score of the defect type. After traversing all feature dimensions, compare the total scores of each defect type and select the defect type with the highest total score as the judgment result; When the defect types with the highest total scores are tied, the categories with exclusive feature dimensions are extracted from the tied defect types. The exclusive feature dimension refers to the dimension in which the reference value range of a certain defect type does not overlap with the reference value ranges of all other tied defect types. The confidence contribution values of each tied defect type on its exclusive dimension are summed, and the one with the largest summation result is selected from the tied defect types as the judgment result. If the exclusive dimension comparison still fails to distinguish the two regions, or if none of the parallel types possess the exclusive characteristic dimension, the region to be analyzed will be marked as a suspected defect and will be manually reviewed and marked by the results output module.
9. A roller surface spraying defect identification system based on image analysis according to claim 8, characterized in that, The elimination of specular artifacts includes: For the region to be analyzed with a clearly identified defect type, locate its edge contour in the target image; Calculate the grayscale gradient direction of each pixel on the edge contour and count the percentage of edge points whose gradient direction points into the region. If the number of edge points accounts for more than half, the area to be analyzed is determined to be a specular artifact formed by specular reflection and is removed from the detection results. Otherwise, it is determined to be a real defect, and the defect type mark is retained.
10. A roller surface spraying defect identification system based on image analysis according to claim 9, characterized in that, The defect contour repair includes: By calculating the Euclidean distance between adjacent edge points, the breakpoints in the real defect edge chain are detected. Using two edge points on each side of the breakpoint as control points, a sequence of connection points is generated by cubic B-spline interpolation to close the edge at the breakpoint and output the repaired defect contour.