Image recognition-based insulating sheet quality automatic detection method and system
Patent Information
- Application Number
- CN202611226364.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-10-30
AI Technical Summary
传统基于单幅灰度图像的处理方法难以有效区分纹理本身引起的灰度波动与真实缺陷信号,容易将正常纹理区域误判为缺陷,导致虚检率偏高
[0028]本申请通过在不同方位角照明下采集两幅灰度图像并逐像素计算归一化方向响应值,结合基于灰度梯度信息估计的纹理主取向角,建立了反映绝缘片固有纹理特征的方向响应映射表,将每个像素的实际方向响应与该纹理取向对应的期望值进行对比,以预测残差作为缺陷判据。该方法在特征层面实现了纹理背景与缺陷信号的解耦,使得因纤维排列方向变化引起的灰度波动不会干扰缺陷判定,从而显著降低了对正常纹理区域的误检率,同时保留了微弱缺陷引起的方向响应异常,保证了检出灵敏度。整个处理流程仅涉及像素级算术运算、局部窗口累加、查表插值和阈值分割,计算量小,在普通工业控制计算机上即可满足高速产线的在线检测实时性要求。
Smart Images

Figure CN123015486A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine vision surface inspection technology, specifically to an automatic inspection method and system for the quality of insulating sheets based on image recognition. Background Technology
[0002] Insulating sheets are widely used in the insulation structures of electrical equipment such as motors, transformers, and lithium batteries. Their surface quality directly affects the insulation performance and service life of the equipment. Common surface defects during the production process include scratches, cracks, bubbles, impurities, and delamination. If these defects are not detected in time, they may lead to insulation failure or even safety accidents.
[0003] In recent years, machine vision technology has been gradually introduced into the field of surface defect detection for insulating sheets. Existing vision-based detection methods typically use unidirectional illumination to acquire images and identify defects through algorithms such as grayscale thresholding, edge detection, or deep learning. However, insulating sheets composed of fibers or sheet-like fillers (such as mica paper, aramid paper, and polyimide film composite insulating sheets) have inherent microscopic texture structures on their surfaces. These textures appear as irregular local variations in brightness and darkness in images, and their grayscale characteristics are highly similar to some minor defects (such as shallow scratches and microcracks). Traditional processing methods based on single grayscale images struggle to effectively distinguish between grayscale fluctuations caused by the texture itself and true defect signals, easily misclassifying normal texture areas as defects, leading to a high false detection rate. Some methods attempt to suppress texture interference through filtering or texture modeling, but fixed-parameter filtering operators are difficult to adapt to the spatial variations of insulating sheet textures, while complex texture modeling struggles to meet the real-time requirements of online detection.
[0004] Therefore, how to effectively separate defect signals from textured backgrounds while fully considering the inherent texture characteristics of the insulating sheet surface, and at the same time maintain high detection speed and low computational complexity, is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0005] In view of this, this disclosure proposes an automatic detection method and system for insulating sheet quality based on image recognition.
[0006] According to one aspect of this disclosure, an automatic quality inspection method for insulating sheets based on image recognition is provided, comprising:
[0007] Grayscale images of the same area of the insulating sheet were acquired under illumination directions at two different azimuth angles to obtain the first grayscale image and the second grayscale image.
[0008] The ratio of the difference between the gray values of the first grayscale image and the second grayscale image to the sum of the gray values is calculated pixel by pixel and used as the normalized directional response value to obtain the directional response map.
[0009] The mean image is obtained from the first grayscale image and the second grayscale image, and the texture principal orientation angle of each pixel is estimated based on the grayscale gradient information of the mean image;
[0010] The range of the texture principal orientation angle is divided into multiple orientation intervals. The median of the normalized orientation response value of the pixel in each orientation interval is calculated and used as the corresponding expected orientation response value to establish an orientation-response mapping table.
[0011] Based on the texture principal orientation angle of each pixel, the expected orientation response value of the pixel is queried in the orientation-response mapping table, and the difference between the normalized orientation response value and the expected orientation response value of the pixel is used as the prediction residual.
[0012] Adaptive threshold segmentation is performed on the absolute value of the predicted residual. Pixels exceeding the threshold are extracted and area filtered. The retained connected components are identified as defective regions.
[0013] In one possible implementation, estimating the texture principal orientation angle of each pixel based on the gray-level gradient information of the mean image includes: calculating gray-level gradient components along the horizontal and vertical directions of the mean image respectively; accumulating the products of the gray-level gradient components within the local neighborhood window of each pixel to construct a structure tensor matrix; performing eigenvalue decomposition on the structure tensor matrix, and determining the texture principal orientation angle of the pixel based on the direction of the eigenvectors.
[0014] In one possible implementation, anisotropy is calculated based on two eigenvalues of the structural tensor matrix, where the anisotropy is the ratio of the difference between the two eigenvalues to the sum of the two eigenvalues; when establishing the orientation-response mapping table, only pixels with anisotropy values higher than an anisotropy threshold are included in the median statistics; the anisotropy threshold is determined based on the anisotropy distribution of all pixels in the same batch of insulating sheet images.
[0015] In one possible implementation, the number of the plurality of orientation intervals is determined by: establishing orientation-response mapping tables with the number of multiple candidate intervals and calculating the prediction residual of each pixel, calculating the standard deviation of the absolute value of the prediction residual of all pixels, and selecting the number of candidate intervals that minimizes the standard deviation.
[0016] In one possible implementation, when querying the desired directional response value of a pixel in the orientation-response mapping table based on the texture principal orientation angle of each pixel, a linear interpolation method is used to interpolate based on the desired directional response values corresponding to the centers of two adjacent orientation intervals where the texture principal orientation angle of the pixel is located; when the texture principal orientation angle is located at the boundary of the first and last orientation intervals, the last orientation interval and the first orientation interval are considered to be adjacent and periodic interpolation is performed.
[0017] In one possible implementation, the segmentation threshold in the adaptive threshold segmentation is determined based on the median and median absolute deviation of the absolute values of the prediction residuals of all pixels in the entire image; the median absolute deviation is obtained by taking the absolute value of the deviation of the absolute value of the prediction residual of each pixel from the median and then calculating the median; the segmentation threshold is the median plus the product of the median absolute deviation and the sensitivity coefficient.
[0018] In one possible implementation, the sensitivity coefficient is determined through first-piece calibration: the steps of establishing the orientation-response mapping table and calculating the prediction residual are performed on a known defect-free insulating sheet sample to obtain the prediction residual of each pixel; a segmentation threshold is calculated using multiple candidate sensitivity coefficient values; the number of connected components with an area greater than the minimum defect area threshold under each segmentation threshold is counted; and the minimum candidate value corresponding to the first time the number of connected components drops to zero is selected as the sensitivity coefficient.
[0019] In one possible implementation, the two different azimuth angles of the illumination direction are 90 degrees apart, and the pitch angles of the two illumination directions are the same and range from 30 degrees to 45 degrees.
[0020] In one possible implementation, the proportion of positive and negative pixels in the prediction residuals of each pixel within the defect region is statistically analyzed, and the defect orientation is determined based on the proportion of positive and negative pixels.
[0021] According to another aspect of this disclosure, an automatic quality inspection system for insulating sheets based on image recognition is provided, comprising:
[0022] The image acquisition module is used to acquire grayscale images of the same area of the insulating sheet under two different azimuth angles of illumination, to obtain a first grayscale image and a second grayscale image.
[0023] The orientation response calculation module is used to calculate the ratio of the difference between the gray values of the first grayscale image and the second grayscale image to the sum of the gray values on a pixel-by-pixel basis, and use it as the normalized orientation response value to obtain the orientation response map.
[0024] The texture orientation estimation module is used to obtain the mean image of the first grayscale image and the second grayscale image, and estimate the main texture orientation angle of each pixel based on the grayscale gradient information of the mean image;
[0025] The mapping table construction module is used to divide the range of the texture main orientation angle into multiple orientation intervals, calculate the median of the normalized direction response value of the pixel in each orientation interval, and use it as the corresponding expected direction response value to establish an orientation-response mapping table.
[0026] The prediction residual calculation module is used to query the expected directional response value of each pixel in the orientation-response mapping table according to the texture principal orientation angle of each pixel, and use the difference between the normalized directional response value and the expected directional response value of the pixel as the prediction residual.
[0027] The defect determination module is used to perform adaptive threshold segmentation on the absolute value of the prediction residual, extract connected components from pixels that exceed the threshold and perform area filtering, and determine the retained connected components as defect regions.
[0028] This application acquires two grayscale images under illumination at different azimuth angles and calculates the normalized directional response value pixel by pixel. Combined with the texture principal orientation angle estimated based on grayscale gradient information, a directional response mapping table reflecting the inherent texture characteristics of the insulating sheet is established. The actual directional response of each pixel is compared with the expected value corresponding to that texture orientation, and the prediction residual is used as the defect criterion. This method decouples the texture background from the defect signal at the feature level, ensuring that grayscale fluctuations caused by changes in fiber arrangement direction do not interfere with defect judgment, thus significantly reducing the false detection rate for normal texture areas. Simultaneously, it preserves the directional response anomalies caused by weak defects, ensuring detection sensitivity. The entire processing flow involves only pixel-level arithmetic operations, local window accumulation, table lookup interpolation, and threshold segmentation, with low computational load, meeting the real-time online detection requirements of high-speed production lines on ordinary industrial control computers.
[0029] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0030] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.
[0031] Figure 1 A flowchart is shown for an automatic quality detection method for insulating sheets based on image recognition according to an embodiment of the present disclosure.
[0032] Figure 2 A flowchart illustrating the establishment of an orientation-response mapping table according to an embodiment of the present disclosure is shown.
[0033] Figure 3 A flowchart illustrating the defect area determination process according to an embodiment of this disclosure is shown.
[0034] Figure 4 A schematic diagram of an image recognition-based automatic quality inspection system for insulating sheets is shown according to an embodiment of the present disclosure.
[0035] Figure 5A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0036] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0037] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0038] This embodiment provides an automatic quality inspection method for insulating sheets based on image recognition, applicable to insulating sheet materials composed of fibers or sheet-like fillers, such as mica paper, aramid paper, polyimide film composite insulating sheets, and glass fiber reinforced insulating sheets. These materials have inherent textures formed by the arrangement of micro-fibers on their surface, which appear as irregular local variations in brightness and darkness in the image. The inspection station is deployed before the winding or slitting section of the insulating sheet production line, with the insulating sheet passing through the inspection area at a constant speed. A planar array industrial camera is installed directly above the station, with the lens optical axis perpendicular to the insulating sheet surface. The shooting resolution is determined based on the minimum defect size to be inspected; for example, when the required inspection accuracy is 0.05 mm, the actual size corresponding to a single pixel can be configured to be 0.02 to 0.03 mm. Two sets of strip LED line light sources are symmetrically arranged on both sides of the camera, alternately triggered by a controller and synchronized with the camera's exposure signal. The entire inspection process runs automatically on an industrial control computer.
[0039] The implementation process of the method described in this application will be described in detail below with reference to specific embodiments. It should be noted that this embodiment is only used to explain this application and is not intended to limit the scope of protection of this application. Conventional adjustments or substitutions of each step by those skilled in the art without departing from the concept of this application should be included in the scope of protection of this application.
[0040] Figure 1 A flowchart illustrating an automatic quality inspection method for insulating sheets based on image recognition according to an embodiment of this disclosure is shown. Figure 1 As shown, the method may include:
[0041] In step S11, grayscale images are acquired under illumination directions at two different azimuth angles to obtain a first grayscale image and a second grayscale image.
[0042] According to an embodiment of this disclosure, two sets of strip light sources illuminate the surface of the insulating sheet from two different azimuth angles, with the two illumination directions differing by 90 degrees. Specifically, the first set is arranged along the direction of the insulating sheet's tape travel, and the second set is arranged perpendicular to the tape travel direction. The elevation angles of the two sets of light sources are kept consistent, ranging from 30 to 45 degrees. Low elevation angle illumination produces a strong contrast between light and dark areas on the surface's micro-undulations, which is beneficial for imaging micro-defects. The specific value of the elevation angle can be determined through a test shot of the first piece, where the same section of a known defective sample is photographed at 30 degrees, 35 degrees, 40 degrees, and 45 degrees, and the angle corresponding to the maximum grayscale contrast between the defect area and the background area is selected.
[0043] The controller operates in a cyclical sequence as follows: the first set of light sources is lit, and the camera exposes and captures a first grayscale image; after the first set of light sources is turned off, the second set of light sources is lit, and the camera exposes and captures a second grayscale image; the second set of light sources then turns off. The time interval between two exposures is, for example, no more than 2 milliseconds. At a typical production line speed (e.g., 30 meters per minute), the displacement of the insulating sheet between two exposures is approximately 1 micrometer, which is much smaller than the actual size corresponding to a single pixel. Therefore, the first grayscale image and the second grayscale image can be considered as imaging at the same location.
[0044] In step S12, the ratio of the difference between the gray values of the first grayscale image and the second grayscale image to the sum of the gray values is calculated pixel by pixel and used as the normalized directional response value to obtain the directional response map.
[0045] In some embodiments, before calculating the normalized directional response value, dark field correction and flat field correction are performed on the first grayscale image and the second grayscale image, respectively. During dark field correction, a dark field image is acquired with the light source off, and the corresponding pixel value of the dark field image is subtracted from each pixel value of the first grayscale image and the second grayscale image to eliminate camera dark current and fixed-mode noise. During flat field correction, reference images are acquired using a uniform white diffuse reflector when each group of light sources is illuminated, and the dark field-corrected image is divided pixel by pixel by the corresponding flat field reference image to eliminate the effects of spatial non-uniformity of light source brightness and lens vignetting. The corrected images are still recorded as the first grayscale image and the second grayscale image, respectively, for use in all subsequent processing steps.
[0046] For the corrected first and second grayscale images, the normalized directional response value is calculated pixel by pixel. The normalized directional response values of all pixels constitute the directional response map. The normalized directional response value is the ratio of the difference between the grayscale values of corresponding pixels in the two grayscale images to the sum of their grayscale values:
[0047]
[0048] in , For pixel coordinates, and These are the grayscale values of the pixel in the first grayscale image and the second grayscale image, respectively, with values ranging from 0 to 255. To prevent small constants from having a denominator of zero, a value of, for example, 1.0 is used. Linear operations where both the numerator and denominator are grayscale values are used. It is a dimensionless quantity, ranging from -1 to +1. The normalization operation eliminates the influence of differences in the overall reflectivity of the material and fluctuations in the brightness of the light source, while preserving the relative response differences of the pixel to the two illumination directions.
[0049] For example, if a pixel has a grayscale value of 180 in the first grayscale image and a grayscale value of 120 in the second grayscale image, substituting it into the above formula yields... .
[0050] Simultaneously calculate the mean image of the two images:
[0051]
[0052] The gray value of the pixel in the mean image is used to combine illumination information from two directions, serving as input for subsequent estimation of the texture principal orientation angle.
[0053] In step S13, the mean image is obtained from the first grayscale image and the second grayscale image, and the texture principal orientation angle of each pixel is estimated based on the grayscale gradient information of the mean image.
[0054] According to embodiments of this disclosure, the texture principal orientation angle refers to the angle of the principal arrangement direction of the fiber texture within the local region of each pixel, with a value ranging from 0 degrees to 180 degrees. Gray-level gradient components are calculated along the horizontal and vertical directions for the mean image. and The gradient calculation uses the 3×3 Sobel operator, a commonly used first-order differential operator in image processing, and a convolution kernel is used in the horizontal direction. Use convolution kernels in the vertical direction The horizontal gray-level gradient components at each pixel are obtained by convolving the image with the mean image. and vertical grayscale gradient components .
[0055] In each pixel local Within the neighborhood window, the products of the gray-level gradient components are accumulated to construct the structure tensor matrix. :
[0056]
[0057] in, Represents pixels The structure tensor matrix at the location; Represented in pixels A local neighborhood window centered on the target; Represents pixels within the neighborhood The horizontal grayscale gradient; Represents pixels within the neighborhood The vertical grayscale gradient; both off-diagonal elements are Therefore, the structure tensor is a symmetric matrix.
[0058] The summation range is all pixels within the window, and each element of the matrix is the cumulative sum of the products of the gray-level gradient components. The window size is... The calibration method is determined based on the spatial period of the fiber texture of the insulating sheet. The method involves taking the mean image of samples from the same batch, extracting the grayscale profile along any horizontal line, calculating the autocorrelation function, and taking the displacement corresponding to the first zero-crossing point of the autocorrelation function as the texture half-period. (Unit: pixels) Pick to Odd values within the range; for example, texture half-cycle. When it is approximately 5 pixels, 17 is a good choice.
[0059] In one embodiment, eigenvalue decomposition is performed on the structure tensor matrix to obtain two eigenvalues. The decomposition algorithm can be generalized, such as the Jacobi method or QR decomposition, and this disclosure does not impose any restrictions. Larger eigenvalues The corresponding feature vector points in the direction of the most drastic grayscale change, and the direction perpendicular to it is the texture principal orientation angle. Calculated using the following formula:
[0060]
[0061] The result is a mold taken within the range of 0 to 180 degrees. The independent variable is the ratio of the cumulative gradient.
[0062] Optionally, the anisotropy degree can be calculated based on the two eigenvalues of the structure tensor matrix. The degree of anisotropy is the ratio of the difference between two eigenvalues to the sum of the two eigenvalues:
[0063]
[0064] and These are the two eigenvalues of the structure tensor matrix. To prevent small constants with denominators of zero, a value of, for example, 0.001 is used. The value of anisotropy is between 0 and 1. The closer the anisotropy is to 1, the stronger the texture directionality and the more reliable the estimation of the principal orientation angle of the texture. When it is close to 0, the texture has no obvious directionality and the principal orientation angle of the texture is unstable.
[0065] Among them, the anisotropy threshold The anisotropy distribution of all pixels in the same batch of insulating sheet images is determined by: calculating and sorting the anisotropy values of all pixels in the entire image, and taking the 5th percentile of this distribution as... Pixels with anisotropy below this value account for approximately 5% of the total image area, corresponding to the region with the weakest texture directionality. In practice, this value is typically between 0.05 and 0.15. Anisotropy is lower than... The pixels marked as having uncertain orientation are excluded when the orientation-response mapping table is subsequently built.
[0066] The inherent texture of insulating sheets is composed of microstructural elements (fibers, sheet-like fillers, etc.) with specific orientations. These orientational structures exhibit direction-dependent scattering characteristics to incident light from different directions: scattering is weaker when the fiber axis is parallel to the incident light plane and stronger when it is perpendicular to the incident light plane. Under the same material and illumination configuration, there is a stable correspondence between the normalized directional response value of a pixel in a normal texture area and the principal orientation angle of the texture at that location. Existing multi-angle illumination detection methods directly use the brightness difference between illumination directions as a defect criterion. However, on fiber-based insulating sheets, the texture itself also produces significant directional response differences due to the spatial variation of fiber orientation, which can be confused with micro-defect signals. The following method establishes a quantitative correspondence between the principal orientation angle of the texture and the normalized directional response value to separate the response changes caused by the texture from the detection signal.
[0067] In step S14, the range of the texture main orientation angle is divided into multiple orientation intervals, and the median of the normalized direction response value of the pixel in each orientation interval is counted as the corresponding expected direction response value to establish an orientation-response mapping table.
[0068] like Figure 2 As shown, Figure 2 The flowchart of establishing an orientation-response mapping table according to an embodiment of the present disclosure is shown. In step S1401, the range of values of the main orientation angle of the texture is divided into multiple orientation intervals.
[0069] The range of the main texture orientation angle from 0 degrees to 180 degrees is evenly divided into... There are orientation intervals, each with a width of . degrees, the center angle of each orientation interval is Spend, .
[0070] Among them, the number of orientation intervals It is necessary to balance mapping accuracy with the sufficiency of pixel samples in each orientation range. If the value is too large, the mapping is more detailed, but the number of pixels in a single orientation interval decreases, and the fluctuation of the median estimate increases. If the value is too small, the mapping is coarse, and the differences in the normalized direction response values corresponding to different texture principal orientation angles cannot be accurately distinguished. For example, when the value is 36, the width of each orientation interval is 5 degrees. The specific determination method is as follows: [The text abruptly ends here, so the translation stops as well.] An orientation-response mapping table is established, and the prediction residual for each pixel is calculated. The standard deviation of the absolute values of the prediction residuals for all pixels is then calculated, and the number of candidate intervals that minimizes the standard deviation is selected. Minimizing the standard deviation means that the residual fluctuations caused by texture are most fully absorbed by the mapping table, achieving the optimal balance between mapping accuracy and statistical stability. In practical implementation, The value range is usually between 18 and 72.
[0071] In step S1402, all pixels of the current inspected insulating sheet image are traversed, and each pixel is sorted according to its texture principal orientation angle. The pixel is assigned to the corresponding orientation range, and the normalized orientation response value of that pixel is recorded. In some embodiments, only anisotropy degrees higher than anisotropy degree thresholds are included. The pixels are used to participate in the median statistics, and regions with uncertain texture orientation are excluded to improve the accuracy of the mapping table.
[0072] In step S1403, for each orientation interval The median of the normalized directional response values of all pixels within the orientation interval is taken as the expected directional response value for that orientation interval. The defect area on the insulating sheet typically accounts for no more than 1% of the total area. The normalized directional response value of defective pixels deviates from the normal texture, but because their number is extremely small, it does not affect the median value; however, the arithmetic mean is easily shifted by these few outliers. Using the median as the expected directional response value, the mapping table can be established without pre-removing defective areas, and can be obtained directly from the statistics of the entire image.
[0073] This yields a set of discrete mapping data. , This forms an orientation-response mapping table. As an example, let... The 7th orientation interval corresponds to a texture principal orientation angle range of 30 to 35 degrees, with a center angle of 32.5 degrees. Assuming this orientation interval contains 28,000 pixels (all satisfying the anisotropy condition), sorting these 28,000 normalized orientation response values from smallest to largest, the value at the 14,000th position is 0.152. Similarly, the 8th orientation interval corresponds to the range of 35 to 40 degrees, with a central angle of 37.5 degrees and a median of 0.178 within the interval. Perform the above statistics on all 36 orientation intervals to complete the establishment of the orientation-response mapping table.
[0074] The physical basis of the orientation-response mapping table is: given the current insulating sheet material and lighting geometry, the principal orientation angle of the texture is... The typical difference in normalized scattering response of a normal fiber region to two illumination directions is determined by the fiber's microscopic scattering anisotropy and the azimuth and elevation angles of the two light sources. Since the fiber type, fiber diameter distribution, and surface treatment are consistent within the same batch of insulating sheets, this mapping relationship remains stable within the batch. The mapping table only contains... The process involves creating a number of floating-point values (e.g., 36 values), which includes pixel traversal, interval classification, sorting, and median calculation. On megapixel-level images, the time taken is, for example, no more than 100 milliseconds, making it suitable for online processing.
[0075] In step S15, the expected directional response value of the pixel is queried in the orientation-response mapping table according to the texture principal orientation angle of each pixel, and the difference between the normalized directional response value and the expected directional response value of the pixel is used as the prediction residual.
[0076] According to embodiments of this disclosure, for each pixel in the image Based on its texture principal orientation angle Query the desired orientation response value of the pixel in the orientation-response mapping table. The query uses linear interpolation, interpolating based on the expected direction response values corresponding to the centers of the two adjacent orientation intervals where the pixel's texture principal orientation angle is located. Let... Located in the Center of each orientation interval With the Center of each orientation interval Between these values, the expected directional response value is:
[0077]
[0078] in , The center angle (in degrees) between two adjacent orientation intervals. and These are the corresponding expected direction response values. When the main orientation angle of the texture is located at the boundary of the first and last orientation intervals, since the orientation angles of 0 degrees and 180 degrees are physically equivalent, that is, there is no distinction between the first and last orientations of the fiber, the last orientation interval and the first orientation interval are regarded as adjacent and periodically interpolated.
[0079] Using the example data from the previous steps, the principal orientation angle of a pixel texture It is located between the center of the 7th orientation interval (32.5 degrees) and the center of the 8th orientation interval (37.5 degrees). , Substituting into the above equation, we get .
[0080] After obtaining the desired orientation response value, the difference between the normalized orientation response value and the desired orientation response value of the pixel is used as the prediction residual:
[0081]
[0082] This is the normalized directional response value of the pixel in the directional response map. The desired directional response value is calculated using the steps described above. To predict residuals, all three are dimensionless quantities.
[0083] The prediction residual refers to the degree and direction by which the actual directional illumination response of a pixel deviates from the expected value corresponding to its texture principal orientation angle. In normal texture regions, the normalized directional response value is consistent with the expected directional response value corresponding to the texture principal orientation angle, and the prediction residual is close to zero. In defective regions, the microstructure differs from the surrounding normal fibers, and the scattering behavior of directional illumination deviates from the expected pattern corresponding to the texture principal orientation angle, resulting in a significant deviation in the prediction residual.
[0084] For example, a pixel with a principal orientation angle of 34 degrees, if located in a normal texture area, has a normalized direction response value. Then predict the residuals The value is close to zero. If a micro-scratch exists at the principal orientation angle of the same texture, the scratch changes the local scattering characteristics, and the normalized directional response value... Then predict the residuals It deviates significantly from zero.
[0085] In the original orientation response map, the spatial variation of the texture principal orientation angle is mixed with the defect signal. When directly performing threshold detection on the orientation response map, regions with large variations in the texture principal orientation angle (such as fiber intersections and fiber density transition areas) are often misclassified as defects. By subtracting the expected orientation response value corresponding to the texture principal orientation angle, the response variation caused by texture orientation is removed in the prediction residual calculation, and only anomalous signals deviating from the texture expectation are retained in the prediction residual. The positive and negative values of the prediction residual also carry defect orientation information. This indicates that the pixel scatters more strongly in the first illumination direction than the normal level corresponding to its texture principal orientation angle, and there may be a linear structure that is approximately perpendicular to the first illumination direction, such as a horizontal scratch. The opposite is true. The absolute value of the prediction residuals for defects without direction bias (such as foreign particle embedding) also exceeds the normal range.
[0086] In step S16, adaptive threshold segmentation is performed on the absolute value of the prediction residual, connected components are extracted from pixels exceeding the threshold and area filtering is performed, and the retained connected components are determined as defect regions.
[0087] like Figure 3 As shown, Figure 3 A flowchart of defect region determination according to an embodiment of the present disclosure is shown. In step S1601, the absolute value of the predicted residual is subjected to adaptive threshold segmentation.
[0088] Specifically, taking the absolute value of the predicted residual yields... An adaptive segmentation threshold was calculated using a method based on median absolute deviation (MAD).
[0089] Take the absolute value of the prediction residuals for all pixels in the entire image and calculate the median. The absolute value of the prediction residual for each pixel deviates from the median. The absolute deviation of the median is obtained by taking the absolute value of the deviation and then calculating the median.
[0090]
[0091] and These represent the central location and dispersion of the absolute values of the predicted residuals, respectively. The median absolute deviation is a robust estimate of dispersion in statistics; compared to the standard deviation, it is insensitive to a few outliers (i.e., defective pixels), making it suitable for scenarios with a very low defect rate. Segmentation threshold. median Add median absolute deviation With sensitivity coefficient The product of:
[0092]
[0093] Sensitivity coefficient As a dimensionless quantity, the larger the value, the higher the segmentation threshold, increasing the risk of missing weak defects; the smaller the value, the lower the segmentation threshold, increasing the risk of false detections.
[0094] The sensitivity coefficient is determined through first-piece calibration. The calibration process involves establishing an orientation-response mapping table and calculating the prediction residual on a known defect-free insulating sheet sample. This yields the prediction residual for each pixel, and multiple candidate sensitivity coefficient values (e.g., ...) are used to determine the sensitivity coefficient. Calculate the segmentation thresholds for each segmentation threshold, and count the number of connected components with an area greater than the minimum defect area threshold at each threshold. Select the minimum candidate value that causes the number of connected components to first drop to zero as the sensitivity coefficient. At this value, no false detections occur on defect-free samples, and the segmentation threshold is at the lowest possible level to maintain sensitivity to minor defects. In actual implementation, the sensitivity coefficient... The typical value range is 3 to 5.
[0095] For example, the median of the absolute values of the prediction residuals in a prediction residual plot. absolute deviation of the median The sensitivity coefficient determined by the first calibration Substituting into the above formula, we obtain the segmentation threshold. Pixels with a predicted residual absolute value exceeding 0.028 are marked as suspected defective pixels.
[0096] In step S1602, the absolute value of the predicted residual exceeds the segmentation threshold. The binary image, composed of pixels, is used to extract connected components, employing the 8-neighborhood connectivity criterion. The area (in pixels) of each connected component is calculated; if the area is less than the minimum defect area threshold, it is considered valid. Connected components are treated as noise and filtered out. The conversion is based directly on product quality standards. For example, if the minimum defect detected according to product specifications is a square area with a side length of 0.1 mm, then the actual size of a single pixel is 0.025 mm. Pixel.
[0097] In step S1603, the connected components retained after area filtering are identified as defect regions. The following information is extracted for each defect region for recording and subsequent classification: the position coordinates of the bounding rectangle of the defect region in the image, used to calculate the physical location of the defect on the insulating sheet; the area of the defect region, i.e., the number of pixels multiplied by the area of a single pixel; and the maximum absolute value of the prediction residual within the defect region, reflecting the degree to which the defect deviates from the normal texture.
[0098] In some embodiments, the method further includes determining the defect orientation based on the positive and negative distribution of the predicted residuals. Specifically, optionally, the proportion of positive and negative pixels in the predicted residuals of each pixel within the defect area is statistically analyzed, and the defect orientation is determined based on the proportion of positive and negative pixels. When the proportion of positive pixels exceeds, for example, 0.8, the defect has a strong scattering response to the first illumination direction, and may be a linear defect approximately perpendicular to the first illumination direction, such as a transverse scratch. When the proportion of negative pixels exceeds 0.8, the orientation determination is reversed. When both the proportion of positive and negative pixels are between 0.3 and 0.7, the defect has no obvious orientation preference and may be a foreign particle or a point defect. This orientation determination is auxiliary classification information and does not affect the defect detection determination.
[0099] In some embodiments, regarding the updating of the orientation-response mapping table when the insulating sheet material or production batch changes, the fiber type, fiber density, or surface coating may change, and the mapping relationship between the texture principal orientation angle and the normalized direction response value will change accordingly. In this case, the steps of re-establishing the orientation-response mapping table are re-executed for the images of the new batch of insulating sheets: image acquisition, preprocessing, normalized direction response value calculation, and texture principal orientation angle estimation are performed sequentially on the first sample of the new batch. Then, the median of each orientation interval is calculated according to the aforementioned steps to generate a new orientation-response mapping table. The updated orientation-response mapping table replaces the currently used orientation-response mapping table before continuing detection. The reconstruction of the mapping table only involves pixel traversal and sorting statistical operations, taking, for example, no more than 100 milliseconds, and can be completed online in the detection process.
[0100] Optionally, automatic monitoring of the orientation-response mapping table can be performed during continuous detection within the same batch. Specifically, every fixed number of detection frames (e.g., every 1000 frames), the orientation-response mapping table is recalculated based on the current frame image. The difference between the new mapping table and the currently used orientation-response mapping table is calculated interval by interval for each orientation, and the maximum absolute value of the difference is recorded as . ;like Exceeding the update threshold If so, the currently used orientation-response mapping table will be replaced with the new mapping table. The determination method is as follows: Take 100 consecutive frames of images from the same batch, establish a mapping table for each frame according to the aforementioned steps, and calculate the relationship between the mapping tables of adjacent frames. The distribution is such that twice the 99th percentile is taken as... Mapping changes within the normal production fluctuation range do not trigger updates; automatic updates are only performed when a substantial shift occurs in the mapping relationship.
[0101] In some embodiments, the location coordinates, area, maximum predicted residual, and orientation classification information of all defect regions within the current detection frame are summarized to generate a detection result record. Based on the defect grading rules defined in the product quality standard (e.g., divided into three levels, A, B, and C, based on area), each defect region is labeled with a quality level. If the level of any defect region exceeds the allowable range, a rejection signal is output to the production line control system. The orientation response map, predicted residual map, and detection result image with labeled defect locations generated during the detection process are stored on the industrial control computer's local disk or network storage device. The detection results of each frame are accumulated chronologically, allowing for the statistical analysis of defect distribution density and type composition over a certain length range.
[0102] This method is based on bidirectional illumination acquisition. It obtains the principal orientation angle of the texture for each pixel through structural tensor analysis. Based on this, a mapping table between the principal orientation angle and the normalized directional response value is statistically established. For each pixel, the directional response that its normal texture should have is predicted, and the prediction residual is calculated. At the feature level, the response changes caused by texture orientation are separated from the detection signal. The entire calculation involves only gradient operations, local window summation, table lookup interpolation, and pixel-by-pixel subtraction, resulting in low computational complexity. It can meet the online detection speed requirements on a standard industrial control computer.
[0103] Figure 4 A block diagram of an image recognition-based automatic quality inspection system for insulating sheets according to an embodiment of the present disclosure is shown. Figure 4 As shown, the system includes:
[0104] The image acquisition module 401 is used to acquire grayscale images of the same area of the insulating sheet under two different azimuth angles of illumination, and obtain a first grayscale image and a second grayscale image.
[0105] The directional response calculation module 402 is used to calculate the ratio of the difference between the gray values of the first grayscale image and the second grayscale image to the sum of the gray values on a pixel-by-pixel basis, and use it as a normalized directional response value to obtain a directional response map.
[0106] The texture orientation estimation module 403 is used to obtain the mean image of the first grayscale image and the second grayscale image, and estimate the main texture orientation angle of each pixel based on the grayscale gradient information of the mean image;
[0107] The mapping table construction module 404 is used to divide the range of the texture main orientation angle into multiple orientation intervals, calculate the median of the normalized direction response value of the pixel in each orientation interval, and use it as the corresponding expected direction response value to establish an orientation-response mapping table.
[0108] The prediction residual calculation module 405 is used to query the expected directional response value of the pixel in the orientation-response mapping table according to the texture principal orientation angle of each pixel, and use the difference between the normalized directional response value and the expected directional response value of the pixel as the prediction residual.
[0109] The defect determination module 406 is used to perform adaptive threshold segmentation on the absolute value of the prediction residual, extract connected components from pixels that exceed the threshold and perform area filtering, and determine the retained connected components as defect regions.
[0110] In some embodiments, the system provided in this disclosure may have functions or include modules that can be used to execute the methods described in the above method embodiments. The specific implementation of these methods can be referred to the description in the above method embodiments, and for the sake of brevity, they will not be repeated here.
[0111] Figure 5 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. (Refer to...) Figure 5 Electronic devices can be provided as servers or terminal devices. (See reference...) Figure 5 The electronic device includes a processing component 501, which further includes one or more processors, and memory resources represented by memory 502 for storing instructions, such as application programs, that can be executed by the processing component 501. The application programs stored in memory 502 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 501 is configured to execute instructions to perform the methods described above.
[0112] The electronic device may also include a power supply component 503 configured to perform power management of the electronic device, a wired or wireless network interface 504 configured to connect the electronic device to a network, and an input / output interface 505 (I / O interface). The electronic device can operate on an operating system stored in memory 502.
[0113] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 502 including computer program instructions that can be executed by a processing component 501 of an electronic device to perform the above-described method.
[0114] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. An automatic quality inspection method for insulating sheets based on image recognition, characterized in that, include: Grayscale images of the same area of the insulating sheet were acquired under illumination directions at two different azimuth angles to obtain the first grayscale image and the second grayscale image. The ratio of the difference between the gray values of the first grayscale image and the second grayscale image to the sum of the gray values is calculated pixel by pixel and used as the normalized directional response value to obtain the directional response map. The mean image is obtained from the first grayscale image and the second grayscale image, and the texture principal orientation angle of each pixel is estimated based on the grayscale gradient information of the mean image; The range of the texture principal orientation angle is divided into multiple orientation intervals. The median of the normalized orientation response value of the pixel in each orientation interval is calculated and used as the corresponding expected orientation response value to establish an orientation-response mapping table. Based on the texture principal orientation angle of each pixel, the expected orientation response value of the pixel is queried in the orientation-response mapping table, and the difference between the normalized orientation response value and the expected orientation response value of the pixel is used as the prediction residual. Adaptive threshold segmentation is performed on the absolute value of the predicted residual. Pixels exceeding the threshold are extracted and area filtered. The retained connected components are identified as defective regions.
2. The method according to claim 1, characterized in that, The step of estimating the texture principal orientation angle of each pixel based on the gray-level gradient information of the mean image includes: calculating gray-level gradient components along the horizontal and vertical directions of the mean image respectively; accumulating the products of the gray-level gradient components within the local neighborhood window of each pixel to construct a structure tensor matrix; performing eigenvalue decomposition on the structure tensor matrix, and determining the texture principal orientation angle of the pixel based on the direction of the eigenvectors.
3. The method according to claim 2, characterized in that, The anisotropy degree is calculated based on the two eigenvalues of the structure tensor matrix, where the anisotropy degree is the ratio of the difference between the two eigenvalues to the sum of the two eigenvalues. When establishing the orientation-response mapping table, only pixels with anisotropy degrees higher than the anisotropy degree threshold are included in the median statistics. The anisotropy degree threshold is determined based on the anisotropy degree distribution of all pixels in the same batch of insulating sheet images.
4. The method according to claim 1, characterized in that, The number of the multiple orientation intervals is determined by the following method: establishing an orientation-response mapping table with multiple candidate intervals and calculating the prediction residual of each pixel, calculating the standard deviation of the absolute value of the prediction residual of all pixels, and selecting the number of candidate intervals that minimizes the standard deviation.
5. The method according to claim 1, characterized in that, When querying the desired directional response value of a pixel in the orientation-response mapping table based on the texture principal orientation angle of each pixel, a linear interpolation method is used to interpolate based on the desired directional response values corresponding to the centers of the two adjacent orientation intervals where the texture principal orientation angle of the pixel is located; when the texture principal orientation angle is located at the boundary of the first and last orientation intervals, the last orientation interval and the first orientation interval are regarded as adjacent and periodic interpolation is performed.
6. The method according to claim 1, characterized in that, The segmentation threshold in the adaptive threshold segmentation is determined based on the median and median absolute deviation of the absolute values of the prediction residuals of all pixels in the entire image; the median absolute deviation is obtained by taking the absolute value of the deviation of the absolute value of the prediction residual of each pixel from the median and then calculating the median; the segmentation threshold is the median plus the product of the median absolute deviation and the sensitivity coefficient.
7. The method according to claim 6, characterized in that, The sensitivity coefficient is determined through first-piece calibration: the steps of establishing the orientation-response mapping table and calculating the prediction residual are performed on a known defect-free insulating sheet sample to obtain the prediction residual of each pixel. The segmentation threshold is calculated using multiple candidate sensitivity coefficient values. The number of connected components with an area greater than the minimum defect area threshold under each segmentation threshold is counted. The minimum candidate value corresponding to the first time the number of connected components drops to zero is selected as the sensitivity coefficient.
8. The method according to claim 1, characterized in that, The two different azimuth angles of the illumination direction are 90 degrees apart, and the elevation angles of the two illumination directions are the same and range from 30 degrees to 45 degrees.
9. The method according to claim 1, characterized in that, The proportion of positive and negative pixels in the prediction residuals of each pixel within the defect area is statistically analyzed, and the defect orientation is determined based on the proportion of positive and negative pixels.
10. An automatic quality inspection system for insulating sheets based on image recognition, characterized in that, include: The image acquisition module is used to acquire grayscale images of the same area of the insulating sheet under two different azimuth angles of illumination, to obtain a first grayscale image and a second grayscale image. The orientation response calculation module is used to calculate the ratio of the difference between the gray values of the first grayscale image and the second grayscale image to the sum of the gray values on a pixel-by-pixel basis, and use it as the normalized orientation response value to obtain the orientation response map. The texture orientation estimation module is used to obtain the mean image of the first grayscale image and the second grayscale image, and estimate the main texture orientation angle of each pixel based on the grayscale gradient information of the mean image; The mapping table construction module is used to divide the range of the texture main orientation angle into multiple orientation intervals, calculate the median of the normalized direction response value of the pixel in each orientation interval, and use it as the corresponding expected direction response value to establish an orientation-response mapping table. The prediction residual calculation module is used to query the expected directional response value of each pixel in the orientation-response mapping table according to the texture principal orientation angle of each pixel, and use the difference between the normalized directional response value and the expected directional response value of the pixel as the prediction residual. The defect determination module is used to perform adaptive threshold segmentation on the absolute value of the prediction residual, extract connected components from pixels that exceed the threshold and perform area filtering, and determine the retained connected components as defect regions.